Subversion Repositories SmartDukaan

Rev

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

Rev 9009 Rev 9014
Line 699... Line 699...
699
 
699
 
700
		PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
700
		PdfPCell disclaimerCell = new PdfPCell(new Phrase("Goods once sold will not be taken back.\nAll disputes subject to Delhi Jurisdiction.\nThis is a Computer generated Invoice.", helvetica8));
701
		disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
701
		disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
702
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
702
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
703
		
703
		
-
 
704
		PdfPCell powerTextCell = new PdfPCell(new Phrase("Powered By  Flipkart", helvetica8));
-
 
705
		powerTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
706
		powerTextCell.setBorder(Rectangle.NO_BORDER);
-
 
707
		powerTextCell.setPaddingBottom(30.0f);
704
		
708
		
705
		logoTitleAndOurAddressTable.addCell(logoTable);
709
		logoTitleAndOurAddressTable.addCell(logoTable);
706
		logoTitleAndOurAddressTable.addCell(retailInvoiceTitleCell);
710
		logoTitleAndOurAddressTable.addCell(retailInvoiceTitleCell);
707
		logoTitleAndOurAddressTable.addCell(sorlAddress);
711
		logoTitleAndOurAddressTable.addCell(sorlAddress);
708
		
712
		
709
		taxTable.addCell(logoTitleAndOurAddressTable);
713
		taxTable.addCell(logoTitleAndOurAddressTable);
710
		taxTable.addCell(addrAndOrderDetailsTable);
714
		taxTable.addCell(addrAndOrderDetailsTable);
711
		taxTable.addCell(invoiceTable);
715
		taxTable.addCell(invoiceTable);
712
		taxTable.addCell(disclaimerCell);
716
		taxTable.addCell(disclaimerCell);
-
 
717
		if(order.getSource() == OrderSource.FLIPKART.getValue()) {
-
 
718
			taxTable.addCell(powerTextCell);
-
 
719
			
713
 
720
		}
714
		return taxTable;
721
		return taxTable;
715
	}
722
	}
716
	
723
	
717
	private PdfPTable getFlipkartBarCodes(Order order) {
724
	private PdfPTable getFlipkartBarCodes(Order order) {
718
		PdfPTable flipkartTable = new PdfPTable(new float[]{0.2f, 0.8f});
725
		PdfPTable flipkartTable = new PdfPTable(new float[]{0.2f, 0.8f});
719
		
726
		
720
		PdfPCell powerTextCell = new PdfPCell(new Phrase("Powered By  Flipkart", helvetica8));
727
		/*PdfPCell powerTextCell = new PdfPCell(new Phrase("Powered By  Flipkart", helvetica8));
721
		powerTextCell.setColspan(2);
728
		powerTextCell.setColspan(2);
722
		powerTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
729
		powerTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
723
		powerTextCell.setBorder(Rectangle.NO_BORDER);
730
		powerTextCell.setBorder(Rectangle.NO_BORDER);*/
724
 
731
 
725
		String flipkartCodeFontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
732
		String flipkartCodeFontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
726
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
733
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
727
		ttfFontFactory.register(flipkartCodeFontPath, "barcode");
734
		ttfFontFactory.register(flipkartCodeFontPath, "barcode");
728
		Font flipkartBarCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, 20);
735
		Font flipkartBarCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, 20);
729
		
736
		
730
		PdfPCell serialNumberTextCell = new PdfPCell(new Phrase("SerialNumber", helvetica10));
737
		PdfPCell serialNumberTextCell = new PdfPCell(new Phrase("SerialNumber", helvetica10));
-
 
738
		serialNumberTextCell.setBorder(Rectangle.NO_BORDER);
731
		PdfPCell serialNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getLineitems().get(0).getSerial_number() + "*", flipkartBarCodeFont));
739
		PdfPCell serialNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getLineitems().get(0).getSerial_number() + "*", flipkartBarCodeFont));
732
		serialNumberBarCodeCell .setBorder(Rectangle.NO_BORDER);
740
		serialNumberBarCodeCell .setBorder(Rectangle.NO_BORDER);
733
		serialNumberBarCodeCell .setPaddingTop(11.0f);
741
		serialNumberBarCodeCell .setPaddingTop(11.0f);
734
		
742
		
735
		
743
		
736
		PdfPCell invoiceNumberTextCell = new PdfPCell(new Phrase("InvoiceNumber", helvetica10));
744
		PdfPCell invoiceNumberTextCell = new PdfPCell(new Phrase("InvoiceNumber", helvetica10));
-
 
745
		invoiceNumberTextCell.setBorder(Rectangle.NO_BORDER);
737
		PdfPCell invoiceNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getInvoice_number() + "*", flipkartBarCodeFont));
746
		PdfPCell invoiceNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getInvoice_number() + "*", flipkartBarCodeFont));
738
		invoiceNumberBarCodeCell .setBorder(Rectangle.NO_BORDER);
747
		invoiceNumberBarCodeCell.setBorder(Rectangle.NO_BORDER);
739
		invoiceNumberBarCodeCell .setPaddingTop(11.0f);
748
		invoiceNumberBarCodeCell.setPaddingTop(11.0f);
740
		
749
		
741
		PdfPCell vatAmtTextCell = new PdfPCell(new Phrase("Vat Amount", helvetica10));
750
		PdfPCell vatAmtTextCell = new PdfPCell(new Phrase("Vat Amount", helvetica10));
-
 
751
		vatAmtTextCell.setBorder(Rectangle.NO_BORDER);
742
		PdfPCell vatAmtBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getLineitems().get(0).getVatRate() * order.getLineitems().get(0).getTotal_price()/100.0 + "*", flipkartBarCodeFont));
752
		PdfPCell vatAmtBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getLineitems().get(0).getVatRate() * order.getLineitems().get(0).getTotal_price()/100.0 + "*", flipkartBarCodeFont));
743
		vatAmtBarCodeCell.setBorder(Rectangle.NO_BORDER);
753
		vatAmtBarCodeCell.setBorder(Rectangle.NO_BORDER);
744
		vatAmtBarCodeCell.setPaddingTop(11.0f);
754
		vatAmtBarCodeCell.setPaddingTop(11.0f);
745
		
755
		
746
		
756
		
747
		flipkartTable.addCell(powerTextCell);
757
		//flipkartTable.addCell(powerTextCell);
748
		flipkartTable.addCell(serialNumberTextCell);
758
		flipkartTable.addCell(serialNumberTextCell);
749
		flipkartTable.addCell(serialNumberBarCodeCell);
759
		flipkartTable.addCell(serialNumberBarCodeCell);
750
		flipkartTable.addCell(invoiceNumberTextCell);
760
		flipkartTable.addCell(invoiceNumberTextCell);
751
		flipkartTable.addCell(invoiceNumberBarCodeCell);
761
		flipkartTable.addCell(invoiceNumberBarCodeCell);
752
		flipkartTable.addCell(vatAmtTextCell);
762
		flipkartTable.addCell(vatAmtTextCell);