diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 0596462e0c..91ffddfea1 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -743,6 +743,8 @@ class InvoiceRepository extends BaseRepository $item->tax_rate1 = $recurItem->tax_rate1; $item->tax_name2 = $recurItem->tax_name2; $item->tax_rate2 = $recurItem->tax_rate2; + $item->custom_value1 = Utils::processVariables($recurItem->custom_value1); + $item->custom_value2 = Utils::processVariables($recurItem->custom_value2); $invoice->invoice_items()->save($item); } diff --git a/public/built.js b/public/built.js index 2ebcfe7e36..7be10bc1f8 100644 --- a/public/built.js +++ b/public/built.js @@ -31359,7 +31359,9 @@ NINJA.invoiceLines = function(invoice) { var notes = item.notes; var productKey = item.product_key; var tax1 = ''; - var tax2 = ''; + var tax2 = ''; + var custom_value1 = item.custom_value1; + var custom_value2 = item.custom_value2; if (showItemTaxes) { if (item.tax_name1) { @@ -31381,6 +31383,8 @@ NINJA.invoiceLines = function(invoice) { if (invoice.is_recurring) { notes = processVariables(notes); productKey = processVariables(productKey); + custom_value1 = processVariables(item.custom_value1); + custom_value2 = processVariables(item.custom_value2); } var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty)); @@ -31393,10 +31397,10 @@ NINJA.invoiceLines = function(invoice) { } row.push({style:["notes", rowStyle], stack:[{text:notes || ' '}]}); if (invoice.features.invoice_settings && account.custom_invoice_item_label1) { - row.push({style:["customValue1", rowStyle], text:item.custom_value1 || ' '}); + row.push({style:["customValue1", rowStyle], text:custom_value1 || ' '}); } if (invoice.features.invoice_settings && account.custom_invoice_item_label2) { - row.push({style:["customValue2", rowStyle], text:item.custom_value2 || ' '}); + row.push({style:["customValue2", rowStyle], text:custom_value2 || ' '}); } row.push({style:["cost", rowStyle], text:cost}); if (!hideQuantity) { diff --git a/public/js/pdf.pdfmake.js b/public/js/pdf.pdfmake.js index 26d82f979c..4ee0b306da 100644 --- a/public/js/pdf.pdfmake.js +++ b/public/js/pdf.pdfmake.js @@ -358,7 +358,9 @@ NINJA.invoiceLines = function(invoice) { var notes = item.notes; var productKey = item.product_key; var tax1 = ''; - var tax2 = ''; + var tax2 = ''; + var custom_value1 = item.custom_value1; + var custom_value2 = item.custom_value2; if (showItemTaxes) { if (item.tax_name1) { @@ -380,6 +382,8 @@ NINJA.invoiceLines = function(invoice) { if (invoice.is_recurring) { notes = processVariables(notes); productKey = processVariables(productKey); + custom_value1 = processVariables(item.custom_value1); + custom_value2 = processVariables(item.custom_value2); } var lineTotal = roundToTwo(NINJA.parseFloat(item.cost)) * roundToTwo(NINJA.parseFloat(item.qty)); @@ -392,10 +396,10 @@ NINJA.invoiceLines = function(invoice) { } row.push({style:["notes", rowStyle], stack:[{text:notes || ' '}]}); if (invoice.features.invoice_settings && account.custom_invoice_item_label1) { - row.push({style:["customValue1", rowStyle], text:item.custom_value1 || ' '}); + row.push({style:["customValue1", rowStyle], text:custom_value1 || ' '}); } if (invoice.features.invoice_settings && account.custom_invoice_item_label2) { - row.push({style:["customValue2", rowStyle], text:item.custom_value2 || ' '}); + row.push({style:["customValue2", rowStyle], text:custom_value2 || ' '}); } row.push({style:["cost", rowStyle], text:cost}); if (!hideQuantity) {