| Line 349... |
Line 349... |
| 349 |
table.addCell(addressAndNoteTable);
|
349 |
table.addCell(addressAndNoteTable);
|
| 350 |
return table;
|
350 |
return table;
|
| 351 |
}
|
351 |
}
|
| 352 |
|
352 |
|
| 353 |
private void addLogoTable(PdfPTable logoTable, Order order) {
|
353 |
private void addLogoTable(PdfPTable logoTable, Order order) {
|
| - |
|
354 |
logoTable.flushContent();
|
| 354 |
logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
355 |
logoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| 355 |
logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
|
356 |
logoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
|
| 356 |
logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
|
357 |
logoTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_BOTTOM);
|
| 357 |
|
358 |
|
| 358 |
PdfPCell logoCell;
|
359 |
PdfPCell logoCell;
|
| 359 |
String logoPath;
|
360 |
String logoPath;
|
| 360 |
Image logo=null;
|
- |
|
| 361 |
logger.info("Order Source Value........."+order.getSource());
|
361 |
logger.info("Order Source Value........."+order.getSource());
|
| 362 |
if(order.getSource() == OrderSource.STORE.getValue()){
|
362 |
if(order.getSource() == OrderSource.STORE.getValue()){
|
| 363 |
logoCell = new PdfPCell(new Phrase(""));
|
363 |
logoCell = new PdfPCell(new Phrase(""));
|
| 364 |
|
364 |
|
| 365 |
}else{
|
365 |
}else{
|
| 366 |
logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
|
366 |
logoPath = InvoiceGenerationService.class.getResource("/logo.jpg").getPath();
|
| 367 |
logger.info("Logo Path........."+logoPath);
|
367 |
logger.info("Logo Path........."+logoPath);
|
| 368 |
|
368 |
|
| 369 |
try {
|
369 |
try {
|
| 370 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
370 |
logoCell = new PdfPCell(Image.getInstance(logoPath), false);
|
| 371 |
logo=Image.getInstance(logoPath);
|
- |
|
| 372 |
} catch (Exception e) {
|
371 |
} catch (Exception e) {
|
| 373 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
372 |
//Too Many exceptions to catch here: BadElementException, MalformedURLException and IOException
|
| 374 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
373 |
logger.warn("Couldn't load the Saholic logo: ", e);
|
| 375 |
logoCell = new PdfPCell(new Phrase("Saholic Logo"));
|
374 |
logoCell = new PdfPCell(new Phrase("Saholic Logo"));
|
| 376 |
}
|
375 |
}
|
| Line 378... |
Line 377... |
| 378 |
}
|
377 |
}
|
| 379 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
378 |
logoCell.setBorder(Rectangle.NO_BORDER);
|
| 380 |
logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
379 |
logoCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| 381 |
|
380 |
|
| 382 |
logoTable.addCell(logoCell);
|
381 |
logoTable.addCell(logoCell);
|
| 383 |
//if(logo!=null)
|
- |
|
| 384 |
//logoTable.addCell(logo);
|
- |
|
| 385 |
}
|
382 |
}
|
| 386 |
|
383 |
|
| 387 |
private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
|
384 |
private Font getBarCodeFont(Provider provider, float barcodeFontSize) {
|
| 388 |
String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
|
385 |
String fontPath = InvoiceGenerationService.class.getResource("/" + provider.getName().toLowerCase() + "/barcode.TTF").getPath();
|
| 389 |
FontFactoryImp ttfFontFactory = new FontFactoryImp();
|
386 |
FontFactoryImp ttfFontFactory = new FontFactoryImp();
|
| Line 609... |
Line 606... |
| 609 |
|
606 |
|
| 610 |
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));
|
607 |
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));
|
| 611 |
disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
608 |
disclaimerCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| 612 |
disclaimerCell.setBorder(Rectangle.NO_BORDER);
|
609 |
disclaimerCell.setBorder(Rectangle.NO_BORDER);
|
| 613 |
|
610 |
|
| 614 |
//taxTable.addCell(logoTable);
|
611 |
taxTable.addCell(logoTable);
|
| 615 |
taxTable.addCell(retailInvoiceTitleCell);
|
612 |
taxTable.addCell(retailInvoiceTitleCell);
|
| 616 |
taxTable.addCell(sorlAddress);
|
613 |
taxTable.addCell(sorlAddress);
|
| 617 |
taxTable.addCell(addrAndOrderDetailsTable);
|
614 |
taxTable.addCell(addrAndOrderDetailsTable);
|
| 618 |
taxTable.addCell(invoiceTable);
|
615 |
taxTable.addCell(invoiceTable);
|
| 619 |
taxTable.addCell(disclaimerCell);
|
616 |
taxTable.addCell(disclaimerCell);
|