Skip to content

Instantly share code, notes, and snippets.

@lxthien
Created October 11, 2013 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxthien/f407205adc84a5e37f49 to your computer and use it in GitHub Desktop.
Save lxthien/f407205adc84a5e37f49 to your computer and use it in GitHub Desktop.
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Journal Voucher',
doc.name,
'entries',
'Journal Entries',
[// Here specify the table columns to be displayed
'SR', 'account'
],
[// Here specify the labels of column headings
'Sr', 'Account'
],
[// Here specify the column widths
'50%', '50%'
],
null,
null
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
} else {
out = '';
for(var i=0; i < (10-1); i++) {
out += table[i].innerHTML +
'<div style = "page-break-after: always;" \
class = "page_break"></div>\
<div class="page-settings"></div>';
}
out += table[table.length-1].innerHTML;
}
return out;
},
print_other_charges: function(parent) {
var oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');
var rows = '<table width=100%>\n';
for(var i=0; i<(table.length-1); i++) {
if(!oc[i].included_in_print_rate) {
rows +=
'<tr>\n' +
'\t<td>thu</td>\n' +
'\t<td></td>\n' +
'\t<td width=38%>thu</td>\n' +
'</tr>\n';
}
}
return rows + '</table>\n';
}
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment