27 lines
4.5 KiB
Plaintext
27 lines
4.5 KiB
Plaintext
# Print Format, POS Invoice
|
|
[
|
|
|
|
# These values are common in all dictionaries
|
|
{
|
|
'creation': '2011-10-19 14:27:47',
|
|
'docstatus': 0,
|
|
'modified': '2011-10-19 14:29:45',
|
|
'modified_by': 'Administrator',
|
|
'owner': 'Administrator'
|
|
},
|
|
|
|
# These values are common for all Print Format
|
|
{
|
|
'doctype': 'Print Format',
|
|
'html': '<html>\n<head>\n<!--Other charges function-->\n<script>\n var make_row = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n return \'<tr><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:20%">\'+doc.currency+\'</td>\'\n +\'<td style="width:30%;text-align:right">\'+(val?val:\'0.00\')+\'</td>\'\n +\'</tr>\'\n }\n var make_row1 = function(title,val,bold){\n var bstart = \'<b>\'; var bend = \'</b>\';\n \n return \'<tr style="font-family:courier new; line-height:150%"><td style="width:50%">\'+(bold?bstart:\'\')+title+(bold?bend:\'\')+\'</td>\'\n +\'<td style="width:50%;text-align:right">\'+(bold?bstart:\'\')+(val?val:\'0.00\')+(bold?bend:\'\')+\'</td>\'\n +\'</tr>\'\n }\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals[\'Control Panel\'][\'Control Panel\'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= \'\';\n\t\t\n\treturn lh;\n}\n\n function get_tax_details(){\n \n var cl = getchildren(\'RV Tax Detail\',doc.name,\'other_charges\');\n var out = \'\';\n\n// if(cl.length){\n out += \'<div><table style="float: right;">\';\n for(var i=0;i<cl.length;i++){\n out += make_row1(cl[i].description,fmt_money(convert_rate(cl[i].tax_amount)),0);\n }\n\n out += make_row1(\'TOTAL\',fmt_money(doc.grand_total),1);\n // }\n out +=\'</table></div>\';\n return out;\n }\n function get_other_charges(){\n var out =\'\';\n out += \'<div><table cssClass="noborder" style="width:100%">\';\n \n out += make_row(\'Net Total\',fmt_money(convert_rate(doc.net_total)),1)\n +make_row(\'Total Taxes\',fmt_money(convert_rate(doc.other_charges_total)),0)\n +make_row(\'Grand Total\',fmt_money(convert_rate(doc.grand_total)),1)\n +make_row(\'Rounded Total\',fmt_money(convert_rate(doc.rounded_total)),1)\n +make_row(\'Outstanding Amount\',fmt_money(convert_rate(doc.outstanding_amount)),1)\n out += \'</table></div>\';\n return out;\n }\n\n \n function convert_rate(val){ \n var new_val = flt(val)/flt(doc.conversion_rate);\n return new_val;\n }\n \n</script>\n</head>\n<body>\n\n<div><script>get_letter_head()</script></div>\n<table width="100%" style="font-family: courier new; line-height:200%">\n<tr>\n<td align="left">NO: <script>doc.name</script></td>\n<td align="right">DATE: <script>date.str_to_user(doc.voucher_date)</script></td>\n</tr>\n<tr>\n<td>M/s <script>doc.contact_display</script></td>\n</tr>\n</table>\n<!--Item Table-->\n<div>\n <script>\n var t = print_table(\'Receivable Voucher\', doc.name, \'entries\', \'RV Detail\', [\'description\',\'qty\',\'basic_rate\',\'amount\'], [\'ITEM\', \'QTY\',\'RATE\',\'AMOUNT\'], [\'35%\',\'20%\',\'20%\',\'25%\'])\n if(t.appendChild) {\n // single\n out = t.innerHTML.replace(/border: 1px/gi,\'border: 0px\').replace(/style="/gi,\'style="font-family:courier new;line-height:150%;\');\n }\n else {//multiple\n out = \'<table class="None" border="0px" width="100%" style="border:0px; font-family:courier-new">\';\n\n for(var i=0;i<t.length;i++) \n {\n\t\tif(i==0)\n\t\t{\n\t\t\tout+=\'<tr>\'+t[i].childNodes[0].childNodes[0].childNodes[0].innerHTML.replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')+\'</tr>\'\n\t\t}\n\t\tout+=\'<tr>\'+t[i].childNodes[0].childNodes[0].childNodes[1].innerHTML.replace(/style="border: 1px solid rgb\\(0, 0, 0\\);/gi,\'style="font-family:courier new;\')+\'</tr>\'\n }\n\tout += \'</table>\'\n }\n out;\n </script>\n\n</div>\n\n<!--Tax table-->\n<div><script>get_tax_details();</script>\n </table>\n</div>\n\n<br>\n<table style="font-family:courier new;">\n<tr><td><b><script>doc.terms</script></b></td></tr>\n<tr><td nowrap><b>For <script>doc.company</script></b></td></tr>\n<tr><td> </td></tr>\n<tr><td nowrap><b>Signatory</b></td></tr>\n</table>\n</body>\n</html>',
|
|
'module': 'Accounts',
|
|
'name': '__common__',
|
|
'standard': 'Yes'
|
|
},
|
|
|
|
# Print Format, POS Invoice
|
|
{
|
|
'doctype': 'Print Format',
|
|
'name': 'POS Invoice'
|
|
}
|
|
] |