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