2011-11-16 07:48:45 +00:00
|
|
|
# Print Format, Sales Order Spartan
|
|
|
|
[
|
|
|
|
|
|
|
|
# These values are common in all dictionaries
|
|
|
|
{
|
2012-05-17 12:41:54 +00:00
|
|
|
'creation': '2012-05-17 17:27:50',
|
2011-11-16 07:48:45 +00:00
|
|
|
'docstatus': 0,
|
2012-05-17 12:41:54 +00:00
|
|
|
'modified': '2012-05-17 17:49:46',
|
|
|
|
'modified_by': u'Administrator',
|
|
|
|
'owner': u'Administrator'
|
2011-11-16 07:48:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
# These values are common for all Print Format
|
|
|
|
{
|
2012-05-17 12:41:54 +00:00
|
|
|
'doc_type': u'Sales Order',
|
2011-11-16 07:48:45 +00:00
|
|
|
'doctype': 'Print Format',
|
2012-05-17 12:41:54 +00:00
|
|
|
'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: "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: "Arial", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !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 h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\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 td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !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</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 = "p
|
|
|
|
'module': u'Selling',
|
2011-11-16 07:48:45 +00:00
|
|
|
'name': '__common__',
|
2012-05-17 12:41:54 +00:00
|
|
|
'standard': u'Yes'
|
2011-11-16 07:48:45 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
# Print Format, Sales Order Spartan
|
|
|
|
{
|
|
|
|
'doctype': 'Print Format',
|
2012-05-17 12:41:54 +00:00
|
|
|
'name': u'Sales Order Spartan'
|
2011-11-16 07:48:45 +00:00
|
|
|
}
|
|
|
|
]
|