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