InvoiceLineTable table = createInvoiceHeaders();
for (InvoiceLineType invoiceLineType : pdfInvoice.getInvoiceType().getInvoiceLine()) {
QuantityConverter quantityConverter =
DefaultInvoiceRenderer
.convertInvoiceQuantityIfRequired(invoiceLineType.getInvoicedQuantity(),
invoiceLineType.getPrice(), pdfInvoice.getLocale(),
pdfInvoice.getUbl4JConfigurationBean());
for (org.openinvoice.ubl4j.core.common.text.TextLabel label : invoiceRendererBean.getInvoiceLineLabelsToDisplay()) {
// Description
if (label == org.openinvoice.ubl4j.core.common.text.TextLabel.INV_ITEM_DESCRIPTION) {
table.addValueCell(getInvoiceLineItemDescription(invoiceLineType),
invoiceRendererBean.getInvoiceLineFont());
}
// Unit of the quantity
if (label == org.openinvoice.ubl4j.core.common.text.TextLabel.INV_ITEM_UNIT) {
table.addValueCell(quantityConverter.getInvoicedQuantityType().getUnitCode(),
invoiceRendererBean.getInvoiceLineFont());
}
// Quantity
if (label == org.openinvoice.ubl4j.core.common.text.TextLabel.INV_ITEM_QUANTITY) {
NumberWrapper quantity = new NumberWrapper(quantityConverter.getInvoicedQuantityType().getValue());
quantity.setLocale(pdfInvoice.getLocale());
table.addValueCell(quantity, invoiceRendererBean.getInvoiceLineFont());
}
// Item price
if (label == org.openinvoice.ubl4j.core.common.text.TextLabel.INV_ITEM_PRICE) {
table.addValueCell(createLinePriceAmount(quantityConverter.getPriceType().getPriceAmount()),
invoiceRendererBean.getInvoiceLineFont());
}
// Tax rate
if (label.equals(org.openinvoice.ubl4j.core.common.text.TextLabel.INV_ITEM_VAT_RATE)) {