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