Subversion Repositories SmartDukaan

Rev

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

Rev 8096 Rev 8097
Line 266... Line 266...
266
		Font barCodeFont = getBarCodeFont(provider, barcodeFontSize);
266
		Font barCodeFont = getBarCodeFont(provider, barcodeFontSize);
267
 
267
 
268
		PdfPTable table = new PdfPTable(1);
268
		PdfPTable table = new PdfPTable(1);
269
		table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
269
		table.getDefaultCell().setBorder(Rectangle.NO_BORDER);
270
 
270
 
271
		PdfPTable logoTable = new PdfPTable(2);
271
		PdfPTable logoTable = addLogoTable(order); 
272
		addLogoTable(logoTable, order);
-
 
273
		
272
		
274
		PdfPCell titleCell = getTitleCell();
273
		PdfPCell titleCell = getTitleCell();
275
		PdfPTable customerTable = getCustomerAddressTable(order, destCode, false, helvetica12, false);
274
		PdfPTable customerTable = getCustomerAddressTable(order, destCode, false, helvetica12, false);
276
		PdfPTable providerInfoTable = getProviderTable(order, provider, barCodeFont);
275
		PdfPTable providerInfoTable = getProviderTable(order, provider, barCodeFont);
277
 
276
 
Line 348... Line 347...
348
		table.addCell(new Phrase("If undelivered, return to:", helvetica10));
347
		table.addCell(new Phrase("If undelivered, return to:", helvetica10));
349
		table.addCell(addressAndNoteTable);
348
		table.addCell(addressAndNoteTable);
350
		return table;
349
		return table;
351
	}
350
	}
352
 
351
 
353
	private void addLogoTable(PdfPTable logoTable, Order order) {
352
	private PdfPTable addLogoTable(Order order) {
354
		logoTable.flushContent();
353
		PdfPTable logoTable = new PdfPTable(2);
355
		logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
354
		logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
356
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
355
		logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
357
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
356
		logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
358
				
357
				
359
		PdfPCell logoCell;
358
		PdfPCell logoCell;
Line 377... Line 376...
377
		}
376
		}
378
		logoCell.setBorder(Rectangle.NO_BORDER);
377
		logoCell.setBorder(Rectangle.NO_BORDER);
379
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
378
		logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
380
		
379
		
381
		logoTable.addCell(logoCell);
380
		logoTable.addCell(logoCell);
-
 
381
		return logoTable;
382
	}
382
	}
383
 
383
 
384
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
384
	private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
385
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
385
		String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
386
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
386
		FontFactoryImp ttfFontFactory = new FontFactoryImp();
Line 573... Line 573...
573
		PdfPTable taxTable = new PdfPTable(1);
573
		PdfPTable taxTable = new PdfPTable(1);
574
		Phrase phrase = null;
574
		Phrase phrase = null;
575
		taxTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
575
		taxTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
576
		taxTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
576
		taxTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
577
 
577
 
578
		PdfPTable logoTable = new PdfPTable(2);
578
		PdfPTable logoTable = addLogoTable(order);
579
		addLogoTable(logoTable, order);
-
 
580
		
579
		
581
		if (order.getOrderType().equals(OrderType.B2B)) {
580
		if (order.getOrderType().equals(OrderType.B2B)) {
582
			phrase = new Phrase("TAX INVOICE", helveticaBold12);
581
			phrase = new Phrase("TAX INVOICE", helveticaBold12);
583
		} else {
582
		} else {
584
			phrase = new Phrase("RETAIL INVOICE", helveticaBold12);
583
			phrase = new Phrase("RETAIL INVOICE", helveticaBold12);