| Line 1... |
Line 1... |
| 1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.hotspot.dashbaord.client.event.AcceptDoaEvent;
|
3 |
import in.shop2020.hotspot.dashbaord.client.event.ReceiveReturnEvent;
|
| 4 |
import in.shop2020.hotspot.dashbaord.client.event.AcceptOrderEvent;
|
4 |
import in.shop2020.hotspot.dashbaord.client.event.AcceptOrderEvent;
|
| 5 |
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
|
5 |
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
|
| 6 |
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
|
6 |
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
|
| 7 |
import in.shop2020.hotspot.dashbaord.client.event.RequestPickupEvent;
|
7 |
import in.shop2020.hotspot.dashbaord.client.event.RequestPickupEvent;
|
| 8 |
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
|
8 |
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
|
| Line 59... |
Line 59... |
| 59 |
private Button acceptOrder = new Button();
|
59 |
private Button acceptOrder = new Button();
|
| 60 |
private Button rejectOrder = new Button();
|
60 |
private Button rejectOrder = new Button();
|
| 61 |
private Button notAvailable= new Button();
|
61 |
private Button notAvailable= new Button();
|
| 62 |
private Button addBillingInfo= new Button();
|
62 |
private Button addBillingInfo= new Button();
|
| 63 |
private Button printInvoice = new Button();
|
63 |
private Button printInvoice = new Button();
|
| 64 |
private Button acceptDOA = new Button();
|
64 |
private Button receiveReturn = new Button();
|
| 65 |
private Button validateDOA = new Button();
|
65 |
private Button validateDOA = new Button();
|
| 66 |
|
66 |
|
| 67 |
//Buttons for the Admin
|
67 |
//Buttons for the Admin
|
| 68 |
private Button flagOrder = new Button();
|
68 |
private Button flagOrder = new Button();
|
| 69 |
private Button requestPickup = new Button();
|
69 |
private Button requestPickup = new Button();
|
| Line 104... |
Line 104... |
| 104 |
|
104 |
|
| 105 |
acceptOrder.setText("Accept");
|
105 |
acceptOrder.setText("Accept");
|
| 106 |
notAvailable.setText("Out Of Stock");
|
106 |
notAvailable.setText("Out Of Stock");
|
| 107 |
addBillingInfo.setText("Bill");
|
107 |
addBillingInfo.setText("Bill");
|
| 108 |
printInvoice.setText("Print Invoice");
|
108 |
printInvoice.setText("Print Invoice");
|
| 109 |
acceptDOA.setText("Accept DOA");
|
109 |
receiveReturn.setText("Receive Return");
|
| 110 |
validateDOA.setText("Validate DOA");
|
110 |
validateDOA.setText("Validate DOA");
|
| 111 |
|
111 |
|
| 112 |
header.setWidget(0, 0, acceptOrder);
|
112 |
header.setWidget(0, 0, acceptOrder);
|
| 113 |
header.setWidget(0, 1, notAvailable);
|
113 |
header.setWidget(0, 1, notAvailable);
|
| 114 |
header.setWidget(0, 2, addBillingInfo);
|
114 |
header.setWidget(0, 2, addBillingInfo);
|
| 115 |
header.setWidget(0, 3, printInvoice);
|
115 |
header.setWidget(0, 3, printInvoice);
|
| 116 |
header.setWidget(0, 4, acceptDOA);
|
116 |
header.setWidget(0, 4, receiveReturn);
|
| 117 |
header.setWidget(0, 5, validateDOA);
|
117 |
header.setWidget(0, 5, validateDOA);
|
| 118 |
|
118 |
|
| 119 |
registerButtonHandlersForWE();
|
119 |
registerButtonHandlersForWE();
|
| 120 |
implementMaskForWE();
|
120 |
implementMaskForWE();
|
| 121 |
}
|
121 |
}
|
| Line 166... |
Line 166... |
| 166 |
Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
|
166 |
Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
|
| 167 |
}
|
167 |
}
|
| 168 |
}
|
168 |
}
|
| 169 |
});
|
169 |
});
|
| 170 |
|
170 |
|
| 171 |
acceptDOA.addClickHandler(new ClickHandler() {
|
171 |
receiveReturn.addClickHandler(new ClickHandler() {
|
| 172 |
|
172 |
|
| 173 |
@Override
|
173 |
@Override
|
| 174 |
public void onClick(ClickEvent event) {
|
174 |
public void onClick(ClickEvent event) {
|
| 175 |
if(acceptDOA.isEnabled())
|
175 |
if(receiveReturn.isEnabled())
|
| 176 |
eventbus.fireEvent(new AcceptDoaEvent(order));
|
176 |
eventbus.fireEvent(new ReceiveReturnEvent(order));
|
| 177 |
}
|
177 |
}
|
| 178 |
});
|
178 |
});
|
| 179 |
|
179 |
|
| 180 |
validateDOA.addClickHandler(new ClickHandler() {
|
180 |
validateDOA.addClickHandler(new ClickHandler() {
|
| 181 |
|
181 |
|
| Line 208... |
Line 208... |
| 208 |
break;
|
208 |
break;
|
| 209 |
case NO_STOCK:
|
209 |
case NO_STOCK:
|
| 210 |
maskButtonsForWE(true, true, false, false, false, false, false);
|
210 |
maskButtonsForWE(true, true, false, false, false, false, false);
|
| 211 |
break;
|
211 |
break;
|
| 212 |
case DOA_AWAITED:
|
212 |
case DOA_AWAITED:
|
| - |
|
213 |
case SALES_RETURN_AWAITED:
|
| 213 |
maskButtonsForWE(false, false, false, false, false, true, false);
|
214 |
maskButtonsForWE(false, false, false, false, false, true, false);
|
| 214 |
break;
|
215 |
break;
|
| 215 |
case DOA_RETURNED:
|
216 |
case DOA_RECEIVED:
|
| 216 |
maskButtonsForWE(false, false, false, false, false, false, true);
|
217 |
maskButtonsForWE(false, false, false, false, false, false, true);
|
| 217 |
break;
|
218 |
break;
|
| 218 |
default:
|
219 |
default:
|
| 219 |
maskButtonsForWE(false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
|
220 |
maskButtonsForWE(false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
|
| 220 |
break;
|
221 |
break;
|
| Line 224... |
Line 225... |
| 224 |
private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa){
|
225 |
private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa){
|
| 225 |
acceptOrder.setEnabled(accept);
|
226 |
acceptOrder.setEnabled(accept);
|
| 226 |
notAvailable.setEnabled(notavailable);
|
227 |
notAvailable.setEnabled(notavailable);
|
| 227 |
printInvoice.setEnabled(printInv);
|
228 |
printInvoice.setEnabled(printInv);
|
| 228 |
addBillingInfo.setEnabled(billing);
|
229 |
addBillingInfo.setEnabled(billing);
|
| 229 |
acceptDOA.setEnabled(acceptdoa);
|
230 |
receiveReturn.setEnabled(acceptdoa);
|
| 230 |
validateDOA.setEnabled(validatedoa);
|
231 |
validateDOA.setEnabled(validatedoa);
|
| 231 |
rejectOrder.setEnabled(reject);
|
232 |
rejectOrder.setEnabled(reject);
|
| 232 |
}
|
233 |
}
|
| 233 |
|
234 |
|
| 234 |
private void initTableForAdmin() {
|
235 |
private void initTableForAdmin() {
|
| Line 316... |
Line 317... |
| 316 |
maskButtonsForAdmin(true, true, false, false, false); //Allow the OM to flag and request pickup.
|
317 |
maskButtonsForAdmin(true, true, false, false, false); //Allow the OM to flag and request pickup.
|
| 317 |
break;
|
318 |
break;
|
| 318 |
case DOA_PICKUP_REQUESTED:
|
319 |
case DOA_PICKUP_REQUESTED:
|
| 319 |
maskButtonsForAdmin(true, true, true, false, false); //Allow the OM to either re-request a pickup no. or authorize pickup by entering one
|
320 |
maskButtonsForAdmin(true, true, true, false, false); //Allow the OM to either re-request a pickup no. or authorize pickup by entering one
|
| 320 |
break;
|
321 |
break;
|
| - |
|
322 |
case DOA_RETURNED:
|
| 321 |
case SALES_RETURNED:
|
323 |
case SALES_RETURNED:
|
| 322 |
maskButtonsForAdmin(false, false, false, true, true); //Allow the OM to either reship the order or refund it
|
324 |
maskButtonsForAdmin(false, false, false, true, true); //Allow the OM to either reship the order or refund it
|
| 323 |
break;
|
325 |
break;
|
| 324 |
default:
|
326 |
default:
|
| 325 |
maskButtonsForAdmin(false, false, false, false, false); //Unknown state. Let's not allow any untoward actions.
|
327 |
maskButtonsForAdmin(false, false, false, false, false); //Unknown state. Let's not allow any untoward actions.
|