Subversion Repositories SmartDukaan

Rev

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

Rev 4606 Rev 4666
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.AcceptOrderEvent;
3
import in.shop2020.hotspot.dashbaord.client.event.AcceptOrderEvent;
4
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
4
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
-
 
5
import in.shop2020.hotspot.dashbaord.client.event.LostInTransitEvent;
5
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
6
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
6
import in.shop2020.hotspot.dashbaord.client.event.ProvisionalCaptureEvent;
7
import in.shop2020.hotspot.dashbaord.client.event.ProvisionalCaptureEvent;
7
import in.shop2020.hotspot.dashbaord.client.event.ReshipOrderEvent;
8
import in.shop2020.hotspot.dashbaord.client.event.ReshipOrderEvent;
8
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
9
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
9
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
10
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
Line 75... Line 76...
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();
78
	private Button refundOrder = new Button();
79
	private Button refundOrder = new Button();
79
	private Button reshipOrder = new Button();
80
	private Button reshipOrder = new Button();
-
 
81
	private Button markLostInTransit = new Button();
80
	private Button provisionallyCapturePaymentForOrder = new Button();
82
	private Button provisionallyCapturePaymentForOrder = new Button();
81
	
83
	
82
	//Buttons for the Admin to edit order details
84
	//Buttons for the Admin to edit order details
83
	private Button addWeight = new Button();
85
	private Button addWeight = new Button();
84
	private Button changeColor = new Button();
86
	private Button changeColor = new Button();
Line 357... Line 359...
357
	    }
359
	    }
358
	    
360
	    
359
	    requestPickup.setText("Request Pick-up No");
361
	    requestPickup.setText("Request Pick-up No");
360
	    authorizePickup.setText("Confirm Pick-up");
362
	    authorizePickup.setText("Confirm Pick-up");
361
	    reshipOrder.setText("Reship");
363
	    reshipOrder.setText("Reship");
-
 
364
	    markLostInTransit.setText("Lost In Transit");
362
	    refundOrder.setText("Refund");
365
	    refundOrder.setText("Refund");
363
	    provisionallyCapturePaymentForOrder.setText("Capture provisionally");
366
	    provisionallyCapturePaymentForOrder.setText("Capture provisionally");
364
	    
367
	    
365
	    header.setWidget(1, 0, flagOrder);
368
	    header.setWidget(1, 0, flagOrder);
366
	    header.setWidget(1, 1, requestPickup);
369
	    header.setWidget(1, 1, requestPickup);
367
	    header.setWidget(1, 2, authorizePickup);
370
	    header.setWidget(1, 2, authorizePickup);
368
	    header.setWidget(1, 3, reshipOrder);
371
	    header.setWidget(1, 3, reshipOrder);
-
 
372
	    header.setWidget(1, 4, markLostInTransit);
369
	    header.setWidget(1, 5, provisionallyCapturePaymentForOrder);
373
	    header.setWidget(1, 5, provisionallyCapturePaymentForOrder);
370
	    header.setWidget(1, 6, refundOrder);
374
	    header.setWidget(1, 6, refundOrder);
371
	    
375
	    
372
	    addWeight.setText("Add weight");
376
	    addWeight.setText("Add weight");
373
	    changeColor.setText("Change Color");
377
	    changeColor.setText("Change Color");
Line 429... Line 433...
429
					eventbus.fireEvent(new ReshipOrderEvent(order));
433
					eventbus.fireEvent(new ReshipOrderEvent(order));
430
				}
434
				}
431
			}
435
			}
432
		});
436
		});
433
 
437
 
-
 
438
		markLostInTransit.addClickHandler(new ClickHandler() {
-
 
439
			
-
 
440
			@Override
-
 
441
			public void onClick(ClickEvent event) {
-
 
442
				if(markLostInTransit.isEnabled()){
-
 
443
					GWT.log("Mark Lost in Transit to the order: " + order.getOrderId());
-
 
444
					eventbus.fireEvent(new LostInTransitEvent(order));
-
 
445
				}
-
 
446
			}
-
 
447
		});
-
 
448
		
