Subversion Repositories SmartDukaan

Rev

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

Rev 6779 Rev 6813
Line 144... Line 144...
144
    @UiField FlexTable headerSimilarItems, tableSimilarItems;
144
    @UiField FlexTable headerSimilarItems, tableSimilarItems;
145
    @UiField ListBox preferredVendor;
145
    @UiField ListBox preferredVendor;
146
    @UiField Button comingSoonButton;
146
    @UiField Button comingSoonButton;
147
    @UiField FlexTable headerVouchers, tableVouchers;
147
    @UiField FlexTable headerVouchers, tableVouchers;
148
    @UiField FlexTable headerIgnoredWarehouse,tableIgnoredWarehouse;
148
    @UiField FlexTable headerIgnoredWarehouse,tableIgnoredWarehouse;
-
 
149
    @UiField TextBox minStockLevel, numOfDaysStock;
149
 
150
 
150
    public ItemDetails(Item item){
151
    public ItemDetails(Item item){
151
        this();
152
        this();
152
        setItemDetails(item);
153
        setItemDetails(item);
153
    }
154
    }
Line 256... Line 257...
256
        bestDealsText.setText(item.getBestDealsText());
257
        bestDealsText.setText(item.getBestDealsText());
257
        bestDealsDetailsText.setText(item.getBestDealsDetailsText());
258
        bestDealsDetailsText.setText(item.getBestDealsDetailsText());
258
        bestDealsDetailsLink.setText(item.getBestDealsDetailsLink());
259
        bestDealsDetailsLink.setText(item.getBestDealsDetailsLink());
259
        bestDealsValue.setText(item.getBestDealsValue() != null ? item.getBestDealsValue()+"" : "");
260
        bestDealsValue.setText(item.getBestDealsValue() != null ? item.getBestDealsValue()+"" : "");
260
        bestSellingRank.setText(item.getBestSellingRank() != null ? item.getBestSellingRank()+"" : "");
261
        bestSellingRank.setText(item.getBestSellingRank() != null ? item.getBestSellingRank()+"" : "");
-
 
262
        minStockLevel.setText(item.getMinStockLevel() != null ? item.getMinStockLevel()+"" : "");
-
 
263
        numOfDaysStock.setText(item.getNumOfDaysStock() != null ? item.getNumOfDaysStock()+"" : "");
261
        defaultForEntity.setValue(item.isDefaultForEntity());
264
        defaultForEntity.setValue(item.isDefaultForEntity());
262
        risky.setValue(item.isRisky());
265
        risky.setValue(item.isRisky());
263
        
266
        
264
        itemStatus.setText(item.getItemStatus());
267
        itemStatus.setText(item.getItemStatus());
265
 
268
 
Line 1284... Line 1287...
1284
            Window.alert("Invalid best selling rank format");
1287
            Window.alert("Invalid best selling rank format");
1285
            return false;
1288
            return false;
1286
        }
1289
        }
1287
        newItem.setDefaultForEntity(defaultForEntity.getValue());
1290
        newItem.setDefaultForEntity(defaultForEntity.getValue());
1288
        newItem.setRisky(risky.getValue());
1291
        newItem.setRisky(risky.getValue());
-
 
1292
        
-
 
1293
        try {
-
 
1294
            if(!minStockLevel.getText().trim().equals("")) {
-
 
1295
                long minStock = Long.parseLong(minStockLevel.getText().trim());
-
 
1296
                if(minStock < 0) {
-
 
1297
                    throw new NumberFormatException("Negative value of Minimum Stock Level");
-
 
1298
                }
-
 
1299
                newItem.setMinStockLevel(minStock);
-
 
1300
            }
-
 
1301
        } catch(NumberFormatException ex) {
-
 
1302
            Window.alert("Invalid minimum Stock Level format");
-
 
1303
            return false;
-
 
1304
        }
-
 
1305
        
-
 
1306
        try {
-
 
1307
            if(!numOfDaysStock.getText().trim().equals("")) {
-
 
1308
                long numDays = Long.parseLong(numOfDaysStock.getText().trim());
-
 
1309
                if(numDays < 0) {
-
 
1310
                    throw new NumberFormatException("Negative value of num Of Days ");
-
 
1311
                }
-
 
1312
                newItem.setNumOfDaysStock(new Long(numDays).intValue());
-
 
1313
            }
-
 
1314
        } catch(NumberFormatException ex) {
-
 
1315
            Window.alert("Invalid number Of Days format");
-
 
1316
            return false;
-
 
1317
        }
1289
        newItem.setShowSellingPrice(showSellingPrice.getValue());
1318
        newItem.setShowSellingPrice(showSellingPrice.getValue());
1290
        try {
1319
        try {
1291
            String expectedDelayText = expectedDelay.getText().trim();
1320
            String expectedDelayText = expectedDelay.getText().trim();
1292
            if(!expectedDelayText.equals("")){
1321
            if(!expectedDelayText.equals("")){
1293
                newItem.setExpectedDelay(Integer.parseInt(expectedDelayText));
1322
                newItem.setExpectedDelay(Integer.parseInt(expectedDelayText));
Line 1504... Line 1533...
1504
            sb.append("\n-Best Deal Value");
1533
            sb.append("\n-Best Deal Value");
1505
        }
1534
        }
1506
        if(!checkParameterIfEqual(newItem.getBestSellingRank(), item.getBestSellingRank())) {
1535
        if(!checkParameterIfEqual(newItem.getBestSellingRank(), item.getBestSellingRank())) {
1507
            sb.append("\n-Best Selling Rank");
1536
            sb.append("\n-Best Selling Rank");
1508
        }
1537
        }
-
 
1538
        if(!checkParameterIfEqual(newItem.getMinStockLevel(), item.getMinStockLevel())) {
-
 
1539
            sb.append("\n-Min Stock Level");
-
 
1540
        }
-
 
1541
        if(!checkParameterIfEqual(newItem.getNumOfDaysStock(), item.getNumOfDaysStock())) {
-
 
1542
            sb.append("\n-Number Of Days Of Stock");
-
 
1543
        }
1509
        if(item.isDefaultForEntity() != defaultForEntity.getValue()) {
1544
        if(item.isDefaultForEntity() != defaultForEntity.getValue()) {
1510
            sb.append("\n-Default For Entity Flag");
1545
            sb.append("\n-Default For Entity Flag");
1511
        }
1546
        }
1512
        if(item.isRisky() != risky.getValue()) {
1547
        if(item.isRisky() != risky.getValue()) {
1513
            sb.append("\n-Risky Flag");
1548
            sb.append("\n-Risky Flag");