Subversion Repositories SmartDukaan

Rev

Rev 4478 | Rev 4545 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4478 Rev 4495
Line 68... Line 68...
68
	private Button notAvailable= new Button();
68
	private Button notAvailable= new Button();
69
	private Button addBillingInfo= new Button();
69
	private Button addBillingInfo= new Button();
70
	private Button printInvoice = new Button();
70
	private Button printInvoice = new Button();
71
	private Button receiveReturn = new Button();
71
	private Button receiveReturn = new Button();
72
	private Button validateDOA = new Button();
72
	private Button validateDOA = new Button();
-
 
73
	private Button validateReturnProduct = new Button();
73
	
74
	
74
	//Buttons for the Admin to track order
75
	//Buttons for the Admin to track order
75
	private Button flagOrder = new Button();
76
	private Button flagOrder = new Button();
76
	private Button requestPickup = new Button();
77
	private Button requestPickup = new Button();
77
	private Button authorizePickup = new Button();
78
	private Button authorizePickup = new Button();
Line 128... Line 129...
128
	    if(billingType == BillingType.OURS)
129
	    if(billingType == BillingType.OURS)
129
	        addBillingInfo.setVisible(false);
130
	        addBillingInfo.setVisible(false);
130
	    printInvoice.setText("Print Invoice");
131
	    printInvoice.setText("Print Invoice");
131
	    receiveReturn.setText("Receive Return");
132
	    receiveReturn.setText("Receive Return");
132
	    validateDOA.setText("Validate DOA");
133
	    validateDOA.setText("Validate DOA");
-
 
134
	    validateReturnProduct.setText("Product Usable ?");
133
	    rejectOrder.setText("Cancel Order");
135
	    rejectOrder.setText("Cancel Order");
134
	    printAllInvoices.setText("Print All Invoices");
136
	    printAllInvoices.setText("Print All Invoices");
135
	    
137
	    
136
	    //header.setWidget(0, 0, verifyOrder);
138
	    //header.setWidget(0, 0, verifyOrder);
137
	    header.setWidget(0, 0, acceptOrder);
139
	    header.setWidget(0, 0, acceptOrder);
Line 140... Line 142...
140
	    header.setWidget(0, 3, printInvoice);
142
	    header.setWidget(0, 3, printInvoice);
141
	    header.setWidget(0, 4, receiveReturn);
143
	    header.setWidget(0, 4, receiveReturn);
142
	    header.setWidget(0, 5, validateDOA);
144
	    header.setWidget(0, 5, validateDOA);
143
	    header.setWidget(0, 6, rejectOrder);
145
	    header.setWidget(0, 6, rejectOrder);
144
	    header.setWidget(0, 7, printAllInvoices);
146
	    header.setWidget(0, 7, printAllInvoices);
-
 
147
	    header.setWidget(0, 8, validateReturnProduct);
145
	    
148
	    
146
	    registerButtonHandlersForWE();
149
	    registerButtonHandlersForWE();
147
	    if(this.userType == UserType.WAREHOUSE_EXECUTIVE || this.userType == UserType.ADMIN){
150
	    if(this.userType == UserType.WAREHOUSE_EXECUTIVE || this.userType == UserType.ADMIN){
148
			implementMaskForWE();
151
			implementMaskForWE();
149
		}
152
		}
Line 264... Line 267...
264
					return;
267
					return;
265
				DoaValidationBox box = new DoaValidationBox(eventbus, order);
268
				DoaValidationBox box = new DoaValidationBox(eventbus, order);
266
				box.center();
269
				box.center();
267
			}
270
			}
268
		});
271
		});
-
 
272
		
-
 
273
		validateReturnProduct.addClickHandler(new ClickHandler() {
-
 
274
			
-
 
275
			@Override
-
 
276
			public void onClick(ClickEvent event) {
-
 
277
				if(!validateReturnProduct.isEnabled())
-
 
278
					return;
-
 
279
				ProductValidationBox box = new ProductValidationBox(eventbus, order);
-
 
280
				box.center();
-
 
281
			}
-
 
282
		});
269
	}
283
	}
270
 
284
 
