| 22245 |
ashik.ali |
1 |
<style>
|
| 23638 |
amit.gupta |
2 |
.pointer {
|
|
|
3 |
cursor:pointer;
|
|
|
4 |
}
|
| 22860 |
ashik.ali |
5 |
.modal-content{
|
| 22245 |
ashik.ali |
6 |
background : white;
|
|
|
7 |
}
|
|
|
8 |
.modelHeaderCustom{
|
|
|
9 |
font-size:14px;
|
|
|
10 |
font-weight:bold;
|
|
|
11 |
}
|
|
|
12 |
.border-highlight{
|
|
|
13 |
border : 3px solid red;
|
|
|
14 |
}
|
|
|
15 |
hr{
|
|
|
16 |
background-color:#dddddd;
|
|
|
17 |
border:none;
|
|
|
18 |
height:1px;
|
|
|
19 |
background:#dddddd;
|
|
|
20 |
}
|
|
|
21 |
.control-label {
|
|
|
22 |
margin-top: 0;
|
|
|
23 |
margin-bottom: 0;
|
|
|
24 |
padding-top: 7px;
|
|
|
25 |
font-weight:bold;
|
|
|
26 |
font-size:14px;
|
|
|
27 |
}
|
|
|
28 |
.right{
|
|
|
29 |
float:right;
|
|
|
30 |
}
|
|
|
31 |
.form-control{
|
|
|
32 |
color:black;
|
| 23783 |
ashik.ali |
33 |
text-transform:uppercase;
|
| 22245 |
ashik.ali |
34 |
}
|
|
|
35 |
.bold-details {
|
|
|
36 |
text-transform:capitalize;
|
|
|
37 |
font-weight:600;
|
|
|
38 |
color:#212121;
|
|
|
39 |
}
|
|
|
40 |
.normal-details{
|
|
|
41 |
font-weight:400;
|
|
|
42 |
text-transform:capitalize;
|
|
|
43 |
color:#797979;
|
|
|
44 |
}
|
| 22860 |
ashik.ali |
45 |
|
| 22245 |
ashik.ali |
46 |
}
|
|
|
47 |
</style>
|
|
|
48 |
#set($options="{ weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute:'numeric' }")
|
|
|
49 |
<section class="wrapper">
|
|
|
50 |
<div class="row" style="background:white;font-size:14px;">
|
|
|
51 |
<div class="col-lg-4" style="border-left:1px solid #f0f0f0;">
|
|
|
52 |
<h4>ORDER DETAILS</h4>
|
|
|
53 |
<div class="row">
|
|
|
54 |
<div class="col-lg-4">
|
|
|
55 |
<p class="bold-details">Order ID</p>
|
|
|
56 |
</div>
|
|
|
57 |
<div class="col-lg-6">
|
| 23654 |
amit.gupta |
58 |
<p class="normal-details">#$fofoOrder.getId() ($fofoOrderItems.size() item)</p>
|
| 22245 |
ashik.ali |
59 |
</div>
|
|
|
60 |
</div>
|
|
|
61 |
<div class="row">
|
|
|
62 |
<div class="col-lg-4">
|
|
|
63 |
<p class="bold-details">Order Date</p>
|
|
|
64 |
</div>
|
|
|
65 |
<div class="col-lg-6">
|
|
|
66 |
<script>document.getElementById('createTimestamp').appendChild(document.createTextNode(new Date('$fofoOrder.getCreateTimestamp()').toLocaleString("en-US",$options)))</script>
|
|
|
67 |
<p class="normal-details" id="createTimestamp"></p>
|
|
|
68 |
</div>
|
|
|
69 |
</div>
|
|
|
70 |
<div class="row">
|
|
|
71 |
<div class="col-lg-4">
|
|
|
72 |
<p class="bold-details">Amount Paid</p>
|
|
|
73 |
</div>
|
|
|
74 |
<div class="col-lg-6">
|
|
|
75 |
<p class="normal-details"><span class="normal-details">₹ </span>$fofoOrder.getTotalAmount()</p>
|
|
|
76 |
</div>
|
|
|
77 |
</div>
|
|
|
78 |
</div>
|
|
|
79 |
|
|
|
80 |
<div class="col-lg-4" style="border-left:1px solid #f0f0f0;">
|
|
|
81 |
<h4>BILLING DETAILS</h4>
|
|
|
82 |
<p class="bold-details">$customerBillingAddressObj.getName()</p>
|
|
|
83 |
<p class="normal-details">$customerBillingAddress</p>
|
| 23378 |
ashik.ali |
84 |
#if($fofoOrder.getCustomerGstNumber() && $fofoOrder.getCustomerGstNumber() != "")
|
|
|
85 |
<p class="bold-details">GST Number <span class="normal-details extra-margin">$fofoOrder.getCustomerGstNumber()</span></p>
|
|
|
86 |
#end
|
| 22245 |
ashik.ali |
87 |
<p class="bold-details">Phone <span class="normal-details extra-margin">$customerBillingAddressObj.getPhoneNumber()</span></p>
|
|
|
88 |
</div>
|
|
|
89 |
|
|
|
90 |
<div class="col-lg-4" style="border-left:1px solid #f0f0f0;">
|
|
|
91 |
<h4>INVOICE DETAILS</h4>
|
|
|
92 |
<p class="bold-details">Invoice Number <span class="normal-details extra-margin">$fofoOrder.getInvoiceNumber()</span></p>
|
| 23783 |
ashik.ali |
93 |
<p class="invoice_download_option"><i class="fa fa-print" aria-hidden="true"></i><a target="_blank" href="generateInvoice?orderId=$fofoOrder.getId()" class="extra-margin" style="font-size:18px">Print Invoice</a ></i></p>
|
| 22245 |
ashik.ali |
94 |
</div>
|
|
|
95 |
|
|
|
96 |
</div>
|
|
|
97 |
|
|
|
98 |
<div class="row" style="font-size:14px;color:#688a7e;">
|
|
|
99 |
<div class="col-lg-12">
|
|
|
100 |
<table class="table table-striped table-advance table-hover">
|
|
|
101 |
<tbody>
|
|
|
102 |
<tr>
|
|
|
103 |
<th>Item Code</th>
|
|
|
104 |
<th>Description</th>
|
|
|
105 |
<th>Unit Price</th>
|
|
|
106 |
<th>Quantity</th>
|
|
|
107 |
<th>Total Price</th>
|
| 23419 |
ashik.ali |
108 |
<th>Prebooking Quantity</th>
|
|
|
109 |
<th>Prebooking Amount</th>
|
| 22245 |
ashik.ali |
110 |
</tr>
|
| 23638 |
amit.gupta |
111 |
<script type="text/javascript">
|
| 23654 |
amit.gupta |
112 |
fofoLineItemsMap = $fofoOrderItemIdLineItemsMap;
|
|
|
113 |
foiIdCustomerReturnInventoryItemsMap = $foiIdCustomerReturnInventoryItemsMap;
|
|
|
114 |
inventoryItemBilledQtyMap = $inventoryItemBilledQtyMap;
|
| 23638 |
amit.gupta |
115 |
</script>
|
| 23654 |
amit.gupta |
116 |
#foreach( $fofoOrderItem in $fofoOrderItems )
|
|
|
117 |
#set ($total = $fofoOrderItem.getSellingPrice() * $fofoOrderItem.getQuantity())
|
| 22245 |
ashik.ali |
118 |
<tr>
|
| 23654 |
amit.gupta |
119 |
<td>$fofoOrderItem.getItemId()</td>
|
| 22245 |
ashik.ali |
120 |
<td>
|
| 23654 |
amit.gupta |
121 |
$fofoOrderItem.getBrand() $fofoOrderItem.getModelName() $fofoOrderItem.getModelNumber() $fofoOrderItem.getColor()
|
| 22245 |
ashik.ali |
122 |
</td>
|
| 23654 |
amit.gupta |
123 |
<td>$fofoOrderItem.getSellingPrice()</td>
|
|
|
124 |
<td>$fofoOrderItem.getQuantity()</td>
|
| 22245 |
ashik.ali |
125 |
<td>$total</td>
|
| 23654 |
amit.gupta |
126 |
#if($itemIdPrebookingOrderItemMap.get($fofoOrderItem.getItemId()))
|
|
|
127 |
<td>$itemIdPrebookingOrderItemMap.get($fofoOrderItem.getItemId()).getQuantity()</td>
|
|
|
128 |
<td>$itemIdPrebookingOrderItemMap.get($fofoOrderItem.getItemId()).getAdvanceAmount()</td>
|
| 23419 |
ashik.ali |
129 |
#else
|
|
|
130 |
<td>0</td>
|
|
|
131 |
<td>0</td>
|
|
|
132 |
#end
|
| 24094 |
amit.gupta |
133 |
#set ($item = $itemsMap.get($fofoOrderItem.getItemId()))
|
|
|
134 |
#if($item.getCategoryId()==10006)
|
|
|
135 |
#if($fofoOrderItem.isDoa())
|
| 23654 |
amit.gupta |
136 |
<td><a class="pointer" data-foi="$fofoOrderItem.getId()"
|
| 24094 |
amit.gupta |
137 |
data-itemdesc="$item.getItemDescription()" data-target=".bs-example-modal-sm" data-toggle="modal">Mark DOA</a></td>
|
| 23638 |
amit.gupta |
138 |
#else
|
|
|
139 |
<td></td>
|
|
|
140 |
#end
|
|
|
141 |
#else
|
|
|
142 |
#if($markDefective)
|
| 23654 |
amit.gupta |
143 |
<td><a class="pointer" data-foi="$fofoOrderItem.getId()"
|
| 24094 |
amit.gupta |
144 |
data-itemdesc="$item.getItemDescription()" data-target=".bs-example-modal-sm" data-toggle="modal">Mark Defective</a></td>
|
| 23638 |
amit.gupta |
145 |
#else
|
|
|
146 |
<td></td>
|
|
|
147 |
#end
|
|
|
148 |
#end
|
|
|
149 |
<td></td>
|
| 22245 |
ashik.ali |
150 |
</tr>
|
|
|
151 |
#end
|
|
|
152 |
</tbody>
|
|
|
153 |
</table>
|
|
|
154 |
</div>
|
| 23638 |
amit.gupta |
155 |
<!-- Small modal -->
|
|
|
156 |
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" id="exampleModal">
|
|
|
157 |
<div class="modal-dialog modal-md" role="document">
|
|
|
158 |
<div class="modal-content">
|
|
|
159 |
<div class="modal-header">
|
|
|
160 |
<p class="modal-title"></p>
|
|
|
161 |
</div>
|
|
|
162 |
<div class="modal-body">
|
|
|
163 |
|
|
|
164 |
</div>
|
|
|
165 |
<div class="modal-footer">
|
|
|
166 |
<button type="button" class="return-submit btn btn-primary">Submit</button>
|
|
|
167 |
</div>
|
|
|
168 |
</div>
|
|
|
169 |
</div>
|
|
|
170 |
</div>
|
| 22245 |
ashik.ali |
171 |
</div>
|
|
|
172 |
|
|
|
173 |
<div class="row">
|
|
|
174 |
#if(!$insurancePolicies.isEmpty())
|
|
|
175 |
<div class="col-lg-8">
|
|
|
176 |
<h4>INSURANCE DETAILS</h4>
|
|
|
177 |
<table class="table table-striped table-advance">
|
|
|
178 |
<tbody>
|
|
|
179 |
<tr>
|
|
|
180 |
<th>Description</th>
|
|
|
181 |
<th>Serial Number</th>
|
|
|
182 |
<th>Provider Name</th>
|
|
|
183 |
<th>Amount</th>
|
|
|
184 |
</tr>
|
|
|
185 |
#if(!$insurancePolicies.isEmpty())
|
|
|
186 |
#foreach( $insurancePolicy in $insurancePolicies )
|
|
|
187 |
<tr>
|
|
|
188 |
<td>$insurancePolicy.getBrand() $insurancePolicy.getModelName()</td>
|
|
|
189 |
<td>$insurancePolicy.getSerialNumber()</td>
|
|
|
190 |
<td>$insurancePolicy.getInsuranceProvider().getName()</td>
|
|
|
191 |
<td>$insurancePolicy.getSaleAmount()</td>
|
|
|
192 |
</tr>
|
|
|
193 |
#end
|
|
|
194 |
#end
|
|
|
195 |
</tbody>
|
|
|
196 |
</table>
|
|
|
197 |
</div>
|
|
|
198 |
#end
|
|
|
199 |
|
|
|
200 |
<div class="col-lg-4 right" style="border-left:1px solid #f0f0f0;background:white;font-size:14px;">
|
|
|
201 |
<h4>PAYMENT DETAILS</h4>
|
| 23547 |
ashik.ali |
202 |
#foreach( $paymentOptionTransaction in $paymentOptionTransactions )
|
|
|
203 |
#set($paymentOption = $paymentOptionIdPaymentOptionMap.get($paymentOptionTransaction.getPaymentOptionId()))
|
| 22245 |
ashik.ali |
204 |
<div class="row">
|
|
|
205 |
<div class="col-lg-3">
|
| 23367 |
ashik.ali |
206 |
<p class="bold-details">$paymentOption.getName()</p>
|
| 22245 |
ashik.ali |
207 |
</div>
|
|
|
208 |
<div class="col-lg-3">
|
| 23547 |
ashik.ali |
209 |
<p class="nomal-details">₹ $paymentOptionTransaction.getAmount()</p>
|
| 22245 |
ashik.ali |
210 |
</div>
|
|
|
211 |
</div>
|
|
|
212 |
#end
|
|
|
213 |
<hr/>
|
|
|
214 |
<div class="row">
|
|
|
215 |
<div class="col-lg-3">
|
|
|
216 |
<p class="bold-details">TOTAL</p>
|
|
|
217 |
</div>
|
|
|
218 |
<div class="col-lg-3">
|
|
|
219 |
<p class="nomal-details">₹$fofoOrder.getTotalAmount() </p>
|
|
|
220 |
</div>
|
|
|
221 |
</div>
|
|
|
222 |
</div>
|
|
|
223 |
</div>
|
|
|
224 |
|
|
|
225 |
</section>
|
| 23638 |
amit.gupta |
226 |
|
|
|
227 |
<script type="text/javascript">
|
|
|
228 |
$('#exampleModal').on('show.bs.modal', function (event) {
|
|
|
229 |
var link = $(event.relatedTarget); // Button that triggered the modal
|
|
|
230 |
var itemDesc = link.data('itemdesc'); // Extract info from data-* attributes
|
| 23654 |
amit.gupta |
231 |
var foitem = link.data('foi'); // Extract info from data-* attributes
|
| 23638 |
amit.gupta |
232 |
li = fofoLineItemsMap[foitem]
|
| 23654 |
amit.gupta |
233 |
returnedItems = foiIdCustomerReturnInventoryItemsMap[foitem];
|
| 23638 |
amit.gupta |
234 |
var modal = $(this);
|
|
|
235 |
modal.find(".modal-title").html(link.html() + "-" + itemDesc);
|
|
|
236 |
htmlArr = [];
|
|
|
237 |
htmlArr.push('<div> <ul data-foi="' + foitem + '">');
|
|
|
238 |
var i;
|
| 23654 |
amit.gupta |
239 |
for( i=0;i<li.length;i++) {
|
|
|
240 |
var counter = 0;
|
|
|
241 |
while(inventoryItemBilledQtyMap[li[i].inventoryItemId] > counter) {
|
|
|
242 |
if(link.html()=="Mark Defective"){
|
|
|
243 |
htmlArr.push('<li class="row">');
|
|
|
244 |
htmlArr.push('<div class="col-sm-6 checkbox"><label><input type="checkbox" value="' + li[i].inventoryItemId +'">Defective</label></div>');
|
|
|
245 |
htmlArr.push('<div class="col-sm-6 form-group"><label for="comment">Remarks</label><textarea class="form-control" rows="2" id="comment"></textarea></div>');
|
|
|
246 |
htmlArr.push('</li>');
|
|
|
247 |
} else {
|
|
|
248 |
htmlArr.push('<li class="row">');
|
|
|
249 |
htmlArr.push('<div class="checkbox col-sm-6"><label><input type="checkbox" value="' + li[i].inventoryItemId +'">DOA Certificate Valid for IMEI - ' + li[i].serialNumber + '</label></div>');
|
|
|
250 |
htmlArr.push('<div class="form-group col-sm-6"><label for="comment">Remarks</label><textarea class="form-control" rows="2" id="comment"></textarea></div>');
|
|
|
251 |
htmlArr.push('</li>');
|
|
|
252 |
}
|
|
|
253 |
counter = counter + 1;
|
|
|
254 |
|
|
|
255 |
}
|
|
|
256 |
var counter = 0;
|
|
|
257 |
while(li[i].quantity - inventoryItemBilledQtyMap[li[i].inventoryItemId] > counter) {
|
|
|
258 |
if(link.html()=="Mark Defective"){
|
|
|
259 |
htmlArr.push('<li class="row">');
|
|
|
260 |
htmlArr.push('<div class="checkbox col-sm-6"><label><input type="checkbox" checked disabled value="' + li[i].inventoryItemId +'">Defective</label></div>');
|
|
|
261 |
htmlArr.push('<div class="form-group col-sm-6"><label for="comment">Remarks</label><textarea disabled class="form-control" rows="2" id="comment">' + returnedItems[counter].remarks + '</textarea></div>');
|
|
|
262 |
htmlArr.push('</li>');
|
|
|
263 |
} else {
|
|
|
264 |
htmlArr.push('<li class="row">');
|
|
|
265 |
htmlArr.push('<div class="checkbox col-sm-6"><label><input type="checkbox" checked disabled value="' + li[i].inventoryItemId +'">DOA Certificate Valid for IMEI - ' + li[i].serialNumber + '</label></div>');
|
|
|
266 |
htmlArr.push('<div class="form-group col-sm-6"><label for="comment">Remarks</label><textarea disabled class="form-control" rows="2" id="comment">' + returnedItems[counter].remarks + '</textarea></div>');
|
|
|
267 |
htmlArr.push('</li>');
|
|
|
268 |
}
|
|
|
269 |
counter = counter + 1;
|
|
|
270 |
}
|
|
|
271 |
}
|
| 23638 |
amit.gupta |
272 |
modal.find(".modal-body").html(htmlArr.join(""));
|
|
|
273 |
});
|
|
|
274 |
|
|
|
275 |
$(".return-submit").on('click', function(){
|
|
|
276 |
var showAlert = false;
|
| 23654 |
amit.gupta |
277 |
var checkedInventory = $('.modal-body').find('input:checked:enabled');
|
| 23638 |
amit.gupta |
278 |
if(checkedInventory.length==0){
|
|
|
279 |
alert("Check the defective and provide remarks");
|
|
|
280 |
return;
|
|
|
281 |
}
|
|
|
282 |
checkedInventory.each(function(i,v){
|
|
|
283 |
if($(v).closest('li').find('textarea').val()==''){
|
|
|
284 |
showAlert = true;
|
|
|
285 |
}
|
|
|
286 |
});
|
|
|
287 |
if(showAlert) {
|
|
|
288 |
alert('Please add remarks');
|
|
|
289 |
return;
|
|
|
290 |
} else {
|
|
|
291 |
var foi = $(checkedInventory).closest('ul').data('foi');
|
|
|
292 |
var markedBadArr = [];
|
|
|
293 |
checkedInventory.each(function(i,v){
|
|
|
294 |
markedBadArr.push({"remarks" : $(v).closest('li').find('textarea').val(),
|
|
|
295 |
"inventoryItemId":$(v).val()});
|
|
|
296 |
});
|
|
|
297 |
var json = {"fofoOrderItemId":foi, "markedBadArr":markedBadArr};
|
|
|
298 |
doPostAjaxRequestWithJsonHandler('${rc.contextPath}/order/bad_return', JSON.stringify(json), function(data){
|
| 23654 |
amit.gupta |
299 |
alert('Credit Note generated');
|
|
|
300 |
window.open('${rc.contextPath}/credit-note/' + data.response, '_blank');
|
|
|
301 |
loadSaleDetails(orderId,"sale-details-container");
|
|
|
302 |
$('#exampleModal').modal('hide');
|
|
|
303 |
|
| 23638 |
amit.gupta |
304 |
});
|
|
|
305 |
}
|
|
|
306 |
});
|
| 23896 |
amit.gupta |
307 |
</script>
|