| Line 289... |
Line 289... |
| 289 |
PdfPTable taxTable = getTaxCumRetailInvoiceTable(order, provider, shippingLocation.getLocation() + "-" + shippingLocation.getPincode() , shippingLocation.getTinNumber());
|
289 |
PdfPTable taxTable = getTaxCumRetailInvoiceTable(order, provider, shippingLocation.getLocation() + "-" + shippingLocation.getPincode() , shippingLocation.getTinNumber());
|
| 290 |
taxTable.setSpacingBefore(5.0f);
|
290 |
taxTable.setSpacingBefore(5.0f);
|
| 291 |
taxTable.setWidthPercentage(90.0f);
|
291 |
taxTable.setWidthPercentage(90.0f);
|
| 292 |
document.add(new DottedLineSeparator());
|
292 |
document.add(new DottedLineSeparator());
|
| 293 |
document.add(taxTable);
|
293 |
document.add(taxTable);
|
| - |
|
294 |
if(order.getSource() == OrderSource.FLIPKART.getValue()) {
|
| - |
|
295 |
document.add(new DottedLineSeparator());
|
| - |
|
296 |
document.add(getFlipkartBarCodes(order));
|
| - |
|
297 |
}
|
| - |
|
298 |
|
| 294 |
}else{
|
299 |
}else{
|
| 295 |
PdfPTable extraInfoTable = getExtraInfoTable(order, provider, 16, warehouse.getBillingType());
|
300 |
PdfPTable extraInfoTable = getExtraInfoTable(order, provider, 16, warehouse.getBillingType());
|
| 296 |
extraInfoTable.setSpacingBefore(5.0f);
|
301 |
extraInfoTable.setSpacingBefore(5.0f);
|
| 297 |
extraInfoTable.setWidthPercentage(90.0f);
|
302 |
extraInfoTable.setWidthPercentage(90.0f);
|
| 298 |
document.add(new DottedLineSeparator());
|
303 |
document.add(new DottedLineSeparator());
|
| Line 706... |
Line 711... |
| 706 |
taxTable.addCell(invoiceTable);
|
711 |
taxTable.addCell(invoiceTable);
|
| 707 |
taxTable.addCell(disclaimerCell);
|
712 |
taxTable.addCell(disclaimerCell);
|
| 708 |
|
713 |
|
| 709 |
return taxTable;
|
714 |
return taxTable;
|
| 710 |
}
|
715 |
}
|
| - |
|
716 |
|
| - |
|
717 |
private PdfPTable getFlipkartBarCodes(Order order) {
|
| - |
|
718 |
PdfPTable flipkartTable = new PdfPTable(new float[]{0.2f, 0.8f});
|
| - |
|
719 |
|
| - |
|
720 |
PdfPCell powerTextCell = new PdfPCell(new Phrase("Powered By Flipkart", helvetica8));
|
| - |
|
721 |
powerTextCell.setColspan(2);
|
| - |
|
722 |
powerTextCell.setHorizontalAlignment(Element.ALIGN_LEFT);
|
| - |
|
723 |
powerTextCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
724 |
|
| - |
|
725 |
String flipkartCodeFontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
|
| - |
|
726 |
FontFactoryImp ttfFontFactory = new FontFactoryImp();
|
| - |
|
727 |
ttfFontFactory.register(flipkartCodeFontPath, "barcode");
|
| - |
|
728 |
Font flipkartBarCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, 20);
|
| - |
|
729 |
|
| - |
|
730 |
PdfPCell serialNumberTextCell = new PdfPCell(new Phrase("SerialNumber", helvetica10));
|
| - |
|
731 |
PdfPCell serialNumberBarCodeCell = new PdfPCell(new Paragraph("*" + order.getLineitems().get(0).getSerial_number() + "*", flipkartBarCodeFont));
|
| - |
|
732 |
serialNumberBarCodeCell .setBorder(Rectangle.NO_BORDER);
|
| - |
|
733 |
serialNumberBarCodeCell .setPaddingTop(11.0f);
|
| - |
|
734 |
|
| - |
|
735 |
|
| - |
|
736 |
PdfPCell invoiceNumberTextCell = new PdfPCell(new Phrase("InvoiceNumber", helvetica10));
|
| - |
|
737 |
PdfPCell invoiceNumberBarCodeCell = new PdfPCell(new Paragraph("*" + order.getInvoice_number() + "*", flipkartBarCodeFont));
|
| - |
|
738 |
invoiceNumberBarCodeCell .setBorder(Rectangle.NO_BORDER);
|
| - |
|
739 |
invoiceNumberBarCodeCell .setPaddingTop(11.0f);
|
| - |
|
740 |
|
| - |
|
741 |
PdfPCell vatAmtTextCell = new PdfPCell(new Phrase("Vat Amount", helvetica10));
|
| - |
|
742 |
PdfPCell vatAmtBarCodeCell = new PdfPCell(new Paragraph("*" + order.getLineitems().get(0).getVatRate() * order.getLineitems().get(0).getTotal_price()/100.0 + "*", flipkartBarCodeFont));
|
| - |
|
743 |
vatAmtBarCodeCell.setBorder(Rectangle.NO_BORDER);
|
| - |
|
744 |
vatAmtBarCodeCell.setPaddingTop(11.0f);
|
| - |
|
745 |
|
| - |
|
746 |
|
| - |
|
747 |
flipkartTable.addCell(powerTextCell);
|
| - |
|
748 |
flipkartTable.addCell(serialNumberTextCell);
|
| - |
|
749 |
flipkartTable.addCell(serialNumberBarCodeCell);
|
| - |
|
750 |
flipkartTable.addCell(invoiceNumberTextCell);
|
| - |
|
751 |
flipkartTable.addCell(invoiceNumberBarCodeCell);
|
| - |
|
752 |
flipkartTable.addCell(vatAmtTextCell);
|
| - |
|
753 |
flipkartTable.addCell(vatAmtBarCodeCell);
|
| - |
|
754 |
|
| - |
|
755 |
return flipkartTable;
|
| - |
|
756 |
|
| - |
|
757 |
}
|
| 711 |
|
758 |
|
| 712 |
private PdfPTable getCustomerAddressTable(Order order, String destCode, boolean showPaymentMode, Font font, boolean forInvoce){
|
759 |
private PdfPTable getCustomerAddressTable(Order order, String destCode, boolean showPaymentMode, Font font, boolean forInvoce){
|
| 713 |
PdfPTable customerTable = new PdfPTable(1);
|
760 |
PdfPTable customerTable = new PdfPTable(1);
|
| 714 |
customerTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
761 |
customerTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
|
| 715 |
if(forInvoce || order.getPickupStoreId() == 0){
|
762 |
if(forInvoce || order.getPickupStoreId() == 0){
|