Subversion Repositories SmartDukaan

Rev

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

Rev 8844 Rev 8845
Line 219... Line 219...
219
					}
219
					}
220
				}
220
				}
221
				t_order.setFulfilmentWarehouseId(fulfillmentWarehouse.getId());
221
				t_order.setFulfilmentWarehouseId(fulfillmentWarehouse.getId());
222
				logger.info("Billing warehouse id for suborderid  " + order.getSuborderId() + " is " + fulfillmentWarehouse.getBillingWarehouseId());
222
				logger.info("Billing warehouse id for suborderid  " + order.getSuborderId() + " is " + fulfillmentWarehouse.getBillingWarehouseId());
223
				t_order.setWarehouse_id(fulfillmentWarehouse.getBillingWarehouseId());
223
				t_order.setWarehouse_id(fulfillmentWarehouse.getBillingWarehouseId());
-
 
224
				VendorItemPricing vendorItemPricing = new VendorItemPricing();
-
 
225
				if(fulfillmentWarehouse.getId()==7) {
-
 
226
					Item item = new CatalogClient().getClient().getItem(lineItem.getItem_id());
-
 
227
					vendorItemPricing = inventoryClient.getItemPricing(lineItem.getItem_id(), item.getPreferredVendor());
-
 
228
				} else {
224
				VendorItemPricing vendorItemPricing = inventoryClient.getItemPricing(lineItem.getItem_id(), fulfillmentWarehouse.getVendor().getId());
229
					vendorItemPricing = inventoryClient.getItemPricing(lineItem.getItem_id(), fulfillmentWarehouse.getVendor().getId());
-
 
230
				}
-
 
231
				
225
				t_order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
232
				t_order.getLineitems().get(0).setTransfer_price(vendorItemPricing.getTransferPrice());
226
				t_order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
233
				t_order.getLineitems().get(0).setNlc(vendorItemPricing.getNlc());
227
			} catch (InventoryServiceException e) {
234
			} catch (InventoryServiceException e) {
228
				logger.error("Error connecting inventory service for suborderid  " + order.getSuborderId());
235
				logger.error("Error connecting inventory service for suborderid  " + order.getSuborderId());
229
				sb.append(order.getSuborderId() + " Inventory Service Exception" + " " + "\n");
236
				sb.append(order.getSuborderId() + " Inventory Service Exception" + " " + "\n");
Line 234... Line 241...
234
				continue;
241
				continue;
235
			} catch (TException e) {
242
			} catch (TException e) {
236
				logger.error("Exception with Inventory Service for suborderid  " + order.getSuborderId() , e);
243
				logger.error("Exception with Inventory Service for suborderid  " + order.getSuborderId() , e);
237
				sb.append(order.getSuborderId() + " Exception in Inventory Service" + " " + "\n");
244
				sb.append(order.getSuborderId() + " Exception in Inventory Service" + " " + "\n");
238
				continue;
245
				continue;
-
 
246
			} catch (CatalogServiceException e) {
-
 
247
				logger.error("Exception with Catalog Service for suborderid  " + order.getSuborderId() + " while getting item " + lineItem.getItem_id(), e);
-
 
248
				sb.append(order.getSuborderId() + " Exception in Catalog Service" + " " + "\n");
-
 
249
				continue;
239
			}
250
			}
240
			if(order.getCourier().equalsIgnoreCase(FIRSTFLIGHT)) {
251
			if(order.getCourier().equalsIgnoreCase(FIRSTFLIGHT)) {
241
				t_order.setLogistics_provider_id(12);
252
				t_order.setLogistics_provider_id(12);
242
			} else if(order.getCourier().equalsIgnoreCase(DELHIVERY)) {
253
			} else if(order.getCourier().equalsIgnoreCase(DELHIVERY)) {
243
				t_order.setLogistics_provider_id(13);
254
				t_order.setLogistics_provider_id(13);