Subversion Repositories SmartDukaan

Rev

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

Rev 19003 Rev 19260
Line 147... Line 147...
147
	private CatalogClient ctsc = null;
147
	private CatalogClient ctsc = null;
148
	private UserClient usc = null;
148
	private UserClient usc = null;
149
 
149
 
150
	private static Locale indianLocale = new Locale("en", "IN");
150
	private static Locale indianLocale = new Locale("en", "IN");
151
	private DecimalFormat amountFormat = new DecimalFormat("#,##0.00");
151
	private DecimalFormat amountFormat = new DecimalFormat("#,##0.00");
-
 
152
	private DecimalFormat weightFormat = new DecimalFormat("#0.000");
152
 
153
 
153
	//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
154
	//Start:-Added By Manish Sharma for FedEx Integration - Shipment Creation on 21-Aug-2013
154
	private static final Font helvetica6 = FontFactory.getFont(FontFactory.HELVETICA, 6);
155
	private static final Font helvetica6 = FontFactory.getFont(FontFactory.HELVETICA, 6);
155
	//End:-Added By Manish Sharma for FedEx Integration  - Shipment Creation on 21-Aug-2013
156
	//End:-Added By Manish Sharma for FedEx Integration  - Shipment Creation on 21-Aug-2013
156
	private static final Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
157
	private static final Font helvetica8 = FontFactory.getFont(FontFactory.HELVETICA, 8);
