Subversion Repositories SmartDukaan

Rev

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

Rev 2835 Rev 2843
Line 4... Line 4...
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.client.event.ReshipOrderEvent;
8
import in.shop2020.hotspot.dashbaord.client.event.ReshipOrderEvent;
-
 
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;
10
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
11
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
11
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
12
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
12
 
13
 
13
import org.enunes.gwt.mvp.client.EventBus;
14
import org.enunes.gwt.mvp.client.EventBus;
Line 75... Line 76...
75
	
76
	
76
	private String user;
77
	private String user;
77
	private DetailsMask mask;
78
	private DetailsMask mask;
78
	private long warehouseID;
79
	private long warehouseID;
79
	private UserType userType;
80
	private UserType userType;
-
 
81
	private BillingType billingType;
80
	
82
	
81
	public OrderDetails(EventBus eventbus, Order order, Order order2, DetailsMask mask, String user, long warehouseID, UserType userType){
83
	public OrderDetails(EventBus eventbus, Order order, Order order2, DetailsMask mask, String user, long warehouseID, UserType userType, BillingType billingType){
82
		this.eventbus = eventbus;
84
		this.eventbus = eventbus;
83
		this.order = order;
85
		this.order = order;
84
		this.transaction = order2;
86
		this.transaction = order2;
85
		this.mask = mask;
87
		this.mask = mask;
86
		this.user = user;
88
		this.user = user;
87
		this.warehouseID = warehouseID;
89
		this.warehouseID = warehouseID;
88
		this.userType = userType;
90
		this.userType = userType;
-
 
91
		this.billingType = billingType;
89
		
92
		
90
		initWidget(binder.createAndBindUi(this));
93
		initWidget(binder.createAndBindUi(this));
91
		initTableForWE();
94
		initTableForWE();
92
		if(this.userType == UserType.ADMIN){
95
		if(this.userType == UserType.ADMIN){
93
			initTableForAdmin();
96
			initTableForAdmin();
Line 105... Line 108...
105
	    header.getColumnFormatter().setWidth(6, "256px");
108
	    header.getColumnFormatter().setWidth(6, "256px");
106
	    
109
	    
107
	    acceptOrder.setText("Accept");
110
	    acceptOrder.setText("Accept");
108
	    notAvailable.setText("Out Of Stock");
111
	    notAvailable.setText("Out Of Stock");
109
	    addBillingInfo.setText("Bill");
112
	    addBillingInfo.setText("Bill");
-
 
113
	    if(billingType == BillingType.OURS)
110
	    addBillingInfo.setVisible(false);
114
	        addBillingInfo.setVisible(false);
111
	    printInvoice.setText("Print Invoice");
115
	    printInvoice.setText("Print Invoice");
112
	    receiveReturn.setText("Receive Return");
116
	    receiveReturn.setText("Receive Return");
113
	    validateDOA.setText("Validate DOA");
117
	    validateDOA.setText("Validate DOA");
114
	    
118
	    
115
	    header.setWidget(0, 0, acceptOrder);
119
	    header.setWidget(0, 0, acceptOrder);
Line 158... Line 162...
158
			@Override
162
			@Override
159
			public void onClick(ClickEvent event) {
163
			public void onClick(ClickEvent event) {
160
				if(!printInvoice.isEnabled())
164
				if(!printInvoice.isEnabled())
161
					return;
165
					return;
162
				if(order.getJacketNumber()==0){
166
				if(order.getJacketNumber()==0){
163
					JacketInfoBox box = new JacketInfoBox(eventbus, order, user);
167
					JacketInfoBox box = new JacketInfoBox(eventbus, order, user, billingType);
164
					//box.clean();
168
					//box.clean();
165
					box.center();
169
					box.center();
166
				}else{
170
				}else{
167
					String invoiceGenerationUrl = "http://" + Window.Location.getHost() + "/invoice/";
171
					String invoiceGenerationUrl = "http://" + Window.Location.getHost() + "/invoice/";
168
					invoiceGenerationUrl = invoiceGenerationUrl + "?id=" +order.getOrderId();
172
					invoiceGenerationUrl += "?id=" +order.getOrderId();
-
 
173
					if(billingType == BillingType.OURS)
-
 
174
					    invoiceGenerationUrl += "&withBill=true";
-
 
175
					else
-
 
176
					    invoiceGenerationUrl += "&withBill=false";
169
					Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
177
					Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
170
				}
178
				}
171
			}
179
			}
172
		});
180
		});
173
		
181
		
Line 196... Line 204...
196
		switch(mask){
204
		switch(mask){
197
		case NEW:
205
		case NEW:
198
			maskButtonsForWE(true, true, true, false, false, false, false);
206
			maskButtonsForWE(true, true, true, false, false, false, false);
199
			break;
207
			break;
200
		case ACCEPT:
208
		case ACCEPT:
-
 
209
		    //TODO: Mask buttons based on the billingType
-
 
210
		    if(billingType == BillingType.OURS)
201
			maskButtonsForWE(false, false, false, true, true, false, false);
211
		        maskButtonsForWE(false, false, false, true, true, false, false);
-
 
212
		    else
-
 
213
		        maskButtonsForWE(false, false, false, false, true, false, false);
202
			break;
214
			break;
203
		case REJECT:
215
		case REJECT:
204
			maskButtonsForWE(false, false, false, false, false, false, false);
216
			maskButtonsForWE(false, false, false, false, false, false, false);
205
			break;
217
			break;
206
		case BILL:
218
		case BILL: