Subversion Repositories SmartDukaan

Rev

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

Rev 8989 Rev 8996
Line 19... Line 19...
19
import in.shop2020.model.v1.order.Order;
19
import in.shop2020.model.v1.order.Order;
20
import in.shop2020.model.v1.order.OrderSource;
20
import in.shop2020.model.v1.order.OrderSource;
21
import in.shop2020.model.v1.order.OrderStatus;
21
import in.shop2020.model.v1.order.OrderStatus;
22
import in.shop2020.model.v1.order.OrderType;
22
import in.shop2020.model.v1.order.OrderType;
23
import in.shop2020.model.v1.order.SnapdealOrder;
23
import in.shop2020.model.v1.order.SnapdealOrder;
-
 
24
import in.shop2020.model.v1.order.FlipkartOrder;
24
import in.shop2020.thrift.clients.CatalogClient;
25
import in.shop2020.thrift.clients.CatalogClient;
25
import in.shop2020.thrift.clients.LogisticsClient;
26
import in.shop2020.thrift.clients.LogisticsClient;
26
import in.shop2020.thrift.clients.TransactionClient;
27
import in.shop2020.thrift.clients.TransactionClient;
27
import in.shop2020.thrift.clients.config.ConfigClient;
28
import in.shop2020.thrift.clients.config.ConfigClient;
28
import in.shop2020.thrift.clients.InventoryClient;
29
import in.shop2020.thrift.clients.InventoryClient;
Line 228... Line 229...
228
				
229
				
229
				PdfPTable dispatchAdviceTable = null;
230
				PdfPTable dispatchAdviceTable = null;
230
				
231
				
231
				if (new Long(order.getSource()).intValue() == OrderSource.SNAPDEAL.getValue()) {
232
				if (new Long(order.getSource()).intValue() == OrderSource.SNAPDEAL.getValue()) {
232
					dispatchAdviceTable = new PdfPTable(1);
233
					dispatchAdviceTable = new PdfPTable(1);
-
 
234
				}  else if(new Long(order.getSource()).intValue() == OrderSource.SNAPDEAL.getValue()) {
-
 
235
					dispatchAdviceTable = new PdfPTable(1);
233
				} else if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7)) {
236
				}  else if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7)) {
234
					if(order.getWarehouse_id() == 7 || order.getWarehouse_id() == 5 || order.getWarehouse_id() == 9) {
237
					if(order.getWarehouse_id() == 7 || order.getWarehouse_id() == 5 || order.getWarehouse_id() == 9) {
235
						dispatchAdviceTable = new PdfPTable(1);
238
						dispatchAdviceTable = new PdfPTable(1);
236
					} else { 
239
					} else { 
237
						if (order.getAirwaybill_no()== null || order.getAirwaybill_no().equals("null") || order.getAirwaybill_no().isEmpty()) {
240
						if (order.getAirwaybill_no()== null || order.getAirwaybill_no().equals("null") || order.getAirwaybill_no().isEmpty()) {
238
							dispatchAdviceTable = new PdfPTable(1);
241
							dispatchAdviceTable = new PdfPTable(1);
Line 840... Line 843...
840
		else if(order.getSource() == OrderSource.FLIPKART.getValue()){
843
		else if(order.getSource() == OrderSource.FLIPKART.getValue()){
841
			FlipkartOrder flipkartOrder = null;
844
			FlipkartOrder flipkartOrder = null;
842
			try {
845
			try {
843
				flipkartOrder = tsc.getClient().getFlipkartOrder(order.getId());
846
				flipkartOrder = tsc.getClient().getFlipkartOrder(order.getId());
844
			} catch (TException e) {
847
			} catch (TException e) {
845
				logger.error("Error while getting snapdeal order", e);
848
				logger.error("Error while getting flipkart order", e);
846
			}
849
			}
847
			orderTable.addCell(new Phrase("Flipkart OrderId:", helvetica8));
850
			orderTable.addCell(new Phrase("Flipkart OrderId:", helvetica8));
848
			orderTable.addCell(new Phrase(flipkartOrder.getFlipkartOrderId(), helvetica8));
851
			orderTable.addCell(new Phrase(flipkartOrder.getFlipkartOrderId(), helvetica8));
849
			
-
 
850
			String refernceCodeFontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
-
 
851
			FontFactoryImp ttfFontFactory = new FontFactoryImp();
-
 
852
			ttfFontFactory.register(refernceCodeFontPath, "barcode");
-
 
853
			Font referenceCodeBarCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, 20);
-
 
854
 
-
 
855
			PdfPCell snapdealReferenceBarCodeCell = new PdfPCell(new Paragraph("*" +  flipkartOrder.getFlipkartSubOrderId() + "*", referenceCodeBarCodeFont));
-
 
856
			snapdealReferenceBarCodeCell.setBorder(Rectangle.NO_BORDER);
-
 
857
			snapdealReferenceBarCodeCell.setPaddingTop(9.0f);
-
 
858
			snapdealReferenceBarCodeCell.setColspan(2);
-
 
859
			//orderTable.addCell(new Phrase("Snapdeal ReferenceCode:", helvetica8));
852
			orderTable.addCell(new Phrase("Flipkart SubOrderId:", helvetica8));
860
			orderTable.addCell(snapdealReferenceBarCodeCell);
-
 
861
			//orderTable.addCell(new Phrase(snapdealOrder.getReferenceCode(), helvetica8));
853
			orderTable.addCell(new Phrase(new Long(flipkartOrder.getFlipkartSubOrderId()).toString(), helvetica8));
862
		}
854
		}
863
 
855
 
864
 
856
 
865
		orderTable.addCell(new Phrase("Order Date:", helvetica8));
857
		orderTable.addCell(new Phrase("Order Date:", helvetica8));
866
		orderTable.addCell(new Phrase(DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date(order.getCreated_timestamp())), helvetica8));
858
		orderTable.addCell(new Phrase(DateFormat.getDateInstance(DateFormat.MEDIUM).format(new Date(order.getCreated_timestamp())), helvetica8));