Line 662... Line 663...
662
	private PdfPTable getPackagingInfoTable(List<Order> orderList) throws CatalogServiceException, TException{
663
	private PdfPTable getPackagingInfoTable(List<Order> orderList) throws CatalogServiceException, TException{
663
		PdfPTable finalTable = new PdfPTable(1);
664
		PdfPTable finalTable = new PdfPTable(1);
664
		finalTable.setWidthPercentage(90.0f);
665
		finalTable.setWidthPercentage(90.0f);
665
		finalTable.setSpacingBefore(5.0f);
666
		finalTable.setSpacingBefore(5.0f);
666
		finalTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
667
		finalTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
-
 
668
		finalTable.setSplitLate(false);
667
		PdfPTable customerAddresTable = new PdfPTable(1);
669
		PdfPTable customerAddresTable = new PdfPTable(1);
668
		customerAddresTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
670
		customerAddresTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
669
		customerAddresTable.addCell(new Phrase("Customer Details: "+orderList.get(0).getCustomer_name() +" "+orderList.get(0).getCustomer_address1()
671
		customerAddresTable.addCell(new Phrase("Customer Details: "+orderList.get(0).getCustomer_name() +" "+orderList.get(0).getCustomer_address1()
670
				+orderList.get(0).getCustomer_address2() +" "+orderList.get(0).getCustomer_city() + "," + orderList.get(0).getCustomer_state()
672
				+orderList.get(0).getCustomer_address2() +" "+orderList.get(0).getCustomer_city() + "," + orderList.get(0).getCustomer_state()
671
				+" -"+orderList.get(0).getCustomer_pincode(), helvetica8));
673
				+" -"+orderList.get(0).getCustomer_pincode(), helvetica8));
Line 678... Line 680...
678
		packagingTable.addCell(new Phrase("Sr Nos", helveticaBold8));
680
		packagingTable.addCell(new Phrase("Sr Nos", helveticaBold8));
679
		packagingTable.addCell(new Phrase("Rate", helveticaBold8));
681
		packagingTable.addCell(new Phrase("Rate", helveticaBold8));
680
		packagingTable.addCell(new Phrase("Pack\nSize", helveticaBold8));
682
		packagingTable.addCell(new Phrase("Pack\nSize", helveticaBold8));
681
		packagingTable.addCell(new Phrase("Qty", helveticaBold8));
683
		packagingTable.addCell(new Phrase("Qty", helveticaBold8));
682
		packagingTable.addCell(new Phrase("Total Pcs.", helveticaBold8));
684
		packagingTable.addCell(new Phrase("Total Pcs.", helveticaBold8));
-
 
685
		packagingTable.setHeaderRows(1);
683
		
686
		
684
		Map<Long, Item> itemMap = new HashMap<Long, Item>();
687
		Map<Long, Item> itemMap = new HashMap<Long, Item>();
685
		
688
		
686
		CatalogService.Client catalogClient = ctsc.getClient();
689
		CatalogService.Client catalogClient = ctsc.getClient();
687
		for(Order order:orderList){
690
		for(Order order:orderList){
Line 971... Line 974...
971
			awbDate = new Date(order.getBilling_timestamp());
974
			awbDate = new Date(order.getBilling_timestamp());
972
		}
975
		}
973
		if(order.getLogistics_provider_id()!=7L){
976
		if(order.getLogistics_provider_id()!=7L){
974
			providerInfoTable.addCell(new Phrase("AWB Date   : " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(awbDate), helvetica8));
977
			providerInfoTable.addCell(new Phrase("AWB Date   : " + DateFormat.getDateInstance(DateFormat.MEDIUM).format(awbDate), helvetica8));
975
		}
978
		}
976
		providerInfoTable.addCell(new Phrase("Weight         : " + totalWeight + " Kg", helvetica8));
979
		providerInfoTable.addCell(new Phrase("Weight         : " + weightFormat.format(totalWeight) + " Kg", helvetica8));
977
		if(order.getSource() == OrderSource.EBAY.getValue()){
980
		if(order.getSource() == OrderSource.EBAY.getValue()){
978
			EbayOrder ebayOrder = null;
981
			EbayOrder ebayOrder = null;
979
			try {
982
			try {
980
				ebayOrder = tsc.getClient().getEbayOrderByOrderId(order.getId());
983
				ebayOrder = tsc.getClient().getEbayOrderByOrderId(order.getId());
981
			} catch (TException e) {
984
			} catch (TException e) {
Line 1005... Line 1008...
1005
		invoiceTable.addCell(new Phrase("Paymode", helvetica8));
1008
		invoiceTable.addCell(new Phrase("Paymode", helvetica8));
1006
		invoiceTable.addCell(new Phrase("Product Name", helvetica8));
1009
		invoiceTable.addCell(new Phrase("Product Name", helvetica8));
1007
		invoiceTable.addCell(new Phrase("Quantity", helvetica8));
1010
		invoiceTable.addCell(new Phrase("Quantity", helvetica8));
1008
		invoiceTable.addCell(new Phrase("Rate", helvetica8));
1011
		invoiceTable.addCell(new Phrase("Rate", helvetica8));
1009
		invoiceTable.addCell(new Phrase("Amount", helvetica8));
1012
		invoiceTable.addCell(new Phrase("Amount", helvetica8));
-
 
1013
		invoiceTable.setHeaderRows(1);
1010
		double totalAmount = 0.0;
1014
		double totalAmount = 0.0;
1011
		double totalShippingCost = 0.0;
1015
		double totalShippingCost = 0.0;
1012
		double insuranceAmount = 0.0;
1016
		double insuranceAmount = 0.0;
1013
		double advanceAmount = 0.0;
1017
		double advanceAmount = 0.0;
1014
		double totalGvAmount = 0.0;
1018
		double totalGvAmount = 0.0;
Line 1641... Line 1645...
1641
		invoiceTable.addCell(new Phrase("Quantity", helveticaBold8));
1645
		invoiceTable.addCell(new Phrase("Quantity", helveticaBold8));
1642
		invoiceTable.addCell(new Phrase("Rate (Rs)", helveticaBold8));
1646
		invoiceTable.addCell(new Phrase("Rate (Rs)", helveticaBold8));
1643
		invoiceTable.addCell(new Phrase("Amount (Rs)", helveticaBold8));
1647
		invoiceTable.addCell(new Phrase("Amount (Rs)", helveticaBold8));
1644
		invoiceTable.addCell(new Phrase("Tax Rate%", helveticaBold8));
1648
		invoiceTable.addCell(new Phrase("Tax Rate%", helveticaBold8));
1645
		invoiceTable.addCell(new Phrase("Tax (Rs)", helveticaBold8));
1649
		invoiceTable.addCell(new Phrase("Tax (Rs)", helveticaBold8));
1646
		invoiceTable.addCell(new Phrase("Item Total (Rs)", helveticaBold8));;
1650
		invoiceTable.addCell(new Phrase("Item Total (Rs)", helveticaBold8));
-
 
1651
		invoiceTable.setHeaderRows(1);
1647
		double totalAmount = 0.0;
1652
		double totalAmount = 0.0;
1648
		double insuranceAmount = 0.0;
1653
		double insuranceAmount = 0.0;
1649
		double totalShippingCost = 0.0;
1654
		double totalShippingCost = 0.0;
1650
		int i=1;
1655
		int i=1;
1651
		if("Bulk".equalsIgnoreCase(invoiceFormat)){
1656
		if("Bulk".equalsIgnoreCase(invoiceFormat)){