Subversion Repositories SmartDukaan

Rev

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

Rev 6318 Rev 6331
Line 415... Line 415...
415
            */
415
            */
416
            invoiceTable.addCell(getProductNameCell(lineitem, false));
416
            invoiceTable.addCell(getProductNameCell(lineitem, false));
417
            
417
            
418
            invoiceTable.addCell(new Phrase(lineitem.getQuantity() + "", helvetica8));
418
            invoiceTable.addCell(new Phrase(lineitem.getQuantity() + "", helvetica8));
419
            
419
            
420
            invoiceTable.addCell(getPriceCell(lineitem.getUnit_price()));
420
            invoiceTable.addCell(getPriceCell(lineitem.getUnit_price()-order.getGvAmount()));
421
 
421
 
422
            invoiceTable.addCell(getPriceCell(lineitem.getTotal_price()));
422
            invoiceTable.addCell(getPriceCell(lineitem.getTotal_price()-order.getGvAmount()));
423
        }
423
        }
424
    }
424
    }
425
    
425
    
426
    private PdfPCell getAddressCell(String address) {
426
    private PdfPCell getAddressCell(String address) {
427
        Paragraph addressParagraph = new Paragraph(address, new Font(FontFamily.TIMES_ROMAN, 8f));
427
        Paragraph addressParagraph = new Paragraph(address, new Font(FontFamily.TIMES_ROMAN, 8f));
Line 756... Line 756...
756
    private PdfPTable getExtraInfoTable(Order order, Provider provider, float barcodeFontSize){
756
    private PdfPTable getExtraInfoTable(Order order, Provider provider, float barcodeFontSize){
757
        PdfPTable extraInfoTable = new PdfPTable(1);
757
        PdfPTable extraInfoTable = new PdfPTable(1);
758
        extraInfoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
758
        extraInfoTable.getDefaultCell().setBorder(Rectangle.NO_BORDER);
759
        extraInfoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
759
        extraInfoTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
760
 
760
 
761
        String fontPath = InvoiceGenerationService.class.getResource("/saholic.TTF").getPath();
761
        String fontPath = InvoiceGenerationService.class.getResource("/saholic-wn.TTF").getPath();
762
        FontFactoryImp ttfFontFactory = new FontFactoryImp();
762
        FontFactoryImp ttfFontFactory = new FontFactoryImp();
763
        ttfFontFactory.register(fontPath, "barcode");
763
        ttfFontFactory.register(fontPath, "barcode");
764
        Font barCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, barcodeFontSize);
764
        Font barCodeFont = ttfFontFactory.getFont("barcode", BaseFont.CP1252, true, barcodeFontSize);
765
        
765
        
766
        PdfPCell extraInfoCell = new PdfPCell(new Paragraph( "*" + order.getId() + "*        *" + order.getCustomer_name() + "*        *"  + order.getTotal_amount() + "*", barCodeFont));
766
        PdfPCell extraInfoCell = new PdfPCell(new Paragraph( "*" + order.getId() + "*        *" + order.getCustomer_name() + "*        *"  + order.getTotal_amount() + "*", barCodeFont));