Subversion Repositories SmartDukaan

Rev

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

Rev 8350 Rev 8488
Line 98... Line 98...
98
    private static final int PAISAPAY_ID_INDEX = 28;
98
    private static final int PAISAPAY_ID_INDEX = 28;
99
    private static final int TRANSACTION_ID_INDEX = 31;
99
    private static final int TRANSACTION_ID_INDEX = 31;
100
    
100
    
101
    private static final int SHIP_DATE_INDEX = 24;
101
    private static final int SHIP_DATE_INDEX = 24;
102
    private static final int WAREHOUSE_ID_INDEX = 34;
102
    private static final int WAREHOUSE_ID_INDEX = 34;
103
    private static final int LISTING_PRICE_INDEX = 35;
103
    private static final int OVERRIDE_BILLING_PRICE_INDEX = 35;
104
    
104
    
105
    private static final int EBAY_GATEWAY_ID = 16;
105
    private static final int EBAY_GATEWAY_ID = 16;
106
    
106
    
107
    private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
107
    private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
108
    private SimpleDateFormat sdf2 = new SimpleDateFormat("dd-MMM-yyyy");
108
    private SimpleDateFormat sdf2 = new SimpleDateFormat("dd-MMM-yyyy");
Line 206... Line 206...
206
            row.getCell(EBAY_LISTINGID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
206
            row.getCell(EBAY_LISTINGID_INDEX).setCellType(Cell.CELL_TYPE_STRING);
207
            String ebayListingId = row.getCell(EBAY_LISTINGID_INDEX).getStringCellValue();
207
            String ebayListingId = row.getCell(EBAY_LISTINGID_INDEX).getStringCellValue();
208
    		CatalogService.Client catalogClient = new CatalogClient().getClient();
208
    		CatalogService.Client catalogClient = new CatalogClient().getClient();
209
    		EbayItem ebayItem = catalogClient.getEbayItem(ebayListingId);
209
    		EbayItem ebayItem = catalogClient.getEbayItem(ebayListingId);
210
    		long quantity = new Double(row.getCell(QUANTITY_INDEX).getNumericCellValue()).longValue();
210
    		long quantity = new Double(row.getCell(QUANTITY_INDEX).getNumericCellValue()).longValue();
211
    		Cell overriddenPriceCell = row.getCell(LISTING_PRICE_INDEX);
211
    		Cell overriddenPriceCell = row.getCell(OVERRIDE_BILLING_PRICE_INDEX);
212
        	if(overriddenPriceCell  != null && overriddenPriceCell .getCellType() != Cell.CELL_TYPE_BLANK) {
212
        	if(overriddenPriceCell  != null && overriddenPriceCell .getCellType() != Cell.CELL_TYPE_BLANK) {
213
        		overriddenPrice = row.getCell(LISTING_PRICE_INDEX).getNumericCellValue();
213
        		overriddenPrice = row.getCell(OVERRIDE_BILLING_PRICE_INDEX).getNumericCellValue();
214
        	}
214
        	}
215
    		String totalPriceString = row.getCell(AMOUNT_INDEX).getStringCellValue();
215
    		String totalPriceString = row.getCell(AMOUNT_INDEX).getStringCellValue();
216
    		if(overriddenPrice>=1) {
216
    		if(overriddenPrice>=1) {
217
    			totalPrice = overriddenPrice*quantity;
217
    			totalPrice = overriddenPrice*quantity;
218
    			listingPrice = (Double.parseDouble(totalPriceString.substring(3).replace(",","")))/quantity;
218
    			listingPrice = (Double.parseDouble(totalPriceString.substring(3).replace(",","")))/quantity;
Line 289... Line 289...
289
        		order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
289
        		order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
290
        		order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
290
        		order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
291
			} catch (InventoryServiceException e) {
291
			} catch (InventoryServiceException e) {
292
				addActionError("Error in updating WarehouseId for row number " + rowId + 1);
292
				addActionError("Error in updating WarehouseId for row number " + rowId + 1);
293
            	logger.error("Error in updating WarehouseId for row number " + (rowId + 1),e);
293
            	logger.error("Error in updating WarehouseId for row number " + (rowId + 1),e);
294
            	return "authsuccess";
294
            	continue;
295
			}
295
			}
296
            
296
            
297
			//TODO set Provider Id
-
 
298
            order.setTotal_amount(totalPrice);
297
            order.setTotal_amount(totalPrice);
299
            order.setSource(EBAY_SOURCE_ID);
298
            order.setSource(EBAY_SOURCE_ID);
300
            orders.add(order);
299
            orders.add(order);
301
            orderCountForRow++;
300
            orderCountForRow++;
302
            
301
            
Line 423... Line 422...
423
        Collection<String> actionErrors = getActionErrors();
422
        Collection<String> actionErrors = getActionErrors();
424
        if(actionErrors != null && !actionErrors.isEmpty()){
423
        if(actionErrors != null && !actionErrors.isEmpty()){
425
            for (String str : actionErrors) {
424
            for (String str : actionErrors) {
426
                errorMsg += "<BR/>" + str;
425
                errorMsg += "<BR/>" + str;
427
            }
426
            }
428
            if(rowId>1) {
-
 
429
            	errorMsg += "<BR/>" + "Error while processing rowNumber : " + rowId;
-
 
430
            }
-
 
431
            return true;
427
            return true;
432
        }
428
        }
433
        return false;
429
        return false;
434
    }
430
    }
435
	
431