Subversion Repositories SmartDukaan

Rev

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

Rev 9100 Rev 9319
Line 142... Line 142...
142
 
142
 
143
	private static final Font helveticaBold8 = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 8);
143
	private static final Font helveticaBold8 = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 8);
144
	private static final Font helveticaBold12 = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 12);
144
	private static final Font helveticaBold12 = FontFactory.getFont(FontFactory.HELVETICA_BOLD, 12);
145
 
145
 
146
	private static final String delhiPincodePrefix = "11";
146
	private static final String delhiPincodePrefix = "11";
-
 
147
	private static final String[] maharashtraPincodePrefix = {"40", "41", "42", "43", "44"};
147
 
148
 
148
	public InvoiceGenerationService() {
149
	public InvoiceGenerationService() {
149
		try {
150
		try {
150
			tsc = new TransactionClient();
151
			tsc = new TransactionClient();
151
			csc = new InventoryClient();
152
			csc = new InventoryClient();
Line 692... Line 693...
692
		addrAndOrderDetailsTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
693
		addrAndOrderDetailsTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
693
		addrAndOrderDetailsTable.addCell(customerAddress);
694
		addrAndOrderDetailsTable.addCell(customerAddress);
694
		addrAndOrderDetailsTable.addCell(new Phrase(" "));
695
		addrAndOrderDetailsTable.addCell(new Phrase(" "));
695
		addrAndOrderDetailsTable.addCell(orderDetails);
696
		addrAndOrderDetailsTable.addCell(orderDetails);
696
 
697
 
697
		boolean isVAT = order.getCustomer_pincode().startsWith(delhiPincodePrefix);
698
		boolean isVAT = isVatApplicable(order);
698
		PdfPTable invoiceTable = getBottomInvoiceTable(order, isVAT);
699
		PdfPTable invoiceTable = getBottomInvoiceTable(order, isVAT);
699
 
700
 
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
		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);
702
		disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
702
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
703
		disclaimerCell.setBorder(Rectangle.NO_BORDER);
Line 766... Line 767...
766
		
767
		
767
		return flipkartTable;
768
		return flipkartTable;
768
		
769
		
769
	}*/
770
	}*/
770
	
771
	
-
 
772
	private boolean isVatApplicable(Order order) {
-
 
773
		if(order.getWarehouse_id() == 7) {
-
 
774
			if(order.getCustomer_pincode().startsWith(delhiPincodePrefix)) {
-
 
775
				return true;
-
 
776
			} else {
-
 
777
				return false;
-
 
778
			}
-
 
779
		} else {
-
 
780
			for(int i=0; i< maharashtraPincodePrefix.length; i++) {
-
 
781
				if(order.getCustomer_pincode().startsWith(maharashtraPincodePrefix[i])) {
-
 
782
					return true;
-
 
783
				}
-
 
784
			}
-
 
785
			return false;
-
 
786
		}
-
 
787
	}
-
 
788
 
771
	private PdfPTable getFlipkartBarCodes(Order order) {
789
	private PdfPTable getFlipkartBarCodes(Order order) {
772
		PdfPTable flipkartTable = new PdfPTable(3);
790
		PdfPTable flipkartTable = new PdfPTable(3);
773
		
791
		
774
		PdfPCell spacerCell = new PdfPCell();
792
		PdfPCell spacerCell = new PdfPCell();
775
		spacerCell.setBorder(Rectangle.NO_BORDER);
793
		spacerCell.setBorder(Rectangle.NO_BORDER);