| 23405 |
amit.gupta |
1 |
<style>
|
|
|
2 |
.btn:hover{
|
|
|
3 |
color: grey;
|
|
|
4 |
text-decoration: none;
|
|
|
5 |
}
|
|
|
6 |
.btn-primary:hover{
|
|
|
7 |
color: grey;
|
|
|
8 |
text-decoration: none;
|
|
|
9 |
}
|
|
|
10 |
.retailer-details{
|
|
|
11 |
cursor:pointer;
|
|
|
12 |
}
|
|
|
13 |
</style>
|
|
|
14 |
|
|
|
15 |
<section class="wrapper">
|
|
|
16 |
<div class="row">
|
|
|
17 |
<div class="col-lg-12">
|
|
|
18 |
<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Indent</h3>
|
|
|
19 |
<ol class="breadcrumb">
|
|
|
20 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
|
|
|
21 |
<li><i class="icon_document_alt"></i>Create/Edit Indent</li>
|
|
|
22 |
</ol>
|
|
|
23 |
</div>
|
|
|
24 |
</div>
|
|
|
25 |
|
|
|
26 |
<div>
|
|
|
27 |
<div class="row">
|
|
|
28 |
<div class="col-lg-8" id="indent-container">
|
|
|
29 |
<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
|
|
|
30 |
<thead>
|
|
|
31 |
<tr>
|
|
|
32 |
<th>Id</th>
|
|
|
33 |
<th>Description</th>
|
|
|
34 |
<th>Selling Price</th>
|
|
|
35 |
<th>MOP</th>
|
|
|
36 |
<th>Stock</th>
|
|
|
37 |
<th>30 days Sale</th>
|
|
|
38 |
<th>Required Quantity</th>
|
|
|
39 |
</tr>
|
|
|
40 |
</thead>
|
|
|
41 |
<tbody>
|
|
|
42 |
#foreach( $tagListing in $tagListings )
|
|
|
43 |
#set($requestedQty=0)
|
|
|
44 |
#if($itemIndentMap.get($tagListing.getItemId()) and $itemIndentMap.get($tagListing.getItemId()).getRequestedQuantity() > 0 )
|
|
|
45 |
#set($requestedQty=$itemIndentMap.get($tagListing.getItemId()).getRequestedQuantity())
|
|
|
46 |
#end
|
|
|
47 |
<tr>
|
|
|
48 |
<td>$tagListing.getItemId()</td>
|
|
|
49 |
<td>$tagListing.getItemDescription()</td>
|
|
|
50 |
<td>$tagListing.getSellingPrice()</td>
|
|
|
51 |
<td>$tagListing.getMop()</td>
|
|
|
52 |
<td>$tagListing.getStockInHand()</td>
|
|
|
53 |
<td>$tagListing.getLast30DaysSale()</td>
|
|
|
54 |
<td><input type="number" min="0" max="10"
|
|
|
55 |
data-item-id="$tagListing.getItemId()"
|
|
|
56 |
data-selling-price="$tagListing.getSellingPrice()"
|
|
|
57 |
data-description="$tagListing.getItemDescription()"
|
|
|
58 |
value="$requestedQty"/></td>
|
|
|
59 |
</tr>
|
|
|
60 |
#end
|
|
|
61 |
</tbody>
|
|
|
62 |
</table>
|
|
|
63 |
</div>
|
|
|
64 |
<div class="col-lg-8" id="indent-container1" style="display:none"></div>
|
|
|
65 |
<div class="col-lg-3">
|
|
|
66 |
<div class="panel panel-default">
|
|
|
67 |
<div class="panel-heading">Indent Summary</div>
|
|
|
68 |
<div class="panel-content">
|
|
|
69 |
<ul class="list-group">
|
|
|
70 |
<li class="list-group-item">Total Items - <span id="itemCount"></span></li>
|
|
|
71 |
<li class="list-group-item">Total Qty - <span id="totalItemQty"></span> pcs</li>
|
|
|
72 |
<li class="list-group-item">Total Amount - Rs.<span id="totalAmount"></span> </li>
|
|
|
73 |
</ul>
|
|
|
74 |
<button class="btn btn-primary mk_submit_indent">Submit Indent</button>
|
|
|
75 |
<button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
|
|
|
76 |
<button class="btn btn-primary confirm_indent" style="display:none">Confirm Indent</button>
|
|
|
77 |
</div>
|
|
|
78 |
</div>
|
|
|
79 |
</div>
|
|
|
80 |
</div>
|
|
|
81 |
</div>
|
|
|
82 |
</section>
|
|
|
83 |
<script type="text/javascript">
|
|
|
84 |
/* Create an array with the values of all the input boxes in a column */
|
|
|
85 |
$.fn.dataTable.ext.order['dom-text'] = function ( settings, col )
|
|
|
86 |
{
|
|
|
87 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
88 |
return $('input', td).val();
|
|
|
89 |
} );
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
|
|
|
93 |
$.fn.dataTable.ext.order['dom-text-numeric'] = function ( settings, col )
|
|
|
94 |
{
|
|
|
95 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
96 |
return $('input', td).val() * 1;
|
|
|
97 |
} );
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
/* Create an array with the values of all the select options in a column */
|
|
|
101 |
$.fn.dataTable.ext.order['dom-select'] = function ( settings, col )
|
|
|
102 |
{
|
|
|
103 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
104 |
return $('select', td).val();
|
|
|
105 |
} );
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
/* Create an array with the values of all the checkboxes in a column */
|
|
|
109 |
$.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col )
|
|
|
110 |
{
|
|
|
111 |
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
|
|
112 |
return $('input', td).prop('checked') ? '1' : '0';
|
|
|
113 |
} );
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
/* Initialise the table with the required column ordering data types */
|
|
|
117 |
$(document).ready(function() {
|
|
|
118 |
indentTable = $('#entire-catalog-table').DataTable({
|
|
|
119 |
"columns": [
|
|
|
120 |
null,null, null, null, null, null,
|
|
|
121 |
{ "orderDataType": "dom-text-numeric" }
|
|
|
122 |
]
|
|
|
123 |
});
|
|
|
124 |
indentMap = {};
|
|
|
125 |
indentTable.rows().data().each(function(arr){
|
|
|
126 |
var $input = $(arr[6]);
|
|
|
127 |
quantity = parseInt($input.val(), 10);
|
|
|
128 |
if(quantity > 0){
|
|
|
129 |
indentMap[parseInt(arr[0])] = {"quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1]}
|
|
|
130 |
}
|
|
|
131 |
});
|
|
|
132 |
populateIndentSummary();
|
|
|
133 |
|
|
|
134 |
});
|
|
|
135 |
|
|
|
136 |
</script>
|