| 167 |
ashish |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
| 2610 |
chandransh |
3 |
import in.shop2020.hotspot.dashbaord.client.event.ReceiveReturnEvent;
|
| 167 |
ashish |
4 |
import in.shop2020.hotspot.dashbaord.client.event.AcceptOrderEvent;
|
| 487 |
rajveer |
5 |
import in.shop2020.hotspot.dashbaord.client.event.NostockOrderEvent;
|
| 2509 |
chandransh |
6 |
import in.shop2020.hotspot.dashbaord.client.event.FlagOrderEvent;
|
| 2513 |
chandransh |
7 |
import in.shop2020.hotspot.dashbaord.client.event.RequestPickupEvent;
|
| 2628 |
chandransh |
8 |
import in.shop2020.hotspot.dashbaord.client.event.ReshipOrderEvent;
|
| 306 |
ashish |
9 |
import in.shop2020.hotspot.dashbaord.shared.actions.DetailsMask;
|
| 167 |
ashish |
10 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
| 2835 |
chandransh |
11 |
import in.shop2020.hotspot.dashbaord.shared.actions.UserType;
|
| 167 |
ashish |
12 |
|
|
|
13 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
14 |
|
|
|
15 |
import com.google.gwt.core.client.GWT;
|
|
|
16 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
17 |
import com.google.gwt.event.dom.client.ClickHandler;
|
|
|
18 |
import com.google.gwt.resources.client.CssResource;
|
|
|
19 |
import com.google.gwt.uibinder.client.UiBinder;
|
|
|
20 |
import com.google.gwt.uibinder.client.UiField;
|
| 487 |
rajveer |
21 |
import com.google.gwt.user.client.Window;
|
| 306 |
ashish |
22 |
import com.google.gwt.user.client.ui.Button;
|
| 167 |
ashish |
23 |
import com.google.gwt.user.client.ui.FlexTable;
|
| 306 |
ashish |
24 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
25 |
import com.google.gwt.user.client.ui.Label;
|
| 167 |
ashish |
26 |
import com.google.gwt.user.client.ui.ResizeComposite;
|
| 306 |
ashish |
27 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
| 167 |
ashish |
28 |
import com.google.gwt.user.client.ui.Widget;
|
|
|
29 |
|
|
|
30 |
public class OrderDetails extends ResizeComposite{
|
|
|
31 |
|
|
|
32 |
public interface Listener{
|
|
|
33 |
void onClick();
|
|
|
34 |
}
|
|
|
35 |
|
| 585 |
chandransh |
36 |
interface OrderDetailsUiBinder extends UiBinder<Widget, OrderDetails>{ }
|
| 167 |
ashish |
37 |
|
|
|
38 |
interface SelectionStyle extends CssResource{
|
| 306 |
ashish |
39 |
String blueLabel();
|
|
|
40 |
String greenLabel();
|
| 167 |
ashish |
41 |
}
|
|
|
42 |
|
| 585 |
chandransh |
43 |
private static final OrderDetailsUiBinder binder = GWT.create(OrderDetailsUiBinder.class);
|
| 167 |
ashish |
44 |
|
|
|
45 |
@UiField FlexTable header;
|
|
|
46 |
@UiField FlexTable table;
|
| 306 |
ashish |
47 |
@UiField HorizontalPanel orderDetails;
|
|
|
48 |
@UiField VerticalPanel orderDetails1;
|
|
|
49 |
@UiField VerticalPanel orderDetails2;
|
|
|
50 |
@UiField VerticalPanel orderDetails3;
|
|
|
51 |
@UiField VerticalPanel orderDetails4;
|
|
|
52 |
@UiField VerticalPanel orderDetails5;
|
|
|
53 |
@UiField SelectionStyle selectionStyle;
|
| 167 |
ashish |
54 |
|
|
|
55 |
|
|
|
56 |
private final EventBus eventbus;
|
|
|
57 |
private Order order;
|
|
|
58 |
private Order transaction;
|
| 2509 |
chandransh |
59 |
|
|
|
60 |
//Buttons for the Warehouse Executive
|
| 306 |
ashish |
61 |
private Button acceptOrder = new Button();
|
|
|
62 |
private Button rejectOrder = new Button();
|
|
|
63 |
private Button notAvailable= new Button();
|
|
|
64 |
private Button addBillingInfo= new Button();
|
| 2449 |
chandransh |
65 |
private Button printInvoice = new Button();
|
| 2610 |
chandransh |
66 |
private Button receiveReturn = new Button();
|
| 2509 |
chandransh |
67 |
private Button validateDOA = new Button();
|
| 677 |
chandransh |
68 |
|
| 2509 |
chandransh |
69 |
//Buttons for the Admin
|
|
|
70 |
private Button flagOrder = new Button();
|
|
|
71 |
private Button requestPickup = new Button();
|
|
|
72 |
private Button authorizePickup = new Button();
|
|
|
73 |
private Button refundOrder = new Button();
|
|
|
74 |
private Button reshipOrder = new Button();
|
|
|
75 |
|
| 306 |
ashish |
76 |
private String user;
|
|
|
77 |
private DetailsMask mask;
|
| 677 |
chandransh |
78 |
private long warehouseID;
|
| 2835 |
chandransh |
79 |
private UserType userType;
|
| 167 |
ashish |
80 |
|
| 2835 |
chandransh |
81 |
public OrderDetails(EventBus eventbus, Order order, Order order2, DetailsMask mask, String user, long warehouseID, UserType userType){
|
| 167 |
ashish |
82 |
this.eventbus = eventbus;
|
|
|
83 |
this.order = order;
|
|
|
84 |
this.transaction = order2;
|
| 306 |
ashish |
85 |
this.mask = mask;
|
|
|
86 |
this.user = user;
|
| 677 |
chandransh |
87 |
this.warehouseID = warehouseID;
|
| 2835 |
chandransh |
88 |
this.userType = userType;
|
| 2449 |
chandransh |
89 |
|
| 167 |
ashish |
90 |
initWidget(binder.createAndBindUi(this));
|
| 2558 |
chandransh |
91 |
initTableForWE();
|
| 2835 |
chandransh |
92 |
if(this.userType == UserType.ADMIN){
|
| 2509 |
chandransh |
93 |
initTableForAdmin();
|
|
|
94 |
}
|
| 306 |
ashish |
95 |
loadOrderDetails();
|
| 167 |
ashish |
96 |
}
|
|
|
97 |
|
| 2509 |
chandransh |
98 |
private void initTableForWE() {
|
| 167 |
ashish |
99 |
header.getColumnFormatter().setWidth(0, "128px");
|
| 306 |
ashish |
100 |
header.getColumnFormatter().setWidth(1, "128px");
|
|
|
101 |
header.getColumnFormatter().setWidth(2, "128px");
|
|
|
102 |
header.getColumnFormatter().setWidth(3, "128px");
|
|
|
103 |
header.getColumnFormatter().setWidth(4, "128px");
|
| 677 |
chandransh |
104 |
header.getColumnFormatter().setWidth(5, "128px");
|
|
|
105 |
header.getColumnFormatter().setWidth(6, "256px");
|
| 306 |
ashish |
106 |
|
|
|
107 |
acceptOrder.setText("Accept");
|
|
|
108 |
notAvailable.setText("Out Of Stock");
|
|
|
109 |
addBillingInfo.setText("Bill");
|
| 2781 |
chandransh |
110 |
addBillingInfo.setVisible(false);
|
| 2449 |
chandransh |
111 |
printInvoice.setText("Print Invoice");
|
| 2610 |
chandransh |
112 |
receiveReturn.setText("Receive Return");
|
| 2509 |
chandransh |
113 |
validateDOA.setText("Validate DOA");
|
| 486 |
rajveer |
114 |
|
| 306 |
ashish |
115 |
header.setWidget(0, 0, acceptOrder);
|
| 487 |
rajveer |
116 |
header.setWidget(0, 1, notAvailable);
|
| 2509 |
chandransh |
117 |
header.setWidget(0, 2, addBillingInfo);
|
|
|
118 |
header.setWidget(0, 3, printInvoice);
|
| 2610 |
chandransh |
119 |
header.setWidget(0, 4, receiveReturn);
|
| 2509 |
chandransh |
120 |
header.setWidget(0, 5, validateDOA);
|
|
|
121 |
|
|
|
122 |
registerButtonHandlersForWE();
|
|
|
123 |
implementMaskForWE();
|
| 167 |
ashish |
124 |
}
|
|
|
125 |
|
| 2509 |
chandransh |
126 |
private void registerButtonHandlersForWE(){
|
| 306 |
ashish |
127 |
acceptOrder.addClickHandler(new ClickHandler() {
|
|
|
128 |
|
|
|
129 |
@Override
|
|
|
130 |
public void onClick(ClickEvent event) {
|
| 2558 |
chandransh |
131 |
if(acceptOrder.isEnabled())
|
| 306 |
ashish |
132 |
eventbus.fireEvent(new AcceptOrderEvent(order));
|
|
|
133 |
}
|
|
|
134 |
});
|
| 486 |
rajveer |
135 |
|
| 487 |
rajveer |
136 |
notAvailable.addClickHandler(new ClickHandler() {
|
|
|
137 |
|
|
|
138 |
@Override
|
|
|
139 |
public void onClick(ClickEvent event) {
|
| 2558 |
chandransh |
140 |
if(notAvailable.isEnabled())
|
|
|
141 |
eventbus.fireEvent(new NostockOrderEvent(order));
|
| 487 |
rajveer |
142 |
}
|
|
|
143 |
});
|
|
|
144 |
|
| 306 |
ashish |
145 |
addBillingInfo.addClickHandler(new ClickHandler() {
|
|
|
146 |
|
|
|
147 |
@Override
|
|
|
148 |
public void onClick(ClickEvent event) {
|
| 1146 |
chandransh |
149 |
if(!addBillingInfo.isEnabled())
|
|
|
150 |
return;
|
| 306 |
ashish |
151 |
BillingInfoBox box = new BillingInfoBox(eventbus, order, user);
|
|
|
152 |
box.center();
|
|
|
153 |
}
|
|
|
154 |
});
|
| 487 |
rajveer |
155 |
|
| 2449 |
chandransh |
156 |
printInvoice.addClickHandler(new ClickHandler() {
|
| 306 |
ashish |
157 |
|
|
|
158 |
@Override
|
|
|
159 |
public void onClick(ClickEvent event) {
|
| 2449 |
chandransh |
160 |
if(!printInvoice.isEnabled())
|
| 1146 |
chandransh |
161 |
return;
|
|
|
162 |
if(order.getJacketNumber()==0){
|
| 2781 |
chandransh |
163 |
JacketInfoBox box = new JacketInfoBox(eventbus, order, user);
|
| 1146 |
chandransh |
164 |
//box.clean();
|
|
|
165 |
box.center();
|
|
|
166 |
}else{
|
| 2788 |
chandransh |
167 |
String invoiceGenerationUrl = "http://" + Window.Location.getHost() + "/invoice/";
|
|
|
168 |
invoiceGenerationUrl = invoiceGenerationUrl + "?id=" +order.getOrderId();
|
| 1146 |
chandransh |
169 |
Window.open(invoiceGenerationUrl, "newWindowName", "window features.");
|
|
|
170 |
}
|
| 306 |
ashish |
171 |
}
|
|
|
172 |
});
|
| 2588 |
chandransh |
173 |
|
| 2610 |
chandransh |
174 |
receiveReturn.addClickHandler(new ClickHandler() {
|
| 2588 |
chandransh |
175 |
|
|
|
176 |
@Override
|
|
|
177 |
public void onClick(ClickEvent event) {
|
| 2610 |
chandransh |
178 |
if(receiveReturn.isEnabled())
|
|
|
179 |
eventbus.fireEvent(new ReceiveReturnEvent(order));
|
| 2588 |
chandransh |
180 |
}
|
|
|
181 |
});
|
|
|
182 |
|
|
|
183 |
validateDOA.addClickHandler(new ClickHandler() {
|
|
|
184 |
|
|
|
185 |
@Override
|
|
|
186 |
public void onClick(ClickEvent event) {
|
|
|
187 |
if(!validateDOA.isEnabled())
|
|
|
188 |
return;
|
|
|
189 |
DoaValidationBox box = new DoaValidationBox(eventbus, order);
|
|
|
190 |
box.center();
|
|
|
191 |
}
|
|
|
192 |
});
|
| 2449 |
chandransh |
193 |
}
|
| 487 |
rajveer |
194 |
|
| 2509 |
chandransh |
195 |
private void implementMaskForWE(){
|
| 306 |
ashish |
196 |
switch(mask){
|
|
|
197 |
case NEW:
|
| 2509 |
chandransh |
198 |
maskButtonsForWE(true, true, true, false, false, false, false);
|
| 306 |
ashish |
199 |
break;
|
|
|
200 |
case ACCEPT:
|
| 2781 |
chandransh |
201 |
maskButtonsForWE(false, false, false, true, true, false, false);
|
| 306 |
ashish |
202 |
break;
|
| 486 |
rajveer |
203 |
case REJECT:
|
| 2509 |
chandransh |
204 |
maskButtonsForWE(false, false, false, false, false, false, false);
|
| 486 |
rajveer |
205 |
break;
|
| 306 |
ashish |
206 |
case BILL:
|
| 2509 |
chandransh |
207 |
maskButtonsForWE(false, false, false, true, false, false, false);
|
| 306 |
ashish |
208 |
break;
|
|
|
209 |
case SHIP:
|
| 2509 |
chandransh |
210 |
maskButtonsForWE(false, false, false, false, false, false, false);
|
| 306 |
ashish |
211 |
break;
|
| 487 |
rajveer |
212 |
case NO_STOCK:
|
| 2509 |
chandransh |
213 |
maskButtonsForWE(true, true, false, false, false, false, false);
|
| 487 |
rajveer |
214 |
break;
|
| 2509 |
chandransh |
215 |
case DOA_AWAITED:
|
| 2610 |
chandransh |
216 |
case SALES_RETURN_AWAITED:
|
| 2509 |
chandransh |
217 |
maskButtonsForWE(false, false, false, false, false, true, false);
|
|
|
218 |
break;
|
| 2610 |
chandransh |
219 |
case DOA_RECEIVED:
|
| 2509 |
chandransh |
220 |
maskButtonsForWE(false, false, false, false, false, false, true);
|
|
|
221 |
break;
|
| 2558 |
chandransh |
222 |
default:
|
|
|
223 |
maskButtonsForWE(false, false, false, false, false, false, false); //Unknown state, let's disallow any untoward actions.
|
|
|
224 |
break;
|
| 306 |
ashish |
225 |
}
|
|
|
226 |
}
|
|
|
227 |
|
| 2509 |
chandransh |
228 |
private void maskButtonsForWE(boolean accept, boolean reject, boolean notavailable, boolean printInv, boolean billing, boolean acceptdoa, boolean validatedoa){
|
| 306 |
ashish |
229 |
acceptOrder.setEnabled(accept);
|
|
|
230 |
notAvailable.setEnabled(notavailable);
|
| 2449 |
chandransh |
231 |
printInvoice.setEnabled(printInv);
|
| 306 |
ashish |
232 |
addBillingInfo.setEnabled(billing);
|
| 2610 |
chandransh |
233 |
receiveReturn.setEnabled(acceptdoa);
|
| 2509 |
chandransh |
234 |
validateDOA.setEnabled(validatedoa);
|
|
|
235 |
rejectOrder.setEnabled(reject);
|
| 306 |
ashish |
236 |
}
|
| 2509 |
chandransh |
237 |
|
|
|
238 |
private void initTableForAdmin() {
|
|
|
239 |
header.getColumnFormatter().setWidth(0, "128px");
|
|
|
240 |
header.getColumnFormatter().setWidth(1, "128px");
|
|
|
241 |
header.getColumnFormatter().setWidth(2, "128px");
|
|
|
242 |
header.getColumnFormatter().setWidth(3, "128px");
|
|
|
243 |
header.getColumnFormatter().setWidth(4, "128px");
|
|
|
244 |
header.getColumnFormatter().setWidth(5, "128px");
|
|
|
245 |
header.getColumnFormatter().setWidth(6, "256px");
|
|
|
246 |
|
|
|
247 |
if(transaction.isDoaFlag()){
|
|
|
248 |
flagOrder.setText("Unflag");
|
|
|
249 |
} else {
|
|
|
250 |
flagOrder.setText("Flag");
|
|
|
251 |
}
|
|
|
252 |
|
|
|
253 |
requestPickup.setText("Request Pick-up No");
|
|
|
254 |
authorizePickup.setText("Authorize Pick-up");
|
|
|
255 |
reshipOrder.setText("Reship");
|
|
|
256 |
refundOrder.setText("Refund");
|
|
|
257 |
|
| 2558 |
chandransh |
258 |
header.setWidget(1, 0, flagOrder);
|
|
|
259 |
header.setWidget(1, 1, requestPickup);
|
|
|
260 |
header.setWidget(1, 2, authorizePickup);
|
|
|
261 |
header.setWidget(1, 3, reshipOrder);
|
|
|
262 |
header.setWidget(1, 6, refundOrder);
|
| 2509 |
chandransh |
263 |
|
|
|
264 |
registerButtonHandlersForAdmin();
|
|
|
265 |
implementMaskForAdmin();
|
|
|
266 |
}
|
| 306 |
ashish |
267 |
|
| 2509 |
chandransh |
268 |
private void registerButtonHandlersForAdmin(){
|
|
|
269 |
flagOrder.addClickHandler(new ClickHandler() {
|
|
|
270 |
|
|
|
271 |
@Override
|
|
|
272 |
public void onClick(ClickEvent event) {
|
|
|
273 |
if(flagOrder.isEnabled()){
|
|
|
274 |
eventbus.fireEvent(new FlagOrderEvent(order));
|
|
|
275 |
}
|
|
|
276 |
}
|
|
|
277 |
});
|
|
|
278 |
|
|
|
279 |
requestPickup.addClickHandler(new ClickHandler() {
|
|
|
280 |
|
|
|
281 |
@Override
|
|
|
282 |
public void onClick(ClickEvent event) {
|
| 2513 |
chandransh |
283 |
if(requestPickup.isEnabled()){
|
|
|
284 |
GWT.log("Raising a pickup request for: " + order.getOrderId());
|
|
|
285 |
eventbus.fireEvent(new RequestPickupEvent(order));
|
|
|
286 |
}
|
| 2509 |
chandransh |
287 |
}
|
|
|
288 |
});
|
|
|
289 |
|
|
|
290 |
authorizePickup.addClickHandler(new ClickHandler() {
|
|
|
291 |
|
|
|
292 |
@Override
|
|
|
293 |
public void onClick(ClickEvent event) {
|
| 2526 |
chandransh |
294 |
if(!authorizePickup.isEnabled())
|
|
|
295 |
return;
|
|
|
296 |
PickupAuthorizationInfoBox box = new PickupAuthorizationInfoBox(eventbus, order);
|
|
|
297 |
box.center();
|
| 2509 |
chandransh |
298 |
}
|
|
|
299 |
});
|
|
|
300 |
|
| 2628 |
chandransh |
301 |
reshipOrder.addClickHandler(new ClickHandler() {
|
|
|
302 |
|
|
|
303 |
@Override
|
|
|
304 |
public void onClick(ClickEvent event) {
|
|
|
305 |
if(reshipOrder.isEnabled()){
|
|
|
306 |
GWT.log("Reshipping the order: " + order.getOrderId());
|
|
|
307 |
eventbus.fireEvent(new ReshipOrderEvent(order));
|
|
|
308 |
}
|
|
|
309 |
}
|
|
|
310 |
});
|
|
|
311 |
|
| 2509 |
chandransh |
312 |
refundOrder.addClickHandler(new ClickHandler() {
|
|
|
313 |
|
|
|
314 |
@Override
|
|
|
315 |
public void onClick(ClickEvent event) {
|
| 2747 |
chandransh |
316 |
if(refundOrder.isEnabled()){
|
|
|
317 |
RejectReasonBox box = new RejectReasonBox(eventbus, order, user);
|
| 2558 |
chandransh |
318 |
//box.clear();
|
|
|
319 |
box.center();
|
|
|
320 |
}
|
| 2509 |
chandransh |
321 |
}
|
|
|
322 |
});
|
|
|
323 |
}
|
|
|
324 |
|
|
|
325 |
private void implementMaskForAdmin(){
|
|
|
326 |
switch(mask){
|
| 2558 |
chandransh |
327 |
case NO_STOCK:
|
|
|
328 |
maskButtonsForAdmin(false, false, false, false, true);
|
|
|
329 |
break;
|
| 2509 |
chandransh |
330 |
case DELIVERED:
|
|
|
331 |
maskButtonsForAdmin(true, true, false, false, false); //Allow the OM to flag and request pickup.
|
|
|
332 |
break;
|
|
|
333 |
case DOA_PICKUP_REQUESTED:
|
|
|
334 |
maskButtonsForAdmin(true, true, true, false, false); //Allow the OM to either re-request a pickup no. or authorize pickup by entering one
|
|
|
335 |
break;
|
| 2610 |
chandransh |
336 |
case DOA_RETURNED:
|
| 2509 |
chandransh |
337 |
case SALES_RETURNED:
|
|
|
338 |
maskButtonsForAdmin(false, false, false, true, true); //Allow the OM to either reship the order or refund it
|
|
|
339 |
break;
|
| 2558 |
chandransh |
340 |
default:
|
|
|
341 |
maskButtonsForAdmin(false, false, false, false, false); //Unknown state. Let's not allow any untoward actions.
|
|
|
342 |
break;
|
| 2509 |
chandransh |
343 |
}
|
|
|
344 |
}
|
|
|
345 |
|
|
|
346 |
private void maskButtonsForAdmin(boolean flag, boolean reqPickup, boolean authPickup, boolean reship, boolean refund){
|
|
|
347 |
flagOrder.setEnabled(flag);
|
|
|
348 |
requestPickup.setEnabled(reqPickup);
|
|
|
349 |
authorizePickup.setEnabled(authPickup);
|
|
|
350 |
reshipOrder.setEnabled(reship);
|
|
|
351 |
refundOrder.setEnabled(refund);
|
|
|
352 |
}
|
|
|
353 |
|
| 306 |
ashish |
354 |
private void loadOrderDetails(){
|
| 966 |
chandransh |
355 |
orderDetails1.add(getHorizontalPanel("PRODUCT GROUP: ", transaction.getProductGroup()));
|
|
|
356 |
orderDetails1.add(getHorizontalPanel("BRAND: ", transaction.getBrand()));
|
|
|
357 |
orderDetails1.add(getHorizontalPanel("MODEL: ", getModelDisplayName(transaction)));
|
|
|
358 |
orderDetails1.add(getHorizontalPanel("Item ID: ", transaction.getItemId()+""));
|
|
|
359 |
orderDetails1.add(getHorizontalPanel("EXTRA INFO: ", transaction.getExtraInfo()));
|
| 306 |
ashish |
360 |
|
| 966 |
chandransh |
361 |
orderDetails2.add(getHorizontalPanel("NAME: ", transaction.getCustomerName()));
|
|
|
362 |
orderDetails2.add(getHorizontalPanel("ADDRESS: ", getDisplayAddress(transaction)));
|
|
|
363 |
orderDetails2.add(getHorizontalPanel("MOBILE NUMBER: ", transaction.getCustomerMobileNumber()));
|
| 306 |
ashish |
364 |
|
| 966 |
chandransh |
365 |
orderDetails3.add(getHorizontalPanel("TOTAL WEIGHT: ", transaction.getTotalWeight()+""));
|
|
|
366 |
orderDetails3.add(getHorizontalPanel("TOTAL AMOUNT(Rs): ", transaction.getTotalAmount()+""));
|
| 306 |
ashish |
367 |
|
| 966 |
chandransh |
368 |
orderDetails4.add(getHorizontalPanel("AIRWAY BILL NO: ", transaction.getAirwayBillNo()));
|
|
|
369 |
orderDetails4.add(getHorizontalPanel("INVOICE NUMBER: ", transaction.getInvoiceNumber()));
|
|
|
370 |
orderDetails4.add(getHorizontalPanel("JACKET NUMBER: ", transaction.getJacketNumber() + ""));
|
| 2781 |
chandransh |
371 |
orderDetails4.add(getHorizontalPanel("ITEM NO: ", getDisplayNameForNullableString(transaction.getItemNumber())));
|
|
|
372 |
orderDetails4.add(getHorizontalPanel("IMEI NO: ", transaction.getImeiNumber() + ""));
|
|
|
373 |
|
| 966 |
chandransh |
374 |
orderDetails4.add(getHorizontalPanel("BILLED BY: ", transaction.getBilledBy()));
|
|
|
375 |
}
|
| 639 |
chandransh |
376 |
|
| 966 |
chandransh |
377 |
private HorizontalPanel getHorizontalPanel(String labelText, String valueText) {
|
|
|
378 |
HorizontalPanel hpanel = new HorizontalPanel();
|
| 639 |
chandransh |
379 |
hpanel.setSpacing(5);
|
| 966 |
chandransh |
380 |
hpanel.add(new Label(labelText));
|
|
|
381 |
hpanel.add(new Label(valueText));
|
| 639 |
chandransh |
382 |
hpanel.setCellWidth(hpanel.getWidget(0), "128px");
|
|
|
383 |
hpanel.setCellWidth(hpanel.getWidget(1), "128px");
|
|
|
384 |
hpanel.getWidget(0).setStyleName(selectionStyle.blueLabel());
|
|
|
385 |
hpanel.getWidget(1).setStyleName(selectionStyle.greenLabel());
|
| 966 |
chandransh |
386 |
return hpanel;
|
|
|
387 |
}
|
| 306 |
ashish |
388 |
|
| 966 |
chandransh |
389 |
private String getModelDisplayName(Order order){
|
|
|
390 |
String modelName = "";
|
|
|
391 |
if(order.getModelName()!=null)
|
|
|
392 |
modelName = order.getModelName() + " ";
|
|
|
393 |
if(order.getModelNumber()!=null)
|
|
|
394 |
modelName = modelName + order.getModelNumber();
|
|
|
395 |
if(order.getColor()!=null)
|
|
|
396 |
modelName = modelName + " (" + order.getColor() + ")";
|
|
|
397 |
return modelName;
|
| 306 |
ashish |
398 |
}
|
| 966 |
chandransh |
399 |
|
|
|
400 |
private String getDisplayAddress(Order order){
|
|
|
401 |
StringBuilder displayAddress = new StringBuilder();
|
|
|
402 |
displayAddress.append(order.getCustomerAddress1() + "\n");
|
|
|
403 |
displayAddress.append(order.getCustomerAddress2() + "\n");
|
|
|
404 |
displayAddress.append(order.getCustomerCity() + "\n");
|
|
|
405 |
displayAddress.append(order.getCustomerState() + " PIN - " + order.getCustomerPincode());
|
|
|
406 |
return displayAddress.toString();
|
|
|
407 |
}
|
| 2781 |
chandransh |
408 |
|
|
|
409 |
private String getDisplayNameForNullableString(String s) {
|
|
|
410 |
if (s == null)
|
|
|
411 |
return "";
|
|
|
412 |
return s;
|
|
|
413 |
}
|
| 167 |
ashish |
414 |
}
|