Subversion Repositories SmartDukaan

Rev

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

Rev 3567 Rev 4413
Line 89... Line 89...
89
    @UiField FlexTable headerVendorItemKey, tableVendorItemKey;
89
    @UiField FlexTable headerVendorItemKey, tableVendorItemKey;
90
    @UiField FlexTable headerVendorPrices, tableVendorPrices;
90
    @UiField FlexTable headerVendorPrices, tableVendorPrices;
91
    @UiField FlexTable headerSourcePrices, tableSourcePrices;
91
    @UiField FlexTable headerSourcePrices, tableSourcePrices;
92
    @UiField TextBox bestSellingRank;
92
    @UiField TextBox bestSellingRank;
93
    @UiField TextBox expectedDelay;
93
    @UiField TextBox expectedDelay;
94
    @UiField TextBox preferredWarehouse;
94
    @UiField TextBox preferredWarehouse, defaultWarehouse;
95
    @UiField CheckBox defaultForEntity, risky;
95
    @UiField CheckBox defaultForEntity, risky, warehouseStickiness;
96
    @UiField DateBox startDate;
96
    @UiField DateBox startDate;
97
 
97
 
98
    public ItemDetails(Item item){
98
    public ItemDetails(Item item){
99
        this();
99
        this();
100
        setItemDetails(item);
100
        setItemDetails(item);
Line 133... Line 133...
133
        mrp.setText(item.getMrp() != null ? item.getMrp()+"" : "");
133
        mrp.setText(item.getMrp() != null ? item.getMrp()+"" : "");
134
        sellingPrice.setText(item.getSellingPrice() != null ? item.getSellingPrice()+"" : "");
134
        sellingPrice.setText(item.getSellingPrice() != null ? item.getSellingPrice()+"" : "");
135
        weight.setText(item.getWeight() != null ? item.getWeight()+"" : "");
135
        weight.setText(item.getWeight() != null ? item.getWeight()+"" : "");
136
        expectedDelay.setValue(item.getExpectedDelay()+"");
136
        expectedDelay.setValue(item.getExpectedDelay()+"");
137
        preferredWarehouse.setValue(item.getPreferredWarehouse()+"");
137
        preferredWarehouse.setValue(item.getPreferredWarehouse()+"");
-
 
138
        defaultWarehouse.setValue(item.getDefaultWarehouse()+"");
-
 
139
        warehouseStickiness.setValue(item.isWarehouseStickiness());
138
        
140
        
139
        startDate.setValue(new Date(item.getStartDate()));
141
        startDate.setValue(new Date(item.getStartDate()));
140
        addedOn.setText(Utils.getDisplayableDate(item.getAddedOn()));
142
        addedOn.setText(Utils.getDisplayableDate(item.getAddedOn()));
141
        retireDate.setText(Utils.getDisplayableDate(item.getRetireDate()));
143
        retireDate.setText(Utils.getDisplayableDate(item.getRetireDate()));
142
        updatedOn.setText(Utils.getDisplayableDate(item.getUpdatedOn()));
144
        updatedOn.setText(Utils.getDisplayableDate(item.getUpdatedOn()));
Line 666... Line 668...
666
        }catch(NumberFormatException nfe){
668
        }catch(NumberFormatException nfe){
667
            Window.alert("Invalid Preferred Warehouse");
669
            Window.alert("Invalid Preferred Warehouse");
668
            return false;
670
            return false;
669
        }
671
        }
670
        
672
        
-
 
673
        try {
-
 
674
            String defaultWarehouseText = defaultWarehouse.getText().trim();
-
 
675
            if(!defaultWarehouseText.equals("")){
-
 
676
                newItem.setDefaultWarehouse(Long.parseLong(defaultWarehouseText) + "");
-
 
677
            }
-
 
678
        }catch(NumberFormatException nfe){
-
 
679
            Window.alert("Invalid Default Warehouse");
-
 
680
            return false;
-
 
681
        }
-
 
682
        
-
 
683
        newItem.setWarehouseStickiness(warehouseStickiness.getValue());
-
 
684
        
671
        /*Create an instance of VendorPricings for each row in vendor pricing table. Set the vendor prices to the instance.
685
        /*Create an instance of VendorPricings for each row in vendor pricing table. Set the vendor prices to the instance.
672
          Add the instance to map and set the map to the item instance created above.*/
686
          Add the instance to map and set the map to the item instance created above.*/
673
        Map<Long, VendorPricings> vendorPrices = new HashMap<Long, VendorPricings>();
687
        Map<Long, VendorPricings> vendorPrices = new HashMap<Long, VendorPricings>();
674
        VendorPricings v;
688
        VendorPricings v;
675
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
689
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
Line 859... Line 873...
859
            sb.append("\n-Expected Delay");
873
            sb.append("\n-Expected Delay");
860
        }
874
        }
861
        if(!checkParameterIfEqual(newItem.getPreferredWarehouse(), item.getPreferredWarehouse())) {
875
        if(!checkParameterIfEqual(newItem.getPreferredWarehouse(), item.getPreferredWarehouse())) {
862
            sb.append("\n-Preferred Warehouse");
876
            sb.append("\n-Preferred Warehouse");
863
        }
877
        }
-
 
878
        if(!checkParameterIfEqual(newItem.getDefaultWarehouse(), item.getDefaultWarehouse())) {
-
 
879
            sb.append("\n-Default Warehouse");
-
 
880
        }
-
 
881
        if(item.isWarehouseStickiness() != warehouseStickiness.getValue()) {
-
 
882
            sb.append("\n-Warehouse Stickiness Flag");
-
 
883
        }
864
        
884
        
865
        VendorPricings vendorPricings;
885
        VendorPricings vendorPricings;
866
        long vendorId;
886
        long vendorId;
867
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
887
        for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
868
            vendorId = Long.parseLong(tableVendorPrices.getText(row, TABLE_INDEX_PRICING_VENDORID));
888
            vendorId = Long.parseLong(tableVendorPrices.getText(row, TABLE_INDEX_PRICING_VENDORID));