Subversion Repositories SmartDukaan

Rev

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

Rev 13748 Rev 18048
Line 167... Line 167...
167
	@UiField TextBox asin;
167
	@UiField TextBox asin;
168
	@UiField TextBox holdInventory;
168
	@UiField TextBox holdInventory;
169
	@UiField TextBox defaultInventory;
169
	@UiField TextBox defaultInventory;
170
	@UiField TextBox dealFreebieItemId;
170
	@UiField TextBox dealFreebieItemId;
171
	@UiField TextBox dealPrice;
171
	@UiField TextBox dealPrice;
-
 
172
	@UiField TextBox packQuantity;
172
 
173
 
173
	public ItemDetails(Item item){
174
	public ItemDetails(Item item){
174
		this();
175
		this();
175
		setItemDetails(item);
176
		setItemDetails(item);
176
	}
177
	}
Line 357... Line 358...
357
		}
358
		}
358
		else{
359
		else{
359
			isCodOnDeal.setValue(false);
360
			isCodOnDeal.setValue(false);
360
		}
361
		}
361
		dealText.setText(item.getPrivateDeal().getDealText());
362
		dealText.setText(item.getPrivateDeal().getDealText());
-
 
363
		packQuantity.setText(item.getPackQuantity().toString());
362
		initVatDetailsHeader();
364
		initVatDetailsHeader();
363
		updateVatDetailsTable(item.getStateNameVatPercentageMap());
365
		updateVatDetailsTable(item.getStateNameVatPercentageMap());
364
		updateAvailabilityTable(item.getItemInventory());
366
		updateAvailabilityTable(item.getItemInventory());
365
		updateVendorKeysTable(item.getVendorKeysMap());
367
		updateVendorKeysTable(item.getVendorKeysMap());
366
		updateVendorPricingTable(item.getVendorPricesMap());
368
		updateVendorPricingTable(item.getVendorPricesMap());
Line 1517... Line 1519...
1517
			}
1519
			}
1518
		} catch(NumberFormatException ex) {
1520
		} catch(NumberFormatException ex) {
1519
			Window.alert("Invalid Selling Price format/value. Value shoule be greater than zero");
1521
			Window.alert("Invalid Selling Price format/value. Value shoule be greater than zero");
1520
			return false;
1522
			return false;
1521
		}
1523
		}
-
 
1524
		try {
-
 
1525
			if(!packQuantity.getText().trim().isEmpty()) {
-
 
1526
				long packQuantityValue = Long.parseLong(packQuantity.getText().trim());
-
 
1527
				if(packQuantityValue < 1) {
-
 
1528
					throw new NumberFormatException("Illegal value of PackQuantity");
-
 
1529
				}
-
 
1530
				newItem.setPackQuantity(packQuantityValue);
-
 
1531
			}
-
 
1532
			else{
-
 
1533
				Window.alert("Invalid PackQuantity format/value. Value should can't be empty");
-
 
1534
				return false;
-
 
1535
			}
-
 
1536
		} catch(NumberFormatException ex) {
-
 
1537
			Window.alert("Invalid PackQuantity format/value. Value should be greater than zero");
-
 
1538
			return false;
-
 
1539
		}
1522
		if(newItem.getPrivateDeal().getDealPrice()!=0 && newItem.getPrivateDeal().getDealPrice() >= newItem.getSellingPrice()){
1540
		if(newItem.getPrivateDeal().getDealPrice()!=0 && newItem.getPrivateDeal().getDealPrice() >= newItem.getSellingPrice()){
1523
			Window.alert("Deal Price can't be more than Selling Price");
1541
			Window.alert("Deal Price can't be more than Selling Price");
1524
			return false;
1542
			return false;
1525
		}
1543
		}
1526
		try {
1544
		try {
Line 1957... Line 1975...
1957
			sb.append("\n-Hold Inventory");
1975
			sb.append("\n-Hold Inventory");
1958
		}
1976
		}
1959
		if(!checkParameterIfEqual(newItem.getDefaultInventory(), item.getDefaultInventory())) {
1977
		if(!checkParameterIfEqual(newItem.getDefaultInventory(), item.getDefaultInventory())) {
1960
			sb.append("\n-Default Inventory");
1978
			sb.append("\n-Default Inventory");
1961
		}
1979
		}
-
 
1980
		if(newItem.getPackQuantity()!=item.getPackQuantity()) {
-
 
1981
			sb.append("\n-PackQuantity");
-
 
1982
		}
-
 
1983
		
1962
		VendorPricings vendorPricings;
1984
		VendorPricings vendorPricings;
1963
		long vendorId;
1985
		long vendorId;
1964
		boolean vendorPricingsChanged = false;
1986
		boolean vendorPricingsChanged = false;
1965
		for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
1987
		for(int row = 0; row < tableVendorPrices.getRowCount(); row++) {
1966
			vendorId = Long.parseLong(tableVendorPrices.getText(row, TABLE_INDEX_PRICING_VENDORID));
1988
			vendorId = Long.parseLong(tableVendorPrices.getText(row, TABLE_INDEX_PRICING_VENDORID));
Line 2007... Line 2029...
2007
			}
2029
			}
2008
			if(sourcePricings.getSellingPrice() != Double.parseDouble(tableSourcePrices.getText(row, TABLE_INDEX_SOURCE_PRICING_SELLING_PRICE))) {
2030
			if(sourcePricings.getSellingPrice() != Double.parseDouble(tableSourcePrices.getText(row, TABLE_INDEX_SOURCE_PRICING_SELLING_PRICE))) {
2009
				sourcePricingsChanged = true;
2031
				sourcePricingsChanged = true;
2010
				sb.append("\n-Selling Price (Source:" + sourceId + ")");
2032
				sb.append("\n-Selling Price (Source:" + sourceId + ")");
2011
			}
2033
			}
-
 
2034
			
2012
		}
2035
		}
2013
		if(sourcePricingsChanged){
2036
		if(sourcePricingsChanged){
2014
			sb.append("\n-Source Pricing");
2037
			sb.append("\n-Source Pricing");
2015
			optionalChangedValMap.put(OPTIONAL_SOURCE_PRICING, newItem.getSourcePricesMap());
2038
			optionalChangedValMap.put(OPTIONAL_SOURCE_PRICING, newItem.getSourcePricesMap());
2016
		}
2039
		}