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