Subversion Repositories SmartDukaan

Rev

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

Rev 19277 Rev 19513
Line 312... Line 312...
312
					
312
					
313
					dispatchAdviceTable.setSpacingAfter(10.0f);
313
					dispatchAdviceTable.setSpacingAfter(10.0f);
314
					dispatchAdviceTable.setWidthPercentage(90.0f);
314
					dispatchAdviceTable.setWidthPercentage(90.0f);
315
					document.add(dispatchAdviceTable);
315
					document.add(dispatchAdviceTable);
316
					if("Bulk".equalsIgnoreCase(invoiceFormat)){
316
					if("Bulk".equalsIgnoreCase(invoiceFormat)){
317
						if(ordersList.size()>3 || (order.getLogistics_provider_id()==7 && order.isLogisticsCod())){
317
						if(ordersList.size()>3 || (order.getLogistics_provider_id()==7 && order.isLogisticsCod()) || (order.getLogistics_provider_id()==46 && order.isLogisticsCod())){
318
							document.newPage();
318
							document.newPage();
319
						}
319
						}
320
					}
320
					}
321
					
321
					
322
					if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7) &&(ordersList.size()==1)) {
322
					if ((new Long(order.getSource()).intValue() == OrderSource.EBAY.getValue()) && (order.getLogistics_provider_id()>7) &&(ordersList.size()==1)) {
Line 769... Line 769...
769
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
769
		chargesTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
770
		if(order.isLogisticsCod()){
770
		if(order.isLogisticsCod()){
771
			chargesTable.addCell(new Phrase("AMOUNT TO BE COLLECTED : Rs " + (totalAmount), helveticaBold12));
771
			chargesTable.addCell(new Phrase("AMOUNT TO BE COLLECTED : Rs " + (totalAmount), helveticaBold12));
772
			chargesTable.addCell(new Phrase("RTO ADDRESS:DEL/HPW/111116"));
772
			chargesTable.addCell(new Phrase("RTO ADDRESS:DEL/HPW/111116"));
773
			//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
773
			//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
774
			if(order.getLogistics_provider_id()==7L){
774
			if(order.getLogistics_provider_id()==7L || order.getLogistics_provider_id()==46L){
775
				in.shop2020.model.v1.order.TransactionService.Client tclient = tsc.getClient();
775
				in.shop2020.model.v1.order.TransactionService.Client tclient = tsc.getClient();
776
				String fedexCodReturnBarcode = "";
776
				String fedexCodReturnBarcode = "";
777
				String fedexCodReturnTrackingId = "";
777
				String fedexCodReturnTrackingId = "";
778
				try {
778
				try {
779
					fedexCodReturnBarcode = tclient.getOrderAttributeValue(order.getId(), "FedEx_COD_Return_BarCode");
779
					fedexCodReturnBarcode = tclient.getOrderAttributeValue(order.getId(), "FedEx_COD_Return_BarCode");
Line 807... Line 807...
807
			//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
807
			//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
808
		} else {
808
		} else {
809
			chargesTable.addCell(new Phrase("Do not pay any extra charges to the Courier."));  
809
			chargesTable.addCell(new Phrase("Do not pay any extra charges to the Courier."));  
810
		}
810
		}
811
		
811
		
812
		if(order.getLogistics_provider_id()==7L){
812
		if(order.getLogistics_provider_id()==7L || order.getLogistics_provider_id()==46L){
813
			chargesTable.addCell(new Phrase("Term and Condition:- Subject to the Conditions of Carriage which " +
813
			chargesTable.addCell(new Phrase("Term and Condition:- Subject to the Conditions of Carriage which " +
814
					"limits the liability of FedEx for loss, delay or damage to the consignment." +
814
					"limits the liability of FedEx for loss, delay or damage to the consignment." +
815
					" Visit http://www.fedex.com/in/domestic/services/terms to view the conitions of Carriage" ,
815
					" Visit http://www.fedex.com/in/domestic/services/terms to view the conitions of Carriage" ,
816
					new Font(FontFamily.TIMES_ROMAN, 8f)));
816
					new Font(FontFamily.TIMES_ROMAN, 8f)));
817
		}
817
		}
Line 893... Line 893...
893
		
893
		
894
		PdfPCell providerNameCell = new PdfPCell(new Phrase(provider.getName(), helveticaBold12));
894
		PdfPCell providerNameCell = new PdfPCell(new Phrase(provider.getName(), helveticaBold12));
895
		providerNameCell.setHorizontalAlignment(Element.ALIGN_LEFT);
895
		providerNameCell.setHorizontalAlignment(Element.ALIGN_LEFT);
896
		providerNameCell.setBorder(Rectangle.NO_BORDER);
896
		providerNameCell.setBorder(Rectangle.NO_BORDER);
897
		PdfPCell formIdCell= null;
897
		PdfPCell formIdCell= null;
898
		if(order.getLogistics_provider_id()==7L){
898
		if(order.getLogistics_provider_id()==7L || order.getLogistics_provider_id()==46L){
899
			if(order.isCod()){
899
			if(order.isCod()){
900
				formIdCell = new PdfPCell(new Paragraph(order.getAirwaybill_no()+" Form id-0305", helvetica6));
900
				formIdCell = new PdfPCell(new Paragraph(order.getAirwaybill_no()+" Form id-0305", helvetica6));
901
			}
901
			}
902
			else{
902
			else{
903
				formIdCell = new PdfPCell(new Paragraph(order.getAirwaybill_no()+" Form id-0467", helvetica6));
903
				formIdCell = new PdfPCell(new Paragraph(order.getAirwaybill_no()+" Form id-0467", helvetica6));
Line 908... Line 908...
908
		}
908
		}
909
		
909
		
910
	
910
	
911
		PdfPCell awbNumberCell= null;
911
		PdfPCell awbNumberCell= null;
912
		String fedexPackageBarcode = "";
912
		String fedexPackageBarcode = "";
913
		if(order.getLogistics_provider_id()!=7L){
913
		if(order.getLogistics_provider_id()!=7L && order.getLogistics_provider_id()!=46L){
914
			awbNumberCell = new PdfPCell(new Paragraph("*" + order.getAirwaybill_no() + "*", barCodeFont));
914
			awbNumberCell = new PdfPCell(new Paragraph("*" + order.getAirwaybill_no() + "*", barCodeFont));
915
			awbNumberCell.setPaddingTop(20.0f);
915
			awbNumberCell.setPaddingTop(20.0f);
916
		}
916
		}
917
		else{
917
		else{
918
			in.shop2020.model.v1.order.TransactionService.Client tclient = tsc.getClient();
918
			in.shop2020.model.v1.order.TransactionService.Client tclient = tsc.getClient();
Line 929... Line 929...
929
		providerInfoTable.addCell(providerNameCell);
929
		providerInfoTable.addCell(providerNameCell);
930
		if(formIdCell != null){
930
		if(formIdCell != null){
931
			providerInfoTable.addCell(formIdCell);
931
			providerInfoTable.addCell(formIdCell);
932
		}
932
		}
933
		//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
933
		//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
934
		if(order.getLogistics_provider_id()==7L){
934
		if(order.getLogistics_provider_id()==7L || order.getLogistics_provider_id()==46L){
935
			generateBarcode(fedexPackageBarcode, "fedex_"+order.getId());
935
			generateBarcode(fedexPackageBarcode, "fedex_"+order.getId());
936
			
936
			
937
			Image barcodeImage=null;
937
			Image barcodeImage=null;
938
			try {
938
			try {
939
				barcodeImage = Image.getInstance("/tmp/"+"fedex_"+order.getId()+".png");
939
				barcodeImage = Image.getInstance("/tmp/"+"fedex_"+order.getId()+".png");
Line 955... Line 955...
955
		DeliveryType dt =  DeliveryType.PREPAID;
955
		DeliveryType dt =  DeliveryType.PREPAID;
956
        if (order.isLogisticsCod()) {
956
        if (order.isLogisticsCod()) {
957
            dt = DeliveryType.COD;
957
            dt = DeliveryType.COD;
958
        }
958
        }
959
        //Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
959
        //Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
960
        if(order.getLogistics_provider_id()!=7L){
960
        if(order.getLogistics_provider_id()!=7L && order.getLogistics_provider_id()!=46L){
961
	        for (ProviderDetails detail : provider.getDetails()) {
961
	        for (ProviderDetails detail : provider.getDetails()) {
962
	            if(in.shop2020.model.v1.inventory.WarehouseLocation.findByValue((int) detail.getLogisticLocation()) == warehouse.getLogisticsLocation() && detail.getDeliveryType() == dt) {
962
	            if(in.shop2020.model.v1.inventory.WarehouseLocation.findByValue((int) detail.getLogisticLocation()) == warehouse.getLogisticsLocation() && detail.getDeliveryType() == dt) {
963
	                providerInfoTable.addCell(new Phrase("Account No : " + detail.getAccountNo(), helvetica8));
963
	                providerInfoTable.addCell(new Phrase("Account No : " + detail.getAccountNo(), helvetica8));
964
	            }
964
	            }
965
	        }
965
	        }
Line 972... Line 972...
972
		if(order.getBilling_timestamp() == 0){
972
		if(order.getBilling_timestamp() == 0){
973
			awbDate = new Date();
973
			awbDate = new Date();
974
		}else{
974
		}else{
975
			awbDate = new Date(order.getBilling_timestamp());
975
			awbDate = new Date(order.getBilling_timestamp());
976
		}
976
		}
977
		if(order.getLogistics_provider_id()!=7L){
977
		if(order.getLogistics_provider_id()!=7L && order.getLogistics_provider_id()!=46L){
978
			providerInfoTable.addCell(new Phrase("AWB Date   : " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(awbDate), helvetica8));
978
			providerInfoTable.addCell(new Phrase("AWB Date   : " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(awbDate), helvetica8));
979
		}
979
		}
980
		providerInfoTable.addCell(new Phrase("Weight         : " + weightFormat.format(totalWeight) + " Kg", helvetica8));
980
		providerInfoTable.addCell(new Phrase("Weight         : " + weightFormat.format(totalWeight) + " Kg", helvetica8));
981
		if(order.getSource() == OrderSource.EBAY.getValue()){
981
		if(order.getSource() == OrderSource.EBAY.getValue()){
982
			EbayOrder ebayOrder = null;
982
			EbayOrder ebayOrder = null;
Line 987... Line 987...
987
			}
987
			}
988
			providerInfoTable.addCell(new Phrase("PaisaPayId            : " + ebayOrder.getPaisaPayId(), helvetica8));
988
			providerInfoTable.addCell(new Phrase("PaisaPayId            : " + ebayOrder.getPaisaPayId(), helvetica8));
989
			providerInfoTable.addCell(new Phrase("Sales Rec Number: " + ebayOrder.getSalesRecordNumber(), helvetica8));
989
			providerInfoTable.addCell(new Phrase("Sales Rec Number: " + ebayOrder.getSalesRecordNumber(), helvetica8));
990
		}
990
		}
991
		//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
991
		//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
992
		if(order.getLogistics_provider_id()==7L){
992
		if(order.getLogistics_provider_id()==7L || order.getLogistics_provider_id()==46L){
993
			providerInfoTable.addCell(new Phrase("Bill T/C Sender      "+ "Bill D/T Sender", helvetica8));
993
			providerInfoTable.addCell(new Phrase("Bill T/C Sender      "+ "Bill D/T Sender", helvetica8));
994
		}
994
		}
995
		//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
995
		//End:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
996
		return providerInfoTable;
996
		return providerInfoTable;
997
	}
997
	}
Line 1381... Line 1381...
1381
						}
1381
						}
1382
						customerTable.addCell(new Phrase(order.getCustomer_address1(), font));
1382
						customerTable.addCell(new Phrase(order.getCustomer_address1(), font));
1383
						customerTable.addCell(new Phrase(order.getCustomer_address2(), font));
1383
						customerTable.addCell(new Phrase(order.getCustomer_address2(), font));
1384
						customerTable.addCell(new Phrase(order.getCustomer_city() + "," + order.getCustomer_state(), font));
1384
						customerTable.addCell(new Phrase(order.getCustomer_city() + "," + order.getCustomer_state(), font));
1385
						//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
1385
						//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
1386
						if(order.getLogistics_provider_id()!=7L){
1386
						if(order.getLogistics_provider_id()!=7L  && order.getLogistics_provider_id()!=46L){
1387
							if(destCode != null)
1387
							if(destCode != null)
1388
								customerTable.addCell(new Phrase(order.getCustomer_pincode() + " - " + destCode, helvetica16));
1388
								customerTable.addCell(new Phrase(order.getCustomer_pincode() + " - " + destCode, helvetica16));
1389
							else
1389
							else
1390
								customerTable.addCell(new Phrase(order.getCustomer_pincode(), font));
1390
								customerTable.addCell(new Phrase(order.getCustomer_pincode(), font));
1391
							}
1391
							}
Line 1421... Line 1421...
1421
					}
1421
					}
1422
					customerTable.addCell(new Phrase(order.getCustomer_address1(), font));
1422
					customerTable.addCell(new Phrase(order.getCustomer_address1(), font));
1423
					customerTable.addCell(new Phrase(order.getCustomer_address2(), font));
1423
					customerTable.addCell(new Phrase(order.getCustomer_address2(), font));
1424
					customerTable.addCell(new Phrase(order.getCustomer_city() + "," + order.getCustomer_state(), font));
1424
					customerTable.addCell(new Phrase(order.getCustomer_city() + "," + order.getCustomer_state(), font));
1425
					//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
1425
					//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
1426
					if(order.getLogistics_provider_id()!=7L){
1426
					if(order.getLogistics_provider_id()!=7L  && order.getLogistics_provider_id()!=46L){
1427
						if(destCode != null)
1427
						if(destCode != null)
1428
							customerTable.addCell(new Phrase(order.getCustomer_pincode() + " - " + destCode, helvetica16));
1428
							customerTable.addCell(new Phrase(order.getCustomer_pincode() + " - " + destCode, helvetica16));
1429
						else
1429
						else
1430
							customerTable.addCell(new Phrase(order.getCustomer_pincode(), font));
1430
							customerTable.addCell(new Phrase(order.getCustomer_pincode(), font));
1431
						}
1431
						}