Work on product fields

This commit is contained in:
Hillel Coren 2017-10-30 11:56:10 +02:00
parent 509a59d5d4
commit 5e7f6a029b

View File

@ -460,7 +460,7 @@ NINJA.invoiceColumns = function(invoice, design, isTasks)
columns.push(width)
}
console.log(columns);
//console.log(columns);
return columns;
}
@ -556,8 +556,6 @@ NINJA.invoiceLines = function(invoice, isSecondTable) {
}
} else if (field == 'tax' && ! invoice.has_item_taxes) {
continue;
} else if (field == 'product_key' && ! invoice.has_product_key) {
continue;
} else if (field == 'unit_cost' || field == 'rate' || field == 'hours') {
headerStyles.push('cost');
}
@ -644,8 +642,6 @@ NINJA.invoiceLines = function(invoice, isSecondTable) {
continue;
} else if (field == 'tax' && ! invoice.has_item_taxes) {
continue;
} else if (field == 'product_key' && ! invoice.has_product_key) {
continue;
}
if (field == 'item' || field == 'service') {
@ -654,10 +650,10 @@ NINJA.invoiceLines = function(invoice, isSecondTable) {
} else if (field == 'description') {
value = item.notes;
} else if (field == 'unit_cost' || field == 'rate') {
value = item.cost;
value = cost;
styles.push('cost');
} else if (field == 'quantity' || field == 'hours') {
value = formatAmount(item.qty, invoice.client.currency_id, getPrecision(item.qty));
value = qty;
if (field == 'hours') {
styles.push('cost');
}
@ -688,7 +684,7 @@ NINJA.invoiceLines = function(invoice, isSecondTable) {
grid.push(row);
}
console.log(JSON.stringify(grid));
//console.log(JSON.stringify(grid));
return NINJA.prepareDataTable(grid, 'invoiceItems');
}