434
	    provisionallyCapturePaymentForOrder.addClickHandler(new ClickHandler() {
449
		provisionallyCapturePaymentForOrder.addClickHandler(new ClickHandler() {
435
 
450
 
436
	        @Override
451
	        @Override
437
	        public void onClick(ClickEvent event) {
452
	        public void onClick(ClickEvent event) {
438
	            if(provisionallyCapturePaymentForOrder.isEnabled()) {
453
	            if(provisionallyCapturePaymentForOrder.isEnabled()) {
439
	                GWT.log("Provisionally capturing payment for order: " + order.getOrderId());
454
	                GWT.log("Provisionally capturing payment for order: " + order.getOrderId());
Line 498... Line 513...
498
	}
513
	}
499
	
514
	
500
	private void implementMaskForAdmin(){
515
	private void implementMaskForAdmin(){
501
		switch(mask){
516
		switch(mask){
502
        case CAPTURE_IN_PROCESS:
517
        case CAPTURE_IN_PROCESS:
503
            maskButtonsForAdmin(false, false, false, false, true, true, true); //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.
518
            maskButtonsForAdmin(false, false, false, false, true, 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.
504
            break;
519
            break;
505
        case VERIFICATION_PENDING:
520
        case VERIFICATION_PENDING:
506
        case NEW:
521
        case NEW:
507
        case NO_STOCK:
522
        case NO_STOCK:
508
        case ACCEPT:
523
        case ACCEPT:
509
        case BILL:
524
        case BILL:
510
			maskButtonsForAdmin(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.
525
			maskButtonsForAdmin(false, false, false, false, true, 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.
511
			break;
526
			break;
512
		case DELIVERED:
527
		case DELIVERED:
513
			maskButtonsForAdmin(false, false, false, false, false, true, false);	//Allow the OM to flag and request pickup.
528
			maskButtonsForAdmin(false, false, false, false, false, true, false, false);	//Allow the OM to flag and request pickup.
514
			break;
529
			break;
515
		case DOA_REQUEST_AUTHORIZED:	
530
		case DOA_REQUEST_AUTHORIZED:	
516
			maskButtonsForAdmin(true, true, false, false, false, true, false);	//Allow the OM to flag and request pickup.
531
			maskButtonsForAdmin(true, true, false, false, false, true, false, false);	//Allow the OM to flag and request pickup.
517
			break;
532
			break;
518
		case DOA_PICKUP_REQUESTED:
533
		case DOA_PICKUP_REQUESTED:
519
			maskButtonsForAdmin(true, true, true, false, false, true, false);	//Allow the OM to either re-request a pickup no. or authorize pickup by entering one
534
			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
520
			break;
535
			break;
521
		case DOA_RETURNED:
536
		case DOA_RETURNED:
522
		case SALES_RETURNED:
537
		case SALES_RETURNED:
523
			maskButtonsForAdmin(false, false, false, true, true, true, false);	//Allow the OM to either reship the order or refund it
538
			maskButtonsForAdmin(false, false, false, true, true, true, false, false);	//Allow the OM to either reship the order or refund it
-
 
539
			break;
-
 
540
		case SHIP:
-
 
541
			maskButtonsForAdmin(false, false, false, false, false, true, false, true);	//Allow the OM to either reship the order or refund it
524
			break;
542
			break;
525
		default:
543
		default:
526
			maskButtonsForAdmin(false, false, false, false, false, true, false);	//Unknown state. Let's not allow any untoward actions.
544
			maskButtonsForAdmin(false, false, false, false, false, true, false, false);	//Unknown state. Let's not allow any untoward actions.
527
			break;
545
			break;
528
		}
546
		}
529
	}
547
	}
530
	
548
	
531
	private void maskButtonsForAdmin(boolean flag, boolean reqPickup, boolean authPickup, boolean reship,
549
	private void maskButtonsForAdmin(boolean flag, boolean reqPickup, boolean authPickup, boolean reship,
532
	                                 boolean refund, boolean printInv, boolean provisionallyCapturePayment)
550
	                                 boolean refund, boolean printInv, boolean provisionallyCapturePayment, boolean lostInTransit)
533
	{
551
	{
534
		flagOrder.setEnabled(flag);
552
		flagOrder.setEnabled(flag);
535
		requestPickup.setEnabled(reqPickup);
553
		requestPickup.setEnabled(reqPickup);
536
		authorizePickup.setEnabled(authPickup);
554
		authorizePickup.setEnabled(authPickup);
537
		reshipOrder.setEnabled(reship);
555
		reshipOrder.setEnabled(reship);
538
		provisionallyCapturePaymentForOrder.setEnabled(provisionallyCapturePayment);
556
		provisionallyCapturePaymentForOrder.setEnabled(provisionallyCapturePayment);
539
		refundOrder.setEnabled(refund);
557
		refundOrder.setEnabled(refund);
540
		printInvoice.setEnabled(printInv);
558
		printInvoice.setEnabled(printInv);
-
 
559
		markLostInTransit.setEnabled(lostInTransit);
541
	}
560
	}
542
	
561
	
543
	private void loadOrderDetails(){
562
	private void loadOrderDetails(){
544
		orderDetails1.add(getHorizontalPanel("FREE ITEM:    ", transaction.getDealText()));
563
		orderDetails1.add(getHorizontalPanel("FREE ITEM:    ", transaction.getDealText()));
545
		orderDetails1.add(getHorizontalPanel("PRODUCT GROUP: ", transaction.getProductGroup()));
564
		orderDetails1.add(getHorizontalPanel("PRODUCT GROUP: ", transaction.getProductGroup()));