| Line 17... |
Line 17... |
| 17 |
import java.util.Map;
|
17 |
import java.util.Map;
|
| 18 |
import java.util.Map.Entry;
|
18 |
import java.util.Map.Entry;
|
| 19 |
|
19 |
|
| 20 |
import com.google.gwt.core.client.GWT;
|
20 |
import com.google.gwt.core.client.GWT;
|
| 21 |
import com.google.gwt.dom.client.Style.Unit;
|
21 |
import com.google.gwt.dom.client.Style.Unit;
|
| - |
|
22 |
import com.google.gwt.event.dom.client.ChangeEvent;
|
| - |
|
23 |
import com.google.gwt.event.dom.client.ChangeHandler;
|
| 22 |
import com.google.gwt.event.dom.client.ClickEvent;
|
24 |
import com.google.gwt.event.dom.client.ClickEvent;
|
| 23 |
import com.google.gwt.event.dom.client.ClickHandler;
|
25 |
import com.google.gwt.event.dom.client.ClickHandler;
|
| 24 |
import com.google.gwt.resources.client.CssResource;
|
26 |
import com.google.gwt.resources.client.CssResource;
|
| 25 |
import com.google.gwt.uibinder.client.UiBinder;
|
27 |
import com.google.gwt.uibinder.client.UiBinder;
|
| 26 |
import com.google.gwt.uibinder.client.UiField;
|
28 |
import com.google.gwt.uibinder.client.UiField;
|
| Line 137... |
Line 139... |
| 137 |
|
139 |
|
| 138 |
@UiField ItemDetailStyle style;
|
140 |
@UiField ItemDetailStyle style;
|
| 139 |
@UiField Label itemId;
|
141 |
@UiField Label itemId;
|
| 140 |
@UiField TextBox brand, modelNumber, modelName, color;
|
142 |
@UiField TextBox brand, modelNumber, modelName, color;
|
| 141 |
@UiField Label contentCategory, catalogItemId, productGroup;
|
143 |
@UiField Label contentCategory, catalogItemId, productGroup;
|
| 142 |
@UiField TextBox statusDesc, comments;
|
144 |
@UiField TextBox statusDesc, comments, dealText;
|
| 143 |
@UiField TextBox sellingPrice, mrp, weight;
|
145 |
@UiField TextBox sellingPrice, mrp, weight;
|
| 144 |
@UiField Label addedOn, retireDate, updatedOn;
|
146 |
@UiField Label addedOn, retireDate, updatedOn;
|
| 145 |
@UiField Label itemStatus;
|
147 |
@UiField Label itemStatus;
|
| 146 |
@UiField TextBox bestDealsText, bestDealsValue ,bestDealsDetailsText,bestDealsDetailsLink;
|
148 |
@UiField TextBox bestDealsText, bestDealsValue ,bestDealsDetailsText,bestDealsDetailsLink;
|
| 147 |
@UiField FlexTable headerAvailability, availabilityTable;
|
149 |
@UiField FlexTable headerAvailability, availabilityTable;
|
| 148 |
@UiField FlexTable headerVendorItemKey, tableVendorItemKey;
|
150 |
@UiField FlexTable headerVendorItemKey, tableVendorItemKey;
|
| 149 |
@UiField FlexTable headerVendorPrices, tableVendorPrices;
|
151 |
@UiField FlexTable headerVendorPrices, tableVendorPrices;
|
| 150 |
@UiField FlexTable headerSourcePrices, tableSourcePrices;
|
152 |
@UiField FlexTable headerSourcePrices, tableSourcePrices;
|
| 151 |
@UiField TextBox bestSellingRank;
|
153 |
@UiField TextBox bestSellingRank,dealRank;
|
| 152 |
@UiField TextBox expectedDelay;
|
154 |
@UiField TextBox expectedDelay;
|
| 153 |
@UiField CheckBox defaultForEntity, risky, warehouseStickiness, itemType, hasItemNo, showSellingPrice, holdOverride;
|
155 |
@UiField CheckBox defaultForEntity, risky, warehouseStickiness, itemType, hasItemNo, showSellingPrice, holdOverride,isCodOnDeal,isDealActive;
|
| 154 |
@UiField DateBox startDate, expectedArrivalDate, comingSoonStartDate;
|
156 |
@UiField DateBox startDate, expectedArrivalDate, comingSoonStartDate,dealStartDate,dealEndDate;
|
| 155 |
@UiField FlexTable headerSimilarItems, tableSimilarItems;
|
157 |
@UiField FlexTable headerSimilarItems, tableSimilarItems;
|
| 156 |
@UiField ListBox preferredVendor,preferredInsurer;
|
158 |
@UiField ListBox preferredVendor,preferredInsurer,dealTextOption,dealFreebieOption;
|
| 157 |
@UiField Button comingSoonButton;
|
159 |
@UiField Button comingSoonButton;
|
| 158 |
@UiField FlexTable headerVouchers, tableVouchers;
|
160 |
@UiField FlexTable headerVouchers, tableVouchers;
|
| 159 |
@UiField FlexTable headerIgnoredWarehouse,tableIgnoredWarehouse;
|
161 |
@UiField FlexTable headerIgnoredWarehouse,tableIgnoredWarehouse;
|
| 160 |
@UiField FlexTable headerVatDetails,tableVatDetails;
|
162 |
@UiField FlexTable headerVatDetails,tableVatDetails;
|
| 161 |
@UiField TextBox minStockLevel, numOfDaysStock;
|
163 |
@UiField TextBox minStockLevel, numOfDaysStock;
|
| 162 |
@UiField TextBox lastNdaySale, websiteLastNdaySale, amazonLastNdaySale, ebayLastNdaySale, snapdealLastNdaySale, flipkartLastNdaySale;
|
164 |
@UiField TextBox lastNdaySale, websiteLastNdaySale, amazonLastNdaySale, ebayLastNdaySale, snapdealLastNdaySale, flipkartLastNdaySale;
|
| 163 |
@UiField TextBox freebieItemId;
|
165 |
@UiField TextBox freebieItemId;
|
| 164 |
@UiField TextBox asin;
|
166 |
@UiField TextBox asin;
|
| 165 |
@UiField TextBox holdInventory;
|
167 |
@UiField TextBox holdInventory;
|
| 166 |
@UiField TextBox defaultInventory;
|
168 |
@UiField TextBox defaultInventory;
|
| - |
|
169 |
@UiField TextBox dealFreebieItemId;
|
| - |
|
170 |
@UiField TextBox dealPrice;
|
| 167 |
|
171 |
|
| 168 |
public ItemDetails(Item item){
|
172 |
public ItemDetails(Item item){
|
| 169 |
this();
|
173 |
this();
|
| 170 |
setItemDetails(item);
|
174 |
setItemDetails(item);
|
| 171 |
}
|
175 |
}
|
| Line 213... |
Line 217... |
| 213 |
|
217 |
|
| 214 |
statusDesc.setText(item.getItemStatusDesc());
|
218 |
statusDesc.setText(item.getItemStatusDesc());
|
| 215 |
contentCategory.setText(item.getContentCategory()+"");
|
219 |
contentCategory.setText(item.getContentCategory()+"");
|
| 216 |
comments.setText(item.getComments());
|
220 |
comments.setText(item.getComments());
|
| 217 |
catalogItemId.setText(item.getCatalogItemId() + "");
|
221 |
catalogItemId.setText(item.getCatalogItemId() + "");
|
| - |
|
222 |
dealTextOption.clear();
|
| - |
|
223 |
dealTextOption.addItem("None","0");
|
| - |
|
224 |
dealTextOption.addItem("Existing Best Deals Text","1");
|
| - |
|
225 |
dealTextOption.addItem("Other","2");
|
| - |
|
226 |
dealTextOption.setSelectedIndex(item.getPrivateDeal().getDealTextOption().intValue());
|
| - |
|
227 |
if(!item.getPrivateDeal().getDealText().equals("")){
|
| - |
|
228 |
dealText.setText(item.getPrivateDeal().getDealText()+"");
|
| - |
|
229 |
}
|
| - |
|
230 |
else{
|
| - |
|
231 |
dealText.setText("");
|
| - |
|
232 |
}
|
| - |
|
233 |
dealFreebieOption.clear();
|
| - |
|
234 |
dealFreebieOption.addItem("None","0");
|
| - |
|
235 |
dealFreebieOption.addItem("Existing Freebie","1");
|
| - |
|
236 |
dealFreebieOption.addItem("Other","2");
|
| - |
|
237 |
dealFreebieOption.setSelectedIndex(item.getPrivateDeal().getDealFreebieOption().intValue());
|
| - |
|
238 |
dealFreebieItemId.setText(item.getPrivateDeal().getDealFreebieItemId()+"");
|
| 218 |
preferredInsurer.clear();
|
239 |
preferredInsurer.clear();
|
| 219 |
preferredVendor.clear();
|
240 |
preferredVendor.clear();
|
| 220 |
int index = -1;
|
241 |
int index = -1;
|
| 221 |
if (item.getPreferredVendor() == null) {
|
242 |
if (item.getPreferredVendor() == null) {
|
| 222 |
index++;
|
243 |
index++;
|
| Line 300... |
Line 321... |
| 300 |
itemStatus.setText(item.getItemStatus());
|
321 |
itemStatus.setText(item.getItemStatus());
|
| 301 |
freebieItemId.setText(item.getFreebieItemId().toString());
|
322 |
freebieItemId.setText(item.getFreebieItemId().toString());
|
| 302 |
asin.setText(item.getAsin());
|
323 |
asin.setText(item.getAsin());
|
| 303 |
holdInventory.setText(Long.toString(item.getHoldInventory()));
|
324 |
holdInventory.setText(Long.toString(item.getHoldInventory()));
|
| 304 |
defaultInventory.setText(Long.toString(item.getDefaultInventory()));
|
325 |
defaultInventory.setText(Long.toString(item.getDefaultInventory()));
|
| - |
|
326 |
dealPrice.setText(item.getPrivateDeal().getDealPrice() != 0 ? item.getPrivateDeal().getDealPrice()+"" : "");
|
| - |
|
327 |
if(item.getPrivateDeal().isActive()){
|
| - |
|
328 |
isDealActive.setValue(true);
|
| - |
|
329 |
}
|
| - |
|
330 |
else{
|
| - |
|
331 |
isDealActive.setValue(false);
|
| - |
|
332 |
}
|
| - |
|
333 |
if(item.getPrivateDeal().getStartDate()!=null){
|
| - |
|
334 |
dealStartDate.setValue(new Date(item.getPrivateDeal().getStartDate()));
|
| - |
|
335 |
}
|
| - |
|
336 |
else{
|
| - |
|
337 |
dealStartDate.setValue(null);
|
| - |
|
338 |
}
|
| - |
|
339 |
if(item.getPrivateDeal().getEndDate()!=null){
|
| - |
|
340 |
dealEndDate.setValue(new Date(item.getPrivateDeal().getEndDate()));
|
| - |
|
341 |
}
|
| - |
|
342 |
else{
|
| - |
|
343 |
dealEndDate.setValue(null);
|
| - |
|
344 |
}
|
| - |
|
345 |
bestSellingRank.setText(item.getBestSellingRank() != null ? item.getBestSellingRank()+"" : "");
|
| - |
|
346 |
dealRank.setText(item.getPrivateDeal().getRank()!= 0L ? item.getPrivateDeal().getRank()+"" : "");
|
| - |
|
347 |
if(item.getPrivateDeal().isCod()){
|
| - |
|
348 |
isCodOnDeal.setValue(true);
|
| - |
|
349 |
}
|
| - |
|
350 |
else{
|
| - |
|
351 |
isCodOnDeal.setValue(false);
|
| - |
|
352 |
}
|
| - |
|
353 |
dealText.setText(item.getPrivateDeal().getDealText());
|
| 305 |
initVatDetailsHeader();
|
354 |
initVatDetailsHeader();
|
| 306 |
updateVatDetailsTable(item.getStateNameVatPercentageMap());
|
355 |
updateVatDetailsTable(item.getStateNameVatPercentageMap());
|
| 307 |
updateAvailabilityTable(item.getItemInventory());
|
356 |
updateAvailabilityTable(item.getItemInventory());
|
| 308 |
updateVendorKeysTable(item.getVendorKeysMap());
|
357 |
updateVendorKeysTable(item.getVendorKeysMap());
|
| 309 |
updateVendorPricingTable(item.getVendorPricesMap());
|
358 |
updateVendorPricingTable(item.getVendorPricesMap());
|
| 310 |
updateSourcePricingTable(item.getSourcePricesMap());
|
359 |
updateSourcePricingTable(item.getSourcePricesMap());
|
| 311 |
updateSimilarItemsTable(item.getSimilarItems());
|
360 |
updateSimilarItemsTable(item.getSimilarItems());
|
| 312 |
updateVoucherTable(item.getVouchersMap());
|
361 |
updateVoucherTable(item.getVouchersMap());
|
| 313 |
updateTableIgnoredWarehouse();
|
362 |
updateTableIgnoredWarehouse();
|
| - |
|
363 |
dealTextOption.addChangeHandler(new ChangeHandler(){
|
| - |
|
364 |
@Override
|
| - |
|
365 |
public void onChange(ChangeEvent event) {
|
| - |
|
366 |
if(dealTextOption.getSelectedIndex()!=2){
|
| - |
|
367 |
dealText.setEnabled(false);
|
| - |
|
368 |
}
|
| - |
|
369 |
else{
|
| - |
|
370 |
dealText.setEnabled(true);
|
| - |
|
371 |
}
|
| - |
|
372 |
if(dealTextOption.getSelectedIndex()==1){
|
| - |
|
373 |
dealText.setText(bestDealsText.getText());
|
| - |
|
374 |
}
|
| - |
|
375 |
if(dealTextOption.getSelectedIndex()==0){
|
| - |
|
376 |
dealText.setText("");
|
| - |
|
377 |
}
|
| - |
|
378 |
|
| - |
|
379 |
}}
|
| - |
|
380 |
);
|
| - |
|
381 |
dealFreebieOption.addChangeHandler(new ChangeHandler(){
|
| - |
|
382 |
@Override
|
| - |
|
383 |
public void onChange(ChangeEvent event) {
|
| - |
|
384 |
if(dealFreebieOption.getSelectedIndex()!=2){
|
| - |
|
385 |
dealFreebieItemId.setEnabled(false);
|
| - |
|
386 |
}
|
| - |
|
387 |
else{
|
| - |
|
388 |
dealFreebieItemId.setEnabled(true);
|
| - |
|
389 |
}
|
| - |
|
390 |
if(dealFreebieOption.getSelectedIndex()==1){
|
| - |
|
391 |
dealFreebieItemId.setText(freebieItemId.getText());
|
| - |
|
392 |
}
|
| - |
|
393 |
if(dealFreebieOption.getSelectedIndex()==0){
|
| - |
|
394 |
dealFreebieItemId.setText("");
|
| - |
|
395 |
}
|
| - |
|
396 |
|
| - |
|
397 |
}}
|
| - |
|
398 |
);
|
| 314 |
}
|
399 |
}
|
| 315 |
|
400 |
|
| 316 |
/**
|
401 |
/**
|
| 317 |
* initialise item availability table header.
|
402 |
* initialise item availability table header.
|
| 318 |
*/
|
403 |
*/
|
| Line 1268... |
Line 1353... |
| 1268 |
* <br>If update is successful, the old Item object is replaced with the new Item object.
|
1353 |
* <br>If update is successful, the old Item object is replaced with the new Item object.
|
| 1269 |
* @return true if new Item object is created successfully
|
1354 |
* @return true if new Item object is created successfully
|
| 1270 |
* <br>false if some error occurs due to NumberFormatException
|
1355 |
* <br>false if some error occurs due to NumberFormatException
|
| 1271 |
*/
|
1356 |
*/
|
| 1272 |
private boolean createNewItem() {
|
1357 |
private boolean createNewItem() {
|
| - |
|
1358 |
|
| 1273 |
newItem = new Item();
|
1359 |
newItem = new Item();
|
| 1274 |
newItem.setId(item.getId());
|
1360 |
newItem.setId(item.getId());
|
| 1275 |
newItem.setProductGroup(productGroup.getText().trim());
|
1361 |
newItem.setProductGroup(productGroup.getText().trim());
|
| 1276 |
newItem.setBrand(brand.getText().trim());
|
1362 |
newItem.setBrand(brand.getText().trim());
|
| 1277 |
newItem.setModelNumber(modelNumber.getText().trim());
|
1363 |
newItem.setModelNumber(modelNumber.getText().trim());
|
| 1278 |
newItem.setModelName(modelName.getText().trim());
|
1364 |
newItem.setModelName(modelName.getText().trim());
|
| 1279 |
newItem.setColor(color.getText().trim());
|
1365 |
newItem.setColor(color.getText().trim());
|
| 1280 |
newItem.setContentCategory(contentCategory.getText());
|
1366 |
newItem.setContentCategory(contentCategory.getText());
|
| 1281 |
newItem.setComments(comments.getText().trim());
|
1367 |
newItem.setComments(comments.getText().trim());
|
| 1282 |
newItem.setCatalogItemId(Long.parseLong(catalogItemId.getText()));
|
1368 |
newItem.setCatalogItemId(Long.parseLong(catalogItemId.getText()));
|
| - |
|
1369 |
in.shop2020.catalog.dashboard.shared.PrivateDeal privateDeal = new in.shop2020.catalog.dashboard.shared.PrivateDeal();
|
| - |
|
1370 |
Date dealStartDt = dealStartDate.getValue();
|
| - |
|
1371 |
Date dealEndDt = dealEndDate.getValue();
|
| - |
|
1372 |
try {
|
| - |
|
1373 |
if(!dealPrice.getText().trim().isEmpty()) {
|
| - |
|
1374 |
double dpValue = Double.parseDouble(dealPrice.getText().trim());
|
| - |
|
1375 |
if(dpValue <= 0) {
|
| - |
|
1376 |
throw new NumberFormatException("Negative value of Deal price");
|
| - |
|
1377 |
}
|
| - |
|
1378 |
privateDeal.setDealPrice(dpValue);
|
| - |
|
1379 |
}
|
| - |
|
1380 |
else{
|
| - |
|
1381 |
privateDeal.setDealPrice(0);
|
| - |
|
1382 |
}
|
| - |
|
1383 |
} catch(NumberFormatException ex) {
|
| - |
|
1384 |
Window.alert("Invalid Deal Price format/value. Value should be greater than zero");
|
| - |
|
1385 |
return false;
|
| - |
|
1386 |
}
|
| - |
|
1387 |
if(dealStartDt!=null && privateDeal.getDealPrice() >0){
|
| - |
|
1388 |
privateDeal.setStartDate(dealStartDt.getTime());
|
| - |
|
1389 |
}
|
| - |
|
1390 |
else if(dealStartDt!=null && privateDeal.getDealPrice()==0){
|
| - |
|
1391 |
Window.alert("Invalid Deal Price format/value. Value should be greater than zero");
|
| - |
|
1392 |
return false;
|
| - |
|
1393 |
}
|
| - |
|
1394 |
else if(dealStartDt==null && privateDeal.getDealPrice()>0){
|
| - |
|
1395 |
Window.alert("Enter valid Start Date");
|
| - |
|
1396 |
return false;
|
| - |
|
1397 |
}
|
| - |
|
1398 |
if(dealEndDt!=null && privateDeal.getDealPrice() >0){
|
| - |
|
1399 |
privateDeal.setEndDate(dealEndDt.getTime());
|
| - |
|
1400 |
}
|
| - |
|
1401 |
else if(dealEndDt!=null && privateDeal.getDealPrice()==0){
|
| - |
|
1402 |
Window.alert("Invalid Deal Price format/value. Value should be greater than zero");
|
| - |
|
1403 |
return false;
|
| - |
|
1404 |
}
|
| - |
|
1405 |
else if(dealEndDt==null && privateDeal.getDealPrice()>0){
|
| - |
|
1406 |
Window.alert("Enter valid End Date");
|
| - |
|
1407 |
return false;
|
| - |
|
1408 |
}
|
| - |
|
1409 |
if(dealEndDt!=null && dealStartDt!=null && dealEndDt.getTime() < dealStartDt.getTime()){
|
| - |
|
1410 |
Window.alert("End date can't be less than start date");
|
| - |
|
1411 |
return false;
|
| - |
|
1412 |
}
|
| - |
|
1413 |
try {
|
| - |
|
1414 |
if(dealFreebieOption.getSelectedIndex()==1 && freebieItemId.getText().trim().isEmpty()){
|
| - |
|
1415 |
Window.alert("Invalid Freebie ItemId");
|
| - |
|
1416 |
return false;
|
| - |
|
1417 |
}
|
| - |
|
1418 |
if(dealFreebieOption.getSelectedIndex()==2 && dealFreebieItemId.getText().trim().isEmpty()){
|
| - |
|
1419 |
Window.alert("Invalid Deal Freebie ItemId");
|
| - |
|
1420 |
return false;
|
| - |
|
1421 |
}
|
| - |
|
1422 |
if(!dealFreebieItemId.getText().trim().equals("")) {
|
| - |
|
1423 |
long dealFreeItemId = Long.parseLong(dealFreebieItemId.getText().trim());
|
| - |
|
1424 |
if(dealFreeItemId < 0) {
|
| - |
|
1425 |
throw new NumberFormatException("Negative value of dealFreebieItemId ");
|
| - |
|
1426 |
}
|
| - |
|
1427 |
privateDeal.setDealFreebieItemId(dealFreeItemId);
|
| - |
|
1428 |
if(dealFreebieOption.getSelectedIndex()==1){
|
| - |
|
1429 |
if(Long.parseLong(freebieItemId.getText().trim()) < 0) {
|
| - |
|
1430 |
throw new NumberFormatException("Negative value of dealFreebieItemId ");
|
| - |
|
1431 |
}
|
| - |
|
1432 |
privateDeal.setDealFreebieItemId(Long.parseLong(freebieItemId.getText().trim()));
|
| - |
|
1433 |
}
|
| - |
|
1434 |
privateDeal.setDealFreebieOption(Long.valueOf(dealFreebieOption.getSelectedIndex()));
|
| - |
|
1435 |
}
|
| - |
|
1436 |
else{
|
| - |
|
1437 |
privateDeal.setDealFreebieItemId(0L);
|
| - |
|
1438 |
privateDeal.setDealFreebieOption(Long.valueOf(dealFreebieOption.getSelectedIndex()));
|
| - |
|
1439 |
}
|
| - |
|
1440 |
} catch(NumberFormatException ex) {
|
| - |
|
1441 |
Window.alert("Invalid deal freebie ItemId");
|
| - |
|
1442 |
return false;
|
| - |
|
1443 |
}
|
| - |
|
1444 |
if(dealTextOption.getSelectedIndex()==1 && bestDealsText.getText().trim().isEmpty()){
|
| - |
|
1445 |
Window.alert("Invalid Best Deals Text");
|
| - |
|
1446 |
return false;
|
| - |
|
1447 |
}
|
| - |
|
1448 |
else if(dealTextOption.getSelectedIndex()==1){
|
| - |
|
1449 |
privateDeal.setDealText(bestDealsText.getText().trim());
|
| - |
|
1450 |
privateDeal.setDealTextOption((long) dealTextOption.getSelectedIndex());
|
| - |
|
1451 |
}
|
| - |
|
1452 |
else if(dealTextOption.getSelectedIndex()==2 && dealText.getText().trim().isEmpty()){
|
| - |
|
1453 |
Window.alert("Please enter some deal Text");
|
| - |
|
1454 |
return false;
|
| - |
|
1455 |
}
|
| - |
|
1456 |
else{
|
| - |
|
1457 |
privateDeal.setDealText(dealText.getText().trim());
|
| - |
|
1458 |
privateDeal.setDealTextOption((long) dealTextOption.getSelectedIndex());
|
| - |
|
1459 |
}
|
| - |
|
1460 |
privateDeal.setCod(isCodOnDeal.getValue());
|
| - |
|
1461 |
privateDeal.setActive(isDealActive.getValue());
|
| - |
|
1462 |
try{
|
| - |
|
1463 |
if(dealRank.getText().trim().isEmpty()){
|
| - |
|
1464 |
privateDeal.setRank(0L);
|
| - |
|
1465 |
}
|
| - |
|
1466 |
else{
|
| - |
|
1467 |
privateDeal.setRank(Long.parseLong(dealRank.getText().trim()));
|
| - |
|
1468 |
}
|
| - |
|
1469 |
}
|
| - |
|
1470 |
catch(NumberFormatException nex){
|
| - |
|
1471 |
Window.alert("Invalid Deals Rank");
|
| - |
|
1472 |
return false;
|
| - |
|
1473 |
}
|
| - |
|
1474 |
newItem.setPrivateDeal(privateDeal);
|
| - |
|
1475 |
if(newItem.getPrivateDeal().getDealPrice()==0 && (newItem.getPrivateDeal().getDealPrice()!=item.getPrivateDeal().getDealPrice())){
|
| - |
|
1476 |
Window.alert("Deal Price can't be zero");
|
| - |
|
1477 |
return false;
|
| 1283 |
|
1478 |
}
|
| 1284 |
try {
|
1479 |
try {
|
| 1285 |
if(!mrp.getText().trim().isEmpty()) {
|
1480 |
if(!mrp.getText().trim().isEmpty()) {
|
| 1286 |
double mrpValue = Double.parseDouble(mrp.getText().trim());
|
1481 |
double mrpValue = Double.parseDouble(mrp.getText().trim());
|
| 1287 |
if(mrpValue <= 0) {
|
1482 |
if(mrpValue <= 0) {
|
| 1288 |
throw new NumberFormatException("Negative value of MRP");
|
1483 |
throw new NumberFormatException("Negative value of MRP");
|
| Line 1312... |
Line 1507... |
| 1312 |
throw new NumberFormatException("Negative value of Weight");
|
1507 |
throw new NumberFormatException("Negative value of Weight");
|
| 1313 |
}
|
1508 |
}
|
| 1314 |
newItem.setWeight(wtValue);
|
1509 |
newItem.setWeight(wtValue);
|
| 1315 |
}
|
1510 |
}
|
| 1316 |
} catch(NumberFormatException ex) {
|
1511 |
} catch(NumberFormatException ex) {
|
| 1317 |
Window.alert("Invalid weight format/value. Value shoule be greater than zero");
|
1512 |
Window.alert("Invalid weight format/value. Value should be greater than zero");
|
| 1318 |
return false;
|
1513 |
return false;
|
| 1319 |
}
|
1514 |
}
|
| 1320 |
try {
|
1515 |
try {
|
| 1321 |
if(!startDate.getTextBox().getText().trim().equals("")) {
|
1516 |
if(!startDate.getTextBox().getText().trim().equals("")) {
|
| 1322 |
newItem.setStartDate(startDate.getValue().getTime());
|
1517 |
newItem.setStartDate(startDate.getValue().getTime());
|
| Line 1502... |
Line 1697... |
| 1502 |
newItem.setUpdatedOn(item.getUpdatedOn());
|
1697 |
newItem.setUpdatedOn(item.getUpdatedOn());
|
| 1503 |
newItem.setItemStatus(item.getItemStatus());
|
1698 |
newItem.setItemStatus(item.getItemStatus());
|
| 1504 |
newItem.setItemInventory(item.getItemInventory());
|
1699 |
newItem.setItemInventory(item.getItemInventory());
|
| 1505 |
newItem.setSimilarItems(item.getSimilarItems());
|
1700 |
newItem.setSimilarItems(item.getSimilarItems());
|
| 1506 |
newItem.setVouchersMap(item.getVouchersMap());
|
1701 |
newItem.setVouchersMap(item.getVouchersMap());
|
| 1507 |
|
1702 |
|
| 1508 |
return true;
|
1703 |
return true;
|
| 1509 |
}
|
1704 |
}
|
| 1510 |
|
1705 |
|
| 1511 |
/**
|
1706 |
/**
|
| 1512 |
* This method is called when Edit button is clicked corresponding to a row in
|
1707 |
* This method is called when Edit button is clicked corresponding to a row in
|
| Line 1698... |
Line 1893... |
| 1698 |
}
|
1893 |
}
|
| 1699 |
if(!checkParameterIfEqual(newItem.getFreebieItemId(), item.getFreebieItemId())) {
|
1894 |
if(!checkParameterIfEqual(newItem.getFreebieItemId(), item.getFreebieItemId())) {
|
| 1700 |
optionalChangedValMap.put(OPTIONAL_FREEBIE_ITEM_ID, freebieItemId.getText().trim());
|
1895 |
optionalChangedValMap.put(OPTIONAL_FREEBIE_ITEM_ID, freebieItemId.getText().trim());
|
| 1701 |
sb.append("\n-Freebie Item Id");
|
1896 |
sb.append("\n-Freebie Item Id");
|
| 1702 |
}
|
1897 |
}
|
| - |
|
1898 |
if(newItem.getPrivateDeal().getDealFreebieItemId()!=0){
|
| - |
|
1899 |
if(newItem.getPrivateDeal().getDealFreebieItemId()!=item.getPrivateDeal().getDealFreebieItemId()) {
|
| - |
|
1900 |
sb.append("\n-Deal Freebie Item Id");
|
| - |
|
1901 |
}
|
| - |
|
1902 |
}
|
| - |
|
1903 |
if(newItem.getPrivateDeal().getDealPrice()!=item.getPrivateDeal().getDealPrice()) {
|
| - |
|
1904 |
sb.append("\n-Deal Price");
|
| - |
|
1905 |
}
|
| - |
|
1906 |
if(newItem.getPrivateDeal().getDealFreebieOption().longValue()!=item.getPrivateDeal().getDealFreebieOption().longValue()) {
|
| - |
|
1907 |
sb.append("\n-Deal Freebie Option");
|
| - |
|
1908 |
}
|
| - |
|
1909 |
if(!newItem.getPrivateDeal().getDealText().equalsIgnoreCase(item.getPrivateDeal().getDealText())) {
|
| - |
|
1910 |
sb.append("\n-Deal Text");
|
| - |
|
1911 |
}
|
| - |
|
1912 |
if(newItem.getPrivateDeal().getDealTextOption()!=item.getPrivateDeal().getDealTextOption()) {
|
| - |
|
1913 |
sb.append("\n-Deal Text Option");
|
| - |
|
1914 |
}
|
| - |
|
1915 |
if(newItem.getPrivateDeal().getRank().longValue()!=item.getPrivateDeal().getRank().longValue()) {
|
| - |
|
1916 |
sb.append("\n-Deal Rank");
|
| - |
|
1917 |
}
|
| - |
|
1918 |
if(newItem.getPrivateDeal().isCod()!=item.getPrivateDeal().isCod()) {
|
| - |
|
1919 |
sb.append("\n-Is Deal Cod");
|
| - |
|
1920 |
}
|
| - |
|
1921 |
if(newItem.getPrivateDeal().isActive()!=item.getPrivateDeal().isActive()) {
|
| - |
|
1922 |
sb.append("\n-Is Deal Active");
|
| - |
|
1923 |
}
|
| - |
|
1924 |
if(!checkParameterIfEqual(newItem.getPrivateDeal().getStartDate(),item.getPrivateDeal().getStartDate())) {
|
| - |
|
1925 |
sb.append("\n-Deal Start Date");
|
| - |
|
1926 |
}
|
| - |
|
1927 |
if(!checkParameterIfEqual(newItem.getPrivateDeal().getEndDate(),item.getPrivateDeal().getEndDate())) {
|
| - |
|
1928 |
sb.append("\n-Deal End Date");
|
| - |
|
1929 |
}
|
| 1703 |
if(!checkParameterIfEqual(asin.getText().trim(), item.getAsin())) {
|
1930 |
if(!checkParameterIfEqual(asin.getText().trim(), item.getAsin())) {
|
| 1704 |
sb.append("\n-Asin");
|
1931 |
sb.append("\n-Asin");
|
| 1705 |
}
|
1932 |
}
|
| 1706 |
if(!checkParameterIfEqual(newItem.getHoldInventory(), item.getHoldInventory())) {
|
1933 |
if(!checkParameterIfEqual(newItem.getHoldInventory(), item.getHoldInventory())) {
|
| 1707 |
sb.append("\n-Hold Inventory");
|
1934 |
sb.append("\n-Hold Inventory");
|
| Line 1762... |
Line 1989... |
| 1762 |
}
|
1989 |
}
|
| 1763 |
if(sourcePricingsChanged){
|
1990 |
if(sourcePricingsChanged){
|
| 1764 |
sb.append("\n-Source Pricing");
|
1991 |
sb.append("\n-Source Pricing");
|
| 1765 |
optionalChangedValMap.put(OPTIONAL_SOURCE_PRICING, newItem.getSourcePricesMap());
|
1992 |
optionalChangedValMap.put(OPTIONAL_SOURCE_PRICING, newItem.getSourcePricesMap());
|
| 1766 |
}
|
1993 |
}
|
| 1767 |
|
- |
|
| 1768 |
|
- |
|
| 1769 |
VendorItemMapping mapping;
|
1994 |
VendorItemMapping mapping;
|
| 1770 |
String old_key, new_key;
|
1995 |
String old_key, new_key;
|
| 1771 |
for(int row = 0; row < tableVendorItemKey.getRowCount(); row++) {
|
1996 |
for(int row = 0; row < tableVendorItemKey.getRowCount(); row++) {
|
| 1772 |
vendorId = Long.parseLong(tableVendorItemKey.getText(row, TABLE_INDEX_MAPPING_VENDORID));
|
1997 |
vendorId = Long.parseLong(tableVendorItemKey.getText(row, TABLE_INDEX_MAPPING_VENDORID));
|
| 1773 |
old_key = tableVendorItemKey.getText(row, TABLE_INDEX_MAPPING_ITEM_KEY_OLD);
|
1998 |
old_key = tableVendorItemKey.getText(row, TABLE_INDEX_MAPPING_ITEM_KEY_OLD);
|