| Line 33... |
Line 33... |
| 33 |
*/
|
33 |
*/
|
| 34 |
public class ItemForm extends DialogBox implements ComingSoon{
|
34 |
public class ItemForm extends DialogBox implements ComingSoon{
|
| 35 |
|
35 |
|
| 36 |
interface ItemFormUiBinder extends UiBinder<Widget, ItemForm> {}
|
36 |
interface ItemFormUiBinder extends UiBinder<Widget, ItemForm> {}
|
| 37 |
private static ItemFormUiBinder uiBinder = GWT.create(ItemFormUiBinder.class);
|
37 |
private static ItemFormUiBinder uiBinder = GWT.create(ItemFormUiBinder.class);
|
| - |
|
38 |
|
| 38 |
|
39 |
|
| 39 |
private final static CatalogServiceAsync catalogService = GWT.create(CatalogService.class);
|
40 |
private final static CatalogServiceAsync catalogService = GWT.create(CatalogService.class);
|
| 40 |
private final int TABLE_INDEX_VENDORID = 0,
|
41 |
private final int TABLE_INDEX_VENDORID = 0,
|
| 41 |
TABLE_INDEX_VENDOR_DESC = 1,
|
42 |
TABLE_INDEX_VENDOR_DESC = 1,
|
| 42 |
TABLE_INDEX_ITEM_KEY = 2,
|
43 |
TABLE_INDEX_ITEM_KEY = 2,
|
| Line 47... |
Line 48... |
| 47 |
|
48 |
|
| 48 |
private static boolean entityIdMandatory = Utils.isEntityIdMandatory();
|
49 |
private static boolean entityIdMandatory = Utils.isEntityIdMandatory();
|
| 49 |
|
50 |
|
| 50 |
@UiField TextBox productGroup, catalogItemId,existingItemId;
|
51 |
@UiField TextBox productGroup, catalogItemId,existingItemId;
|
| 51 |
@UiField TextBox brand, modelNumber, modelName, color, comments,holdInventory,defaultInventory;
|
52 |
@UiField TextBox brand, modelNumber, modelName, color, comments,holdInventory,defaultInventory;
|
| 52 |
@UiField TextBox mrp, sellingPrice, weight, bestDealText, bestDealValue, bestSellingRank,bestDealsDetailsText,bestDealsDetailsLink, minStockLevel, numOfDaysStock, freebieItemId,asin;
|
53 |
@UiField TextBox mrp, sellingPrice, weight, bestDealText, bestDealValue, bestSellingRank,bestDealsDetailsText,bestDealsDetailsLink, minStockLevel, numOfDaysStock, freebieItemId,asin,packQuantity;
|
| 53 |
@UiField DateBox startDate, retireDate, comingSoonStartDate, expectedArrivalDate;
|
54 |
@UiField DateBox startDate, retireDate, comingSoonStartDate, expectedArrivalDate;
|
| 54 |
@UiField Button addButton, cancelButton, comingSoonButton,searchButton;
|
55 |
@UiField Button addButton, cancelButton, comingSoonButton,searchButton;
|
| 55 |
@UiField CheckBox defaultForEntity, risky, itemType, hasItemNo, clearance, showSellingPrice;
|
56 |
@UiField CheckBox defaultForEntity, risky, itemType, hasItemNo, clearance, showSellingPrice;
|
| 56 |
@UiField FlexTable headerVendor, vendorTable;
|
57 |
@UiField FlexTable headerVendor, vendorTable;
|
| 57 |
@UiField FlexTable headerVendorM, vendorTableM;
|
58 |
@UiField FlexTable headerVendorM, vendorTableM;
|
| Line 239... |
Line 240... |
| 239 |
freebieItemId.setText(null);
|
240 |
freebieItemId.setText(null);
|
| 240 |
asin.setText(null);
|
241 |
asin.setText(null);
|
| 241 |
holdInventory.setText(null);
|
242 |
holdInventory.setText(null);
|
| 242 |
defaultInventory.setText(null);
|
243 |
defaultInventory.setText(null);
|
| 243 |
color.setText(null);
|
244 |
color.setText(null);
|
| 244 |
vendorTable.removeAllRows();
|
245 |
vendorTable.removeAllRows();
|
| - |
|
246 |
packQuantity.setText(null);
|
| 245 |
if(!existingItemId.getText().trim().isEmpty()){
|
247 |
if(!existingItemId.getText().trim().isEmpty()){
|
| 246 |
long id = Long.parseLong(existingItemId.getText().trim());
|
248 |
long id = Long.parseLong(existingItemId.getText().trim());
|
| 247 |
|
249 |
|
| 248 |
if(id <= 0) {
|
250 |
if(id <= 0) {
|
| 249 |
throw new NumberFormatException("Invalid value of Item Id");
|
251 |
throw new NumberFormatException("Invalid value of Item Id");
|
| Line 321... |
Line 323... |
| 321 |
brand.setText(item.getBrand());
|
323 |
brand.setText(item.getBrand());
|
| 322 |
modelNumber.setText(item.getModelNumber());
|
324 |
modelNumber.setText(item.getModelNumber());
|
| 323 |
modelName.setText(item.getModelName());
|
325 |
modelName.setText(item.getModelName());
|
| 324 |
comments.setText(item.getComments());
|
326 |
comments.setText(item.getComments());
|
| 325 |
mrp.setText(item.getMrp() != null ? item.getMrp()+"" : "");
|
327 |
mrp.setText(item.getMrp() != null ? item.getMrp()+"" : "");
|
| - |
|
328 |
packQuantity.setText(item.getPackQuantity().toString());
|
| 326 |
sellingPrice.setText(item.getSellingPrice() != null ? item.getSellingPrice()+"" : "");
|
329 |
sellingPrice.setText(item.getSellingPrice() != null ? item.getSellingPrice()+"" : "");
|
| 327 |
weight.setText(item.getWeight() != null ? item.getWeight()+"" : "");
|
330 |
weight.setText(item.getWeight() != null ? item.getWeight()+"" : "");
|
| 328 |
hasItemNo.setValue(item.isHasItemNo());
|
331 |
hasItemNo.setValue(item.isHasItemNo());
|
| 329 |
itemType.setValue(item.isItemType());
|
332 |
itemType.setValue(item.isItemType());
|
| 330 |
showSellingPrice.setValue(item.isShowSellingPrice());
|
333 |
showSellingPrice.setValue(item.isShowSellingPrice());
|
| Line 514... |
Line 517... |
| 514 |
} catch(NumberFormatException ex) {
|
517 |
} catch(NumberFormatException ex) {
|
| 515 |
Window.alert("Invalid weight format/value. Value shoule be greater than zero");
|
518 |
Window.alert("Invalid weight format/value. Value shoule be greater than zero");
|
| 516 |
return;
|
519 |
return;
|
| 517 |
}
|
520 |
}
|
| 518 |
try {
|
521 |
try {
|
| - |
|
522 |
if(!packQuantity.getText().trim().isEmpty()) {
|
| - |
|
523 |
long packQuantityValue = Long.parseLong(packQuantity.getText().trim());
|
| - |
|
524 |
if(packQuantityValue < 1) {
|
| - |
|
525 |
throw new NumberFormatException("Illegal value of PackQuantity");
|
| - |
|
526 |
}
|
| - |
|
527 |
item.setPackQuantity(packQuantityValue);
|
| - |
|
528 |
}
|
| - |
|
529 |
else{
|
| - |
|
530 |
Window.alert("Invalid PackQuantity format/value. Value should can't be empty");
|
| - |
|
531 |
return;
|
| - |
|
532 |
}
|
| - |
|
533 |
} catch(NumberFormatException ex) {
|
| - |
|
534 |
Window.alert("Invalid PackQuantity format/value. Value should be greater than zero");
|
| - |
|
535 |
return;
|
| - |
|
536 |
}
|
| - |
|
537 |
try {
|
| 519 |
if(!startDate.getTextBox().getText().trim().equals("")) {
|
538 |
if(!startDate.getTextBox().getText().trim().equals("")) {
|
| 520 |
item.setStartDate(startDate.getValue().getTime());
|
539 |
item.setStartDate(startDate.getValue().getTime());
|
| 521 |
}
|
540 |
}
|
| 522 |
} catch(Exception ex) {
|
541 |
} catch(Exception ex) {
|
| 523 |
Window.alert("Invalid start date format");
|
542 |
Window.alert("Invalid start date format");
|