Subversion Repositories SmartDukaan

Rev

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

Rev 9511 Rev 9588
Line 721... Line 721...
721
			
721
			
722
		}
722
		}
723
		return taxTable;
723
		return taxTable;
724
	}
724
	}
725
	
725
	
726
/*	private PdfPTable getFlipkartBarCodes(Order order) {
-
 
727
		PdfPTable flipkartTable = new PdfPTable(new float[]{0.2f, 0.8f});
-
 
728
		
-
 
729
		PdfPCell powerTextCell = new PdfPCell(new Phrase("Powered By  Flipkart", helvetica8));
-
 
730
		powerTextCell.setColspan(2);
-
 
731
		powerTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
-
 
732
		powerTextCell.setBorder(Rectangle.NO_BORDER);
-
 
733
 
-
 
734
		String flipkartCodeFontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
-
 
735
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
-
 
736
		ttfFontFactory.register(flipkartCodeFontPath, "barcode");
-
 
737
		Font flipkartBarCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, 20);
-
 
738
		
-
 
739
		PdfPCell serialNumberTextCell = new PdfPCell(new Phrase("SerialNumber", helvetica10));
-
 
740
		serialNumberTextCell.setBorder(Rectangle.NO_BORDER);
-
 
741
		PdfPCell serialNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  (order.getLineitems().get(0).getSerial_number()==null?order.getLineitems().get(0).getItem_number():order.getLineitems().get(0).getSerial_number()) + "*", flipkartBarCodeFont));
-
 
742
		serialNumberBarCodeCell.setBorder(Rectangle.NO_BORDER);
-
 
743
		serialNumberBarCodeCell.setPaddingTop(11.0f);
-
 
744
		
-
 
745
		
-
 
746
		PdfPCell invoiceNumberTextCell = new PdfPCell(new Phrase("InvoiceNumber", helvetica10));
-
 
747
		invoiceNumberTextCell.setBorder(Rectangle.NO_BORDER);
-
 
748
		PdfPCell invoiceNumberBarCodeCell = new PdfPCell(new Paragraph("*" +  order.getInvoice_number() + "*", flipkartBarCodeFont));
-
 
749
		invoiceNumberBarCodeCell.setBorder(Rectangle.NO_BORDER);
-
 
750
		invoiceNumberBarCodeCell.setPaddingTop(11.0f);
-
 
751
		
-
 
752
		PdfPCell vatAmtTextCell = new PdfPCell(new Phrase("Vat Amount", helvetica10));
-
 
753
		vatAmtTextCell.setBorder(Rectangle.NO_BORDER);
-
 
754
		double rate = order.getLineitems().get(0).getVatRate();
-
 
755
		double salesTax = (rate * order.getTotal_amount())/(100 + rate);
-
 
756
		PdfPCell vatAmtBarCodeCell = new PdfPCell(new Paragraph("*" +  salesTax + "*", flipkartBarCodeFont));
-
 
757
		vatAmtBarCodeCell.setBorder(Rectangle.NO_BORDER);
-
 
758
		vatAmtBarCodeCell.setPaddingTop(11.0f);
-
 
759
		
-
 
760
		
-
 
761
		//flipkartTable.addCell(powerTextCell);
-
 
762
		flipkartTable.addCell(serialNumberTextCell);
-
 
763
		flipkartTable.addCell(serialNumberBarCodeCell);
-
 
764
		flipkartTable.addCell(invoiceNumberTextCell);
-
 
765
		flipkartTable.addCell(invoiceNumberBarCodeCell);
-
 
766
		flipkartTable.addCell(vatAmtTextCell);
-
 
767
		flipkartTable.addCell(vatAmtBarCodeCell);
-
 
768
		
-
 
769
		return flipkartTable;
-
 
770
		
-
 
771
	}*/
-
 
772
	
-
 
773
	private boolean isVatApplicable(Order order) {
726
	private boolean isVatApplicable(Order order) {
774
		if(order.getWarehouse_id() == 7) {
727
		if(order.getWarehouse_id() == 7) {
775
			if(order.getCustomer_pincode().startsWith(delhiPincodePrefix)) {
728
			if(order.getCustomer_pincode().startsWith(delhiPincodePrefix)) {
776
				return true;
729
				return true;
777
			} else {
730
			} else {
Line 1031... Line 984...
1031
 
984
 
1032
		populateBottomInvoiceTable(order, invoiceTable, rate);
985
		populateBottomInvoiceTable(order, invoiceTable, rate);
1033
 
986
 
1034
		PdfPCell salesTaxCell = getPriceCell(salesTax);
987
		PdfPCell salesTaxCell = getPriceCell(salesTax);
1035
		
988
		
1036
		if(order.getTaxType() == TaxType.CFORM) {
989
		if(order.getTaxType().equals(TaxType.CFORM)) {
1037
			invoiceTable.addCell(getCFORMLabelCell());
990
			invoiceTable.addCell(getCFORMLabelCell());
1038
		} else {
991
		} else {
1039
			invoiceTable.addCell(getVATLabelCell(isVAT));
992
			invoiceTable.addCell(getVATLabelCell(isVAT));
1040
		}
993
		}
1041
		invoiceTable.addCell(new Phrase(rate + "%", helvetica8));
994
		invoiceTable.addCell(new Phrase(rate + "%", helvetica8));