271
	private void implementMaskForWM(){
285
	private void implementMaskForWM(){
272
		maskButtonsForWE(false, false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
286
		maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
273
	}
287
	}
274
	
288
	
275
	private void implementMaskForWE(){
289
	private void implementMaskForWE(){
276
		switch(mask){
290
		switch(mask){
277
		case VERIFICATION_PENDING:
291
		case VERIFICATION_PENDING:
278
		    maskButtonsForWE(false, false, false, false, false, false, false, false); //Do not allow the WE to verify the order.
292
		    maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Do not allow the WE to verify the order.
279
		    break;
293
		    break;
280
		case CAPTURE_IN_PROCESS:
294
		case CAPTURE_IN_PROCESS:
281
		case NEW:
295
		case NEW:
282
			maskButtonsForWE(true, false, true, false, false, false, false, false);  //Allow the WE to either accept the order or mark it as out of stock.
296
			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.
283
			break;
297
			break;
284
		case ACCEPT:
298
		case ACCEPT:
285
		    //TODO: Mask buttons based on the billingType
299
		    //TODO: Mask buttons based on the billingType
286
		    if(billingType == BillingType.OURS)
300
		    if(billingType == BillingType.OURS)
287
		        maskButtonsForWE(false, false, false, true, true, false, false, true); // For our billing, allow the WE to directly print the invoive.
301
		        maskButtonsForWE(false, false, false, true, true, false, false, true, false); // For our billing, allow the WE to directly print the invoive.
288
		    else
302
		    else
289
		        maskButtonsForWE(false, false, false, true, true, false, false, true); //For external billing, allow the WE to feed the invoice info.
303
		        maskButtonsForWE(false, false, false, true, true, false, false, true, false); //For external billing, allow the WE to feed the invoice info.
290
			break;
304
			break;
291
		case REJECT:
305
		case REJECT:
292
			maskButtonsForWE(false, false, false, false, false, false, false, false); //Can't do anything once the order has been rejected.
306
			maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Can't do anything once the order has been rejected.
293
			break;
307
			break;
294
		case BILL:
308
		case BILL:
295
			maskButtonsForWE(false, false, false, true, false, false, false, false); //Allow WE to print the invoice for a billed order.
309
			maskButtonsForWE(false, false, false, true, false, false, false, false, false); //Allow WE to print the invoice for a billed order.
296
			break;
310
			break;
297
		case SHIP:
311
		case SHIP:
298
			maskButtonsForWE(false, false, false, false, false, false, false, false);
312
			maskButtonsForWE(false, false, false, false, false, false, false, false, false);
299
			break;
313
			break;
300
		case NO_STOCK:
314
		case NO_STOCK:
301
			maskButtonsForWE(true, false, false, false, false, false, false, false); //Allow WE to accept a low inventory item. 
315
			maskButtonsForWE(true, false, false, false, false, false, false, false, false); //Allow WE to accept a low inventory item. 
302
			break;
316
			break;
303
		case CANCEL_CONFIRMED:
317
		case CANCEL_CONFIRMED:
304
			maskButtonsForWE(false, true, false, false, false, false, false, false); //Allow WE to Cancel a order which is in cancellation pending state. 
318
			maskButtonsForWE(false, true, false, false, false, false, false, false, false); //Allow WE to Cancel a order which is in cancellation pending state. 
305
			break;			
319
			break;			
306
		case DOA_AWAITED:
320
		case DOA_AWAITED:
307
		case SALES_RETURN_AWAITED:
321
		case SALES_RETURN_AWAITED:
308
			maskButtonsForWE(false, false, false, false, false, true, false, false); //Allow WE to accept the packet.
322
			maskButtonsForWE(false, false, false, false, false, true, false, false, false); //Allow WE to accept the packet.
309
			break;
323
			break;
310
		case DOA_RECEIVED:
324
		case DOA_RECEIVED:
311
			maskButtonsForWE(false, false, false, false, false, false, true, false); //Allow WE to validate the DOA certificate.
325
			maskButtonsForWE(false, false, false, false, false, false, true, false, false); //Allow WE to validate the DOA certificate.
312
			break;
326
			break;
-
 
327
		case RET_RECEIVED:
-
 
328
			maskButtonsForWE(false, false, false, false, false, false, false, false, true); //Allow WE to validate the DOA certificate.
-
 
329
			break;
-
 
330
			
313
		default:
331
		default:
314
			maskButtonsForWE(false, false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
332
			maskButtonsForWE(false, false, false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
315
			break;
333
			break;
316
		}
334
		}
317
	}
335
	}
318
	
336
	
319
	private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa, boolean printAllInvoice){
337
	private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa, boolean printAllInvoice, boolean validatereturnproduct){
320
	    //verifyOrder.setEnabled(verify);
338
	    //verifyOrder.setEnabled(verify);
321
	    acceptOrder.setEnabled(accept);
339
	    acceptOrder.setEnabled(accept);
322
		notAvailable.setEnabled(notavailable);
340
		notAvailable.setEnabled(notavailable);
323
		printInvoice.setEnabled(printInv);
341
		printInvoice.setEnabled(printInv);
324
		addBillingInfo.setEnabled(billing);
342
		addBillingInfo.setEnabled(billing);
325
		receiveReturn.setEnabled(acceptdoa);
343
		receiveReturn.setEnabled(acceptdoa);
326
		validateDOA.setEnabled(validatedoa);
344
		validateDOA.setEnabled(validatedoa);
327
		rejectOrder.setEnabled(reject);
345
		rejectOrder.setEnabled(reject);
328
		printAllInvoices.setEnabled(printAllInvoice);
346
		printAllInvoices.setEnabled(printAllInvoice);
-
 
347
		validateReturnProduct.setEnabled(validatereturnproduct);
329
	}
348
	}
330
 
349
 
331
	private void initTableForAdmin() {
350
	private void initTableForAdmin() {
332
	    if(transaction.isDoaFlag()){
351
	    if(transaction.isDoaFlag()){
333
	    	flagOrder.setText("Unflag");
352
	    	flagOrder.setText("Unflag");