| 1146 |
chandransh |
1 |
package in.shop2020.hotspot.dashbaord.client.inbox;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.hotspot.dashbaord.client.event.AddJacketNumberEvent;
|
| 2843 |
chandransh |
4 |
import in.shop2020.hotspot.dashbaord.shared.actions.BillingType;
|
| 1146 |
chandransh |
5 |
import in.shop2020.hotspot.dashbaord.shared.actions.Order;
|
|
|
6 |
|
| 5411 |
rajveer |
7 |
import java.util.ArrayList;
|
| 13146 |
manish.sha |
8 |
import java.util.HashMap;
|
| 5411 |
rajveer |
9 |
import java.util.List;
|
| 5110 |
mandeep.dh |
10 |
import java.util.Map;
|
|
|
11 |
|
| 1146 |
chandransh |
12 |
import org.enunes.gwt.mvp.client.EventBus;
|
|
|
13 |
|
|
|
14 |
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
15 |
import com.google.gwt.event.dom.client.ClickHandler;
|
| 13146 |
manish.sha |
16 |
import com.google.gwt.event.dom.client.KeyPressEvent;
|
|
|
17 |
import com.google.gwt.event.dom.client.KeyPressHandler;
|
| 1146 |
chandransh |
18 |
import com.google.gwt.user.client.ui.Button;
|
| 13227 |
manish.sha |
19 |
import com.google.gwt.user.client.ui.CheckBox;
|
| 1146 |
chandransh |
20 |
import com.google.gwt.user.client.ui.DialogBox;
|
| 13146 |
manish.sha |
21 |
import com.google.gwt.user.client.ui.HTML;
|
|
|
22 |
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
|
| 1146 |
chandransh |
23 |
import com.google.gwt.user.client.ui.HorizontalPanel;
|
|
|
24 |
import com.google.gwt.user.client.ui.Label;
|
| 13146 |
manish.sha |
25 |
import com.google.gwt.user.client.ui.ScrollPanel;
|
| 1146 |
chandransh |
26 |
import com.google.gwt.user.client.ui.TextBox;
|
|
|
27 |
import com.google.gwt.user.client.ui.VerticalPanel;
|
| 2781 |
chandransh |
28 |
import com.google.gwt.user.client.ui.Widget;
|
| 1146 |
chandransh |
29 |
|
|
|
30 |
public class JacketInfoBox extends DialogBox {
|
|
|
31 |
private Label errorLabel = new Label("");
|
| 2781 |
chandransh |
32 |
|
| 13146 |
manish.sha |
33 |
private Label jacketNumberLabel = new Label("Jacket Number");
|
| 6746 |
rajveer |
34 |
|
| 5110 |
mandeep.dh |
35 |
private Label warehousePickSuggestion = new Label("");
|
| 13146 |
manish.sha |
36 |
|
| 1146 |
chandransh |
37 |
private TextBox jacketNumberBox = new TextBox();
|
| 2781 |
chandransh |
38 |
|
| 13146 |
manish.sha |
39 |
private Label billedByLabel = new Label("Billed By");
|
| 2781 |
chandransh |
40 |
|
| 13146 |
manish.sha |
41 |
private Label billNumberLabel = new Label("Bill Number");
|
|
|
42 |
private TextBox billNumber = new TextBox();
|
| 2781 |
chandransh |
43 |
|
| 13228 |
manish.sha |
44 |
private CheckBox changeInvoiceType = new CheckBox("Bulk Invoice");
|
| 13227 |
manish.sha |
45 |
|
| 13146 |
manish.sha |
46 |
private VerticalPanel vpanel = new VerticalPanel();
|
| 7190 |
amar.kumar |
47 |
|
| 13146 |
manish.sha |
48 |
private ScrollPanel spanel = new ScrollPanel();
|
| 7190 |
amar.kumar |
49 |
|
| 13146 |
manish.sha |
50 |
private Button submitbutton = new Button("Submit");
|
| 2781 |
chandransh |
51 |
|
| 13710 |
manish.sha |
52 |
private Button cancelButton = new Button("Cancel");
|
|
|
53 |
|
| 13146 |
manish.sha |
54 |
private Map<Long, List<String>> itemNumbersMap = new HashMap<Long, List<String>>();
|
|
|
55 |
|
|
|
56 |
private Map<Long, List<String>> serialNumbersMap = new HashMap<Long, List<String>>();
|
|
|
57 |
|
|
|
58 |
private Map<Long, List<Long>> freebieWarehouseIdMap = new HashMap<Long, List<Long>>();
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
private Map<Long, List<TextBox>> itemNumbersBoxMap= new HashMap<Long, List<TextBox>>();
|
|
|
62 |
|
|
|
63 |
private Map<Long, List<TextBox>> serialNumbersBoxMap = new HashMap<Long, List<TextBox>>();
|
|
|
64 |
|
|
|
65 |
private Map<Long, List<TextBox>> freebieWarehouseIdBoxMap = new HashMap<Long, List<TextBox>>();
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
private HorizontalPanel hpanel;
|
|
|
69 |
|
| 13231 |
manish.sha |
70 |
private Widget tmpLabel;
|
|
|
71 |
|
| 5110 |
mandeep.dh |
72 |
public JacketInfoBox(final EventBus eventBus, final Order order, final String user,
|
| 13146 |
manish.sha |
73 |
final BillingType billingType, Map<Long, String> warehouses, final Map<Long, Map<String, String>> billTogetherOrdersMap){
|
| 1146 |
chandransh |
74 |
vpanel.add(errorLabel);
|
| 13146 |
manish.sha |
75 |
|
|
|
76 |
jacketNumberBox.addKeyPressHandler(new KeyPressHandler() {
|
|
|
77 |
@Override
|
|
|
78 |
public void onKeyPress(KeyPressEvent event) {
|
|
|
79 |
// TODO Auto-generated method stub
|
|
|
80 |
if (!Character.isDigit(event.getCharCode())) {
|
|
|
81 |
((TextBox) event.getSource()).cancelKey();
|
|
|
82 |
}
|
|
|
83 |
}
|
|
|
84 |
});
|
|
|
85 |
|
|
|
86 |
vpanel.add(getHorizontalPanel(jacketNumberLabel, jacketNumberBox));
|
|
|
87 |
|
|
|
88 |
vpanel.add(getHorizontalPanel(billedByLabel, new Label(user)));
|
|
|
89 |
|
| 13315 |
manish.sha |
90 |
if (order.getPickFromWarehouse() != null && billTogetherOrdersMap.size()==1) {
|
| 5110 |
mandeep.dh |
91 |
warehousePickSuggestion.setText("Pick from WH: " + order.getPickFromWarehouse());
|
| 13315 |
manish.sha |
92 |
vpanel.add(warehousePickSuggestion);
|
| 5110 |
mandeep.dh |
93 |
}
|
| 13315 |
manish.sha |
94 |
|
| 13227 |
manish.sha |
95 |
//changeInvoiceType = new CheckBox("BulkInvoice");
|
|
|
96 |
changeInvoiceType.setValue(false);
|
| 13315 |
manish.sha |
97 |
if(!order.getSource().equals("WEBSITE")) {
|
|
|
98 |
changeInvoiceType.setEnabled(false);
|
|
|
99 |
}
|
| 13227 |
manish.sha |
100 |
|
|
|
101 |
|
|
|
102 |
vpanel.add(changeInvoiceType);
|
|
|
103 |
|
| 6746 |
rajveer |
104 |
if(billingType == BillingType.OURS_EXTERNAL || billingType == BillingType.EXTERNAL){
|
|
|
105 |
vpanel.add(getHorizontalPanel(billNumberLabel, billNumber));
|
|
|
106 |
if(order.getInvoiceNumber() != null && !order.getInvoiceNumber().trim().equals("")){
|
|
|
107 |
billNumber.setText(order.getInvoiceNumber().trim());
|
|
|
108 |
}
|
|
|
109 |
}
|
|
|
110 |
|
| 13228 |
manish.sha |
111 |
vpanel.add(new HTML("<br>"));
|
|
|
112 |
|
| 13146 |
manish.sha |
113 |
hpanel = new HorizontalPanel();
|
|
|
114 |
hpanel.setSpacing(5);
|
| 13231 |
manish.sha |
115 |
tmpLabel = new Label("Order Id");
|
|
|
116 |
hpanel.add(tmpLabel);
|
| 13232 |
manish.sha |
117 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13231 |
manish.sha |
118 |
tmpLabel = new Label("Product Name");
|
|
|
119 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
120 |
hpanel.setCellWidth(tmpLabel, "250");
|
| 13231 |
manish.sha |
121 |
tmpLabel = new Label("Quantity");
|
|
|
122 |
hpanel.add(tmpLabel);
|
|
|
123 |
hpanel.setCellWidth(tmpLabel, "50");
|
|
|
124 |
tmpLabel = new Label("Item Number");
|
|
|
125 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
126 |
hpanel.setCellWidth(tmpLabel, "200");
|
| 13231 |
manish.sha |
127 |
tmpLabel = new Label("Serial Number");
|
|
|
128 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
129 |
hpanel.setCellWidth(tmpLabel, "200");
|
| 13231 |
manish.sha |
130 |
tmpLabel = new Label("Freebie Warehouse Id");
|
|
|
131 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
132 |
hpanel.setCellWidth(tmpLabel, "200");
|
| 13231 |
manish.sha |
133 |
|
| 13146 |
manish.sha |
134 |
vpanel.add(hpanel);
|
| 6746 |
rajveer |
135 |
|
| 13146 |
manish.sha |
136 |
for(Long orderId : billTogetherOrdersMap.keySet()){
|
|
|
137 |
List<TextBox> itemNumbersBoxList = new ArrayList<TextBox>();
|
|
|
138 |
List<TextBox> serialNumbersBoxList = new ArrayList<TextBox>();
|
|
|
139 |
List<TextBox> freebieWarehouseIdBoxList = new ArrayList<TextBox>();
|
|
|
140 |
|
|
|
141 |
long quantity = (long)Double.parseDouble(billTogetherOrdersMap.get(orderId).get("Quantity"));
|
|
|
142 |
boolean hasSerialized = Boolean.parseBoolean(billTogetherOrdersMap.get(orderId).get("IsSerialized"));
|
|
|
143 |
boolean hasFreebie = Boolean.parseBoolean(billTogetherOrdersMap.get(orderId).get("IsFreebie"));
|
|
|
144 |
TextBox itemNumber;
|
|
|
145 |
TextBox serialNumber;
|
|
|
146 |
TextBox freebieWarehouseId;
|
|
|
147 |
|
|
|
148 |
if(quantity>1){
|
|
|
149 |
if(hasSerialized){
|
|
|
150 |
for(long i=0; i<quantity; i++){
|
|
|
151 |
hpanel = new HorizontalPanel();
|
|
|
152 |
hpanel.setSpacing(5);
|
| 13231 |
manish.sha |
153 |
tmpLabel = new Label(orderId+"");
|
|
|
154 |
hpanel.add(tmpLabel);
|
| 13233 |
manish.sha |
155 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13231 |
manish.sha |
156 |
tmpLabel = new Label(billTogetherOrdersMap.get(orderId).get("ProductName"));
|
|
|
157 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
158 |
hpanel.setCellWidth(tmpLabel, "250");
|
| 13231 |
manish.sha |
159 |
tmpLabel = new Label("1");
|
|
|
160 |
hpanel.add(tmpLabel);
|
|
|
161 |
hpanel.setCellWidth(tmpLabel, "50");
|
|
|
162 |
|
| 13146 |
manish.sha |
163 |
hpanel.add(new Label(orderId+""));
|
|
|
164 |
hpanel.add(new Label(billTogetherOrdersMap.get(orderId).get("ProductName")));
|
|
|
165 |
hpanel.add(new Label("1"));
|
|
|
166 |
itemNumber = new TextBox();
|
|
|
167 |
serialNumber = new TextBox();
|
|
|
168 |
freebieWarehouseId = new TextBox();
|
|
|
169 |
if(!hasFreebie){
|
|
|
170 |
freebieWarehouseId.setEnabled(false);
|
|
|
171 |
}
|
|
|
172 |
freebieWarehouseId.addKeyPressHandler(new KeyPressHandler() {
|
|
|
173 |
@Override
|
|
|
174 |
public void onKeyPress(KeyPressEvent event) {
|
|
|
175 |
// TODO Auto-generated method stub
|
|
|
176 |
if (!Character.isDigit(event.getCharCode())) {
|
|
|
177 |
((TextBox) event.getSource()).cancelKey();
|
|
|
178 |
}
|
|
|
179 |
}
|
|
|
180 |
});
|
| 13231 |
manish.sha |
181 |
|
| 13146 |
manish.sha |
182 |
hpanel.add(itemNumber);
|
| 13234 |
manish.sha |
183 |
hpanel.setCellWidth(itemNumber, "200");
|
| 13146 |
manish.sha |
184 |
hpanel.add(serialNumber);
|
| 13234 |
manish.sha |
185 |
hpanel.setCellWidth(serialNumber, "200");
|
| 13146 |
manish.sha |
186 |
hpanel.add(freebieWarehouseId);
|
| 13234 |
manish.sha |
187 |
hpanel.setCellWidth(freebieWarehouseId, "200");
|
| 13146 |
manish.sha |
188 |
vpanel.add(hpanel);
|
|
|
189 |
itemNumbersBoxList.add(itemNumber);
|
|
|
190 |
serialNumbersBoxList.add(serialNumber);
|
|
|
191 |
freebieWarehouseIdBoxList.add(freebieWarehouseId);
|
|
|
192 |
}
|
|
|
193 |
}
|
|
|
194 |
else{
|
|
|
195 |
hpanel = new HorizontalPanel();
|
|
|
196 |
hpanel.setSpacing(5);
|
| 13231 |
manish.sha |
197 |
tmpLabel = new Label(orderId+"");
|
|
|
198 |
hpanel.add(tmpLabel);
|
| 13233 |
manish.sha |
199 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13231 |
manish.sha |
200 |
tmpLabel = new Label(billTogetherOrdersMap.get(orderId).get("ProductName"));
|
|
|
201 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
202 |
hpanel.setCellWidth(tmpLabel, "250");
|
| 13231 |
manish.sha |
203 |
tmpLabel = new Label(quantity+"");
|
|
|
204 |
hpanel.add(tmpLabel);
|
|
|
205 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13146 |
manish.sha |
206 |
itemNumber = new TextBox();
|
|
|
207 |
serialNumber = new TextBox();
|
|
|
208 |
freebieWarehouseId = new TextBox();
|
|
|
209 |
serialNumber.setEnabled(false);
|
|
|
210 |
if(!hasFreebie){
|
|
|
211 |
freebieWarehouseId.setEnabled(false);
|
|
|
212 |
}
|
|
|
213 |
freebieWarehouseId.addKeyPressHandler(new KeyPressHandler() {
|
|
|
214 |
@Override
|
|
|
215 |
public void onKeyPress(KeyPressEvent event) {
|
|
|
216 |
// TODO Auto-generated method stub
|
|
|
217 |
if (!Character.isDigit(event.getCharCode())) {
|
|
|
218 |
((TextBox) event.getSource()).cancelKey();
|
|
|
219 |
}
|
|
|
220 |
}
|
|
|
221 |
});
|
|
|
222 |
hpanel.add(itemNumber);
|
| 13234 |
manish.sha |
223 |
hpanel.setCellWidth(itemNumber, "200");
|
| 13146 |
manish.sha |
224 |
hpanel.add(serialNumber);
|
| 13234 |
manish.sha |
225 |
hpanel.setCellWidth(serialNumber, "200");
|
| 13146 |
manish.sha |
226 |
hpanel.add(freebieWarehouseId);
|
| 13234 |
manish.sha |
227 |
hpanel.setCellWidth(freebieWarehouseId, "200");
|
| 13146 |
manish.sha |
228 |
vpanel.add(hpanel);
|
|
|
229 |
itemNumbersBoxList.add(itemNumber);
|
|
|
230 |
serialNumbersBoxList.add(serialNumber);
|
|
|
231 |
freebieWarehouseIdBoxList.add(freebieWarehouseId);
|
|
|
232 |
}
|
|
|
233 |
}
|
|
|
234 |
else {
|
|
|
235 |
|
|
|
236 |
hpanel = new HorizontalPanel();
|
|
|
237 |
hpanel.setSpacing(5);
|
| 13231 |
manish.sha |
238 |
tmpLabel = new Label(orderId+"");
|
|
|
239 |
hpanel.add(tmpLabel);
|
| 13233 |
manish.sha |
240 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13231 |
manish.sha |
241 |
tmpLabel = new Label(billTogetherOrdersMap.get(orderId).get("ProductName"));
|
|
|
242 |
hpanel.add(tmpLabel);
|
| 13234 |
manish.sha |
243 |
hpanel.setCellWidth(tmpLabel, "250");
|
| 13231 |
manish.sha |
244 |
tmpLabel = new Label(quantity+"");
|
|
|
245 |
hpanel.add(tmpLabel);
|
|
|
246 |
hpanel.setCellWidth(tmpLabel, "50");
|
| 13146 |
manish.sha |
247 |
itemNumber = new TextBox();
|
|
|
248 |
serialNumber = new TextBox();
|
|
|
249 |
freebieWarehouseId = new TextBox();
|
|
|
250 |
if(!hasSerialized){
|
|
|
251 |
serialNumber.setEnabled(false);
|
|
|
252 |
}
|
|
|
253 |
if(!hasFreebie){
|
|
|
254 |
freebieWarehouseId.setEnabled(false);
|
|
|
255 |
}
|
|
|
256 |
freebieWarehouseId.addKeyPressHandler(new KeyPressHandler() {
|
|
|
257 |
@Override
|
|
|
258 |
public void onKeyPress(KeyPressEvent event) {
|
|
|
259 |
// TODO Auto-generated method stub
|
|
|
260 |
if (!Character.isDigit(event.getCharCode())) {
|
|
|
261 |
((TextBox) event.getSource()).cancelKey();
|
|
|
262 |
}
|
|
|
263 |
}
|
|
|
264 |
});
|
|
|
265 |
hpanel.add(itemNumber);
|
| 13234 |
manish.sha |
266 |
hpanel.setCellWidth(itemNumber, "200");
|
| 13146 |
manish.sha |
267 |
hpanel.add(serialNumber);
|
| 13234 |
manish.sha |
268 |
hpanel.setCellWidth(serialNumber, "200");
|
| 13146 |
manish.sha |
269 |
hpanel.add(freebieWarehouseId);
|
| 13234 |
manish.sha |
270 |
hpanel.setCellWidth(freebieWarehouseId, "200");
|
| 13146 |
manish.sha |
271 |
vpanel.add(hpanel);
|
|
|
272 |
itemNumbersBoxList.add(itemNumber);
|
|
|
273 |
serialNumbersBoxList.add(serialNumber);
|
|
|
274 |
freebieWarehouseIdBoxList.add(freebieWarehouseId);
|
|
|
275 |
}
|
|
|
276 |
|
|
|
277 |
//itemNumbersBoxMap, serialNumbersBoxMap, freebieWarehouseIdBoxMap
|
|
|
278 |
itemNumbersBoxMap.put(orderId, itemNumbersBoxList);
|
|
|
279 |
serialNumbersBoxMap.put(orderId, serialNumbersBoxList);
|
|
|
280 |
freebieWarehouseIdBoxMap.put(orderId, freebieWarehouseIdBoxList);
|
|
|
281 |
}
|
| 13710 |
manish.sha |
282 |
hpanel = new HorizontalPanel();
|
|
|
283 |
hpanel.setSpacing(5);
|
|
|
284 |
hpanel.add(submitbutton);
|
|
|
285 |
hpanel.add(cancelButton);
|
|
|
286 |
vpanel.add(hpanel);
|
|
|
287 |
vpanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
|
| 13146 |
manish.sha |
288 |
|
| 1146 |
chandransh |
289 |
setWidget(vpanel);
|
| 13710 |
manish.sha |
290 |
setAutoHideEnabled(false);
|
| 1146 |
chandransh |
291 |
setGlassEnabled(true);
|
| 13146 |
manish.sha |
292 |
setText("Enter all the details below:");
|
| 1146 |
chandransh |
293 |
setModal(true);
|
| 13146 |
manish.sha |
294 |
setWidth("1000px");
|
|
|
295 |
|
|
|
296 |
|
| 1146 |
chandransh |
297 |
submitbutton.addClickHandler(new ClickHandler() {
|
|
|
298 |
@Override
|
|
|
299 |
public void onClick(ClickEvent event) {
|
| 2352 |
chandransh |
300 |
long jacketNumber = -1;
|
| 13146 |
manish.sha |
301 |
String itemNumber = "";
|
| 5442 |
rajveer |
302 |
String serialNumber = "";
|
| 13146 |
manish.sha |
303 |
long freebieWhId = -1;
|
| 2352 |
chandransh |
304 |
try {
|
|
|
305 |
jacketNumber = Long.parseLong(jacketNumberBox.getText());
|
|
|
306 |
} catch(NumberFormatException nfe){
|
|
|
307 |
nfe.printStackTrace();
|
| 1146 |
chandransh |
308 |
}
|
| 2352 |
chandransh |
309 |
|
|
|
310 |
if(jacketNumber <= 0){
|
|
|
311 |
errorLabel.setText("Invalid Jacket number.");
|
|
|
312 |
return;
|
|
|
313 |
}
|
| 13146 |
manish.sha |
314 |
|
|
|
315 |
for(Long orderId : billTogetherOrdersMap.keySet()){
|
|
|
316 |
boolean isSerialized = Boolean.parseBoolean(billTogetherOrdersMap.get(orderId).get("IsSerialized"));
|
|
|
317 |
boolean isFreebie = Boolean.parseBoolean(billTogetherOrdersMap.get(orderId).get("IsFreebie"));
|
|
|
318 |
for(TextBox tb : itemNumbersBoxMap.get(orderId)){
|
|
|
319 |
itemNumber = tb.getText();
|
|
|
320 |
if(itemNumber==null || itemNumber.trim().isEmpty()){
|
|
|
321 |
errorLabel.setText("Item Number can't be left empty for Order Id:- "+ orderId);
|
| 5530 |
mandeep.dh |
322 |
return;
|
|
|
323 |
}
|
| 7190 |
amar.kumar |
324 |
}
|
| 13146 |
manish.sha |
325 |
|
|
|
326 |
if(isSerialized){
|
|
|
327 |
for(TextBox tb : serialNumbersBoxMap.get(orderId)){
|
|
|
328 |
serialNumber = tb.getText();
|
|
|
329 |
if(serialNumber==null || serialNumber.trim().isEmpty()){
|
|
|
330 |
errorLabel.setText("Serial Number can't be left empty for Order Id:- "+ orderId);
|
|
|
331 |
return;
|
|
|
332 |
}
|
|
|
333 |
}
|
| 5411 |
rajveer |
334 |
}
|
| 13146 |
manish.sha |
335 |
|
|
|
336 |
if(isFreebie){
|
|
|
337 |
for(TextBox tb : freebieWarehouseIdBoxMap.get(orderId)){
|
|
|
338 |
try {
|
|
|
339 |
freebieWhId = Long.parseLong(tb.getText());
|
|
|
340 |
} catch(NumberFormatException nfe){
|
|
|
341 |
nfe.printStackTrace();
|
|
|
342 |
}
|
|
|
343 |
|
|
|
344 |
if(freebieWhId <= 0){
|
|
|
345 |
errorLabel.setText("Freebie Warehouse Id can't be left empty for Order Id:- "+ orderId);
|
|
|
346 |
return;
|
|
|
347 |
}
|
|
|
348 |
}
|
|
|
349 |
}
|
| 5411 |
rajveer |
350 |
}
|
| 13227 |
manish.sha |
351 |
|
| 13315 |
manish.sha |
352 |
String invoiceType = !changeInvoiceType.isEnabled() ? "Individual" : changeInvoiceType.getValue() ? "BulkInvoice" : "Individual";
|
| 13146 |
manish.sha |
353 |
setValuesInDesiredMaps(billTogetherOrdersMap);
|
| 13276 |
manish.sha |
354 |
eventBus.fireEvent(new AddJacketNumberEvent(order, billNumber.getText(), jacketNumber, itemNumbersMap, serialNumbersMap, freebieWarehouseIdMap, user, billingType, invoiceType));
|
| 2352 |
chandransh |
355 |
hide();
|
|
|
356 |
clean();
|
| 1146 |
chandransh |
357 |
}
|
|
|
358 |
});
|
| 13710 |
manish.sha |
359 |
|
|
|
360 |
cancelButton.addClickHandler(new ClickHandler() {
|
|
|
361 |
|
|
|
362 |
@Override
|
|
|
363 |
public void onClick(ClickEvent event) {
|
|
|
364 |
hide();
|
|
|
365 |
clean();
|
|
|
366 |
}
|
|
|
367 |
});
|
| 1146 |
chandransh |
368 |
}
|
|
|
369 |
|
| 5110 |
mandeep.dh |
370 |
public void clean() {
|
| 1146 |
chandransh |
371 |
jacketNumberBox.setText("");
|
|
|
372 |
errorLabel.setText("");
|
| 5110 |
mandeep.dh |
373 |
warehousePickSuggestion.setText("");
|
| 1146 |
chandransh |
374 |
}
|
| 2352 |
chandransh |
375 |
|
| 13146 |
manish.sha |
376 |
public void setValuesInDesiredMaps(Map<Long, Map<String, String>> billOrdersMap){
|
|
|
377 |
for(Long orderId : billOrdersMap.keySet()){
|
|
|
378 |
List<TextBox> itemNumbersBoxList = itemNumbersBoxMap.get(orderId);
|
|
|
379 |
|
|
|
380 |
Map<String, String> orderValuesMap = billOrdersMap.get(orderId);
|
|
|
381 |
boolean hasSerialized = Boolean.parseBoolean(orderValuesMap.get("IsSerialized"));
|
|
|
382 |
boolean hasFreebie = Boolean.parseBoolean(orderValuesMap.get("IsFreebie"));
|
|
|
383 |
|
|
|
384 |
List<String> itemNumbers = new ArrayList<String>();
|
|
|
385 |
|
|
|
386 |
for(TextBox tb : itemNumbersBoxList){
|
|
|
387 |
itemNumbers.add(tb.getText().trim());
|
|
|
388 |
}
|
|
|
389 |
|
|
|
390 |
itemNumbersMap.put(orderId, itemNumbers);
|
|
|
391 |
|
|
|
392 |
if(hasSerialized){
|
|
|
393 |
List<TextBox> serialNumbersBoxList = serialNumbersBoxMap.get(orderId);
|
|
|
394 |
List<String> serialNumbers = new ArrayList<String>();
|
|
|
395 |
for(TextBox tb : serialNumbersBoxList){
|
|
|
396 |
serialNumbers.add(tb.getText().trim());
|
|
|
397 |
}
|
|
|
398 |
serialNumbersMap.put(orderId, serialNumbers);
|
|
|
399 |
} else{
|
|
|
400 |
//itemNumbersMap, serialNumbersMap, freebieWarehouseIdMap
|
|
|
401 |
serialNumbersMap.put(orderId, new ArrayList<String>());
|
|
|
402 |
}
|
|
|
403 |
|
|
|
404 |
if(hasFreebie){
|
|
|
405 |
List<TextBox> freebieWarehouseIdBoxList = freebieWarehouseIdBoxMap.get(orderId);
|
|
|
406 |
List<Long> freebieWhIds = new ArrayList<Long>();
|
|
|
407 |
for(TextBox tb : freebieWarehouseIdBoxList){
|
|
|
408 |
freebieWhIds.add(Long.parseLong(tb.getText().trim()));
|
|
|
409 |
}
|
|
|
410 |
freebieWarehouseIdMap.put(orderId, freebieWhIds);
|
|
|
411 |
} else {
|
|
|
412 |
freebieWarehouseIdMap.put(orderId, new ArrayList<Long>());
|
|
|
413 |
}
|
|
|
414 |
}
|
|
|
415 |
}
|
|
|
416 |
|
| 4658 |
mandeep.dh |
417 |
private HorizontalPanel getHorizontalPanel(Label label, Widget textBox) {
|
| 2352 |
chandransh |
418 |
HorizontalPanel hpanel = new HorizontalPanel();
|
|
|
419 |
hpanel.setSpacing(5);
|
|
|
420 |
hpanel.add(label);
|
|
|
421 |
hpanel.add(textBox);
|
|
|
422 |
hpanel.setCellWidth(label, "120px");
|
|
|
423 |
return hpanel;
|
|
|
424 |
}
|
| 1146 |
chandransh |
425 |
}
|