Subversion Repositories SmartDukaan

Rev

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

Rev 2431 Rev 2489
Line 129... Line 129...
129
        if(item.getModelNumber() == null || item.getModelNumber().isEmpty()) {
129
        if(item.getModelNumber() == null || item.getModelNumber().isEmpty()) {
130
            Window.alert("Model Number cannot be empty.");
130
            Window.alert("Model Number cannot be empty.");
131
            return false;
131
            return false;
132
        }
132
        }
133
        
133
        
134
        if(item.getSellingPrice() != -1 && item.getMrp() != -1 && item.getSellingPrice() > item.getMrp()) {
134
        if(item.getSellingPrice() != null && item.getMrp() != null && item.getSellingPrice() > item.getMrp()) {
135
            Window.alert("Selling price cannot be more than MRP");
135
            Window.alert("Selling price cannot be more than MRP");
136
            return false;
136
            return false;
137
        }
137
        }
138
        if(item.getVendorPricesMap() != null && !item.getVendorPricesMap().isEmpty()) {
138
        if(item.getVendorPricesMap() != null && !item.getVendorPricesMap().isEmpty()) {
139
            for(VendorPricings v : item.getVendorPricesMap().values()) {
139
            for(VendorPricings v : item.getVendorPricesMap().values()) {
140
                if(item.getMrp() != -1 && item.getMrp() < v.getMop()) {
140
                if(item.getMrp() != null && item.getMrp() < v.getMop()) {
141
                    Window.alert("MRP cannot be less than MOP. Vendor: " + Utils.getVendorDesc(v.getVendorId()));
141
                    Window.alert("MRP cannot be less than MOP. Vendor: " + Utils.getVendorDesc(v.getVendorId()));
142
                    return false;
142
                    return false;
143
                }
143
                }
144
                if(v.getTransferPrice() > v.getMop()) {
144
                if(v.getTransferPrice() > v.getMop()) {
145
                    Window.alert("Transfer Price cannot be more than MOP. Vendor: " + Utils.getVendorDesc(v.getVendorId()));
145
                    Window.alert("Transfer Price cannot be more than MOP. Vendor: " + Utils.getVendorDesc(v.getVendorId()));