Hi,
Thank you for example, I believe I got the idea.
Still, did not manage to show an additional column (even without using any calculation).
Perhaps I am still missing something. This is set also as SalesInvVatCol report on my
erpnext.com account.
Do you have any suggestion?
.......
<!-- Javascript -->
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Sales Invoice',
doc.name,
'entries',
'Sales Invoice Item',
[// Here specify the table columns to be displayed
'SR', 'item_code', 'description', 'qty', 'stock_uom',
'export_rate', 'export_amount',
'vatvat'
],
[// Here specify the labels of column headings
'Sr', 'Item Code', 'Description', 'Qty',
'UoM', 'Basic Rate', 'Amount','VAT'
],
[// Here specify the column widths
'3%', '10%', '15%', '32%', '5%',
'10%', '15%',
'10%' ],
null,
null,
{
'description' : function(data_row) {
if(data_row.adj_rate) {
var to_append = '<div style="padding-left: 15px;"><i>Discount: ' +
data_row.adj_rate + '% on ' + doc.currency + ' ' +
fmt_money(data_row.ref_rate) + '</i></div>';
if(data_row.description.indexOf(to_append)==-1) {
return data_row.description + to_append;
} else { return data_row.description; }
} else {
return data_row.description;
}
},
// return vavat column just a value for test
'vatvat' : function(data_row) {
return data_row.amount;
} }
);