Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
index 8bc45f1..2f6ae86 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-05-17 17:27:49',
+ 'creation': '2012-05-16 14:07:31',
'docstatus': 0,
- 'modified': '2012-05-17 17:53:54',
+ 'modified': '2012-06-04 16:02:12',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': u'Sales Invoice',
'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: "Georgia", 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: "Georgia", 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}\n\n\ttable td {\n\t\tpadding: 2px 0px;\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 thead {\n\t\tborder-bottom: 1px solid black;\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 0px;\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\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 Invoice 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 Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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\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><script>\'<h1>\' + (doc.select_print_heading || \'Invoice\') + \'</h1>\'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></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>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(date.add_days(date.add_months(doc.posting_date, -1), 1)) +\n \' to \' + date.str_to_user(doc.posting_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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\'>\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\n\t\t</tfoot>\n\t</table>\n</div>\n',
+ '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: "Georgia", 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: "Georgia", 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}\n\n\ttable td {\n\t\tpadding: 2px 0px;\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 thead {\n\t\tborder-bottom: 1px solid black;\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 0px;\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\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\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t\'Sales Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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\t\tdata_row.adj_rate + \'% 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><script>\'<h1>\' + (doc.select_print_heading || \'Invoice\') + \'</h1>\'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></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>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n \' to \' + date.str_to_user(doc.invoice_period_to_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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\'>\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\n\t\t</tfoot>\n\t</table>\n</div>\n',
'module': u'Accounts',
'name': '__common__',
'standard': u'Yes'
diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
index c095798..1146503 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-05-17 17:27:49',
+ 'creation': '2012-05-16 14:07:31',
'docstatus': 0,
- 'modified': '2012-05-17 17:57:23',
+ 'modified': '2012-06-04 16:01:46',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': u'Sales Invoice',
'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 Invoice 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 Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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 || \'Invoice\') + \'</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>Invoice 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=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(date.add_days(date.add_months(doc.posting_date, -1), 1)) +\n \' to \' + date.str_to_user(doc.posting_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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',
+ '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\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t\'Sales Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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\t\tdata_row.adj_rate + \'% 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 || \'Invoice\') + \'</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>Invoice 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=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n \' to \' + date.str_to_user(doc.invoice_period_to_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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'Accounts',
'name': '__common__',
'standard': u'Yes'
diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
index 01dd765..77e6ef3 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-05-17 17:27:49',
+ 'creation': '2012-05-16 14:07:31',
'docstatus': 0,
- 'modified': '2012-05-17 17:58:06',
+ 'modified': '2012-06-04 16:01:09',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -14,7 +14,7 @@
{
'doc_type': u'Sales Invoice',
'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: "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 Invoice 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 Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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><script>\'<h1>\' + (doc.select_print_heading || \'Invoice\') + \'</h1>\'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></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>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(date.add_days(date.add_months(doc.posting_date, -1), 1)) +\n \' to \' + date.str_to_user(doc.posting_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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\'>\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\n\t\t</tfoot>\n\t</table>\n</div>\n',
+ '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\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t\'Sales Invoice\',\n\t\t\t\tdoc.name,\n\t\t\t\t\'entries\',\n\t\t\t\t\'Sales Invoice Item\',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t\'SR\', \'item_name\', \'description\', \'qty\', \'stock_uom\',\n\t\t\t\t\t\'export_rate\', \'export_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 Name\', \'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\t\tdata_row.adj_rate + \'% 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><script>\'<h1>\' + (doc.select_print_heading || \'Invoice\') + \'</h1>\'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></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>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?"<b>Invoice Period</b>"\n :"";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n \' to \' + date.str_to_user(doc.invoice_period_to_date))\n :"";\n </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>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_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 & 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/doc.conversion_rate)\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\'>\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\n\t\t</tfoot>\n\t</table>\n</div>\n',
'module': u'Accounts',
'name': '__common__',
'standard': u'Yes'
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 501ae40..d5300c7 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -52,7 +52,7 @@
cur_frm.cscript.hide_unhide_group_ledger = function(doc) {
hide_field(['convert_to_group', 'convert_to_ledger']);
if (cstr(doc.group_or_ledger) == 'Group') unhide_field('convert_to_ledger');
- else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_ledger');
+ else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_group');
}
// Convert group to ledger
diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py
index c16bb95..2f84a9c 100644
--- a/erpnext/accounts/doctype/gl_control/gl_control.py
+++ b/erpnext/accounts/doctype/gl_control/gl_control.py
@@ -485,7 +485,8 @@
and notify the concerned people
"""
rv = webnotes.conn.sql("""select name, recurring_id from `tabSales Invoice` where ifnull(convert_into_recurring_invoice, 0) = 1
- and next_date = %s and next_date <= end_date and docstatus=1 order by next_date desc""", nowdate())
+ and next_date = %s and next_date <= ifnull(end_date, '2199-12-31') and docstatus=1""", nowdate())
+
for d in rv:
if not webnotes.conn.sql("""select name from `tabSales Invoice` where posting_date = %s and recurring_id = %s and docstatus=1""", (nowdate(), d[1])):
prev_rv = get_obj('Sales Invoice', d[0], with_children=1)
@@ -503,6 +504,8 @@
new_rv.doc.posting_date = new_rv.doc.next_date
new_rv.doc.aging_date = new_rv.doc.next_date
new_rv.doc.due_date = add_days(new_rv.doc.next_date, cint(date_diff(prev_rv.doc.due_date, prev_rv.doc.posting_date)))
+ new_rv.doc.invoice_period_from_date = get_next_month_date(new_rv.doc.invoice_period_from_date)
+ new_rv.doc.invoice_period_to_date = get_next_month_date(new_rv.doc.invoice_period_to_date)
new_rv.doc.owner = prev_rv.doc.owner
new_rv.doc.save()
@@ -512,6 +515,21 @@
return new_rv
+def get_next_month_date(dt):
+ import datetime
+ m = getdate(dt).month + 1
+ y = getdate(dt).year
+ d = getdate(dt).day
+ if m > 12:
+ m, y = 1, y+1
+ try:
+ next_month_date = datetime.date(y, m, d)
+ except:
+ import calendar
+ last_day = calendar.monthrange(y, m)[1]
+ next_month_date = datetime.date(y, m, last_day)
+ return next_month_date.strftime("%Y-%m-%d")
+
def send_notification(new_rv):
"""Notify concerned persons about recurring invoice generation"""
@@ -528,7 +546,7 @@
</tr>
</table>
''' % (com, new_rv.doc.name, new_rv.doc.customer, new_rv.doc.address_display, getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"), \
- getdate(add_days(add_months(new_rv.doc.posting_date, -1), 1)).strftime("%d-%m-%Y"), getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"),\
+ getdate(new_rv.doc.invoice_period_from_date).strftime("%d-%m-%Y"), getdate(new_rv.doc.invoice_period_to_date).strftime("%d-%m-%Y"),\
getdate(new_rv.doc.due_date).strftime("%d-%m-%Y"))
@@ -570,5 +588,4 @@
msg = hd + tbl + totals
from webnotes.utils.email_lib import sendmail
- sendmail(recipients = new_rv.doc.notification_email_address.split(", "), \
- sender=new_rv.doc.owner, subject=subject, parts=[['text/plain', msg]])
+ sendmail(new_rv.doc.notification_email_address.split(", "), subject=subject, msg = msg)
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 428e050..3f33398 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -292,7 +292,7 @@
// Expense Head
// -------------
cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = function(doc) {
- return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Debit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
+ return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Debit" OR tabAccount.account_type = "Expense Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
}
cur_frm.cscript.expense_head = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index abea87c..2badf4d 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -390,7 +390,7 @@
// Income Account in Details Table
// --------------------------------
cur_frm.fields_dict.entries.grid.get_field("income_account").get_query = function(doc) {
- return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Credit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
+ return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Credit" OR tabAccount.account_type = "Income Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
}
// warehouse in detail table
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 5cf557e..620d8dd 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -683,6 +683,8 @@
def convert_into_recurring(self):
if self.doc.convert_into_recurring_invoice:
+ if not self.doc.invoice_period_from_date or not self.doc.invoice_period_to_date:
+ msgprint("Invoice period from date and to date is mandatory for recurring invoice", raise_exception=1)
self.set_next_date()
if not self.doc.recurring_id:
webnotes.conn.set(self.doc, 'recurring_id', make_autoname('RECINV/.#####'))
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
index b1b4f4b..d2439c8 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -5,7 +5,7 @@
{
'creation': '2012-04-13 11:56:18',
'docstatus': 0,
- 'modified': '2012-05-14 14:09:43',
+ 'modified': '2012-06-04 14:40:59',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -1498,11 +1498,25 @@
{
'allow_on_submit': 1,
'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
- 'description': u'The date on which recurring invoice will be stop',
+ 'description': u'Start date of the invoice period',
'doctype': u'DocField',
- 'fieldname': u'end_date',
+ 'fieldname': u'invoice_period_from_date',
'fieldtype': u'Date',
- 'label': u'End Date',
+ 'label': u'Invoice Period From Date',
+ 'no_copy': 1,
+ 'permlevel': 0,
+ 'print_hide': 1
+ },
+
+ # DocField
+ {
+ 'allow_on_submit': 1,
+ 'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+ 'description': u'End date of the invoice period',
+ 'doctype': u'DocField',
+ 'fieldname': u'invoice_period_to_date',
+ 'fieldtype': u'Date',
+ 'label': u'Invoice Period To Date',
'no_copy': 1,
'permlevel': 0,
'print_hide': 1
@@ -1561,6 +1575,20 @@
# DocField
{
+ 'allow_on_submit': 1,
+ 'depends_on': u'eval:doc.convert_into_recurring_invoice==1',
+ 'description': u'The date on which recurring invoice will be stop',
+ 'doctype': u'DocField',
+ 'fieldname': u'end_date',
+ 'fieldtype': u'Date',
+ 'label': u'End Date',
+ 'no_copy': 1,
+ 'permlevel': 0,
+ 'print_hide': 1
+ },
+
+ # DocField
+ {
'doctype': u'DocField',
'fieldname': u'against_income_account',
'fieldtype': u'Small Text',
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index 5678e98..2334cdd 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
+wn.require('erpnext/support/doctype/communication/communication.js');
cur_frm.cscript.onload = function(doc,dt,dn){
@@ -28,6 +29,7 @@
// make contact, history list body
//cur_frm.cscript.make_cl_body();
cur_frm.cscript.make_hl_body();
+ cur_frm.cscript.make_communication_body();
}
cur_frm.cscript.refresh = function(doc,dt,dn) {
@@ -44,7 +46,8 @@
// make lists
cur_frm.cscript.make_address(doc,dt,dn);
cur_frm.cscript.make_contact(doc,dt,dn);
- cur_frm.cscript.make_history(doc,dt,dn);
+ cur_frm.cscript.render_communication_list(doc, cdt, cdn);
+ cur_frm.cscript.make_history(doc,dt,dn);
}
}
@@ -109,44 +112,88 @@
// Transaction History
cur_frm.cscript.make_po_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Purchase Order',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'status', width: '25%', label: 'Status', type: 'Data'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tabPurchase Order`.status",
+ "`tabPurchase Order`.currency",
+ "ifnull(`tabPurchase Order`.grand_total_import, 0) as grand_total_import",
+
+ ]);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '20%', content: 'name'},
+ {width: '30%', content: 'status',
+ css: {'text-align': 'right', 'color': '#777'}},
+ {width: '35%', content: 'grand_total_import', css: {'text-align': 'right'}},
+ {width: '12%', content:'modified', css: {'text-align': 'right'}}
+ ],
+ });
+
+ cur_frm.cscript.render_list(doc, 'Purchase Order', parent, ListView);
}
cur_frm.cscript.make_pr_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Purchase Receipt',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'status', width: '15%', label: 'Status', type: 'Data'},
- {fieldname: 'per_billed', width: '10%', label: '% Billed',
- type: 'Percentage', style: 'text-align: right'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tabPurchase Receipt`.status",
+ "`tabPurchase Receipt`.currency",
+ "ifnull(`tabPurchase Receipt`.grand_total_import, 0) as grand_total_import",
+ "ifnull(`tabPurchase Receipt`.per_billed, 0) as per_billed",
+ ]);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '20%', content: 'name'},
+ {width: '20%', content: 'status',
+ css: {'text-align': 'right', 'color': '#777'}},
+ {width: '35%', content: 'grand_total_import', css: {'text-align': 'right'}},
+ {width: '10%', content: 'per_billed', type: 'bar-graph', label: 'Billed'},
+ {width: '12%', content:'modified', css: {'text-align': 'right'}}
+ ],
+ });
+
+ cur_frm.cscript.render_list(doc, 'Purchase Receipt', parent, ListView);
}
cur_frm.cscript.make_pi_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Purchase Invoice',
- [
- {fieldname: 'name', width: '30%', label: 'Id', type: 'Link'},
- {fieldname: 'modified', width: '35%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tabPurchase Invoice`.currency",
+ "ifnull(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import",
+ ]);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '30%', content: 'name'},
+ {width: '55%', content: 'grand_total_import', css: {'text-align': 'right'}},
+ {width: '12%', content:'modified', css: {'text-align': 'right'}}
+ ],
+ });
+
+ cur_frm.cscript.render_list(doc, 'Purchase Invoice', parent, ListView);
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt
index 10d5591..938633a 100644
--- a/erpnext/buying/doctype/supplier/supplier.txt
+++ b/erpnext/buying/doctype/supplier/supplier.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-03-27 14:35:52',
+ 'creation': '2012-05-15 12:14:41',
'docstatus': 0,
- 'modified': '2012-03-27 14:35:52',
+ 'modified': '2012-05-31 13:18:29',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -25,7 +25,7 @@
'show_in_menu': 0,
'subject': u' ',
'tag_fields': u'supplier_type',
- 'version': 87
+ 'version': 1
},
# These values are common for all DocField
@@ -55,6 +55,30 @@
# DocPerm
{
+ 'amend': 0,
+ 'cancel': 0,
+ 'create': 0,
+ 'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'Purchase Manager',
+ 'submit': 0,
+ 'write': 0
+ },
+
+ # DocPerm
+ {
+ 'amend': 0,
+ 'cancel': 0,
+ 'create': 0,
+ 'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'Purchase Manager',
+ 'submit': 0,
+ 'write': 0
+ },
+
+ # DocPerm
+ {
'doctype': u'DocPerm',
'permlevel': 1,
'role': u'Purchase Master Manager'
@@ -72,30 +96,6 @@
'write': 1
},
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'permlevel': 1,
- 'role': u'Purchase Manager',
- 'submit': 0,
- 'write': 0
- },
-
- # DocPerm
- {
- 'amend': 0,
- 'cancel': 0,
- 'create': 0,
- 'doctype': u'DocPerm',
- 'permlevel': 0,
- 'role': u'Purchase Manager',
- 'submit': 0,
- 'write': 0
- },
-
# DocField
{
'colour': u'White:FFF',
@@ -221,6 +221,24 @@
# DocField
{
'doctype': u'DocField',
+ 'fieldname': u'communication_history',
+ 'fieldtype': u'Section Break',
+ 'label': u'Communication History',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'communication_html',
+ 'fieldtype': u'HTML',
+ 'label': u'Communication HTML',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
'fieldname': u'more_info',
'fieldtype': u'Section Break',
'label': u'More Info',
diff --git a/erpnext/patches/may_2012/remove_communication_log.py b/erpnext/patches/may_2012/remove_communication_log.py
new file mode 100644
index 0000000..6ca05a7
--- /dev/null
+++ b/erpnext/patches/may_2012/remove_communication_log.py
@@ -0,0 +1,108 @@
+def execute():
+ import webnotes
+ import webnotes.model.sync
+ webnotes.model.sync.sync('support', 'communication')
+ webnotes.conn.commit()
+ webnotes.conn.begin()
+
+ # change doctype property setter and custom fields, and save them
+ move_customizations()
+
+ try:
+ remove_communication_log()
+ except Exception, e:
+ if e.args[0] != 1146:
+ raise e
+
+def move_customizations():
+ import webnotes.model.doc
+ import webnotes.model.doctype
+
+ res = webnotes.conn.sql("""\
+ delete from `tabProperty Setter`
+ where property='previous_field'
+ and doc_type = 'Communication Log'""")
+
+ res = webnotes.conn.sql("""\
+ select name from `tabCustom Field`
+ where dt='Communication Log'""")
+ for r in res:
+ d = webnotes.model.doc.Document('Custom Field', r[0])
+ d.dt = 'Communication'
+ d.save()
+ from webnotes.model.db_schema import updatedb
+ updatedb('Communication')
+
+ res = webnotes.conn.sql("""\
+ select field_name from `tabProperty Setter`
+ where doc_type='Communication Log' and field_name is not null""")
+
+ doclist = webnotes.model.doctype.get('Communication', 0)
+ field_list = [d.fieldname for d in doclist if d.doctype=='DocField']
+ for r in res:
+ if r[0] in field_list:
+ webnotes.conn.sql("""\
+ update `tabProperty Setter`
+ set doc_type = 'Communication'
+ where field_name=%s and doc_type='Communication Log'""", r[0])
+
+ webnotes.conn.sql("""\
+ delete from `tabProperty Setter`
+ where doc_type='Communication Log'""")
+
+ from webnotes.utils.cache import CacheItem
+ CacheItem('Communication').clear()
+
+def remove_communication_log():
+ import webnotes
+ import webnotes.model
+ import webnotes.model.doc
+ import webnotes.model.doctype
+
+ webnotes.conn.auto_commit_on_many_writes = True
+
+ # get all communication log records
+ comm_log_list = webnotes.conn.sql("select * from `tabCommunication Log`",
+ as_dict=1)
+
+ field_list = [d.fieldname for d in \
+ webnotes.model.doctype.get('Communication', 0) \
+ if d.doctype=='DocField']
+
+ # copy it to communication
+ for comm_log in comm_log_list:
+ d = webnotes.model.doc.Document('Communication')
+
+ for key in comm_log.keys():
+ if key not in webnotes.model.default_fields:
+ d.fields[key] = comm_log[key]
+
+ parenttype = (comm_log.get('parenttype') or '').lower()
+ if parenttype in field_list:
+ d.fields[parenttype] = comm_log.get('parent')
+
+ d.naming_series = 'COMM-'
+ d.subject = 'Follow Up'
+ d.content = comm_log.get('notes') or ''
+ d.medium = comm_log.get('follow_up_type') or ''
+ d.sales_person = comm_log.get('follow_up_by')
+ d.communication_date = comm_log.get('date')
+ d.category = 'Miscellaneous'
+ d.action = 'No Action'
+ d.save(ignore_fields=1)
+
+ # delete records with parent type "Customer", "Lead", "Supplier"
+ webnotes.conn.sql("""\
+ delete from `tabCommunication Log`
+ where parenttype in ('Customer', 'Lead', 'Supplier',
+ 'Opportunity', 'Quotation')""")
+
+ # if all records deleted, drop table communication log
+ # and delete doctype communication log
+ # if for some reason, records remain, dont drop table and dont delete doctype
+ count = webnotes.conn.sql("select count(*) from `tabCommunication Log`")[0][0]
+ if not count:
+ webnotes.model.delete_doc('DocType', 'Communication Log')
+ webnotes.conn.commit()
+ webnotes.conn.sql("drop table `tabCommunication Log`")
+ webnotes.conn.begin()
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 32a1e77..aba4ce5 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -407,4 +407,9 @@
'patch_file': 'remove_euro_currency',
'description': 'Remove EURO currency and replace with EUR'
},
+ {
+ 'patch_module': 'patches.may_2012',
+ 'patch_file': 'remove_communication_log',
+ 'description': 'Remove Communication Log and replace it with Communication'
+ },
]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index a695922..f49a1ab 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
+wn.require('erpnext/support/doctype/communication/communication.js');
/* ********************************* onload ********************************************* */
@@ -31,6 +32,8 @@
//cur_frm.cscript.make_sl_body();
cur_frm.cscript.load_defaults(doc, dt, dn);
+
+ cur_frm.cscript.make_communication_body();
}
cur_frm.cscript.load_defaults = function(doc, dt, dn) {
@@ -62,6 +65,7 @@
cur_frm.cscript.make_address(doc,dt,dn);
cur_frm.cscript.make_contact(doc,dt,dn);
cur_frm.cscript.make_history(doc,dt,dn);
+ cur_frm.cscript.render_communication_list(doc, cdt, cdn);
//cur_frm.cscript.make_shipping_address(doc,dt,dn);
}
}
@@ -143,62 +147,84 @@
// Transaction History
-// functions called by these functions are defined in contact_control.js
+// functions called by these functions are defined in communication.js
cur_frm.cscript.make_qtn_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Quotation',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'status', width: '25%', label: 'Status', type: 'Data'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ cur_frm.cscript.get_common_list_view(parent, doc, 'Quotation');
}
cur_frm.cscript.make_so_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Sales Order',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'status', width: '25%', label: 'Status', type: 'Data'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ cur_frm.cscript.get_common_list_view(parent, doc, 'Sales Order');
}
cur_frm.cscript.make_dn_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Delivery Note',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'status', width: '25%', label: 'Status', type: 'Data'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ cur_frm.cscript.get_common_list_view(parent, doc, 'Delivery Note');
+}
+
+cur_frm.cscript.get_common_list_view = function(parent, doc, doctype) {
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tab" + doctype + "`.status",
+ "`tab" + doctype + "`.currency",
+ "ifnull(`tab" + doctype + "`.grand_total_export, 0) as grand_total_export",
+
+ ]);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.grand_total_export = data.currency + " " + fmt_money(data.grand_total_export)
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '25%', content: 'name'},
+ {width: '25%', content: 'status'},
+ {width: '35%', content: 'grand_total_export', css: {'text-align': 'right'}},
+ {width: '12%', content:'modified', css: {'text-align': 'right'}}
+ ],
+ });
+
+ cur_frm.cscript.render_list(doc, doctype, parent, ListView);
}
cur_frm.cscript.make_si_list = function(parent, doc) {
- cur_frm.cscript.render_transaction_history(parent, doc, 'Sales Invoice',
- [
- {fieldname: 'name', width: '28%', label: 'Id', type: 'Link'},
- {fieldname: 'outstanding_amount', width: '25%',
- label: 'Outstanding Amount',
- type: 'Currency', style: 'text-align: right; color: #777'},
- {fieldname: 'modified', width: '12%', label: 'Last Modified On',
- type: 'Date', style: 'text-align: right; color: #777'},
- {fieldname: 'currency', width: '0%', label: 'Currency',
- style: 'display: hidden'},
- {fieldname: 'grand_total', width: '35%', label: 'Grand Total',
- type: 'Currency', style: 'text-align: right'},
- ]);
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "ifnull(`tabSales Invoice`.outstanding_amount, 0) as outstanding_amount",
+ "`tabSales Invoice`.currency",
+ "ifnull(`tabSales Invoice`.conversion_rate, 0) as conversion_rate",
+ "ifnull(`tabSales Invoice`.grand_total_export, 0) as grand_total_export",
+
+ ]);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ if (data.outstanding_amount) {
+ data.outstanding_amount = data.currency + " " +
+ fmt_money(flt(data.outstanding_amount)/flt(data.conversion_rate)) +
+ " [outstanding]";
+
+ } else {
+ data.outstanding_amount = '';
+ }
+ data.grand_total_export = data.currency + " " + fmt_money(data.grand_total_export);
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '25%', content: 'name'},
+ {width: '25%', content: 'outstanding_amount',
+ css: {'text-align': 'right', 'color': '#777'}},
+ {width: '35%', content: 'grand_total_export', css: {'text-align': 'right'}},
+ {width: '12%', content:'modified', css: {'text-align': 'right'}}
+ ],
+ });
+
+ cur_frm.cscript.render_list(doc, 'Sales Invoice', parent, ListView);
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt
index 2914492..e8f03d0 100644
--- a/erpnext/selling/doctype/customer/customer.txt
+++ b/erpnext/selling/doctype/customer/customer.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-04-13 11:56:26',
+ 'creation': '2012-05-15 12:14:51',
'docstatus': 0,
- 'modified': '2012-04-19 17:12:24',
+ 'modified': '2012-05-31 11:41:06',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -305,6 +305,24 @@
# DocField
{
+ 'doctype': u'DocField',
+ 'fieldname': u'communication_history',
+ 'fieldtype': u'Section Break',
+ 'label': u'Communication History',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'communication_html',
+ 'fieldtype': u'HTML',
+ 'label': u'Communication HTML',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'more_info',
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index 4aa460d..5d43449 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -8,19 +8,20 @@
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
// Module CRM
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/support/doctype/communication/communication.js');
cur_frm.cscript.onload = function(doc, cdt, cdn) {
- if(user =='Guest'){
- hide_field(['status', 'naming_series', 'order_lost_reason',
+ if(user =='Guest'){
+ hide_field(['status', 'naming_series', 'order_lost_reason',
'customer', 'rating', 'fax', 'website', 'territory',
'address_line1', 'address_line2', 'city', 'state',
'country', 'pincode', 'address', 'lead_owner', 'market_segment',
@@ -29,29 +30,33 @@
'contact_date_ref', 'to_discuss', 'more_info', 'follow_up',
'communication_history', 'cc_to', 'subject', 'message', 'lead_attachment_detail',
'Create Customer', 'Create Opportunity', 'transaction_date', 'type', 'source']);
- doc.source = 'Website';
- }
- if(!doc.status) set_multiple(dt,dn,{status:'Open'});
+ doc.source = 'Website';
+ }
+ if(!doc.status) set_multiple(dt,dn,{status:'Open'});
- if (!doc.date){
- doc.date = date.obj_to_str(new Date());
- }
- // set naming series
- if(user=='Guest') doc.naming_series = 'WebLead';
-
- cur_frm.add_fetch('customer', 'customer_name', 'company_name');
+ if (!doc.date){
+ doc.date = date.obj_to_str(new Date());
+ }
+ // set naming series
+ if(user=='Guest') doc.naming_series = 'WebLead';
+
+ cur_frm.add_fetch('customer', 'customer_name', 'company_name');
+
+ cur_frm.cscript.make_communication_body();
}
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
- // custom buttons
- //---------------
- cur_frm.clear_custom_buttons()
- if(!doc.__islocal && !in_list(['Converted', 'Lead Lost'], doc.status)) {
+ // custom buttons
+ //---------------
+ cur_frm.clear_custom_buttons()
+ if(!doc.__islocal && !in_list(['Converted', 'Lead Lost'], doc.status)) {
if (doc.source != 'Existing Customer') cur_frm.add_custom_button('Create Customer', cur_frm.cscript['Create Customer']);
- cur_frm.add_custom_button('Create Opportunity', cur_frm.cscript['Create Opportunity']);
- cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
- }
- erpnext.hide_naming_series();
+ cur_frm.add_custom_button('Create Opportunity', cur_frm.cscript['Create Opportunity']);
+ cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
+ }
+ erpnext.hide_naming_series();
+
+ if (!doc.__islocal) cur_frm.cscript.render_communication_list(doc, cdt, cdn);
}
@@ -59,82 +64,81 @@
// ===========================================================
// ************ Status ******************
cur_frm.cscript.status = function(doc, cdt, cdn){
- cur_frm.cscript.refresh(doc, cdt, cdn);
+ cur_frm.cscript.refresh(doc, cdt, cdn);
}
-
//Trigger in Item Table
//===================================
cur_frm.cscript.item_code=function(doc,cdt,cdn){
- var d = locals[cdt][cdn];
- if (d.item_code) { get_server_fields('get_item_detail',d.item_code,'lead_item_detail',doc,cdt,cdn,1);}
+ var d = locals[cdt][cdn];
+ if (d.item_code) { get_server_fields('get_item_detail',d.item_code,'lead_item_detail',doc,cdt,cdn,1);}
}
// Create New Customer
// ===============================================================
cur_frm.cscript['Create Customer'] = function(){
- var doc = cur_frm.doc;
- $c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
- function(r,rt){
- if(r.message == 'Converted'){
- msgprint("This lead is already converted to customer");
- }
- else{
- n = createLocal("Customer");
- $c('dt_map', args={
- 'docs':compress_doclist([locals["Customer"][n]]),
- 'from_doctype':'Lead',
- 'to_doctype':'Customer',
- 'from_docname':doc.name,
- 'from_to_list':"[['Lead', 'Customer']]"
- },
- function(r,rt) {
- loaddoc("Customer", n);
- }
- );
- }
- }
- );
+ var doc = cur_frm.doc;
+ $c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
+ function(r,rt){
+ if(r.message == 'Converted'){
+ msgprint("This lead is already converted to customer");
+ }
+ else{
+ n = createLocal("Customer");
+ $c('dt_map', args={
+ 'docs':compress_doclist([locals["Customer"][n]]),
+ 'from_doctype':'Lead',
+ 'to_doctype':'Customer',
+ 'from_docname':doc.name,
+ 'from_to_list':"[['Lead', 'Customer']]"
+ },
+ function(r,rt) {
+ loaddoc("Customer", n);
+ }
+ );
+ }
+ }
+ );
}
// send email
// ===============================================================
cur_frm.cscript.send_email = function(doc,cdt,cdn){
- if(doc.__islocal != 1){
- $c_obj(make_doclist(doc.doctype, doc.name),'send_mail','',function(r,rt){});
- }else{
- msgprint("Please save lead first before sending email")
- }
+ if(doc.__islocal != 1){
+ $c_obj(make_doclist(doc.doctype, doc.name),'send_mail','',function(r,rt){});
+ }else{
+ msgprint("Please save lead first before sending email")
+ }
}
// Create New Opportunity
// ===============================================================
cur_frm.cscript['Create Opportunity'] = function(){
- var doc = cur_frm.doc;
- $c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
- function(r,rt){
- if(r.message == 'Converted'){
- msgprint("This lead is now converted to customer. Please create enquiry on behalf of customer");
- }
- else{
- n = createLocal("Opportunity");
- $c('dt_map', args={
- 'docs':compress_doclist([locals["Opportunity"][n]]),
- 'from_doctype':'Lead',
- 'to_doctype':'Opportunity',
- 'from_docname':doc.name,
- 'from_to_list':"[['Lead', 'Opportunity']]"
- }
- , function(r,rt) {
- loaddoc("Opportunity", n);
- }
- );
- }
- }
- );
+ var doc = cur_frm.doc;
+ $c('runserverobj',args={ 'method':'check_status', 'docs':compress_doclist([doc])},
+ function(r,rt){
+ if(r.message == 'Converted'){
+ msgprint("This lead is now converted to customer. Please create enquiry on behalf of customer");
+ }
+ else{
+ n = createLocal("Opportunity");
+ $c('dt_map', args={
+ 'docs':compress_doclist([locals["Opportunity"][n]]),
+ 'from_doctype':'Lead',
+ 'to_doctype':'Opportunity',
+ 'from_docname':doc.name,
+ 'from_to_list':"[['Lead', 'Opportunity']]"
+ }
+ , function(r,rt) {
+ loaddoc("Opportunity", n);
+ }
+ );
+ }
+ }
+ );
}
//get query select Territory
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
- return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
+ return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt
index e714858..b6aa839 100644
--- a/erpnext/selling/doctype/lead/lead.txt
+++ b/erpnext/selling/doctype/lead/lead.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-04-02 16:02:08',
+ 'creation': '2012-05-15 12:14:52',
'docstatus': 0,
- 'modified': '2012-04-30 15:20:50',
+ 'modified': '2012-05-30 12:43:03',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -314,13 +314,13 @@
# DocField
{
'allow_on_submit': 0,
+ 'colour': u'White:FFF',
'doctype': u'DocField',
- 'fieldname': u'follow_up',
- 'fieldtype': u'Table',
- 'label': u'Communication Log',
+ 'fieldname': u'communication_html',
+ 'fieldtype': u'HTML',
+ 'label': u'Communication HTML',
'oldfieldname': u'follow_up',
'oldfieldtype': u'Table',
- 'options': u'Communication Log',
'permlevel': 0
},
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index ba4b538..c672aa1 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/support/doctype/communication/communication.js');
cur_frm.cscript.refresh = function(doc, cdt, cdn){
erpnext.hide_naming_series();
@@ -25,7 +26,7 @@
cur_frm.add_custom_button('Opportunity Lost', cur_frm.cscript['Declare Opportunity Lost']);
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
}
-
+ if(!doc.__islocal) cur_frm.cscript.render_communication_list(doc, cdt, cdn);
}
// ONLOAD
@@ -49,6 +50,7 @@
// setup fetch
cur_frm.cscript.set_fetch();
+ cur_frm.cscript.make_communication_body();
}
cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) {
diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt
index ddf3b96..0913b62 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.txt
+++ b/erpnext/selling/doctype/opportunity/opportunity.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-04-02 16:02:08',
+ 'creation': '2012-05-15 12:14:52',
'docstatus': 0,
- 'modified': '2012-04-30 15:34:34',
+ 'modified': '2012-05-31 12:42:38',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -282,12 +282,11 @@
'allow_on_submit': 1,
'colour': u'White:FFF',
'doctype': u'DocField',
- 'fieldname': u'follow_up',
- 'fieldtype': u'Table',
- 'label': u'Communication Log',
+ 'fieldname': u'communication_html',
+ 'fieldtype': u'HTML',
+ 'label': u'Communication HTML',
'oldfieldname': u'follow_up',
'oldfieldtype': u'Table',
- 'options': u'Communication Log',
'permlevel': 0
},
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 2807260..e89ad15 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -25,6 +25,7 @@
wn.require('erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js');
wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
+wn.require('erpnext/support/doctype/communication/communication.js');
// ONLOAD
// ===================================================================================
@@ -39,7 +40,7 @@
if(!doc.company && sys_defaults.company) set_multiple(cdt,cdn,{company:sys_defaults.company});
if(!doc.fiscal_year && sys_defaults.fiscal_year) set_multiple(cdt,cdn,{fiscal_year:sys_defaults.fiscal_year});
-
+
if(doc.quotation_to) {
if(doc.quotation_to == 'Customer') {
hide_field(['lead', 'lead_name']);
@@ -48,9 +49,11 @@
hide_field(['customer','customer_address','contact_person', 'customer_name','contact_display', 'customer_group']);
}
}
+ cur_frm.cscript.make_communication_body();
+
}
-cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
+cur_frm.cscript.onload_post_render = function(doc, dt, dn) {
var callback = function(doc, dt, dn) {
// defined in sales_common.js
cur_frm.cscript.update_item_details(doc, dt, dn);
@@ -95,6 +98,8 @@
if(doc.customer || doc.lead) $(cur_frm.fields_dict.contact_section.row.wrapper).toggle(true);
else $(cur_frm.fields_dict.contact_section.row.wrapper).toggle(false);
+
+ if (!doc.__islocal) cur_frm.cscript.render_communication_list(doc, cdt, cdn);
}
diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt
index aa2fd65..e5f8e75 100644
--- a/erpnext/selling/doctype/quotation/quotation.txt
+++ b/erpnext/selling/doctype/quotation/quotation.txt
@@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
- 'creation': '2012-04-30 18:40:10',
+ 'creation': '2012-05-21 11:43:59',
'docstatus': 0,
- 'modified': '2012-04-30 20:30:45',
+ 'modified': '2012-05-31 11:43:18',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@@ -51,8 +51,7 @@
'name': '__common__',
'parent': u'Quotation',
'parentfield': u'permissions',
- 'parenttype': u'DocType',
- 'read': 1
+ 'parenttype': u'DocType'
},
# DocType, Quotation
@@ -63,11 +62,19 @@
# DocPerm
{
+ 'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'user print'
+ },
+
+ # DocPerm
+ {
'amend': 0,
'cancel': 0,
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
+ 'read': 1,
'role': u'Sales Manager',
'submit': 0,
'write': 0
@@ -80,6 +87,7 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
+ 'read': 1,
'role': u'Sales Manager',
'submit': 1,
'write': 1
@@ -92,6 +100,7 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
+ 'read': 1,
'role': u'Sales User',
'submit': 1,
'write': 1
@@ -104,6 +113,7 @@
'create': 0,
'doctype': u'DocPerm',
'permlevel': 1,
+ 'read': 1,
'role': u'Sales User',
'submit': 0,
'write': 0
@@ -114,6 +124,7 @@
'doctype': u'DocPerm',
'match': u'customer_name',
'permlevel': 0,
+ 'read': 1,
'role': u'Customer'
},
@@ -124,6 +135,7 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
+ 'read': 1,
'role': u'Maintenance Manager',
'submit': 1,
'write': 1
@@ -133,6 +145,7 @@
{
'doctype': u'DocPerm',
'permlevel': 1,
+ 'read': 1,
'role': u'Maintenance Manager'
},
@@ -143,6 +156,7 @@
'create': 1,
'doctype': u'DocPerm',
'permlevel': 0,
+ 'read': 1,
'role': u'Maintenance User',
'submit': 1,
'write': 1
@@ -152,6 +166,7 @@
{
'doctype': u'DocPerm',
'permlevel': 1,
+ 'read': 1,
'role': u'Maintenance User'
},
@@ -1240,12 +1255,11 @@
'allow_on_submit': 1,
'colour': u'White:FFF',
'doctype': u'DocField',
- 'fieldname': u'follow_up',
- 'fieldtype': u'Table',
- 'label': u'Communication Log',
+ 'fieldname': u'communication_html',
+ 'fieldtype': u'HTML',
+ 'label': u'Communication HTML',
'oldfieldname': u'follow_up',
'oldfieldtype': u'Table',
- 'options': u'Communication Log',
'permlevel': 0,
'print_hide': 1,
'width': u'40px'
diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js
index 97e49f5..1d17244 100755
--- a/erpnext/setup/doctype/contact_control/contact_control.js
+++ b/erpnext/setup/doctype/contact_control/contact_control.js
@@ -7,9 +7,11 @@
cur_frm.cscript.make_hl_body = function(){
cur_frm.fields_dict['history_html'].wrapper.innerHTML = '';
cur_frm.history_html = $a(cur_frm.fields_dict['history_html'].wrapper,'div');
+ $(cur_frm.history_html).css({
+ 'min-height': '320px',
+ });
}
-
// make history
// -------------
cur_frm.cscript.make_history = function(doc,dt,dn){
@@ -50,42 +52,6 @@
}
}
-// run list
-// ---------
-cur_frm.cscript.run_list = function(lst,parent,q,q_max,doc,dn,nm){
-
- parent.innerHTML = '';
- $dh(parent);
-
- lst.doc = doc;
- lst.dn = dn;
- lst.nm = nm;
- lst.page_len = 10;
-
- lst.get_query = function(){
- this.query = q;
- this.query_max = q_max;
- }
-
- lst.make(parent);
- lst.run();
-
- lst.onrun = function(){
- $ds(parent);
- if(!this.has_data()){
- parent.innerHTML = '';
- var dv = $a(parent,'div','help_box');
- $a(dv,'span').innerHTML = "No " + this.dn + " found. ";
-
- var lbl = 'Create the <b>first</b> ' + this.dn + ' for ' + this.doc.name;
- var sp = $a(dv,'span');
- sp.nm = this.nm;
- $(sp).html(lbl).addClass('link_type').click(function(){ newdoc(this.nm); });
- }
- }
-}
-
-
// get sates on country trigger
// -----------------------------
cur_frm.cscript.get_states=function(doc,dt,dn){
@@ -111,80 +77,3 @@
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
}
}
-
-
-// Transaction History related functions
-cur_frm.cscript.render_transaction_history = function(parent, doc, doctype, args) {
- $(parent).css({ 'padding-top': '10px' });
- cur_frm.transaction_list = new wn.ui.Listing({
- parent: parent,
- page_length: 10,
- get_query: function() {
- return cur_frm.cscript.get_query_transaction_history({
- parent: doc.doctype.toLowerCase(),
- parent_name: doc.name,
- doctype: doctype,
- fields: (function() {
- var fields = [];
- for(var i in args) {
- fields.push(args[i].fieldname);
- }
- return fields.join(", ");
- })(),
- });
- },
- as_dict: 1,
- no_result_message: repl('No %(doctype)s created for this %(parent)s',
- { doctype: doctype, parent: doc.doctype }),
- render_row: function(wrapper, data) {
- render_html = cur_frm.cscript.render_transaction_history_row(data, args, doctype);
- $(wrapper).html(render_html);
- },
- });
- cur_frm.transaction_list.run();
-}
-
-cur_frm.cscript.render_transaction_history_row = function(data, args, doctype) {
- var content = [];
- var currency = data.currency;
- for (var a in args) {
- for (var d in data) {
- if (args[a].fieldname === d && args[a].fieldname !== 'currency') {
- if (args[a].type === 'Link') {
- data[d] = repl('<a href="#!Form/%(doctype)s/%(name)s">\
- %(name)s</a>', { doctype: doctype, name: data[d]});
- } else if (args[a].type === 'Currency') {
- data[d] = currency + " " + fmt_money(data[d]);
- } else if (args[a].type === 'Percentage') {
- data[d] = flt(data[d]) + '%';
- } else if (args[a].type === 'Date') {
- data[d] = wn.datetime.only_date(data[d]);
- }
- if (args[a].style == undefined) {
- args[a].style = '';
- }
- data[d] = repl('\
- <td width="%(width)s" title="%(title)s" style="%(style)s">\
- %(content)s</td>',
- {
- content: data[d],
- width: args[a].width,
- title: args[a].label,
- style: args[a].style,
- });
- content.push(data[d]);
- break;
- }
- }
- }
- content = content.join("\n");
- return '<table><tr>' + content + '</tr></table>';
-}
-
-cur_frm.cscript.get_query_transaction_history = function(args) {
- var query = repl("\
- select %(fields)s from `tab%(doctype)s` \
- where %(parent)s = '%(parent_name)s' \
- order by modified desc", args);
- return query;
-}
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index 4a5d5d0..161ce4e 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -52,7 +52,7 @@
def validate(self):
if self.doc.lft and self.doc.rgt:
- res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name))
+ res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_item_group,self.doc.item_group_name))
if not res:
msgprint("Please enter proper parent item group.")
raise Exception
diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py
index 5f71cf6..606efa8 100644
--- a/erpnext/setup/doctype/territory/territory.py
+++ b/erpnext/setup/doctype/territory/territory.py
@@ -61,7 +61,7 @@
def validate(self):
if self.doc.lft and self.doc.rgt:
- res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_territory,self.doc.territory_name))
+ res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_territory,self.doc.territory_name))
if not res:
msgprint("Please enter proper parent territory.")
raise Exception
diff --git a/erpnext/support/doctype/communication/__init__.py b/erpnext/support/doctype/communication/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/support/doctype/communication/__init__.py
diff --git a/erpnext/support/doctype/communication/communication.js b/erpnext/support/doctype/communication/communication.js
new file mode 100644
index 0000000..afa853d
--- /dev/null
+++ b/erpnext/support/doctype/communication/communication.js
@@ -0,0 +1,92 @@
+cur_frm.cscript.refresh = function(doc, dt, dn) {
+ if(!doc.__islocal) {
+ var field_list = ['lead', 'customer', 'supplier', 'contact', 'opportunity',
+ 'quotation', 'support_ticket'];
+ var hide_list = [];
+ $.each(field_list, function(i, v) {
+ if(!doc[v]) hide_list.push(v);
+ });
+
+ if(hide_list.length < field_list.length) hide_field(hide_list);
+ }
+}
+
+
+cur_frm.cscript.make_communication_body = function() {
+ var communication_wrapper = cur_frm.fields_dict.communication_html.wrapper;
+ communication_wrapper.innerHTML = '';
+ cur_frm.communication_html = $a(communication_wrapper, 'div');
+ $(cur_frm.communication_html).css({
+ 'min-height': '275px',
+ });
+}
+
+cur_frm.cscript.render_communication_list = function(doc, dt, dn) {
+ var ListView = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tabCommunication`.communication_date",
+ "`tabCommunication`.category",
+ "`tabCommunication`.subject",
+ "`tabCommunication`.content"
+ ]);
+ this.order_by = "`tabCommunication`.communication_date desc";
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.creation = wn.datetime.str_to_user(data.communication_date);
+
+ data.content = cstr(data.subject) + " | " + cstr(data.content);
+
+ if(data.content && data.content.length > 50) {
+ data.content = '<span title="'+data.content+'">' +
+ data.description.substr(0,50) + '...</span>';
+ }
+
+ },
+
+ columns: [
+ {width: '3%', content: 'docstatus'},
+ {width: '15%', content: 'name'},
+ {width: '15%', content: 'category'},
+ {width: '55%', content: 'content'},
+ {width: '12%', content:'communication_date',
+ css: {'text-align': 'right', 'color':'#777'}}
+ ],
+
+ });
+
+ cur_frm.cscript.render_list(doc, 'Communication', cur_frm.communication_html,
+ ListView, function(doctype) {
+ var new_doc = LocalDB.create(doctype);
+ new_doc = locals[doctype][new_doc];
+ new_doc[doc.doctype.toLowerCase()] = doc.name;
+ loaddoc(new_doc.doctype, new_doc.name);
+ });
+}
+
+
+// Render List
+cur_frm.cscript.render_list = function(doc, doctype, wrapper, ListView, make_new_doc) {
+ wn.model.with_doctype(doctype, function(r) {
+ if(r && r['403']) {
+ return;
+ }
+ var RecordListView = wn.views.RecordListView.extend({
+ default_docstatus: ['0', '1', '2'],
+ default_filters: [
+ [doctype, doc.doctype.toLowerCase(), '=', doc.name],
+ ],
+ });
+
+ if (make_new_doc) {
+ RecordListView = RecordListView.extend({
+ make_new_doc: make_new_doc,
+ });
+ }
+
+ var record_list_view = new RecordListView(doctype, wrapper, ListView);
+ });
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/communication/communication.py b/erpnext/support/doctype/communication/communication.py
new file mode 100644
index 0000000..c99422d
--- /dev/null
+++ b/erpnext/support/doctype/communication/communication.py
@@ -0,0 +1,26 @@
+# ERPNext - web based ERP (http://erpnext.com)
+# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import webnotes
+from webnotes.model.doc import make_autoname
+
+class DocType():
+ def __init__(self, doc, doclist=[]):
+ self.doc = doc
+ self.doclist = doclist
+
+ def autoname(self):
+ self.doc.name = make_autoname(self.doc.naming_series+'.#####')
diff --git a/erpnext/support/doctype/communication/communication.txt b/erpnext/support/doctype/communication/communication.txt
new file mode 100644
index 0000000..d6efd10
--- /dev/null
+++ b/erpnext/support/doctype/communication/communication.txt
@@ -0,0 +1,377 @@
+# DocType, Communication
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-05-29 16:56:41',
+ 'docstatus': 0,
+ 'modified': '2012-05-31 16:14:39',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all DocType
+ {
+ 'allow_attach': 1,
+ 'description': u'Keep a track of all communications',
+ 'doctype': 'DocType',
+ 'module': u'Support',
+ 'name': '__common__',
+ 'version': 1
+ },
+
+ # These values are common for all DocField
+ {
+ 'doctype': u'DocField',
+ 'name': '__common__',
+ 'parent': u'Communication',
+ 'parentfield': u'fields',
+ 'parenttype': u'DocType'
+ },
+
+ # These values are common for all DocPerm
+ {
+ 'doctype': u'DocPerm',
+ 'name': '__common__',
+ 'parent': u'Communication',
+ 'parentfield': u'permissions',
+ 'parenttype': u'DocType',
+ 'read': 1,
+ 'write': 1
+ },
+
+ # DocType, Communication
+ {
+ 'doctype': 'DocType',
+ 'name': u'Communication'
+ },
+
+ # DocPerm
+ {
+ 'create': 1,
+ 'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'Support Team'
+ },
+
+ # DocPerm
+ {
+ 'create': 1,
+ 'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'Sales Manager'
+ },
+
+ # DocPerm
+ {
+ 'create': 1,
+ 'doctype': u'DocPerm',
+ 'permlevel': 0,
+ 'role': u'Sales User'
+ },
+
+ # DocPerm
+ {
+ 'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'Sales Manager'
+ },
+
+ # DocPerm
+ {
+ 'doctype': u'DocPerm',
+ 'permlevel': 1,
+ 'role': u'Support Manager'
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'basic_info',
+ 'fieldtype': u'Section Break',
+ 'label': u'Basic Info',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'default': u'COMM-',
+ 'doctype': u'DocField',
+ 'fieldname': u'naming_series',
+ 'fieldtype': u'Select',
+ 'hidden': 1,
+ 'label': u'Naming Series',
+ 'options': u'COMM-',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'category',
+ 'fieldtype': u'Select',
+ 'label': u'Category',
+ 'options': u'\nSales\nComplaint\nHelp\nSuggestion\nMiscellaneous',
+ 'permlevel': 0,
+ 'reqd': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'action',
+ 'fieldtype': u'Select',
+ 'label': u'Action',
+ 'options': u'\nCreated Opportunity\nSent Quotation\nCreated Support Ticket\nCreated Customer Issue\nNo Action',
+ 'permlevel': 0,
+ 'reqd': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'column_break2',
+ 'fieldtype': u'Column Break',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'subject',
+ 'fieldtype': u'Small Text',
+ 'label': u'Subject',
+ 'permlevel': 0,
+ 'reqd': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'section_break1',
+ 'fieldtype': u'Section Break',
+ 'options': u'simple',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'content',
+ 'fieldtype': u'Text Editor',
+ 'label': u'Content',
+ 'permlevel': 0,
+ 'reqd': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'additional_info',
+ 'fieldtype': u'Section Break',
+ 'label': u'Additional Info',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'doctype': u'DocField',
+ 'fieldname': u'column_break3',
+ 'fieldtype': u'Column Break',
+ 'label': u'Communication With / Related To',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'lead',
+ 'fieldtype': u'Link',
+ 'hidden': 0,
+ 'label': u'Lead',
+ 'options': u'Lead',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'contact',
+ 'fieldtype': u'Link',
+ 'label': u'Contact',
+ 'options': u'Contact',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'customer',
+ 'fieldtype': u'Link',
+ 'label': u'Customer',
+ 'options': u'Customer',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'supplier',
+ 'fieldtype': u'Link',
+ 'label': u'Supplier',
+ 'options': u'Supplier',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'opportunity',
+ 'fieldtype': u'Link',
+ 'label': u'Opportunity',
+ 'options': u'Opportunity',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'quotation',
+ 'fieldtype': u'Link',
+ 'label': u'Quotation',
+ 'options': u'Quotation',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'support_ticket',
+ 'fieldtype': u'Link',
+ 'label': u'Support Ticket',
+ 'options': u'Support Ticket',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'column_break1',
+ 'fieldtype': u'Column Break',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'communication_medium',
+ 'fieldtype': u'Select',
+ 'label': u'Communication Medium',
+ 'options': u'\nChat\nPhone\nEmail\nSMS\nVisit\nOther',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'phone_no',
+ 'fieldtype': u'Data',
+ 'label': u'Phone No.',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'email_address',
+ 'fieldtype': u'Data',
+ 'label': u'Email Address',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'section_break2',
+ 'fieldtype': u'Section Break',
+ 'options': u'simple',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'column_break4',
+ 'fieldtype': u'Column Break',
+ 'label': u'Communication Carried Out By',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'default': u'__user',
+ 'doctype': u'DocField',
+ 'fieldname': u'user',
+ 'fieldtype': u'Link',
+ 'label': u'User',
+ 'options': u'Profile',
+ 'permlevel': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'sales_person',
+ 'fieldtype': u'Link',
+ 'label': u'Sales Person',
+ 'options': u'Sales Person',
+ 'permlevel': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'column_break5',
+ 'fieldtype': u'Column Break',
+ 'label': u'Communication Carried Out On',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'colour': u'White:FFF',
+ 'default': u'Today',
+ 'doctype': u'DocField',
+ 'fieldname': u'communication_date',
+ 'fieldtype': u'Date',
+ 'label': u'Date',
+ 'permlevel': 0
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'file_list',
+ 'fieldtype': u'Text',
+ 'hidden': 1,
+ 'label': u'File List',
+ 'no_copy': 1,
+ 'permlevel': 0,
+ 'print_hide': 1
+ },
+
+ # DocField
+ {
+ 'doctype': u'DocField',
+ 'fieldname': u'_user_tags',
+ 'fieldtype': u'Data',
+ 'hidden': 1,
+ 'label': u'User Tags',
+ 'no_copy': 1,
+ 'permlevel': 0,
+ 'print_hide': 1
+ }
+]
\ No newline at end of file
diff --git a/erpnext/support/doctype/communication/listview.js b/erpnext/support/doctype/communication/listview.js
new file mode 100644
index 0000000..8d3da06
--- /dev/null
+++ b/erpnext/support/doctype/communication/listview.js
@@ -0,0 +1,35 @@
+wn.doclistviews['Communication'] = wn.views.ListView.extend({
+ init: function(doclistview) {
+ this._super(doclistview);
+ this.fields = this.fields.concat([
+ "`tabCommunication`.creation",
+ "`tabCommunication`.category",
+ "`tabCommunication`.subject",
+ "`tabCommunication`.content"
+ ]);
+ this.order_by = "`tabCommunication`.creation desc";
+ this.stats = this.stats.concat(['category']);
+ },
+
+ prepare_data: function(data) {
+ this._super(data);
+ data.creation = wn.datetime.only_date(data.creation);
+
+ data.content = cstr(data.subject) + " | " + cstr(data.content);
+
+ if(data.content && data.content.length > 50) {
+ data.content = '<span title="'+data.content+'">' +
+ data.content.substr(0,50) + '...</span>';
+ }
+ },
+
+ columns: [
+ {width: '5%', content: 'avatar'},
+ {width: '3%', content: 'docstatus'},
+ {width: '15%', content: 'name'},
+ {width: '15%', content: 'category'},
+ {width: '55%', content: 'content+tags'},
+ {width: '12%', content:'creation',
+ css: {'text-align': 'right', 'color':'#777'}}
+ ],
+});
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
index c8035dc..27ec01e 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
@@ -114,7 +114,7 @@
""" Add calendar event for Maintenece Schedule in calendar of Allocated person"""
event = Document('Event')
event.owner = incharge_email
- event.description = "Item Code:%s and Reference:%s" %(item_code,self.doc.name)
+ event.description = "Reference:%s, Item Code:%s and Customer: %s" %(self.doc.name, item_code, self.doc.customer)
event.event_date = scheduled_date
event.event_hour = '10:00'
event.event_type = 'Private'
diff --git a/erpnext/support/page/support_home/support_home.html b/erpnext/support/page/support_home/support_home.html
index dcabe1c..9404f12 100644
--- a/erpnext/support/page/support_home/support_home.html
+++ b/erpnext/support/page/support_home/support_home.html
@@ -15,6 +15,9 @@
<br>
<h4><a href="#!List/Maintenance Visit">Maintenance Visit</a></h4>
<p class="help">Visit report for maintenance visit</p>
+ <br>
+ <h4><a href="#!List/Communication">Communication</a></h4>
+ <p class="help">Communication Log</p>
</div>
<div style="width: 48%; float: right;">
<h4><a href="#!List/Serial No">Serial No</a></h4>
diff --git a/public/js/all-app.js b/public/js/all-app.js
index 7358058..f7a507d 100644
--- a/public/js/all-app.js
+++ b/public/js/all-app.js
@@ -305,9 +305,9 @@
if(icon){$('<i>').addClass(icon).appendTo($button);}
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
-if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype);},'icon-plus');}
+if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){me.make_new_doc(me.new_doctype);},'icon-plus');}
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
-if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
+if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_new_doc:function(new_doctype){new_doc(new_doctype);},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
this.onrun=a0;if(a0&&a0.callback)
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(a0),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(opts){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
@@ -321,7 +321,7 @@
* lib/js/wn/ui/filters.js
*/
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('js/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});this.$w.find('.search-btn').bind('click',function(){me.listobj.run();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length)
-this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
+this.add_filter();},add_filter:function(fieldname,condition,value){this.push_new_filter(fieldname,condition,value);if(fieldname){this.$w.find('.show_filters').toggle(true);}},push_new_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
values.push(f.get_value());})
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)
@@ -968,13 +968,13 @@
<div style="clear: both"></div>\
</div>',{label:this.label}));this.appframe=new wn.ui.AppFrame(this.$page.find('.appframe-area'));wn.views.breadcrumbs($('<span>').appendTo(this.appframe.$titlebar),locals.DocType[this.doctype].module);},setup:function(){var me=this;me.can_delete=wn.model.can_delete(me.doctype);me.meta=locals.DocType[me.doctype];me.$page.find('.wnlist-area').empty(),me.setup_docstatus_filter();me.setup_listview();me.init_list();me.init_stats();me.make_report_button();me.add_delete_option();},make_report_button:function(){var me=this;if(wn.boot.profile.can_get_report.indexOf(this.doctype)!=-1){this.appframe.add_button('Build Report',function(){wn.set_route('Report2',me.doctype);},'icon-th')}},setup_docstatus_filter:function(){var me=this;this.can_submit=$.map(locals.DocPerm,function(d){if(d.parent==me.meta.name&&d.submit)return 1
else return null;}).length;if(this.can_submit){this.$page.find('.show-docstatus').removeClass('hide');this.$page.find('.show-docstatus input').click(function(){me.run();})}},setup_listview:function(){if(this.meta.__listjs){eval(this.meta.__listjs);this.listview=new wn.doclistviews[this.doctype](this);}else{this.listview=new wn.views.ListView(this);}
-this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.$page.find('.wnlist-area'),start:0,page_length:20,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:true,no_result_message:this.make_no_result(),columns:this.listview.fields});this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
+this.listview.parent=this;this.wrapper=this.$page.find('.wnlist-area');this.page_length=20;this.allow_delete=true;},init_list:function(auto_run){this.make({method:'webnotes.widgets.doclistview.get',get_args:this.get_args,parent:this.wrapper,start:0,page_length:this.page_length,show_filters:true,show_grid:true,new_doctype:this.doctype,allow_delete:this.allow_delete,no_result_message:this.make_no_result(),columns:this.listview.fields});if((auto_run!==false)&&(auto_run!==0))this.run();},make_no_result:function(){return repl('<div class="well"><p>No %(doctype_label)s found</p>\
%(description)s\
<hr>\
<p><button class="btn btn-info btn-small"\
onclick="newdoc(\'%(doctype)s\');"\
>Make a new %(doctype_label)s</button>\
- </p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('Delete',function(){me.delete_items();},'icon-remove')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
+ </p></div>',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[],order_by:this.listview.order_by||undefined,}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('Delete',function(){me.delete_items();},'icon-remove')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length)
return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;}
me.set_working(true);wn.call({method:'webnotes.widgets.doclistview.delete_items',args:{items:dl,doctype:me.doctype},callback:function(){me.set_working(false);me.refresh();}})},init_stats:function(){var me=this
wn.call({method:'webnotes.widgets.doclistview.get_stats',args:{stats:me.listview.stats,doctype:me.doctype},callback:function(r){$.each(me.listview.stats,function(i,v){me.render_stat(v,r.message[v]);});if(me.listview.stats.length){$('<button class="btn btn-small"><i class="refresh"></i> Refresh</button>').click(function(){me.reload_stats();}).appendTo($('<div class="stat-wrapper">').appendTo(me.$page.find('.layout-side-section')))}}});},render_stat:function(field,stat){var me=this;if(!stat||!stat.length){if(field=='_user_tags'){this.$page.find('.layout-side-section').append('<div class="stat-wrapper"><h4>Tags</h4>\
@@ -1021,7 +1021,7 @@
if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';}
for(key in data){if(data[key]==null){data[key]='';}}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){if($(parent).html().length>0){$(parent).append('<br />');}
$.each(data._user_tags.split(','),function(i,t){if(t){$('<span class="label label-info" style="cursor: pointer; line-height: 200%">'
-+strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}},show_hide_check_column:function(){if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}}})
++strip(t)+'</span>').click(function(){me.doclistview.set_filter('_user_tags',$(this).text())}).appendTo(parent);}});}},show_hide_check_column:function(){if(!this.doclistview.can_delete){this.columns=$.map(this.columns,function(v,i){if(v.content!='check')return v});}}});wn.provide('wn.views.RecordListView');wn.views.RecordListView=wn.views.DocListView.extend({init:function(doctype,wrapper,ListView){this.doctype=doctype;this.wrapper=wrapper;this.listview=new ListView(this);this.listview.parent=this;this.setup();},setup:function(){var me=this;me.page_length=10;$(me.wrapper).empty();me.init_list();},get_args:function(){var args=this._super();$.each((this.default_filters||[]),function(i,f){args.filters.push(f);});args.docstatus=args.docstatus.concat((this.default_docstatus||[]));return args;},});
/*
* lib/js/wn/views/formview.js
*/
diff --git a/public/js/all-web.js b/public/js/all-web.js
index 25bd1ba..150f298 100644
--- a/public/js/all-web.js
+++ b/public/js/all-web.js
@@ -192,9 +192,9 @@
if(icon){$('<i>').addClass(icon).appendTo($button);}
$button.html(label).click(click);return $button}},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
if(!(this.hide_refresh||this.no_refresh)){this.add_button('Refresh',function(){me.run();},'icon-refresh');}
-if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){newdoc(me.new_doctype);},'icon-plus');}
+if(this.new_doctype){this.add_button('New '+this.new_doctype,function(){me.make_new_doc(me.new_doctype);},'icon-plus');}
if(me.show_filters){this.add_button('Show Filters',function(){me.filter_list.show_filters();},'icon-search').addClass('btn-filter');}
-if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
+if(me.no_toolbar||me.hide_toolbar){me.$w.find('.list-toolbar-wrapper').toggle(false);}},make_new_doc:function(new_doctype){new_doc(new_doctype);},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
this.onrun=a0;if(a0&&a0.callback)
this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(a0),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(opts){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
@@ -208,7 +208,7 @@
* lib/js/wn/ui/filters.js
*/
wn.ui.FilterList=Class.extend({init:function(opts){wn.require('js/fields.js');$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});this.$w.find('.search-btn').bind('click',function(){me.listobj.run();});},show_filters:function(){this.$w.find('.show_filters').toggle();if(!this.filters.length)
-this.add_filter();},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').toggle(true);}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
+this.add_filter();},add_filter:function(fieldname,condition,value){this.push_new_filter(fieldname,condition,value);if(fieldname){this.$w.find('.show_filters').toggle(true);}},push_new_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
values.push(f.get_value());})
return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
this.filters=fl;},get_filter:function(fieldname){for(var i in this.filters){if(this.filters[i].field.df.fieldname==fieldname)