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