mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Copy custom values of invoice items
This commit is contained in:
parent
e4ce4e0fc8
commit
986156117e
@ -743,6 +743,8 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$item->tax_rate1 = $recurItem->tax_rate1;
|
$item->tax_rate1 = $recurItem->tax_rate1;
|
||||||
$item->tax_name2 = $recurItem->tax_name2;
|
$item->tax_name2 = $recurItem->tax_name2;
|
||||||
$item->tax_rate2 = $recurItem->tax_rate2;
|
$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);
|
$invoice->invoice_items()->save($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31360,6 +31360,8 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
var productKey = item.product_key;
|
var productKey = item.product_key;
|
||||||
var tax1 = '';
|
var tax1 = '';
|
||||||
var tax2 = '';
|
var tax2 = '';
|
||||||
|
var custom_value1 = item.custom_value1;
|
||||||
|
var custom_value2 = item.custom_value2;
|
||||||
|
|
||||||
if (showItemTaxes) {
|
if (showItemTaxes) {
|
||||||
if (item.tax_name1) {
|
if (item.tax_name1) {
|
||||||
@ -31381,6 +31383,8 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
if (invoice.is_recurring) {
|
if (invoice.is_recurring) {
|
||||||
notes = processVariables(notes);
|
notes = processVariables(notes);
|
||||||
productKey = processVariables(productKey);
|
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));
|
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 || ' '}]});
|
row.push({style:["notes", rowStyle], stack:[{text:notes || ' '}]});
|
||||||
if (invoice.features.invoice_settings && account.custom_invoice_item_label1) {
|
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) {
|
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});
|
row.push({style:["cost", rowStyle], text:cost});
|
||||||
if (!hideQuantity) {
|
if (!hideQuantity) {
|
||||||
|
@ -359,6 +359,8 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
var productKey = item.product_key;
|
var productKey = item.product_key;
|
||||||
var tax1 = '';
|
var tax1 = '';
|
||||||
var tax2 = '';
|
var tax2 = '';
|
||||||
|
var custom_value1 = item.custom_value1;
|
||||||
|
var custom_value2 = item.custom_value2;
|
||||||
|
|
||||||
if (showItemTaxes) {
|
if (showItemTaxes) {
|
||||||
if (item.tax_name1) {
|
if (item.tax_name1) {
|
||||||
@ -380,6 +382,8 @@ NINJA.invoiceLines = function(invoice) {
|
|||||||
if (invoice.is_recurring) {
|
if (invoice.is_recurring) {
|
||||||
notes = processVariables(notes);
|
notes = processVariables(notes);
|
||||||
productKey = processVariables(productKey);
|
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));
|
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 || ' '}]});
|
row.push({style:["notes", rowStyle], stack:[{text:notes || ' '}]});
|
||||||
if (invoice.features.invoice_settings && account.custom_invoice_item_label1) {
|
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) {
|
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});
|
row.push({style:["cost", rowStyle], text:cost});
|
||||||
if (!hideQuantity) {
|
if (!hideQuantity) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user