blob: e676870a96ac4f6f9e919f8f8879ed6dc4426ab7 [file] [log] [blame]
# Print Format, Sales Order Modern
[
# These values are common in all dictionaries
{
'creation': '2012-05-17 17:27:50',
'docstatus': 0,
'modified': '2012-05-17 17:48:22',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all Print Format
{
'doc_type': u'Sales Order',
'doctype': 'Print Format',
'html': u'<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/webnotes/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: "Helvetica", "Arial", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t\tline-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: "Helvetica", "Arial", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n // Store round off to places for fields\n var decimals = {\n adj_rate: (function() {\n var adj_rate = get_field(\'Sales Order Item\', \'adj_rate\');\n if (adj_rate.fieldtype===\'Float\') return 6;\n return 2;\n })(),\n };\n\tvar si_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t\'Sales Order\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'sales_order_details\',\n\t\t\t\t\'Sales Order Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_code\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'basic_rate\', \'amount\'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t\'Sr\', \'Item Code\', \'Description\', \'Qty\',\n\t\t\t\t\t\'UoM\', \'Basic Rate\', \'Amount\'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t\'3%\', \'20%\', \'37%\', \'5%\',\n\t\t\t\t\t\'5%\', \'15%\', \'15%\'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t\'description\' : function(data_row) {\n\t\t\t\t\t\tif(data_row.adj_rate) {\n\t\t\t\t\t\t\tvar to_append = \'<div style="padding-left: 15px;"><i>Discount: \' + \n \t\t\t\t\t\t\troundNumber(data_row.adj_rate, decimals.adj_rate || 2) +\n \'% on \' + doc.currency + \' \' +\n\t\t\t\t\t\t\t\tfmt_money(data_row.ref_rate) + \'</i></div>\';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = \'\';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t\'<div style = "page-break-after: always;" \\\n\t\t\t\t\t\tclass = "page_break"></div>\\\n\t\t\t\t\t\t<div class="page-settings"></div>\';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren(\'Sales Taxes and Charges\', doc.name, \'other_charges\');\n\t\t\tvar rows = \'<table width=100%>\\n\';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t\'<tr>\\n\' +\n\t\t\t\t\t\t\t\'\\t<td>\' + oc[i].description + \'</td>\\n\' +\n\t\t\t\t\t\t\t\'\\t<td></td>\\n\' +\n\t\t\t\t\t\t\t\'\\t<td width=38%>\' + fmt_money(oc[i].tax_amount) + \'</td>\\n\' +\n\t\t\t\t\t\t\'</tr>\\n\';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn rows + \'</table>\\n\';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class=\'common page-header\'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class=\'header-table\' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>\'<h1>\' + (doc.select_print_heading || \'Sales Order\') + \'</h1>\'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style="height:15px"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class=\'imp-details\'>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class=\'common page-body\'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class=\'common page-footer\'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class=\'footer-table\' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style=\'padding-right: 10px;\'>\n\t\t\t\t\t<b>Terms, Conditions &amp; Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td width=38%><script>\n\t\t\t\t\t\t\t\tfmt_money(doc.net_total)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td><script>\n\t\t\t\t\t\t\t\tfmt_money(doc.grand_total_export)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style=\'font-weight: bold\' class=\'imp-details\'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td><script>doc.currency</script></td>\n\t\t\t\t\t\t\t<td><script>\n\t\t\t\t\t\t\t\tfmt_money(doc.rounded_total_export)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>\n',
'module': u'Selling',
'name': '__common__',
'standard': u'Yes'
},
# Print Format, Sales Order Modern
{
'doctype': 'Print Format',
'name': u'Sales Order Modern'
}
]