| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.client.event.AcceptOrderEvent;
|
| 4421 |
mandeep.dh |
4 |
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
|
| 4666 |
rajveer |
5 |
import in.shop2020.hotspot.dashbaord.client.event.LostInTransitEvent;
|
| 6019 |
rajveer |
6 |
import in.shop2020.hotspot.dashbaord.client.event.MarkRtoInTransitEvent;
|
| 487 |
rajveer |
7 |
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
|
| 4421 |
mandeep.dh |
8 |
import in.shop2020.hotspot.dashbaord.client.event.ProvisionalCaptureEvent;
|
| 2628 |
chandransh |
9 |
import in.shop2020.hotspot.dashbaord.client.event.ReshipOrderEvent;
|
| 6019 |
rajveer |
10 |
import in.shop2020.hotspot.dashbaord.client.event.UnacceptOrderEvent;
|
| 2843 |
chandransh |
11 |
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
|
| 306 |
ashish |
12 |
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
|
| 167 |
ashish |
13 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
| 2835 |
chandransh |
14 |
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
|
| 167 |
ashish |
15 |
|
| 4421 |
mandeep.dh |
16 |
import java.util.Map;
|
|
|
17 |
|
| 167 |
ashish |
18 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
19 |
|
|
|
20 |
import com.google.gwt.core.client.GWT;
|
|
|
21 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
22 |
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
23 |
import com.google.gwt.resources.client.CssResource;
|
|
|
24 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
25 |
import com.google.gwt.uibinder.client.UiField;
|
| 487 |
rajveer |
26 |
import com.google.gwt.user.client.Window;
|
| 306 |
ashish |
27 |
import com.google.gwt.user.client.ui.Button;
|
| 167 |
ashish |
28 |
import com.google.gwt.user.client.ui.FlexTable;
|
| 306 |
ashish |
29 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
30 |
import com.google.gwt.user.client.ui.Label;
|
| 167 |
ashish |
31 |
import com.google.gwt.user.client.ui.ResizeComposite;
|
| 306 |
ashish |
32 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
| 167 |
ashish |
33 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
34 |
|
|
|
35 |
public class OrderDetails extends ResizeComposite{
|
|
|
36 |
|
|
|
37 |
public interface Listener{
|
|
|
38 |
void onClick();
|
|
|
39 |
}
|
|
|
40 |
|
| 585 |
chandransh |
41 |
interface OrderDetailsUiBinder extends UiBinder<Widget, OrderDetails>{ }
|
| 167 |
ashish |
42 |
|
|
|
43 |
interface SelectionStyle extends CssResource{
|
| 306 |
ashish |
44 |
String blueLabel();
|
|
|
45 |
String greenLabel();
|
| 167 |
ashish |
46 |
}
|
|
|
47 |
|
| 585 |
chandransh |
48 |
private static final OrderDetailsUiBinder binder = GWT.create(OrderDetailsUiBinder.class);
|
| 167 |
ashish |
49 |
|
|
|
50 |
@UiField FlexTable header;
|
|
|
51 |
@UiField FlexTable table;
|
| 306 |
ashish |
52 |
@UiField HorizontalPanel orderDetails;
|
|
|
53 |
@UiField VerticalPanel orderDetails1;
|
|
|
54 |
@UiField VerticalPanel orderDetails2;
|
|
|
55 |
@UiField VerticalPanel orderDetails3;
|
|
|
56 |
@UiField VerticalPanel orderDetails4;
|
|
|
57 |
@UiField VerticalPanel orderDetails5;
|
|
|
58 |
@UiField SelectionStyle selectionStyle;
|
| 167 |
ashish |
59 |
|
|
|
60 |
|
|
|
61 |
private final EventBus eventbus;
|
|
|
62 |
private Order order;
|
|
|
63 |
private Order transaction;
|
| 2509 |
chandransh |
64 |
|
| 3065 |
chandransh |
65 |
//Buttons for the Warehouse Executive
|
| 4367 |
rajveer |
66 |
//private Button verifyOrder = new Button();
|
| 306 |
ashish |
67 |
private Button acceptOrder = new Button();
|
|
|
68 |
private Button rejectOrder = new Button();
|
| 4361 |
rajveer |
69 |
private Button printAllInvoices = new Button();
|
| 306 |
ashish |
70 |
private Button notAvailable= new Button();
|
|
|
71 |
private Button addBillingInfo= new Button();
|
| 2449 |
chandransh |
72 |
private Button printInvoice = new Button();
|
| 2610 |
chandransh |
73 |
private Button receiveReturn = new Button();
|
| 2509 |
chandransh |
74 |
private Button validateDOA = new Button();
|
| 4495 |
rajveer |
75 |
private Button validateReturnProduct = new Button();
|
| 677 |
chandransh |
76 |
|
| 3463 |
chandransh |
77 |
//Buttons for the Admin to track order
|
| 2509 |
chandransh |
78 |
private Button flagOrder = new Button();
|
|
|
79 |
private Button requestPickup = new Button();
|
|
|
80 |
private Button authorizePickup = new Button();
|
|
|
81 |
private Button refundOrder = new Button();
|
| 4421 |
mandeep.dh |
82 |
private Button reshipOrder = new Button();
|
| 4666 |
rajveer |
83 |
private Button markLostInTransit = new Button();
|
| 4421 |
mandeep.dh |
84 |
private Button provisionallyCapturePaymentForOrder = new Button();
|
| 2509 |
chandransh |
85 |
|
| 3463 |
chandransh |
86 |
//Buttons for the Admin to edit order details
|
|
|
87 |
private Button addWeight = new Button();
|
|
|
88 |
private Button changeColor = new Button();
|
| 3553 |
chandransh |
89 |
private Button addDelayReason = new Button();
|
| 4712 |
rajveer |
90 |
private Button markDelivered = new Button();
|
| 6019 |
rajveer |
91 |
private Button markRtoInTransit = new Button();
|
|
|
92 |
private Button unacceptOrder = new Button();
|
| 7561 |
rajveer |
93 |
// private Button changeJacketNumber = new Button();
|
|
|
94 |
// private Button shiftWarehouse = new Button();
|
| 7190 |
amar.kumar |
95 |
private Button splitFreebieOrder = new Button();
|
| 7822 |
amar.kumar |
96 |
private Button changeFreebieItem = new Button();
|
| 8182 |
amar.kumar |
97 |
private Button splitEbayOrder = new Button();
|
| 3463 |
chandransh |
98 |
|
| 306 |
ashish |
99 |
private String user;
|
|
|
100 |
private DetailsMask mask;
|
| 677 |
chandransh |
101 |
private long warehouseID;
|
| 2835 |
chandransh |
102 |
private UserType userType;
|
| 2843 |
chandransh |
103 |
private BillingType billingType;
|
| 5110 |
mandeep.dh |
104 |
private Map<Long, String> warehouses;
|
| 4603 |
rajveer |
105 |
private Map<Long, String> providers;
|
| 167 |
ashish |
106 |
|
| 5110 |
mandeep.dh |
107 |
public OrderDetails(EventBus eventbus, Order order, Order order2, DetailsMask mask, String user, long warehouseID, UserType userType, BillingType billingType, Map<Long, String> warehouses, Map<Long, String> providers){
|
| 167 |
ashish |
108 |
this.eventbus = eventbus;
|
|
|
109 |
this.order = order;
|
|
|
110 |
this.transaction = order2;
|
| 306 |
ashish |
111 |
this.mask = mask;
|
|
|
112 |
this.user = user;
|
| 677 |
chandransh |
113 |
this.warehouseID = warehouseID;
|
| 2835 |
chandransh |
114 |
this.userType = userType;
|
| 2843 |
chandransh |
115 |
this.billingType = billingType;
|
| 5110 |
mandeep.dh |
116 |
this.warehouses = warehouses;
|
| 4606 |
rajveer |
117 |
this.providers = providers;
|
| 2449 |
chandransh |
118 |
|
| 167 |
ashish |
119 |
initWidget(binder.createAndBindUi(this));
|
| 8910 |
amar.kumar |
120 |
if(this.userType != UserType.WAREHOUSE_OBSERVER) {
|
|
|
121 |
initTableForWE();
|
|
|
122 |
}
|
| 2835 |
chandransh |
123 |
if(this.userType == UserType.ADMIN){
|
| 2509 |
chandransh |
124 |
initTableForAdmin();
|
| 8303 |
amar.kumar |
125 |
} else if(this.userType == UserType.WAREHOUSE_MONITOR){
|
|
|
126 |
initTableForWM();
|
| 2509 |
chandransh |
127 |
}
|
| 306 |
ashish |
128 |
loadOrderDetails();
|
| 167 |
ashish |
129 |
}
|
|
|
130 |
|
| 2509 |
chandransh |
131 |
private void initTableForWE() {
|
| 10521 |
manish.sha |
132 |
header.getColumnFormatter().setWidth(0, "120px");
|
|
|
133 |
header.getColumnFormatter().setWidth(1, "120px");
|
|
|
134 |
header.getColumnFormatter().setWidth(2, "120px");
|
|
|
135 |
header.getColumnFormatter().setWidth(3, "120px");
|
|
|
136 |
header.getColumnFormatter().setWidth(4, "120px");
|
|
|
137 |
header.getColumnFormatter().setWidth(5, "120px");
|
|
|
138 |
header.getColumnFormatter().setWidth(6, "120px");
|
|
|
139 |
header.getColumnFormatter().setWidth(7, "120px");
|
|
|
140 |
header.getColumnFormatter().setWidth(8, "120px");
|
| 306 |
ashish |
141 |
|
| 4367 |
rajveer |
142 |
//verifyOrder.setText("Verify");
|
| 306 |
ashish |
143 |
acceptOrder.setText("Accept");
|
|
|
144 |
notAvailable.setText("Out Of Stock");
|
|
|
145 |
addBillingInfo.setText("Bill");
|
| 6746 |
rajveer |
146 |
if(billingType == BillingType.OURS || billingType == BillingType.OURS_EXTERNAL)
|
| 2843 |
chandransh |
147 |
addBillingInfo.setVisible(false);
|
| 10521 |
manish.sha |
148 |
|
| 2449 |
chandransh |
149 |
printInvoice.setText("Print Invoice");
|
| 2610 |
chandransh |
150 |
receiveReturn.setText("Receive Return");
|
| 2509 |
chandransh |
151 |
validateDOA.setText("Validate DOA");
|
| 4545 |
rajveer |
152 |
validateReturnProduct.setText("Product Usable?");
|
| 4248 |
rajveer |
153 |
rejectOrder.setText("Cancel Order");
|
| 4361 |
rajveer |
154 |
printAllInvoices.setText("Print All Invoices");
|
| 486 |
rajveer |
155 |
|
| 4367 |
rajveer |
156 |
//header.setWidget(0, 0, verifyOrder);
|
|
|
157 |
header.setWidget(0, 0, acceptOrder);
|
|
|
158 |
header.setWidget(0, 1, notAvailable);
|
|
|
159 |
header.setWidget(0, 2, addBillingInfo);
|
| 2509 |
chandransh |
160 |
|
| 10521 |
manish.sha |
161 |
header.setWidget(0, 3, printInvoice);
|
|
|
162 |
header.setWidget(0, 4, receiveReturn);
|
|
|
163 |
header.setWidget(0, 5, validateDOA);
|
|
|
164 |
header.setWidget(0, 6, rejectOrder);
|
|
|
165 |
header.setWidget(0, 7, printAllInvoices);
|
|
|
166 |
header.setWidget(0, 8, validateReturnProduct);
|
|
|
167 |
|
|
|
168 |
markRtoInTransit.setText("Mark RTO");
|
|
|
169 |
|
| 10541 |
manish.sha |
170 |
|
| 10521 |
manish.sha |
171 |
header.setWidget(2, 4, markRtoInTransit);
|
|
|
172 |
|
| 2509 |
chandransh |
173 |
registerButtonHandlersForWE();
|
| 4367 |
rajveer |
174 |
if(this.userType == UserType.WAREHOUSE_EXECUTIVE || this.userType == UserType.ADMIN){
|
|
|
175 |
implementMaskForWE();
|
| 8303 |
amar.kumar |
176 |
} else if(this.userType == UserType.WAREHOUSE_MONITOR){
|
| 4367 |
rajveer |
177 |
implementMaskForWM();
|
|
|
178 |
}
|
|
|
179 |
|
| 167 |
ashish |
180 |
}
|
|
|
181 |
|
| 2509 |
chandransh |
182 |
private void registerButtonHandlersForWE(){
|
| 4367 |
rajveer |
183 |
/*
|
| 3065 |
chandransh |
184 |
verifyOrder.addClickHandler(new ClickHandler() {
|
|
|
185 |
|
|
|
186 |
@Override
|
|
|
187 |
public void onClick(ClickEvent event) {
|
|
|
188 |
if(verifyOrder.isEnabled()){
|
|
|
189 |
GWT.log("Verify order event fired");
|
|
|
190 |
eventbus.fireEvent(new VerifyOrderEvent(order));
|
|
|
191 |
}
|
|
|
192 |
}
|
|
|
193 |
});
|
| 4367 |
rajveer |
194 |
*/
|
| 3065 |
chandransh |
195 |
|
| 306 |
ashish |
196 |
acceptOrder.addClickHandler(new ClickHandler() {
|
|
|
197 |
|
|
|
198 |
@Override
|
|
|
199 |
public void onClick(ClickEvent event) {
|
| 2558 |
chandransh |
200 |
if(acceptOrder.isEnabled())
|
| 306 |
ashish |
201 |
eventbus.fireEvent(new AcceptOrderEvent(order));
|
|
|
202 |
}
|
|
|
203 |
});
|
| 486 |
rajveer |
204 |
|
| 487 |
rajveer |
205 |
notAvailable.addClickHandler(new ClickHandler() {
|
|
|
206 |
|
|
|
207 |
@Override
|
|
|
208 |
public void onClick(ClickEvent event) {
|
| 2558 |
chandransh |
209 |
if(notAvailable.isEnabled())
|
|
|
210 |
eventbus.fireEvent(new NostockOrderEvent(order));
|
| 487 |
rajveer |
211 |
}
|
|
|
212 |
});
|
|
|
213 |
|
| 4248 |
rajveer |
214 |
rejectOrder.addClickHandler(new ClickHandler() {
|
|
|
215 |
|
|
|
216 |
@Override
|
|
|
217 |
public void onClick(ClickEvent event) {
|
|
|
218 |
if(rejectOrder.isEnabled()){
|
|
|
219 |
RejectReasonBox box = new RejectReasonBox(eventbus, order, user);
|
|
|
220 |
box.center();
|
|
|
221 |
}
|
|
|
222 |
}
|
|
|
223 |
});
|
|
|
224 |
|
| 306 |
ashish |
225 |
addBillingInfo.addClickHandler(new ClickHandler() {
|
|
|
226 |
|
|
|
227 |
@Override
|
|
|
228 |
public void onClick(ClickEvent event) {
|
| 1146 |
chandransh |
229 |
if(!addBillingInfo.isEnabled())
|
|
|
230 |
return;
|
| 306 |
ashish |
231 |
BillingInfoBox box = new BillingInfoBox(eventbus, order, user);
|
|
|
232 |
box.center();
|
|
|
233 |
}
|
|
|
234 |
});
|
| 487 |
rajveer |
235 |
|
| 2449 |
chandransh |
236 |
printInvoice.addClickHandler(new ClickHandler() {
|
| 306 |
ashish |
237 |
|
|
|
238 |
@Override
|
|
|
239 |
public void onClick(ClickEvent event) {
|
| 2449 |
chandransh |
240 |
if(!printInvoice.isEnabled())
|
| 1146 |
chandransh |
241 |
return;
|
| 6746 |
rajveer |
242 |
if(order.getJacketNumber()==0 && (billingType == BillingType.OURS || billingType == BillingType.OURS_EXTERNAL)) {
|
| 5110 |
mandeep.dh |
243 |
JacketInfoBox box = new JacketInfoBox(eventbus, order, user, billingType, warehouses);
|
| 1146 |
chandransh |
244 |
//box.clean();
|
|
|
245 |
box.center();
|
| 5110 |
mandeep.dh |
246 |
} else{
|
| 9264 |
amar.kumar |
247 |
String invoiceGenerationUrl = null;
|
| 9263 |
amar.kumar |
248 |
if(warehouseID == 0) {
|
| 9266 |
amar.kumar |
249 |
invoiceGenerationUrl = GWT.getHostPageBaseURL() + "invoice/?id=" + order.getOrderId() + "&warehouse=" + order.getWarehouseId() + "&withBill=true";
|
| 9263 |
amar.kumar |
250 |
} else {
|
| 9264 |
amar.kumar |
251 |
invoiceGenerationUrl = GWT.getHostPageBaseURL() + "invoice/?id=" + order.getOrderId() + "&warehouse=" + warehouseID;
|
| 9266 |
amar.kumar |
252 |
if(billingType == BillingType.OURS || billingType == BillingType.OURS_EXTERNAL)
|
|
|
253 |
invoiceGenerationUrl += "&withBill=true";
|
|
|
254 |
else
|
|
|
255 |
invoiceGenerationUrl += "&withBill=false";
|
| 9263 |
amar.kumar |
256 |
}
|
| 1146 |
chandransh |
257 |
Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
|
|
|
258 |
}
|
| 306 |
ashish |
259 |
}
|
|
|
260 |
});
|
| 2588 |
chandransh |
261 |
|
| 4361 |
rajveer |
262 |
printAllInvoices.addClickHandler(new ClickHandler() {
|
|
|
263 |
|
|
|
264 |
@Override
|
|
|
265 |
public void onClick(ClickEvent event) {
|
|
|
266 |
if(!printAllInvoices.isEnabled()){
|
|
|
267 |
return;
|
|
|
268 |
}else{
|
|
|
269 |
String invoiceGenerationUrl = GWT.getHostPageBaseURL() + "invoice/?id=" + order.getOrderId() + "&printAll=true&warehouse=" + warehouseID;
|
| 6746 |
rajveer |
270 |
if(billingType == BillingType.OURS || billingType == BillingType.OURS_EXTERNAL)
|
| 4361 |
rajveer |
271 |
invoiceGenerationUrl += "&withBill=true";
|
|
|
272 |
else
|
|
|
273 |
invoiceGenerationUrl += "&withBill=false";
|
|
|
274 |
Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
|
|
|
275 |
}
|
|
|
276 |
}
|
|
|
277 |
});
|
|
|
278 |
|
| 2610 |
chandransh |
279 |
receiveReturn.addClickHandler(new ClickHandler() {
|
| 2588 |
chandransh |
280 |
|
|
|
281 |
@Override
|
|
|
282 |
public void onClick(ClickEvent event) {
|
| 4478 |
rajveer |
283 |
if(!receiveReturn.isEnabled())
|
|
|
284 |
return;
|
|
|
285 |
ReceiveReturnBox box = new ReceiveReturnBox(eventbus, order);
|
|
|
286 |
box.center();
|
| 2588 |
chandransh |
287 |
}
|
|
|
288 |
});
|
|
|
289 |
|
|
|
290 |
validateDOA.addClickHandler(new ClickHandler() {
|
|
|
291 |
|
|
|
292 |
@Override
|
|
|
293 |
public void onClick(ClickEvent event) {
|
|
|
294 |
if(!validateDOA.isEnabled())
|
|
|
295 |
return;
|
|
|
296 |
DoaValidationBox box = new DoaValidationBox(eventbus, order);
|
|
|
297 |
box.center();
|
|
|
298 |
}
|
|
|
299 |
});
|
| 4495 |
rajveer |
300 |
|
|
|
301 |
validateReturnProduct.addClickHandler(new ClickHandler() {
|
|
|
302 |
|
|
|
303 |
@Override
|
|
|
304 |
public void onClick(ClickEvent event) {
|
|
|
305 |
if(!validateReturnProduct.isEnabled())
|
|
|
306 |
return;
|
|
|
307 |
ProductValidationBox box = new ProductValidationBox(eventbus, order);
|
|
|
308 |
box.center();
|
|
|
309 |
}
|
|
|
310 |
});
|
| 10522 |
manish.sha |
311 |
|
|
|
312 |
markRtoInTransit.addClickHandler(new ClickHandler() {
|
|
|
313 |
|
|
|
314 |
@Override
|
|
|
315 |
public void onClick(ClickEvent event) {
|
|
|
316 |
eventbus.fireEvent(new MarkRtoInTransitEvent(order));
|
|
|
317 |
}
|
|
|
318 |
});
|
| 2449 |
chandransh |
319 |
}
|
| 487 |
rajveer |
320 |
|
| 4367 |
rajveer |
321 |
private void implementMaskForWM(){
|
| 8910 |
amar.kumar |
322 |
|
|
|
323 |
/*boolean accept, boolean notavailable, boolean updateColor, boolean reject,
|
|
|
324 |
boolean printAllInvoice, boolean printInv, boolean splitSourceOrder, boolean markDelivery,
|
|
|
325 |
boolean reqPickup, boolean authPickup, boolean reship, boolean lostInTransit, boolean acceptdoa,
|
|
|
326 |
boolean validatedoa, boolean validatereturnproduct*/
|
| 8303 |
amar.kumar |
327 |
//TODO Currently a lot of options have been disabled for this case. This would need a revisit based on discussions and requirements
|
|
|
328 |
printAllInvoices.setEnabled(false);
|
|
|
329 |
addBillingInfo.setEnabled(false);
|
|
|
330 |
printInvoice.setEnabled(false);
|
| 8910 |
amar.kumar |
331 |
//receiveReturn.setEnabled(false);
|
|
|
332 |
//validateDOA.setEnabled(false);
|
|
|
333 |
//validateReturnProduct.setEnabled(false);
|
| 8303 |
amar.kumar |
334 |
flagOrder.setEnabled(false);
|
| 8910 |
amar.kumar |
335 |
//requestPickup.setEnabled(false);
|
|
|
336 |
//authorizePickup.setEnabled(false);
|
| 8303 |
amar.kumar |
337 |
refundOrder.setEnabled(false);
|
| 8910 |
amar.kumar |
338 |
//reshipOrder.setEnabled(false);
|
|
|
339 |
//markLostInTransit.setEnabled(false);
|
| 8303 |
amar.kumar |
340 |
provisionallyCapturePaymentForOrder.setEnabled(false);
|
|
|
341 |
addWeight.setEnabled(false);
|
| 8910 |
amar.kumar |
342 |
//markDelivered.setEnabled(false);
|
|
|
343 |
//markRtoInTransit.setEnabled(false);
|
| 8303 |
amar.kumar |
344 |
changeFreebieItem.setEnabled(false);
|
|
|
345 |
|
|
|
346 |
switch(mask){
|
|
|
347 |
case CAPTURE_IN_PROCESS:
|
| 8910 |
amar.kumar |
348 |
maskButtonsForWM(false, false, false, false, false, false, false, false,
|
|
|
349 |
false, false, false, false, false, false, false);
|
| 8303 |
amar.kumar |
350 |
break;
|
|
|
351 |
case VERIFICATION_PENDING:
|
|
|
352 |
case NEW:
|
|
|
353 |
case NO_STOCK:
|
|
|
354 |
case ACCEPT:
|
| 8910 |
amar.kumar |
355 |
maskButtonsForWM(true, true, true, true, true, false, true, false,
|
|
|
356 |
false, false, false, false, false, false, false);
|
| 8303 |
amar.kumar |
357 |
break;
|
|
|
358 |
case BILL:
|
| 8910 |
amar.kumar |
359 |
maskButtonsForWM(false, true, false, true, false, true, false, true,
|
|
|
360 |
false, false, false, false, false, false, false);
|
| 8303 |
amar.kumar |
361 |
break;
|
|
|
362 |
case DELIVERED:
|
| 8910 |
amar.kumar |
363 |
maskButtonsForWM(false, false, false, false, false, true, false, false,
|
|
|
364 |
false, false, false, false, false, false, false);
|
| 8303 |
amar.kumar |
365 |
case DOA_REQUEST_AUTHORIZED:
|
| 8910 |
amar.kumar |
366 |
maskButtonsForWM(false, false, false, false, false, true, false, false,
|
|
|
367 |
false, false, false, false, false, false, false);
|
| 8303 |
amar.kumar |
368 |
case DOA_PICKUP_REQUESTED:
|
| 8910 |
amar.kumar |
369 |
maskButtonsForWM(false, false, false, false, false, true, false, false,
|
|
|
370 |
true, true, false, false, false, false, false);
|
| 8303 |
amar.kumar |
371 |
case DOA_RETURNED:
|
|
|
372 |
case SALES_RETURNED:
|
| 8910 |
amar.kumar |
373 |
maskButtonsForWM(false, false, false, false, false, true, false, false,
|
|
|
374 |
false, false, true, false, false, false, false);
|
|
|
375 |
|
| 8303 |
amar.kumar |
376 |
case SHIP:
|
| 8910 |
amar.kumar |
377 |
maskButtonsForWM(false, false, false, false, false, true, false, true,
|
|
|
378 |
false, false, false, true, false, false, false);
|
| 8303 |
amar.kumar |
379 |
break;
|
|
|
380 |
default:
|
| 8910 |
amar.kumar |
381 |
maskButtonsForWM(false, false, false, false, false, true, false, false,
|
|
|
382 |
false, false, false, false, false, false, false); //Unknown state. Let's not allow any untoward actions.
|
| 8303 |
amar.kumar |
383 |
break;
|
|
|
384 |
}
|
| 4367 |
rajveer |
385 |
}
|
|
|
386 |
|
| 2509 |
chandransh |
387 |
private void implementMaskForWE(){
|
| 306 |
ashish |
388 |
switch(mask){
|
| 3065 |
chandransh |
389 |
case VERIFICATION_PENDING:
|
| 4495 |
rajveer |
390 |
maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Do not allow the WE to verify the order.
|
| 3065 |
chandransh |
391 |
break;
|
| 4421 |
mandeep.dh |
392 |
case CAPTURE_IN_PROCESS:
|
| 306 |
ashish |
393 |
case NEW:
|
| 4495 |
rajveer |
394 |
maskButtonsForWE(true, false, true, false, false, false, false, false, false); //Allow the WE to either accept the order or mark it as out of stock.
|
| 306 |
ashish |
395 |
break;
|
|
|
396 |
case ACCEPT:
|
| 2843 |
chandransh |
397 |
//TODO: Mask buttons based on the billingType
|
|
|
398 |
if(billingType == BillingType.OURS)
|
| 6746 |
rajveer |
399 |
maskButtonsForWE(false, false, false, true, true, false, false, false, false); // For our billing, allow the WE to directly print the invoive.
|
| 2843 |
chandransh |
400 |
else
|
| 4495 |
rajveer |
401 |
maskButtonsForWE(false, false, false, true, true, false, false, true, false); //For external billing, allow the WE to feed the invoice info.
|
| 306 |
ashish |
402 |
break;
|
| 486 |
rajveer |
403 |
case REJECT:
|
| 4495 |
rajveer |
404 |
maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Can't do anything once the order has been rejected.
|
| 486 |
rajveer |
405 |
break;
|
| 306 |
ashish |
406 |
case BILL:
|
| 4495 |
rajveer |
407 |
maskButtonsForWE(false, false, false, true, false, false, false, false, false); //Allow WE to print the invoice for a billed order.
|
| 306 |
ashish |
408 |
break;
|
|
|
409 |
case SHIP:
|
| 4495 |
rajveer |
410 |
maskButtonsForWE(false, false, false, false, false, false, false, false, false);
|
| 306 |
ashish |
411 |
break;
|
| 487 |
rajveer |
412 |
case NO_STOCK:
|
| 4495 |
rajveer |
413 |
maskButtonsForWE(true, false, false, false, false, false, false, false, false); //Allow WE to accept a low inventory item.
|
| 487 |
rajveer |
414 |
break;
|
| 4248 |
rajveer |
415 |
case CANCEL_CONFIRMED:
|
| 4495 |
rajveer |
416 |
maskButtonsForWE(false, true, false, false, false, false, false, false, false); //Allow WE to Cancel a order which is in cancellation pending state.
|
| 4248 |
rajveer |
417 |
break;
|
| 2509 |
chandransh |
418 |
case DOA_AWAITED:
|
| 2610 |
chandransh |
419 |
case SALES_RETURN_AWAITED:
|
| 4495 |
rajveer |
420 |
maskButtonsForWE(false, false, false, false, false, true, false, false, false); //Allow WE to accept the packet.
|
| 2509 |
chandransh |
421 |
break;
|
| 2610 |
chandransh |
422 |
case DOA_RECEIVED:
|
| 4495 |
rajveer |
423 |
maskButtonsForWE(false, false, false, false, false, false, true, false, false); //Allow WE to validate the DOA certificate.
|
| 2509 |
chandransh |
424 |
break;
|
| 4495 |
rajveer |
425 |
case RET_RECEIVED:
|
|
|
426 |
maskButtonsForWE(false, false, false, false, false, false, false, false, true); //Allow WE to validate the DOA certificate.
|
|
|
427 |
break;
|
|
|
428 |
|
| 2558 |
chandransh |
429 |
default:
|
| 4495 |
rajveer |
430 |
maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
|
| 2558 |
chandransh |
431 |
break;
|
| 306 |
ashish |
432 |
}
|
|
|
433 |
}
|
|
|
434 |
|
| 4495 |
rajveer |
435 |
private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa, boolean printAllInvoice, boolean validatereturnproduct){
|
| 4367 |
rajveer |
436 |
//verifyOrder.setEnabled(verify);
|
| 3065 |
chandransh |
437 |
acceptOrder.setEnabled(accept);
|
| 306 |
ashish |
438 |
notAvailable.setEnabled(notavailable);
|
| 2449 |
chandransh |
439 |
printInvoice.setEnabled(printInv);
|
| 306 |
ashish |
440 |
addBillingInfo.setEnabled(billing);
|
| 2610 |
chandransh |
441 |
receiveReturn.setEnabled(acceptdoa);
|
| 2509 |
chandransh |
442 |
validateDOA.setEnabled(validatedoa);
|
|
|
443 |
rejectOrder.setEnabled(reject);
|
| 4363 |
rajveer |
444 |
printAllInvoices.setEnabled(printAllInvoice);
|
| 4495 |
rajveer |
445 |
validateReturnProduct.setEnabled(validatereturnproduct);
|
| 306 |
ashish |
446 |
}
|
| 2509 |
chandransh |
447 |
|
| 8910 |
amar.kumar |
448 |
private void maskButtonsForWM(boolean accept, boolean notavailable, boolean updateColor, boolean reject,
|
|
|
449 |
boolean printAllInvoice, boolean printInv, boolean splitSourceOrder, boolean markDelivery,
|
|
|
450 |
boolean reqPickup, boolean authPickup, boolean reship, boolean lostInTransit, boolean acceptdoa,
|
|
|
451 |
boolean validatedoa, boolean validatereturnproduct){
|
| 8303 |
amar.kumar |
452 |
acceptOrder.setEnabled(accept);
|
|
|
453 |
notAvailable.setEnabled(notavailable);
|
|
|
454 |
changeColor.setEnabled(updateColor);
|
|
|
455 |
rejectOrder.setEnabled(reject);
|
|
|
456 |
printAllInvoices.setEnabled(printAllInvoice);
|
|
|
457 |
printInvoice.setEnabled(printInv);
|
|
|
458 |
splitEbayOrder.setEnabled(splitSourceOrder);
|
| 8910 |
amar.kumar |
459 |
markDelivered.setEnabled(markDelivery);
|
|
|
460 |
requestPickup.setEnabled(reqPickup);
|
|
|
461 |
authorizePickup.setEnabled(authPickup);
|
|
|
462 |
reshipOrder.setEnabled(reship);
|
|
|
463 |
markLostInTransit.setEnabled(lostInTransit);
|
|
|
464 |
receiveReturn.setEnabled(acceptdoa);
|
|
|
465 |
validateDOA.setEnabled(validatedoa);
|
|
|
466 |
validateReturnProduct.setEnabled(validatereturnproduct);
|
| 8303 |
amar.kumar |
467 |
}
|
|
|
468 |
|
|
|
469 |
private void initTableForWM() {
|
|
|
470 |
if(transaction.isDoaFlag()){
|
|
|
471 |
flagOrder.setText("Unflag");
|
|
|
472 |
} else {
|
|
|
473 |
flagOrder.setText("Flag");
|
|
|
474 |
}
|
|
|
475 |
requestPickup.setText("Request Pick-up No");
|
|
|
476 |
authorizePickup.setText("Confirm Pick-up");
|
|
|
477 |
reshipOrder.setText("Reship");
|
|
|
478 |
markLostInTransit.setText("Lost In Transit");
|
|
|
479 |
refundOrder.setText("Refund");
|
|
|
480 |
provisionallyCapturePaymentForOrder.setText("Capture provisionally");
|
|
|
481 |
unacceptOrder.setText("Unaccept");
|
|
|
482 |
|
|
|
483 |
header.setWidget(1, 0, flagOrder);
|
|
|
484 |
header.setWidget(1, 1, requestPickup);
|
|
|
485 |
header.setWidget(1, 2, authorizePickup);
|
|
|
486 |
header.setWidget(1, 3, reshipOrder);
|
|
|
487 |
header.setWidget(1, 4, markLostInTransit);
|
|
|
488 |
header.setWidget(1, 5, provisionallyCapturePaymentForOrder);
|
|
|
489 |
header.setWidget(1, 6, refundOrder);
|
|
|
490 |
//header.setWidget(1, 7, unacceptOrder);
|
|
|
491 |
|
|
|
492 |
addWeight.setText("Add weight");
|
|
|
493 |
changeColor.setText("Change Color WH Jacket Courier");
|
|
|
494 |
addDelayReason.setText("Add Delay Reason");
|
|
|
495 |
markDelivered.setText("Mark Delivered");
|
|
|
496 |
markRtoInTransit.setText("Mark RTO");
|
|
|
497 |
// changeJacketNumber.setText("Change Jacket");
|
|
|
498 |
// shiftWarehouse.setText("Shift Warehouse");
|
|
|
499 |
splitFreebieOrder.setText("Split Freebie Order");
|
|
|
500 |
changeFreebieItem.setText("Change Freebie Item");
|
|
|
501 |
splitEbayOrder.setText("Split Ebay Order");
|
|
|
502 |
|
|
|
503 |
header.setWidget(2, 0, addWeight);
|
|
|
504 |
header.setWidget(2, 1, changeColor);
|
|
|
505 |
header.setWidget(2, 2, addDelayReason);
|
|
|
506 |
header.setWidget(2, 3, markDelivered);
|
|
|
507 |
header.setWidget(2, 4, markRtoInTransit);
|
|
|
508 |
header.setWidget(2, 5, splitFreebieOrder);
|
|
|
509 |
header.setWidget(2, 6, changeFreebieItem);
|
|
|
510 |
if(order.getSource().equals("EBAY")) {
|
|
|
511 |
header.setWidget(2, 5, splitEbayOrder);
|
|
|
512 |
if(order.getQuantity()<2) {
|
|
|
513 |
splitEbayOrder.setEnabled(false);
|
|
|
514 |
}
|
|
|
515 |
}
|
|
|
516 |
if(order.getTotalWeight() != 0)
|
|
|
517 |
addWeight.setEnabled(false);
|
|
|
518 |
|
|
|
519 |
if(order.getFreebieItemId() == 0) {
|
|
|
520 |
splitFreebieOrder.setEnabled(false);
|
|
|
521 |
changeFreebieItem.setEnabled(false);
|
|
|
522 |
}
|
|
|
523 |
|
|
|
524 |
registerButtonHandlersForAdmin();
|
|
|
525 |
implementMaskForWM();
|
|
|
526 |
}
|
|
|
527 |
|
| 2509 |
chandransh |
528 |
private void initTableForAdmin() {
|
|
|
529 |
if(transaction.isDoaFlag()){
|
|
|
530 |
flagOrder.setText("Unflag");
|
|
|
531 |
} else {
|
|
|
532 |
flagOrder.setText("Flag");
|
|
|
533 |
}
|
|
|
534 |
|
|
|
535 |
requestPickup.setText("Request Pick-up No");
|
| 4455 |
rajveer |
536 |
authorizePickup.setText("Confirm Pick-up");
|
| 2509 |
chandransh |
537 |
reshipOrder.setText("Reship");
|
| 4666 |
rajveer |
538 |
markLostInTransit.setText("Lost In Transit");
|
| 2509 |
chandransh |
539 |
refundOrder.setText("Refund");
|
| 4545 |
rajveer |
540 |
provisionallyCapturePaymentForOrder.setText("Capture provisionally");
|
| 6019 |
rajveer |
541 |
unacceptOrder.setText("Unaccept");
|
| 2509 |
chandransh |
542 |
|
| 2558 |
chandransh |
543 |
header.setWidget(1, 0, flagOrder);
|
|
|
544 |
header.setWidget(1, 1, requestPickup);
|
|
|
545 |
header.setWidget(1, 2, authorizePickup);
|
|
|
546 |
header.setWidget(1, 3, reshipOrder);
|
| 4666 |
rajveer |
547 |
header.setWidget(1, 4, markLostInTransit);
|
| 4421 |
mandeep.dh |
548 |
header.setWidget(1, 5, provisionallyCapturePaymentForOrder);
|
| 2558 |
chandransh |
549 |
header.setWidget(1, 6, refundOrder);
|
| 6019 |
rajveer |
550 |
//header.setWidget(1, 7, unacceptOrder);
|
| 2509 |
chandransh |
551 |
|
| 3463 |
chandransh |
552 |
addWeight.setText("Add weight");
|
| 7562 |
rajveer |
553 |
changeColor.setText("Change Color WH Jacket Courier");
|
| 3553 |
chandransh |
554 |
addDelayReason.setText("Add Delay Reason");
|
| 4712 |
rajveer |
555 |
markDelivered.setText("Mark Delivered");
|
| 6019 |
rajveer |
556 |
markRtoInTransit.setText("Mark RTO");
|
| 7561 |
rajveer |
557 |
// changeJacketNumber.setText("Change Jacket");
|
|
|
558 |
// shiftWarehouse.setText("Shift Warehouse");
|
| 7190 |
amar.kumar |
559 |
splitFreebieOrder.setText("Split Freebie Order");
|
| 7822 |
amar.kumar |
560 |
changeFreebieItem.setText("Change Freebie Item");
|
| 8182 |
amar.kumar |
561 |
splitEbayOrder.setText("Split Ebay Order");
|
| 3463 |
chandransh |
562 |
|
|
|
563 |
header.setWidget(2, 0, addWeight);
|
|
|
564 |
header.setWidget(2, 1, changeColor);
|
| 3553 |
chandransh |
565 |
header.setWidget(2, 2, addDelayReason);
|
| 4712 |
rajveer |
566 |
header.setWidget(2, 3, markDelivered);
|
| 6019 |
rajveer |
567 |
header.setWidget(2, 4, markRtoInTransit);
|
| 7561 |
rajveer |
568 |
// header.setWidget(2, 5, changeJacketNumber);
|
|
|
569 |
// header.setWidget(2, 6, shiftWarehouse);
|
|
|
570 |
header.setWidget(2, 5, splitFreebieOrder);
|
| 7822 |
amar.kumar |
571 |
header.setWidget(2, 6, changeFreebieItem);
|
| 8182 |
amar.kumar |
572 |
if(order.getSource().equals("EBAY")) {
|
|
|
573 |
header.setWidget(2, 5, splitEbayOrder);
|
| 8257 |
amar.kumar |
574 |
if(order.getQuantity()<2) {
|
|
|
575 |
splitEbayOrder.setEnabled(false);
|
|
|
576 |
}
|
| 8182 |
amar.kumar |
577 |
}
|
| 3463 |
chandransh |
578 |
if(order.getTotalWeight() != 0)
|
|
|
579 |
addWeight.setEnabled(false);
|
|
|
580 |
|
| 7192 |
amar.kumar |
581 |
if(order.getFreebieItemId() == 0) {
|
| 7191 |
amar.kumar |
582 |
splitFreebieOrder.setEnabled(false);
|
| 7822 |
amar.kumar |
583 |
changeFreebieItem.setEnabled(false);
|
| 7191 |
amar.kumar |
584 |
}
|
|
|
585 |
|
| 2509 |
chandransh |
586 |
registerButtonHandlersForAdmin();
|
| 3729 |
chandransh |
587 |
implementMaskForAdmin();
|
| 2509 |
chandransh |
588 |
}
|
| 306 |
ashish |
589 |
|
| 2509 |
chandransh |
590 |
private void registerButtonHandlersForAdmin(){
|
|
|
591 |
flagOrder.addClickHandler(new ClickHandler() {
|
|
|
592 |
|
|
|
593 |
@Override
|
|
|
594 |
public void onClick(ClickEvent event) {
|
|
|
595 |
if(flagOrder.isEnabled()){
|
|
|
596 |
eventbus.fireEvent(new FlagOrderEvent(order));
|
|
|
597 |
}
|
|
|
598 |
}
|
|
|
599 |
});
|
|
|
600 |
|
|
|
601 |
requestPickup.addClickHandler(new ClickHandler() {
|
|
|
602 |
|
|
|
603 |
@Override
|
|
|
604 |
public void onClick(ClickEvent event) {
|
| 2513 |
chandransh |
605 |
if(requestPickup.isEnabled()){
|
|
|
606 |
GWT.log("Raising a pickup request for: " + order.getOrderId());
|
| 4578 |
rajveer |
607 |
ChoosePickupProviderBox box = new ChoosePickupProviderBox(eventbus, order, providers);
|
|
|
608 |
box.center();
|
| 2513 |
chandransh |
609 |
}
|
| 2509 |
chandransh |
610 |
}
|
|
|
611 |
});
|
|
|
612 |
|
|
|
613 |
authorizePickup.addClickHandler(new ClickHandler() {
|
|
|
614 |
|
|
|
615 |
@Override
|
|
|
616 |
public void onClick(ClickEvent event) {
|
| 2526 |
chandransh |
617 |
if(!authorizePickup.isEnabled())
|
|
|
618 |
return;
|
| 4603 |
rajveer |
619 |
PickupAuthorizationInfoBox box = new PickupAuthorizationInfoBox(eventbus, order, providers);
|
| 2526 |
chandransh |
620 |
box.center();
|
| 2509 |
chandransh |
621 |
}
|
|
|
622 |
});
|
|
|
623 |
|
| 2628 |
chandransh |
624 |
reshipOrder.addClickHandler(new ClickHandler() {
|
|
|
625 |
|
|
|
626 |
@Override
|
|
|
627 |
public void onClick(ClickEvent event) {
|
|
|
628 |
if(reshipOrder.isEnabled()){
|
|
|
629 |
GWT.log("Reshipping the order: " + order.getOrderId());
|
|
|
630 |
eventbus.fireEvent(new ReshipOrderEvent(order));
|
|
|
631 |
}
|
|
|
632 |
}
|
|
|
633 |
});
|
| 4421 |
mandeep.dh |
634 |
|
| 4666 |
rajveer |
635 |
markLostInTransit.addClickHandler(new ClickHandler() {
|
|
|
636 |
|
|
|
637 |
@Override
|
|
|
638 |
public void onClick(ClickEvent event) {
|
|
|
639 |
if(markLostInTransit.isEnabled()){
|
|
|
640 |
GWT.log("Mark Lost in Transit to the order: " + order.getOrderId());
|
|
|
641 |
eventbus.fireEvent(new LostInTransitEvent(order));
|
|
|
642 |
}
|
|
|
643 |
}
|
|
|
644 |
});
|
|
|
645 |
|
|
|
646 |
provisionallyCapturePaymentForOrder.addClickHandler(new ClickHandler() {
|
| 4421 |
mandeep.dh |
647 |
|
|
|
648 |
@Override
|
|
|
649 |
public void onClick(ClickEvent event) {
|
|
|
650 |
if(provisionallyCapturePaymentForOrder.isEnabled()) {
|
|
|
651 |
GWT.log("Provisionally capturing payment for order: " + order.getOrderId());
|
|
|
652 |
eventbus.fireEvent(new ProvisionalCaptureEvent(order));
|
|
|
653 |
}
|
|
|
654 |
}
|
|
|
655 |
});
|
|
|
656 |
|
| 2509 |
chandransh |
657 |
refundOrder.addClickHandler(new ClickHandler() {
|
|
|
658 |
|
|
|
659 |
@Override
|
|
|
660 |
public void onClick(ClickEvent event) {
|
| 2747 |
chandransh |
661 |
if(refundOrder.isEnabled()){
|
|
|
662 |
RejectReasonBox box = new RejectReasonBox(eventbus, order, user);
|
| 2558 |
chandransh |
663 |
//box.clear();
|
| 4092 |
chandransh |
664 |
box.center();
|
| 2558 |
chandransh |
665 |
}
|
| 2509 |
chandransh |
666 |
}
|
|
|
667 |
});
|
| 3463 |
chandransh |
668 |
|
|
|
669 |
addWeight.addClickHandler(new ClickHandler() {
|
|
|
670 |
|
|
|
671 |
@Override
|
|
|
672 |
public void onClick(ClickEvent event) {
|
|
|
673 |
if(addWeight.isEnabled()){
|
|
|
674 |
AddWeightBox box = new AddWeightBox(eventbus, order);
|
|
|
675 |
box.center();
|
|
|
676 |
}
|
|
|
677 |
}
|
|
|
678 |
});
|
|
|
679 |
|
|
|
680 |
changeColor.addClickHandler(new ClickHandler() {
|
|
|
681 |
|
|
|
682 |
@Override
|
|
|
683 |
public void onClick(ClickEvent event) {
|
| 3473 |
chandransh |
684 |
if(changeColor.isEnabled()){
|
|
|
685 |
ChooseColorBox box = new ChooseColorBox(eventbus, order);
|
|
|
686 |
box.center();
|
|
|
687 |
}
|
| 3463 |
chandransh |
688 |
}
|
|
|
689 |
});
|
|
|
690 |
|
| 3553 |
chandransh |
691 |
addDelayReason.addClickHandler(new ClickHandler() {
|
|
|
692 |
|
|
|
693 |
@Override
|
|
|
694 |
public void onClick(ClickEvent event) {
|
|
|
695 |
AddDelayReasonBox box = new AddDelayReasonBox(eventbus, order);
|
|
|
696 |
box.center();
|
|
|
697 |
}
|
|
|
698 |
});
|
|
|
699 |
|
| 4712 |
rajveer |
700 |
markDelivered.addClickHandler(new ClickHandler() {
|
|
|
701 |
|
|
|
702 |
@Override
|
|
|
703 |
public void onClick(ClickEvent event) {
|
|
|
704 |
MarkDeliveredBox box = new MarkDeliveredBox(eventbus, order);
|
|
|
705 |
box.center();
|
|
|
706 |
}
|
|
|
707 |
});
|
|
|
708 |
|
| 6019 |
rajveer |
709 |
markRtoInTransit.addClickHandler(new ClickHandler() {
|
|
|
710 |
|
|
|
711 |
@Override
|
|
|
712 |
public void onClick(ClickEvent event) {
|
|
|
713 |
eventbus.fireEvent(new MarkRtoInTransitEvent(order));
|
|
|
714 |
}
|
|
|
715 |
});
|
|
|
716 |
|
| 7561 |
rajveer |
717 |
// changeJacketNumber.addClickHandler(new ClickHandler() {
|
|
|
718 |
//
|
|
|
719 |
// @Override
|
|
|
720 |
// public void onClick(ClickEvent event) {
|
|
|
721 |
// ChangeJacketBox box = new ChangeJacketBox(eventbus, order);
|
|
|
722 |
// box.center();
|
|
|
723 |
// }
|
|
|
724 |
// });
|
| 6019 |
rajveer |
725 |
|
|
|
726 |
unacceptOrder.addClickHandler(new ClickHandler() {
|
|
|
727 |
|
|
|
728 |
@Override
|
|
|
729 |
public void onClick(ClickEvent event) {
|
|
|
730 |
if(unacceptOrder.isEnabled())
|
|
|
731 |
eventbus.fireEvent(new UnacceptOrderEvent(order));
|
|
|
732 |
}
|
|
|
733 |
});
|
|
|
734 |
|
|
|
735 |
|
| 7561 |
rajveer |
736 |
// shiftWarehouse.addClickHandler(new ClickHandler() {
|
|
|
737 |
//
|
|
|
738 |
// @Override
|
|
|
739 |
// public void onClick(ClickEvent event) {
|
|
|
740 |
// if(shiftWarehouse.isEnabled()){
|
|
|
741 |
// ChooseWarehouseBox box = new ChooseWarehouseBox(eventbus, order);
|
|
|
742 |
// box.center();
|
|
|
743 |
// }
|
|
|
744 |
// }
|
|
|
745 |
// });
|
| 7190 |
amar.kumar |
746 |
|
|
|
747 |
splitFreebieOrder.addClickHandler(new ClickHandler() {
|
|
|
748 |
|
|
|
749 |
@Override
|
|
|
750 |
public void onClick(ClickEvent event) {
|
|
|
751 |
if(splitFreebieOrder.isEnabled()){
|
|
|
752 |
SplitFreebieOrderBox box = new SplitFreebieOrderBox(eventbus, order);
|
|
|
753 |
box.center();
|
|
|
754 |
}
|
|
|
755 |
}
|
|
|
756 |
});
|
| 7822 |
amar.kumar |
757 |
|
| 8182 |
amar.kumar |
758 |
splitEbayOrder.addClickHandler(new ClickHandler() {
|
|
|
759 |
|
|
|
760 |
@Override
|
|
|
761 |
public void onClick(ClickEvent event) {
|
|
|
762 |
if(splitEbayOrder.isEnabled()){
|
|
|
763 |
SplitEbayOrderBox box = new SplitEbayOrderBox(eventbus, order);
|
|
|
764 |
box.center();
|
|
|
765 |
}
|
|
|
766 |
}
|
|
|
767 |
});
|
|
|
768 |
|
| 7822 |
amar.kumar |
769 |
changeFreebieItem.addClickHandler(new ClickHandler() {
|
|
|
770 |
|
|
|
771 |
@Override
|
|
|
772 |
public void onClick(ClickEvent event) {
|
|
|
773 |
if(changeFreebieItem.isEnabled()){
|
|
|
774 |
ChangeFreebieItemBox box = new ChangeFreebieItemBox(eventbus, order);
|
|
|
775 |
box.center();
|
|
|
776 |
}
|
|
|
777 |
}
|
|
|
778 |
});
|
| 2509 |
chandransh |
779 |
}
|
|
|
780 |
|
|
|
781 |
private void implementMaskForAdmin(){
|
|
|
782 |
switch(mask){
|
| 4421 |
mandeep.dh |
783 |
case CAPTURE_IN_PROCESS:
|
| 4682 |
rajveer |
784 |
maskButtonsForAdmin(false, false, false, false, false, true, true, false); //Allow the OM to refund a COD order or an order with low inventory or when a customer calls or writes to cancel an order.
|
| 4421 |
mandeep.dh |
785 |
break;
|
|
|
786 |
case VERIFICATION_PENDING:
|
| 3729 |
chandransh |
787 |
case NEW:
|
|
|
788 |
case NO_STOCK:
|
|
|
789 |
case ACCEPT:
|
|
|
790 |
case BILL:
|
| 4682 |
rajveer |
791 |
maskButtonsForAdmin(false, false, false, false, false, true, false, false); //Allow the OM to refund a COD order or an order with low inventory or when a customer calls or writes to cancel an order.
|
| 2558 |
chandransh |
792 |
break;
|
| 2509 |
chandransh |
793 |
case DELIVERED:
|
| 4666 |
rajveer |
794 |
maskButtonsForAdmin(false, false, false, false, false, true, false, false); //Allow the OM to flag and request pickup.
|
| 4455 |
rajveer |
795 |
break;
|
|
|
796 |
case DOA_REQUEST_AUTHORIZED:
|
| 4666 |
rajveer |
797 |
maskButtonsForAdmin(true, true, false, false, false, true, false, false); //Allow the OM to flag and request pickup.
|
| 2509 |
chandransh |
798 |
break;
|
|
|
799 |
case DOA_PICKUP_REQUESTED:
|
| 4666 |
rajveer |
800 |
maskButtonsForAdmin(true, true, true, false, false, true, false, false); //Allow the OM to either re-request a pickup no. or authorize pickup by entering one
|
| 2509 |
chandransh |
801 |
break;
|
| 2610 |
chandransh |
802 |
case DOA_RETURNED:
|
| 2509 |
chandransh |
803 |
case SALES_RETURNED:
|
| 4666 |
rajveer |
804 |
maskButtonsForAdmin(false, false, false, true, true, true, false, false); //Allow the OM to either reship the order or refund it
|
| 2509 |
chandransh |
805 |
break;
|
| 4666 |
rajveer |
806 |
case SHIP:
|
|
|
807 |
maskButtonsForAdmin(false, false, false, false, false, true, false, true); //Allow the OM to either reship the order or refund it
|
|
|
808 |
break;
|
| 2558 |
chandransh |
809 |
default:
|
| 4666 |
rajveer |
810 |
maskButtonsForAdmin(false, false, false, false, false, true, false, false); //Unknown state. Let's not allow any untoward actions.
|
| 2558 |
chandransh |
811 |
break;
|
| 2509 |
chandransh |
812 |
}
|
|
|
813 |
}
|
|
|
814 |
|
| 4421 |
mandeep.dh |
815 |
private void maskButtonsForAdmin(boolean flag, boolean reqPickup, boolean authPickup, boolean reship,
|
| 4666 |
rajveer |
816 |
boolean refund, boolean printInv, boolean provisionallyCapturePayment, boolean lostInTransit)
|
| 4421 |
mandeep.dh |
817 |
{
|
| 2509 |
chandransh |
818 |
flagOrder.setEnabled(flag);
|
|
|
819 |
requestPickup.setEnabled(reqPickup);
|
|
|
820 |
authorizePickup.setEnabled(authPickup);
|
|
|
821 |
reshipOrder.setEnabled(reship);
|
| 4421 |
mandeep.dh |
822 |
provisionallyCapturePaymentForOrder.setEnabled(provisionallyCapturePayment);
|
| 2509 |
chandransh |
823 |
refundOrder.setEnabled(refund);
|
| 4309 |
rajveer |
824 |
printInvoice.setEnabled(printInv);
|
| 4666 |
rajveer |
825 |
markLostInTransit.setEnabled(lostInTransit);
|
| 2509 |
chandransh |
826 |
}
|
|
|
827 |
|
| 306 |
ashish |
828 |
private void loadOrderDetails(){
|
| 7198 |
amar.kumar |
829 |
if(transaction.getDealText()!=null &&!transaction.getDealText().isEmpty()) {
|
|
|
830 |
orderDetails1.add(getHorizontalPanel("DEAL TEXT: ", transaction.getDealText()));
|
|
|
831 |
}
|
| 966 |
chandransh |
832 |
orderDetails1.add(getHorizontalPanel("PRODUCT GROUP: ", transaction.getProductGroup()));
|
|
|
833 |
orderDetails1.add(getHorizontalPanel("BRAND: ", transaction.getBrand()));
|
|
|
834 |
orderDetails1.add(getHorizontalPanel("MODEL: ", getModelDisplayName(transaction)));
|
|
|
835 |
orderDetails1.add(getHorizontalPanel("Item ID: ", transaction.getItemId()+""));
|
| 4175 |
rajveer |
836 |
|
| 3553 |
chandransh |
837 |
orderDetails1.add(getHorizontalPanel("DELAY REASON: ", transaction.getDelayReason()));
|
| 4004 |
chandransh |
838 |
orderDetails1.add(getHorizontalPanel("ALERT: ", transaction.getAlert().toString()));
|
| 306 |
ashish |
839 |
|
| 966 |
chandransh |
840 |
orderDetails2.add(getHorizontalPanel("NAME: ", transaction.getCustomerName()));
|
|
|
841 |
orderDetails2.add(getHorizontalPanel("ADDRESS: ", getDisplayAddress(transaction)));
|
|
|
842 |
orderDetails2.add(getHorizontalPanel("MOBILE NUMBER: ", transaction.getCustomerMobileNumber()));
|
| 7198 |
amar.kumar |
843 |
if(transaction.getExtraInfo()!=null && !transaction.getExtraInfo().isEmpty()) {
|
|
|
844 |
orderDetails2.add(getHorizontalPanel("EXTRA INFO: ", transaction.getExtraInfo()));
|
|
|
845 |
}
|
| 306 |
ashish |
846 |
|
| 966 |
chandransh |
847 |
orderDetails3.add(getHorizontalPanel("TOTAL WEIGHT: ", transaction.getTotalWeight()+""));
|
|
|
848 |
orderDetails3.add(getHorizontalPanel("TOTAL AMOUNT(Rs): ", transaction.getTotalAmount()+""));
|
| 5276 |
mandeep.dh |
849 |
orderDetails3.add(getHorizontalPanel("FULFIL FROM: ", transaction.getPickFromWarehouse()+""));
|
| 5527 |
anupam.sin |
850 |
orderDetails3.add(getHorizontalPanel("ORDER TYPE: ", transaction.getOrderType()+""));
|
| 5387 |
rajveer |
851 |
if(transaction.getQuantity()>1)
|
|
|
852 |
orderDetails3.add(getHorizontalPanel("BULK ORDER: ", transaction.getQuantity()+""));
|
| 7198 |
amar.kumar |
853 |
if(transaction.getFreebieItemId()>0)
|
|
|
854 |
orderDetails3.add(getHorizontalPanel("FREEBIE ITEMID: ", transaction.getFreebieItemId()+""));
|
| 5527 |
anupam.sin |
855 |
|
| 966 |
chandransh |
856 |
orderDetails4.add(getHorizontalPanel("AIRWAY BILL NO: ", transaction.getAirwayBillNo()));
|
|
|
857 |
orderDetails4.add(getHorizontalPanel("INVOICE NUMBER: ", transaction.getInvoiceNumber()));
|
|
|
858 |
orderDetails4.add(getHorizontalPanel("JACKET NUMBER: ", transaction.getJacketNumber() + ""));
|
| 2781 |
chandransh |
859 |
orderDetails4.add(getHorizontalPanel("ITEM NO: ", getDisplayNameForNullableString(transaction.getItemNumber())));
|
|
|
860 |
orderDetails4.add(getHorizontalPanel("IMEI NO: ", transaction.getImeiNumber() + ""));
|
|
|
861 |
|
| 966 |
chandransh |
862 |
orderDetails4.add(getHorizontalPanel("BILLED BY: ", transaction.getBilledBy()));
|
|
|
863 |
}
|
| 639 |
chandransh |
864 |
|
| 966 |
chandransh |
865 |
private HorizontalPanel getHorizontalPanel(String labelText, String valueText) {
|
|
|
866 |
HorizontalPanel hpanel = new HorizontalPanel();
|
| 639 |
chandransh |
867 |
hpanel.setSpacing(5);
|
| 966 |
chandransh |
868 |
hpanel.add(new Label(labelText));
|
|
|
869 |
hpanel.add(new Label(valueText));
|
| 639 |
chandransh |
870 |
hpanel.setCellWidth(hpanel.getWidget(0), "128px");
|
|
|
871 |
hpanel.setCellWidth(hpanel.getWidget(1), "128px");
|
|
|
872 |
hpanel.getWidget(0).setStyleName(selectionStyle.blueLabel());
|
|
|
873 |
hpanel.getWidget(1).setStyleName(selectionStyle.greenLabel());
|
| 966 |
chandransh |
874 |
return hpanel;
|
|
|
875 |
}
|
| 306 |
ashish |
876 |
|
| 966 |
chandransh |
877 |
private String getModelDisplayName(Order order){
|
|
|
878 |
String modelName = "";
|
|
|
879 |
if(order.getModelName()!=null)
|
|
|
880 |
modelName = order.getModelName() + " ";
|
|
|
881 |
if(order.getModelNumber()!=null)
|
|
|
882 |
modelName = modelName + order.getModelNumber();
|
|
|
883 |
if(order.getColor()!=null)
|
|
|
884 |
modelName = modelName + " (" + order.getColor() + ")";
|
|
|
885 |
return modelName;
|
| 306 |
ashish |
886 |
}
|
| 966 |
chandransh |
887 |
|
|
|
888 |
private String getDisplayAddress(Order order){
|
|
|
889 |
StringBuilder displayAddress = new StringBuilder();
|
|
|
890 |
displayAddress.append(order.getCustomerAddress1() + "\n");
|
|
|
891 |
displayAddress.append(order.getCustomerAddress2() + "\n");
|
|
|
892 |
displayAddress.append(order.getCustomerCity() + "\n");
|
|
|
893 |
displayAddress.append(order.getCustomerState() + " PIN - " + order.getCustomerPincode());
|
|
|
894 |
return displayAddress.toString();
|
|
|
895 |
}
|
| 2781 |
chandransh |
896 |
|
|
|
897 |
private String getDisplayNameForNullableString(String s) {
|
|
|
898 |
if (s == null)
|
|
|
899 |
return "";
|
|
|
900 |
return s;
|
|
|
901 |
}
|
| 167 |
ashish |
902 |
}
|