| 21627 |
kshitij.so |
1 |
<style>
|
| 21987 |
kshitij.so |
2 |
|
| 30694 |
amit.gupta |
3 |
.table-striped > tbody > tr:nth-child(odd) > td {
|
|
|
4 |
background: white;
|
|
|
5 |
background-color: white;
|
|
|
6 |
font-size: 14px;
|
|
|
7 |
}
|
|
|
8 |
|
|
|
9 |
.table-striped > tbody > tr:nth-child(even) > td {
|
|
|
10 |
background: white;
|
|
|
11 |
background-color: white;
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
.table-striped > tbody > tr:hover > td,
|
|
|
15 |
.table-striped > tbody > tr:hover {
|
|
|
16 |
background-color: #e98c8f;
|
|
|
17 |
color: white;
|
|
|
18 |
}
|
|
|
19 |
|
|
|
20 |
.btn:hover,
|
|
|
21 |
.btn:focus {
|
|
|
22 |
color: grey;
|
|
|
23 |
text-decoration: none;
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
.modal-content {
|
|
|
27 |
background: white;
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
.modelHeaderCustom {
|
|
|
31 |
font-size: 14px;
|
|
|
32 |
font-weight: bold;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
hr {
|
|
|
36 |
background-color: #007aff;
|
|
|
37 |
border: none;
|
|
|
38 |
height: 1px;
|
|
|
39 |
background: #007aff;
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
.border-highlight {
|
|
|
43 |
border: 3px solid red;
|
|
|
44 |
}
|
| 21627 |
kshitij.so |
45 |
</style>
|
|
|
46 |
|
| 30694 |
amit.gupta |
47 |
<section class="wrapper">
|
|
|
48 |
<!--overview start-->
|
|
|
49 |
<div class="row">
|
|
|
50 |
<div class="col-lg-12">
|
|
|
51 |
<h3 class="page-header"><i class="icon_document_alt"></i>GRN</h3>
|
|
|
52 |
<ol class="breadcrumb">
|
| 32771 |
raveendra. |
53 |
<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">#springMessage("grn.home")</a></li>
|
|
|
54 |
<li><i class="icon_document_alt"></i>#springMessage("grn.new")</li>
|
| 31805 |
amit.gupta |
55 |
<!--Training Video -->
|
| 31986 |
tejbeer |
56 |
<li><a href="#videoModal" class="btn btn-danger" data-toggle="modal" data-src="o6GyFxS8jUo"><span
|
| 32771 |
raveendra. |
57 |
class="glyphicon glyphicon-play-circle"></span> #springMessage("grn.playvideo")</a></li>
|
| 30694 |
amit.gupta |
58 |
</ol>
|
|
|
59 |
</div>
|
|
|
60 |
</div>
|
|
|
61 |
<!--<form class="form-horizontal row" id="purchase-reference-submit-form">-->
|
|
|
62 |
<div class="col-lg-9 row">
|
| 32771 |
raveendra. |
63 |
<label class="col-lg-3 control-label font-bold" style="text-align:center;font-weight:600;">#springMessage("grn.invoiceno")</label>
|
| 30694 |
amit.gupta |
64 |
<div class="input-group col-lg-6">
|
|
|
65 |
#if($airwayBillOrInvoiceNumber)
|
|
|
66 |
#set($value = $airwayBillOrInvoiceNumber)
|
|
|
67 |
#else
|
|
|
68 |
#set($value = "")
|
|
|
69 |
#end
|
|
|
70 |
<input type="text" class="form-control" name="airwayBillOrInvoiceNumber" value="$value"
|
|
|
71 |
id="airwayBillOrInvoiceNumberText" placeholder="Enter invoice Number"/>
|
|
|
72 |
<span class="input-group-btn">
|
|
|
73 |
<button class="btn btn-primary" id="purchase-reference-submit-button"
|
| 32771 |
raveendra. |
74 |
onclick="getPurchaseByInvoiceNumber()">#springMessage("grn.submit")</button>
|
| 21627 |
kshitij.so |
75 |
</span>
|
|
|
76 |
</div>
|
|
|
77 |
</div>
|
| 23076 |
ashik.ali |
78 |
<!--</form>-->
|
| 24993 |
amit.gupta |
79 |
#if($customItems && $customItems.size() > 0)
|
| 30694 |
amit.gupta |
80 |
#if($totalImeisCount && $totalImeisCount > 0)
|
|
|
81 |
<div class="row col-lg-12">
|
|
|
82 |
<br>
|
|
|
83 |
<h4>
|
|
|
84 |
Add imeis (<span id="scanleft">0</span>/$totalImeisCount)
|
|
|
85 |
</h4>
|
|
|
86 |
<div id="invalid-imeis-container" style="display:none">
|
|
|
87 |
<div id="invalid-imeis" class="col-lg-12" style="color: red">
|
|
|
88 |
</div>
|
|
|
89 |
</div>
|
|
|
90 |
</div>
|
|
|
91 |
<div class="row">
|
|
|
92 |
<div class="col-lg-6">
|
|
|
93 |
<input type="text" id="all-imeis" placeholder="">
|
|
|
94 |
</div>
|
|
|
95 |
<div class="col-lg-3">
|
|
|
96 |
<button class="btn btn-primary" id="grnPartial" onclick="grnPartial('$invoiceNumber')">Add IMEI!
|
|
|
97 |
</button>
|
|
|
98 |
</div>
|
|
|
99 |
</div>
|
|
|
100 |
#else
|
|
|
101 |
<div class="row col-lg-9">
|
|
|
102 |
<h4 style="color:green">All imeis/serial numbers are added</h4>
|
|
|
103 |
</div>
|
|
|
104 |
#end
|
|
|
105 |
<div class="row">
|
|
|
106 |
<div class="col-lg-12">
|
|
|
107 |
<table class="table table-striped table-advance table-hover">
|
|
|
108 |
<tbody>
|
|
|
109 |
<tr>
|
|
|
110 |
<th>Brand</th>
|
|
|
111 |
<th>Model Name</th>
|
|
|
112 |
<th>Model Number</th>
|
|
|
113 |
<th>Color</th>
|
|
|
114 |
<th>Quantity</th>
|
|
|
115 |
<th>Unit Price</th>
|
|
|
116 |
<th>GRN</th>
|
|
|
117 |
</tr>
|
|
|
118 |
#foreach( $customItem in $customItems )
|
|
|
119 |
#set($customLineItem = $customItem.getItemDetail())
|
|
|
120 |
<tr>
|
|
|
121 |
<td>$customLineItem.getBrand()</td>
|
|
|
122 |
#if($customLineItem.getModelName())
|
|
|
123 |
<td>$customLineItem.getModelName()</td>
|
|
|
124 |
#else
|
|
|
125 |
<td>-</td>
|
|
|
126 |
#end
|
|
|
127 |
#if($customLineItem.getModelNumber())
|
|
|
128 |
<td>$customLineItem.getModelNumber()</td>
|
|
|
129 |
#else
|
|
|
130 |
<td>-</td>
|
|
|
131 |
#end
|
|
|
132 |
#if($customLineItem.getColor())
|
|
|
133 |
<td>$customLineItem.getColor()</td>
|
|
|
134 |
#else
|
|
|
135 |
<td>-</td>
|
|
|
136 |
#end
|
|
|
137 |
<td>$customLineItem.getQuantity()</td>
|
|
|
138 |
<td>$customLineItem.getUnitPrice()</td>
|
|
|
139 |
#if($customItem.isScanned())
|
|
|
140 |
<td class="grnDone"><a class="btn btn-primary" href="javascript:void(0)"><i
|
|
|
141 |
class="icon_check_alt2"></i></a></td>
|
|
|
142 |
#else
|
|
|
143 |
#if($customItem.getType() == "SERIALIZED")
|
|
|
144 |
<td class="startGrnSerialized" itemId="$customItem.getItemId()"
|
|
|
145 |
displayName="$customLineItem.getDisplayName()" invoiceNumber="$invoiceNumber"
|
|
|
146 |
quantity="$customLineItem.getQuantity()">
|
|
|
147 |
<a class="btn btn-primary" data-toggle="modal"
|
|
|
148 |
data-target="#scanModel"
|
| 30707 |
amit.gupta |
149 |
data-serial_numbers="$customLineItem.getSerialNumbers()"><i
|
| 30694 |
amit.gupta |
150 |
class="icon_plus_alt2"></i></a></td>
|
|
|
151 |
#else
|
|
|
152 |
<td class="startGrnNonSerialized" itemId="$customItem.getItemId()"
|
|
|
153 |
displayName="$customLineItem.getDisplayName()" invoiceNumber="$invoiceNumber"
|
|
|
154 |
quantity="$customLineItem.getQuantity()"><a class="btn btn-primary"
|
|
|
155 |
data-toggle="modal"
|
|
|
156 |
data-target="#scanNonSerializedModel"><i
|
|
|
157 |
class="icon_plus_alt2"></i></a></td>
|
|
|
158 |
#end
|
|
|
159 |
#end
|
|
|
160 |
</tr>
|
|
|
161 |
#end
|
|
|
162 |
</tbody>
|
|
|
163 |
</table>
|
|
|
164 |
</div>
|
|
|
165 |
</div>
|
|
|
166 |
|
|
|
167 |
<div id="scanModel" class="modal" role="dialog">
|
|
|
168 |
<div class="modal-dialog modal-lg">
|
|
|
169 |
<!-- Modal content-->
|
|
|
170 |
<div class="modal-content">
|
|
|
171 |
<div class="modal-header">
|
|
|
172 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
173 |
<h4 class="modal-title">Enter GRN Details</h4>
|
|
|
174 |
</div>
|
| 30701 |
amit.gupta |
175 |
<div class="modal-body" style="max-height: 600px;overflow: scroll">
|
| 30694 |
amit.gupta |
176 |
<input type="hidden" class="invoiceNumber"/>
|
|
|
177 |
<input type="hidden" class="itemId"/>
|
|
|
178 |
<h4 class="modelHeaderCustom">Item Type : <span>SERIALIZED</span></h4>
|
|
|
179 |
<h4 class="grnInvoiceNumber modelHeaderCustom">Invoice Number : <span></span></h4>
|
|
|
180 |
<h4 class="grnProductInfo modelHeaderCustom">Product Details : <span></span></h4>
|
|
|
181 |
<h4 class="modal-title">Enter Serial Numbers</h4>
|
|
|
182 |
<div id="grnImeiInformation">
|
|
|
183 |
</div>
|
|
|
184 |
<hr/>
|
| 30701 |
amit.gupta |
185 |
<button type="submit" id="grnSubmitSerialized" class="btn btn-primary">Check and Submit!
|
|
|
186 |
</button>
|
| 30694 |
amit.gupta |
187 |
</div>
|
|
|
188 |
<div class="modal-footer">
|
|
|
189 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
190 |
</div>
|
|
|
191 |
</div>
|
|
|
192 |
</div>
|
|
|
193 |
</div>
|
|
|
194 |
|
|
|
195 |
<div id="scanNonSerializedModel" class="modal" role="dialog">
|
|
|
196 |
<div class="modal-dialog modal-lg">
|
|
|
197 |
<!-- Modal content-->
|
|
|
198 |
<div class="modal-content">
|
|
|
199 |
<div class="modal-header">
|
|
|
200 |
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
201 |
<h4 class="modal-title">Enter GRN Details</h4>
|
|
|
202 |
</div>
|
|
|
203 |
<div class="modal-body">
|
|
|
204 |
<input type="hidden" class="invoiceNumber"/>
|
|
|
205 |
<input type="hidden" class="itemId"/>
|
|
|
206 |
<h4 class="modelHeaderCustom">Item Type : <span>NON-SERIALIZED</span></h4>
|
|
|
207 |
<h4 class="grnInvoiceNumber modelHeaderCustom">Invoice Number : <span></span></h4>
|
|
|
208 |
<h4 class="grnProductInfo modelHeaderCustom">Product Details : <span></span></h4>
|
|
|
209 |
<h4 class="modal-title">Enter Quantity</h4>
|
|
|
210 |
<div class="row">
|
|
|
211 |
<div class="col-sm-3">
|
|
|
212 |
<div class="input-group"><input type="text" class="quantity form-control"></input></div>
|
|
|
213 |
</div>
|
|
|
214 |
</div>
|
|
|
215 |
<hr/>
|
|
|
216 |
<span class="input-group-btn">
|
| 21640 |
kshitij.so |
217 |
<button type="submit" id="grnNonSerializedSubmit" class="btn btn-primary">Submit!</button>
|
|
|
218 |
</span>
|
| 30694 |
amit.gupta |
219 |
</div>
|
|
|
220 |
<div class="modal-footer">
|
|
|
221 |
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
|
222 |
</div>
|
|
|
223 |
</div>
|
|
|
224 |
</div>
|
|
|
225 |
</div>
|
|
|
226 |
|
|
|
227 |
</div>
|
|
|
228 |
#end
|
|
|
229 |
|
| 21627 |
kshitij.so |
230 |
</section>
|
| 30694 |
amit.gupta |
231 |
|
|
|
232 |
<script>
|
|
|
233 |
$(function () {
|
| 30701 |
amit.gupta |
234 |
//debugger;
|
| 30694 |
amit.gupta |
235 |
imeisToValidate = [];
|
| 30707 |
amit.gupta |
236 |
let imeiInputElem = $("#all-imeis");
|
| 30694 |
amit.gupta |
237 |
imeiInputElem.tagsinput({
|
| 33995 |
vikas.jang |
238 |
maxTags:`$totalImeisCount`,
|
| 30694 |
amit.gupta |
239 |
trimValue: true,
|
|
|
240 |
allowDuplicates: false,
|
|
|
241 |
confirmKeys: [13, 44, 188, 32],
|
| 30696 |
amit.gupta |
242 |
delimiterRegex: ',',
|
| 30694 |
amit.gupta |
243 |
tagClass: function (item) {
|
|
|
244 |
if (item.valid == null) return 'label label-primary';
|
|
|
245 |
if (item.valid) {
|
|
|
246 |
return 'label label-success';
|
|
|
247 |
} else {
|
|
|
248 |
return 'label label-danger';
|
|
|
249 |
}
|
|
|
250 |
},
|
|
|
251 |
});
|
|
|
252 |
const debouncedCallback = debounce(function () {
|
|
|
253 |
$("#invalid-imeis").html('');
|
|
|
254 |
let imeisJson = {
|
|
|
255 |
serialNumbers: imeisToValidate,
|
|
|
256 |
invoiceNumber: "$invoiceNumber"
|
|
|
257 |
}
|
|
|
258 |
doPostAjaxRequestWithJsonHandler(`${context}/purchase/validate-imeis`, JSON.stringify(imeisJson), function (data) {
|
|
|
259 |
imeiData = data.response;
|
|
|
260 |
let invalidImeis = [];
|
|
|
261 |
for (let imeiIndex in imeisToValidate) {
|
|
|
262 |
let imei = imeisToValidate[imeiIndex];
|
|
|
263 |
let isValid = imeiData[imeisToValidate[imeiIndex]];
|
|
|
264 |
if (!isValid) {
|
|
|
265 |
imeiInputElem.tagsinput('remove', imei);
|
|
|
266 |
invalidImeis.push(imei);
|
|
|
267 |
}
|
|
|
268 |
}
|
|
|
269 |
$("#invalid-imeis").html(invalidImeis.join(','));
|
|
|
270 |
invalidImeis = []
|
|
|
271 |
$("#invalid-imeis-container").show();
|
|
|
272 |
$("#scanleft").html($("#all-imeis").tagsinput('items').length);
|
|
|
273 |
imeisToValidate = [];
|
|
|
274 |
});
|
|
|
275 |
}, 300);
|
|
|
276 |
imeiInputElem.on('itemAdded', (event) => {
|
|
|
277 |
imeisToValidate.push(event.item);
|
|
|
278 |
debouncedCallback();
|
|
|
279 |
});
|
| 30696 |
amit.gupta |
280 |
imeiInputElem.on('beforeItemAdd', (event) => {
|
|
|
281 |
if (event.item.indexOf(' ') > 0) {
|
|
|
282 |
event.cancel = true;
|
|
|
283 |
let strItem = event.item.replaceAll(' ', '');
|
|
|
284 |
imeiInputElem.tagsinput('add', strItem);
|
|
|
285 |
}
|
|
|
286 |
});
|
| 30694 |
amit.gupta |
287 |
|
|
|
288 |
});
|
|
|
289 |
|
|
|
290 |
</script>
|