Skip to content

Instantly share code, notes, and snippets.

@lxthien
Created October 14, 2013 05:00
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/6970994 to your computer and use it in GitHub Desktop.
Save lxthien/6970994 to your computer and use it in GitHub Desktop.
<style>
.page-settings{width: 8.3in; margin: 0 auto;}
.jv-head{width: 8.3in;}
.noborder{width: 100%; text-align: left;}
.noborder tbody{border-bottom: 1px solid #000;}
.noborder-01{height: 30px;}
.noborder-01 tbody{border-bottom: none;}
.common page-body{width: 100%;}
.jv-footer{width: 100%; margin-bottom: 30px; margin-top: 15px;}
.jv-footer table{border-collapse: collapse;}
.jv-footer td{}
.jv-signature{width: 100%;}
.jv-signature table{width: 100%;}
.jv-signature td{width: 33%; text-align: center;}
</style>
<script>
si_std = {
print_item_table: function() {
var table = print_table(
'Journal Voucher',
doc.name,
'entries',
'Journal Voucher Detail',
['SR', 'account', 'cost_center', 'debit', 'credit', 'balance'],
['Sr', 'Account', 'Cost Center', 'Debit', 'Credit', 'Account Balances'],
['5%', '29%', '20%', '13%', '13%', '20%']
);
// This code takes care of page breaks
if(table.appendChild) {
out = table.innerHTML;
}else {
out = '';
for(var i=0; i < (table.length-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<9; 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>
<div class="jv-head" style="position: relative;">
<table class="noborder" style="width: 100%;">
<tbody>
<tr>
<td><b><script>'<h1>' + (doc.select_print_heading || 'Jounnal Voucher') + '</h1>'</script></b></td>
</tr>
<tr>
<td><h3><script>cur_frm.docname</script></h3></td>
</tr>
</tbody>
</table>
<table class="noborder noborder-01" width="100%">
<tbody>
<tr>
<td>Voucher Type: <script>doc.voucher_type</script></td>
<td>Posting Date: <script>date.str_to_user(doc.posting_date)</script></td>
</tr>
</tbody>
</table>
</div>
<div class="common page-body">
<script>si_std.print_item_table()</script>
</div>
<div class="jv-footer">
<table>
<tbody>
<tr>
<td width="25%"><b>Total Debit</b></td>
<td width="25%"><script>doc.total_debit</script></td>
<td width="17%"></td>
<td width="33%"></td>
</tr>
<tr>
<td><b>Total Crebit</b></td>
<td><script>doc.total_credit</script></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td><b>User Remark</b></td>
<td><script>doc.user_remark</script></td>
</tr>
<tr>
<td></td>
<td></td>
<td><b>Remark</b></td>
<td><script>doc.remark</script></td>
</tr>
</tbody>
</table>
</div>
<div class="jv-signature">
<table>
<tbody>
<tr>
<td><b>Director</b></td>
<td><b>Receiver</b></td>
<td><b>Scheduled</b></td>
</tr>
</tbody>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment