From 7057cbf9e57621133d438aaa2e028f2a6c2077aa Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 2 Dec 2011 15:15:38 +0530 Subject: [PATCH 01/43] Started with email digest --- .../doctype/email_digest/email_digest.css | 10 + .../doctype/email_digest/email_digest.js | 69 +++++ .../doctype/email_digest/email_digest.py | 204 ++++++++++++ .../doctype/email_digest/email_digest.txt | 290 ++++++++++++++++-- 4 files changed, 548 insertions(+), 25 deletions(-) create mode 100644 erpnext/setup/doctype/email_digest/email_digest.css create mode 100644 erpnext/setup/doctype/email_digest/email_digest.js create mode 100644 erpnext/setup/doctype/email_digest/email_digest.py diff --git a/erpnext/setup/doctype/email_digest/email_digest.css b/erpnext/setup/doctype/email_digest/email_digest.css new file mode 100644 index 00000000000..0654dec254f --- /dev/null +++ b/erpnext/setup/doctype/email_digest/email_digest.css @@ -0,0 +1,10 @@ +table.profile-list { + text-align: left; + margin: auto; + line-height: 250%; +} + +div.dialog-div { + text-align: 'center'; + width: 100%; +} diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js new file mode 100644 index 00000000000..a84072196d3 --- /dev/null +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -0,0 +1,69 @@ +cur_frm.cscript.refresh = function(doc, dt, dn) { + cur_frm.add_custom_button('Execute Now', function() { + $c_obj(make_doclist(dt, dn), 'get_standard_data', '', function(r, rt) { + if(r.exc) { + msgprint(r.exc); + } else { + console.log(arguments); + } + }); + }, 1); +} + +cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { + // Get profile list + $c_obj(make_doclist(dt, dn), 'get_profiles', '', function(r, rt) { + if(r.exc) { + msgprint(r.exc); + } else { + // Open a dialog and display checkboxes against email addresses + doc = locals[dt][dn]; + var d = new wn.widgets.Dialog({ + title: 'Add Recipients', + width: 400 + }); + var dialog_div = $a(d.body, 'div', 'dialog-div', '', ''); + var tab = make_table(dialog_div, r.profile_list.length+2, 2, '', ['15%', '85%']); + tab.className = 'profile-list'; + var add_or_update = 'Add'; + $.each(r.profile_list, function(i, v) { + var check = $a_input($td(tab, i+1, 0), 'checkbox'); + check.value = v.name; + if(v.checked==1) { + check.checked = 1; + add_or_update = 'Update'; + } + var profile = $a($td(tab, i+1, 1), 'span', '', '', v.name); + profile.onclick = function() { check.checked = !check.checked; } + }); + + // Display add recipients button + if(r.profile_list.length>15) { + $btn($td(tab, 0, 1), add_or_update + ' Recipients', function() { + cur_frm.cscript.add_to_rec_list(doc, tab, r.profile_list.length); + }); + } + $btn($td(tab, r.profile_list.length+1, 1), add_or_update + ' Recipients', function() { + cur_frm.cscript.add_to_rec_list(doc, tab, r.profile_list.length); + }); + + cur_frm.rec_dialog = d; + d.show(); + } + }); +} + +cur_frm.cscript.add_to_rec_list = function(doc, tab, length) { + // add checked profiles to list of recipients + var rec_list = []; + for(var i = 1; i <= length; i++) { + var input = $($td(tab, i, 0)).find('input'); + if(input.is(':checked')) { + rec_list.push(input.attr('value')); + } + } + doc.recipient_list = rec_list.join('\n'); + console.log(doc.recipient_list); + cur_frm.rec_dialog.hide(); + cur_frm.refresh_fields(); +} diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py new file mode 100644 index 00000000000..0167a151a8a --- /dev/null +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -0,0 +1,204 @@ +import webnotes + +class DocType: + def __init__(self, doc, doclist=[]): + self.doc, self.doclist = doc, doclist + + + def get_profiles(self): + """ + Get a list of profiles + """ + import webnotes + profile_list = webnotes.conn.sql(""" + SELECT name, enabled FROM tabProfile + WHERE docstatus=0 AND name NOT IN ('Administrator', 'Guest') + ORDER BY enabled DESC, name ASC""", as_dict=1) + if self.doc.recipient_list: + recipient_list = self.doc.recipient_list.split("\n") + else: + recipient_list = [] + for p in profile_list: + if p['name'] in recipient_list: p['checked'] = 1 + else: p['checked'] = 0 + webnotes.response['profile_list'] = profile_list + + + def get_standard_data(self): + """ + Executes standard queries + """ + res = {} + query_dict = { + + 'invoiced_amount': self.generate_gle_query({ + 'field': 'debit', + 'type': 'Customer', + }), + + 'payables': self.generate_gle_query({ + 'field': 'credit', + 'type': 'Supplier', + }), + + 'collections': self.generate_gle_query({ + 'field': 'credit', + 'type': 'Customer', + 'against': 'Bank or Cash' + }), + + 'payments': self.generate_gle_query({ + 'field': 'debit', + 'type': 'Supplier', + 'against': 'Bank or Cash' + }), + + 'income': self.generate_gle_query({ + 'debit_or_credit': 'Credit' + }), + + 'expenses_booked': self.generate_gle_query({ + 'debit_or_credit': 'Debit' + }), + + 'bank_balance': self.generate_gle_query({ + 'bank_balance': None + }), + + 'new_leads': """""", + + 'new_inquiries': """""", + + 'new_quotations': "", + + 'new_orders': "", + + 'stock_below_rl': """""", + + 'new_transactions': """""" + + } + + result = {} + + for query in query_dict.keys(): + if query_dict[query]: + webnotes.msgprint(query) + res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1) + if query == 'income': + res[0]['value'] = float(res[0]['credit'] - res[0]['debit']) + elif query == 'expenses_booked': + res[0]['value'] = float(res[0]['debit'] - res[0]['credit']) + elif query == 'bank_balance': + for r in res: + r['value'] = float(r['debit'] - r['credit']) + webnotes.msgprint(query) + webnotes.msgprint(res) + result[query] = (res and res[0]) and res[0] or None + + return result + + + def generate_gle_query(self, args): + """ + Returns generated query string + """ + start_date = '2011-11-01' + end_date = '2011-11-30' + args.update({ + 'start_date': start_date, + 'end_date': end_date, + 'company': self.doc.company, + 'select': None, + 'where': None + }) + + + self.evaluate_query_conditions(args) + + query = """ + SELECT + %(select)s, + COUNT(*) AS 'count' + FROM + `tabGL Entry` gle, + `tabAccount` ac + WHERE + gle.company = '%(company)s' AND + gle.account = ac.name AND + ac.docstatus < 2 AND + IFNULL(gle.is_cancelled, 'No') = 'No' AND + %(where)s AND + gle.posting_date <= '%(end_date)s'""" % args + + if 'group_by' in args.keys(): + query = query + args['group_by'] + + return query + + + def evaluate_query_conditions(self, args): + """ + Modify query according to type of information required based on args passed + """ + # If collections or payments + if 'against' in args.keys(): + if args['against'] == 'Bank or Cash': + bc_account_list = webnotes.conn.sql(""" + SELECT name + FROM `tabAccount` + WHERE account_type = 'Bank or Cash'""", as_list=1) + args['reg'] = '(' + '|'.join([ac[0] for ac in bc_account_list]) + ')' + args['where'] = """ + ac.master_type = '%(type)s' AND + gle.against REGEXP '%(reg)s' AND + gle.posting_date >= '%(start_date)s'""" % args + + # If income or expenses_booked + elif 'debit_or_credit' in args.keys(): + args['select'] = """ + SUM(IFNULL(gle.debit, 0)) AS 'debit', + SUM(IFNULL(gle.credit, 0)) AS 'credit'""" + + args['where'] = """ + ac.is_pl_account = 'Yes' AND + ac.debit_or_credit = '%(debit_or_credit)s' AND + gle.posting_date >= '%(start_date)s'""" % args + + elif 'bank_balance' in args.keys(): + args['select'] = "ac.name AS 'name', SUM(IFNULL(debit, 0)) AS 'debit', SUM(IFNULL(credit, 0)) AS 'credit'" + args['where'] = "ac.account_type = 'Bank or Cash'" + args['group_by'] = "GROUP BY ac.name" + + # For everything else + else: + args['where'] = """ + ac.master_type = '%(type)s' AND + gle.posting_date >= '%(start_date)s'""" % args + + if not args['select']: + args['select'] = "SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s'" % args + + + def get(self): + """ + * Execute Query + * Prepare Email Body from Print Format + """ + pass + + + def execute_queries(self): + """ + * If standard==1, execute get_standard_data + * If standard==0, execute python code in custom_code field + """ + pass + + + def send(self): + """ + * Execute get method + * Send email to recipients + """ + pass diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 026caa7d6e7..d6fa85a3df5 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -3,24 +3,25 @@ # These values are common in all dictionaries { - 'creation': '2011-07-27 14:23:09', + 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-07-27 17:32:27', + 'modified': '2011-12-02 10:58:22', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1311760331', + '_last_update': '1322803627', + 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', - 'issingle': 1, + 'document_type': 'System', 'module': 'Setup', 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 4 + 'version': 45 }, # These values are common for all DocField @@ -29,23 +30,18 @@ 'name': '__common__', 'parent': 'Email Digest', 'parentfield': 'fields', - 'parenttype': 'DocType', - 'permlevel': 0 + 'parenttype': 'DocType' }, # These values are common for all DocPerm { - 'create': 1, 'doctype': 'DocPerm', - 'idx': 1, 'name': '__common__', 'parent': 'Email Digest', 'parentfield': 'permissions', 'parenttype': 'DocType', - 'permlevel': 0, 'read': 1, - 'role': 'Administrator', - 'write': 1 + 'role': 'System Manager' }, # DocType, Email Digest @@ -56,34 +52,278 @@ # DocPerm { - 'doctype': 'DocPerm' + 'create': 1, + 'doctype': 'DocPerm', + 'permlevel': 0, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'permlevel': 1 }, # DocField { 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 1, - 'label': 'Body' + 'fieldtype': 'Section Break', + 'label': 'Settings', + 'permlevel': 0 }, # DocField { 'doctype': 'DocField', - 'fieldname': 'content_config', + 'fieldtype': 'Column Break', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'enabled', + 'fieldtype': 'Check', + 'label': 'Enabled', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'company', + 'fieldtype': 'Select', + 'label': 'For Company', + 'options': 'link:Company', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'allow_on_submit': 0, + 'doctype': 'DocField', + 'fieldname': 'frequency', + 'fieldtype': 'Select', + 'label': 'How frequently?', + 'options': '\nDaily\nWeekly\nMonthly', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'send_time', + 'fieldtype': 'Select', + 'label': 'At what time?', + 'options': '\n1 AM\n2 AM\n3 AM\n4 AM\n5 AM\n6 AM\n7 AM\n8 AM\n9 AM\n10 AM\n11 AM\nNoon\n1 PM\n2 PM\n3 PM\n4 PM\n5 PM\n6 PM\n7 PM\n8 PM\n9 PM\n10 PM\n11 PM\nMidnight', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'default': '1', + 'doctype': 'DocField', + 'fieldname': 'use_standard', + 'fieldtype': 'Check', + 'label': 'Use standard?', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'print_format', + 'fieldtype': 'Select', + 'label': 'Email Template', + 'options': "link:Print Format\ndoc_type='Email Digest'", + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Button', + 'label': 'Add Recipients', + 'permlevel': 0, + 'trigger': 'Client' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'recipient_list', 'fieldtype': 'Text', - 'hidden': 1, - 'idx': 2, - 'label': 'Content Config' + 'label': 'Recipients', + 'permlevel': 1, + 'reqd': 1 }, # DocField { + 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', - 'fieldname': 'email_config', - 'fieldtype': 'Text', - 'hidden': 1, - 'idx': 3, - 'label': 'Email Config' + 'fieldtype': 'Section Break', + 'label': 'Select Digest Content', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'invoiced_amount', + 'fieldtype': 'Check', + 'label': 'Invoiced Amount (Receivables)', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'payables', + 'fieldtype': 'Check', + 'label': 'Payables', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'income', + 'fieldtype': 'Check', + 'label': 'Income', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'expenses_booked', + 'fieldtype': 'Check', + 'label': 'Expenses Booked', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'collections', + 'fieldtype': 'Check', + 'label': 'Collections', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'payments', + 'fieldtype': 'Check', + 'label': 'Payments', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'bank_balance', + 'fieldtype': 'Check', + 'label': 'Bank Balance', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'new_leads', + 'fieldtype': 'Check', + 'label': 'New Leads', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'new_inquiries', + 'fieldtype': 'Check', + 'label': 'New Inquiries', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'new_quotations', + 'fieldtype': 'Check', + 'label': 'New Quotations', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'new_orders', + 'fieldtype': 'Check', + 'label': 'New Orders', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'stock_below_rl', + 'fieldtype': 'Check', + 'label': 'Stock Items below re-order level', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'new_transactions', + 'fieldtype': 'Check', + 'label': 'New Transactions', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:!doc.use_standard', + 'doctype': 'DocField', + 'fieldtype': 'Section Break', + 'label': 'Enter Custom Code', + 'permlevel': 0 + }, + + # DocField + { + 'default': '\n', + 'depends_on': 'eval:!doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'custom_code', + 'fieldtype': 'Code', + 'label': 'Custom Python Code', + 'permlevel': 0 } ] \ No newline at end of file From f10ad98ebf4d1647a6a3e31278bfd73d598aadaa Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 2 Dec 2011 17:53:08 +0530 Subject: [PATCH 02/43] Refactored queries to be more clean --- .../doctype/email_digest/email_digest.py | 175 ++++++++++-------- 1 file changed, 102 insertions(+), 73 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 0167a151a8a..b869e8393fd 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -32,37 +32,41 @@ class DocType: query_dict = { 'invoiced_amount': self.generate_gle_query({ + 'type': 'invoiced_amount', 'field': 'debit', - 'type': 'Customer', + 'master_type': 'Customer', }), 'payables': self.generate_gle_query({ + 'type': 'payables', 'field': 'credit', - 'type': 'Supplier', + 'master_type': 'Supplier', }), 'collections': self.generate_gle_query({ + 'type': 'collections', 'field': 'credit', - 'type': 'Customer', - 'against': 'Bank or Cash' + 'master_type': 'Customer', }), 'payments': self.generate_gle_query({ + 'type': 'payments', 'field': 'debit', - 'type': 'Supplier', - 'against': 'Bank or Cash' + 'master_type': 'Supplier', }), 'income': self.generate_gle_query({ + 'type': 'income', 'debit_or_credit': 'Credit' }), 'expenses_booked': self.generate_gle_query({ + 'type': 'expenses_booked', 'debit_or_credit': 'Debit' }), 'bank_balance': self.generate_gle_query({ - 'bank_balance': None + 'type': 'bank_balance' }), 'new_leads': """""", @@ -103,82 +107,107 @@ class DocType: """ Returns generated query string """ - start_date = '2011-11-01' - end_date = '2011-11-30' - args.update({ - 'start_date': start_date, - 'end_date': end_date, - 'company': self.doc.company, - 'select': None, - 'where': None - }) + self.process_args(args) + query = None - self.evaluate_query_conditions(args) - - query = """ - SELECT - %(select)s, - COUNT(*) AS 'count' - FROM - `tabGL Entry` gle, - `tabAccount` ac - WHERE - gle.company = '%(company)s' AND - gle.account = ac.name AND - ac.docstatus < 2 AND - IFNULL(gle.is_cancelled, 'No') = 'No' AND - %(where)s AND - gle.posting_date <= '%(end_date)s'""" % args + if args['type'] in ['invoiced_amount', 'payables']: + query = """ + SELECT + SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s', + %(common_select)s + FROM + %(common_from)s + WHERE + %(common_where)s AND + ac.master_type = '%(master_type)s' AND + %(start_date_condition)s AND + %(end_date_condition)s""" % args + + elif args['type'] in ['collections', 'payments']: + args['bc_accounts_regex'] = self.get_bc_accounts_regex() + query = """ + SELECT + SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s', + %(common_select)s + FROM + %(common_from)s + WHERE + %(common_where)s AND + ac.master_type = '%(master_type)s' AND + gle.against REGEXP '%(bc_accounts_regex)s' AND + %(start_date_condition)s AND + %(end_date_condition)s""" % args + + elif args['type'] in ['income', 'expenses_booked']: + query = """ + SELECT + SUM(IFNULL(gle.debit, 0)) AS 'debit', + SUM(IFNULL(gle.credit, 0)) AS 'credit', + %(common_select)s + FROM + %(common_from)s + WHERE + %(common_where)s AND + ac.is_pl_account = 'Yes' AND + ac.debit_or_credit = '%(debit_or_credit)s' AND + %(start_date_condition)s AND + %(end_date_condition)s""" % args + + elif args['type'] == 'bank_balance': + query = """ + SELECT + ac.name AS 'name', + SUM(IFNULL(gle.debit, 0)) AS 'debit', + SUM(IFNULL(gle.credit, 0)) AS 'credit', + %(common_select)s + FROM + %(common_from)s + WHERE + %(common_where)s AND + ac.account_type = 'Bank or Cash' AND + %(end_date_condition)s + GROUP BY + ac.name""" % args - if 'group_by' in args.keys(): - query = query + args['group_by'] - return query - def evaluate_query_conditions(self, args): + def process_args(self, args): """ - Modify query according to type of information required based on args passed + Adds common conditions in dictionary "args" """ - # If collections or payments - if 'against' in args.keys(): - if args['against'] == 'Bank or Cash': - bc_account_list = webnotes.conn.sql(""" - SELECT name - FROM `tabAccount` - WHERE account_type = 'Bank or Cash'""", as_list=1) - args['reg'] = '(' + '|'.join([ac[0] for ac in bc_account_list]) + ')' - args['where'] = """ - ac.master_type = '%(type)s' AND - gle.against REGEXP '%(reg)s' AND - gle.posting_date >= '%(start_date)s'""" % args + start_date = '2011-11-01' + end_date = '2011-11-30' + + args.update({ + 'common_select': "COUNT(*) AS 'count'", + + 'common_from': "`tabGL Entry` gle, `tabAccount` ac", + + 'common_where': """ + gle.company = '%s' AND + gle.account = ac.name AND + ac.docstatus < 2 AND + IFNULL(gle.is_cancelled, 'No') = 'No'""" % self.doc.company, + + 'start_date_condition': "gle.posting_date >= '%s'" % start_date, + + 'end_date_condition': "gle.posting_date <= '%s'" % end_date + }) + + + def get_bc_accounts_regex(self): + """ + Returns a regular expression of 'Bank or Cash' type account list + """ + bc_account_list = webnotes.conn.sql(""" + SELECT name + FROM `tabAccount` + WHERE account_type = 'Bank or Cash'""", as_list=1) - # If income or expenses_booked - elif 'debit_or_credit' in args.keys(): - args['select'] = """ - SUM(IFNULL(gle.debit, 0)) AS 'debit', - SUM(IFNULL(gle.credit, 0)) AS 'credit'""" - - args['where'] = """ - ac.is_pl_account = 'Yes' AND - ac.debit_or_credit = '%(debit_or_credit)s' AND - gle.posting_date >= '%(start_date)s'""" % args - - elif 'bank_balance' in args.keys(): - args['select'] = "ac.name AS 'name', SUM(IFNULL(debit, 0)) AS 'debit', SUM(IFNULL(credit, 0)) AS 'credit'" - args['where'] = "ac.account_type = 'Bank or Cash'" - args['group_by'] = "GROUP BY ac.name" - - # For everything else - else: - args['where'] = """ - ac.master_type = '%(type)s' AND - gle.posting_date >= '%(start_date)s'""" % args + return '(' + '|'.join([ac[0] for ac in bc_account_list]) + ')' - if not args['select']: - args['select'] = "SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s'" % args - def get(self): """ From 393f5e6078292d631217a2e886dea8bbeab8a0bf Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 2 Dec 2011 19:20:10 +0530 Subject: [PATCH 03/43] Queries to get new records in a particular doctype --- .../doctype/email_digest/email_digest.js | 2 +- .../doctype/email_digest/email_digest.py | 136 +++++++++++++----- .../doctype/email_digest/email_digest.txt | 23 ++- 3 files changed, 118 insertions(+), 43 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index a84072196d3..d39000f2675 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -34,7 +34,7 @@ cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { add_or_update = 'Update'; } var profile = $a($td(tab, i+1, 1), 'span', '', '', v.name); - profile.onclick = function() { check.checked = !check.checked; } + //profile.onclick = function() { check.checked = !check.checked; } }); // Display add recipients button diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index b869e8393fd..78ff5930c56 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -69,31 +69,52 @@ class DocType: 'type': 'bank_balance' }), - 'new_leads': """""", + 'new_leads': self.generate_new_type_query({ + 'type': 'new_leads', + 'doctype': 'Lead' + }), - 'new_inquiries': """""", + 'new_enquiries': self.generate_new_type_query({ + 'type': 'new_enquiries', + 'doctype': 'Enquiry' + }), - 'new_quotations': "", + 'new_quotations': self.generate_new_type_query({ + 'type': 'new_quotations', + 'doctype': 'Quotation', + 'sum_col': 'grand_total' + }), - 'new_orders': "", + 'new_sales_orders': self.generate_new_type_query({ + 'type': 'new_sales_orders', + 'doctype': 'Receivable Voucher', + 'sum_col': 'grand_total' + }), - 'stock_below_rl': """""", + 'new_purchase_orders': self.generate_new_type_query({ + 'type': 'new_purchase_orders', + 'doctype': 'Purchase Order', + 'sum_col': 'grand_total' + }), - 'new_transactions': """""" + 'new_transactions': self.generate_new_type_query({ + 'type': 'new_transactions', + 'doctype': 'Feed' + }), + 'stock_below_rl': "" } result = {} for query in query_dict.keys(): - if query_dict[query]: + if self.doc.fields[query]: webnotes.msgprint(query) res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1) if query == 'income': - res[0]['value'] = float(res[0]['credit'] - res[0]['debit']) - elif query == 'expenses_booked': - res[0]['value'] = float(res[0]['debit'] - res[0]['credit']) - elif query == 'bank_balance': + for r in res: + r['value'] = float(r['credit'] - r['debit']) + elif query in ['expenses_booked', 'bank_balance']: for r in res: r['value'] = float(r['debit'] - r['credit']) webnotes.msgprint(query) @@ -105,7 +126,7 @@ class DocType: def generate_gle_query(self, args): """ - Returns generated query string + Returns generated query string based 'tabGL Entry' and 'tabAccount' """ self.process_args(args) @@ -114,7 +135,7 @@ class DocType: if args['type'] in ['invoiced_amount', 'payables']: query = """ SELECT - SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s', + IFNULL(SUM(IFNULL(gle.%(field)s, 0)), 0) AS '%(field)s', %(common_select)s FROM %(common_from)s @@ -128,7 +149,7 @@ class DocType: args['bc_accounts_regex'] = self.get_bc_accounts_regex() query = """ SELECT - SUM(IFNULL(gle.%(field)s, 0)) AS '%(field)s', + IFNULL(SUM(IFNULL(gle.%(field)s, 0)), 0) AS '%(field)s', %(common_select)s FROM %(common_from)s @@ -142,8 +163,8 @@ class DocType: elif args['type'] in ['income', 'expenses_booked']: query = """ SELECT - SUM(IFNULL(gle.debit, 0)) AS 'debit', - SUM(IFNULL(gle.credit, 0)) AS 'credit', + IFNULL(SUM(IFNULL(gle.debit, 0)), 0) AS 'debit', + IFNULL(SUM(IFNULL(gle.credit, 0)), 0) AS 'credit', %(common_select)s FROM %(common_from)s @@ -158,8 +179,8 @@ class DocType: query = """ SELECT ac.name AS 'name', - SUM(IFNULL(gle.debit, 0)) AS 'debit', - SUM(IFNULL(gle.credit, 0)) AS 'credit', + IFNULL(SUM(IFNULL(gle.debit, 0)), 0) AS 'debit', + IFNULL(SUM(IFNULL(gle.credit, 0)), 0) AS 'credit', %(common_select)s FROM %(common_from)s @@ -177,26 +198,71 @@ class DocType: """ Adds common conditions in dictionary "args" """ + start_date, end_date = self.get_start_end_dates() + + if 'new' in args['type']: + args.update({ + 'company': self.doc.company, + 'start_date': start_date, + 'end_date': end_date, + 'sum_if_reqd': '' + }) + if args['type'] in ['new_quotations', 'new_sales_orders', 'new_purchase_orders']: + args['sum_if_reqd'] = "IFNULL(SUM(IFNULL(%(sum_col)s, 0)), 0) AS '%(sum_col)s'," % args + + if args['type'] == 'new_transactions': + args['company_condition'] = '' + else: + args['company_condition'] = "company = '%(company)s' AND" % args + + else: + args.update({ + 'common_select': "COUNT(*) AS 'count'", + + 'common_from': "`tabGL Entry` gle, `tabAccount` ac", + + 'common_where': """ + gle.company = '%s' AND + gle.account = ac.name AND + ac.docstatus < 2 AND + IFNULL(gle.is_cancelled, 'No') = 'No'""" % self.doc.company, + + 'start_date_condition': "gle.posting_date >= '%s'" % start_date, + + 'end_date_condition': "gle.posting_date <= '%s'" % end_date + }) + + + def get_start_end_dates(self): + """ + Returns start and end date depending on the frequency of email digest + """ start_date = '2011-11-01' - end_date = '2011-11-30' - - args.update({ - 'common_select': "COUNT(*) AS 'count'", - - 'common_from': "`tabGL Entry` gle, `tabAccount` ac", - - 'common_where': """ - gle.company = '%s' AND - gle.account = ac.name AND - ac.docstatus < 2 AND - IFNULL(gle.is_cancelled, 'No') = 'No'""" % self.doc.company, - - 'start_date_condition': "gle.posting_date >= '%s'" % start_date, - - 'end_date_condition': "gle.posting_date <= '%s'" % end_date - }) + end_date = '2011-11-31' + return start_date, end_date + def generate_new_type_query(self, args): + """ + Returns generated query string for calculating new transactions created + """ + self.process_args(args) + + query = """ + SELECT + %(sum_if_reqd)s + COUNT(*) AS 'count' + FROM + `tab%(doctype)s` + WHERE + docstatus < 2 AND + %(company_condition)s + creation >= '%(start_date)s' AND + creation <= '%(end_date)s'""" % args + + return query + + def get_bc_accounts_regex(self): """ Returns a regular expression of 'Bank or Cash' type account list diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index d6fa85a3df5..392c15409a8 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-12-02 10:58:22', + 'modified': '2011-12-02 18:55:47', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1322803627', + '_last_update': '1322829965', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 45 + 'version': 47 }, # These values are common for all DocField @@ -261,9 +261,9 @@ { 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', - 'fieldname': 'new_inquiries', + 'fieldname': 'new_enquiries', 'fieldtype': 'Check', - 'label': 'New Inquiries', + 'label': 'New Enquiries', 'permlevel': 0 }, @@ -277,13 +277,22 @@ 'permlevel': 0 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'new_sales_orders', + 'fieldtype': 'Check', + 'label': 'New Sales Orders', + 'permlevel': 0 + }, + # DocField { 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', - 'fieldname': 'new_orders', + 'fieldname': 'new_purchase_orders', 'fieldtype': 'Check', - 'label': 'New Orders', + 'label': 'New Purchase Orders', 'permlevel': 0 }, From adf2f777d3a1f6317f97f9b50b4bfc5692074f65 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 5 Dec 2011 12:16:31 +0530 Subject: [PATCH 04/43] Removed print format option. Instead show html code. --- .../doctype/email_digest/email_digest.js | 2 +- .../doctype/email_digest/email_digest.py | 28 +++++++++++++++---- .../doctype/email_digest/email_digest.txt | 27 +++++++++--------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index d39000f2675..7af68a4920f 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -1,6 +1,6 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.add_custom_button('Execute Now', function() { - $c_obj(make_doclist(dt, dn), 'get_standard_data', '', function(r, rt) { + $c_obj(make_doclist(dt, dn), 'get', '', function(r, rt) { if(r.exc) { msgprint(r.exc); } else { diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 78ff5930c56..6512f8c2b19 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -109,18 +109,19 @@ class DocType: for query in query_dict.keys(): if self.doc.fields[query]: - webnotes.msgprint(query) - res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1) + #webnotes.msgprint(query) + res = webnotes.conn.sql(query_dict[query], as_dict=1) if query == 'income': for r in res: r['value'] = float(r['credit'] - r['debit']) elif query in ['expenses_booked', 'bank_balance']: for r in res: r['value'] = float(r['debit'] - r['credit']) - webnotes.msgprint(query) - webnotes.msgprint(res) + #webnotes.msgprint(query) + #webnotes.msgprint(res) result[query] = (res and res[0]) and res[0] or None + #webnotes.msgprint(result) return result @@ -280,7 +281,9 @@ class DocType: * Execute Query * Prepare Email Body from Print Format """ - pass + result = self.execute_queries() + webnotes.msgprint(result) + return result def execute_queries(self): @@ -288,6 +291,21 @@ class DocType: * If standard==1, execute get_standard_data * If standard==0, execute python code in custom_code field """ + result = {} + if self.doc.use_standard==1: + result = self.get_standard_data() + else: + result = self.execute_custom_code() + + #webnotes.msgprint(result) + + return result + + + def execute_custom_code(self): + """ + Execute custom python code + """ pass diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 392c15409a8..d57a04543e7 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-12-02 18:55:47', + 'modified': '2011-12-05 11:55:31', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1322829965', + '_last_update': '1323066269', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 47 + 'version': 51 }, # These values are common for all DocField @@ -132,16 +132,6 @@ 'permlevel': 0 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'print_format', - 'fieldtype': 'Select', - 'label': 'Email Template', - 'options': "link:Print Format\ndoc_type='Email Digest'", - 'permlevel': 0 - }, - # DocField { 'doctype': 'DocField', @@ -279,6 +269,7 @@ # DocField { + 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', 'fieldname': 'new_sales_orders', 'fieldtype': 'Check', @@ -318,13 +309,21 @@ # DocField { - 'depends_on': 'eval:!doc.use_standard', 'doctype': 'DocField', 'fieldtype': 'Section Break', 'label': 'Enter Custom Code', 'permlevel': 0 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'email_template', + 'fieldtype': 'Code', + 'label': 'Email Template', + 'permlevel': 0 + }, + # DocField { 'default': '\n', From 41e542ce4d947325edf3381f4ad213f02a54bdf6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 6 Dec 2011 10:41:54 +0530 Subject: [PATCH 05/43] Email Digest changes --- .../doctype/email_digest/email_digest.js | 9 ++ .../doctype/email_digest/email_digest.py | 96 +++++++++++++++++-- .../doctype/email_digest/email_digest.txt | 37 +++---- 3 files changed, 114 insertions(+), 28 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index 7af68a4920f..4d533ce10cc 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -8,6 +8,15 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { } }); }, 1); + cur_frm.add_custom_button('Send Now', function() { + $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) { + if(r.exc) { + msgprint(r.exc); + } else { + console.log(arguments); + } + }); + }, 1); } cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 6512f8c2b19..9c395c3a557 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -2,7 +2,8 @@ import webnotes class DocType: def __init__(self, doc, doclist=[]): - self.doc, self.doclist = doc, doclist + self.doc, self.doclist = doc, doclist + self.sending = False def get_profiles(self): @@ -110,7 +111,7 @@ class DocType: for query in query_dict.keys(): if self.doc.fields[query]: #webnotes.msgprint(query) - res = webnotes.conn.sql(query_dict[query], as_dict=1) + res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1) if query == 'income': for r in res: r['value'] = float(r['credit'] - r['debit']) @@ -238,8 +239,41 @@ class DocType: """ Returns start and end date depending on the frequency of email digest """ - start_date = '2011-11-01' - end_date = '2011-11-31' + from datetime import datetime, date, timedelta + today = datetime.now().date() + year, month, day = today.year, today.month, today.day + + if self.doc.frequency == 'Daily': + if self.sending: + start_date = end_date = today - timedelta(days=1) + else: + start_date = end_date = today + + elif self.doc.frequency == 'Weekly': + if self.sending: + start_date = today - timedelta(weeks=1) + end_date = today - timedelta(days=1) + else: + start_date = today - timedelta(days=today.weekday()) + end_date = start_date + timedelta(weeks=1) + + else: + import calendar + + if self.sending: + if month == 1: + year = year - 1 + prev_month = 12 + else: + prev_month = month - 1 + start_date = date(year, prev_month, 1) + last_day = calendar.monthrange(year, prev_month)[1] + end_date = date(year, prev_month, last_day) + else: + start_date = date(year, month, 1) + last_day = calendar.monthrange(year, month)[1] + end_date = date(year, month, last_day) + return start_date, end_date @@ -281,9 +315,10 @@ class DocType: * Execute Query * Prepare Email Body from Print Format """ - result = self.execute_queries() + result, email_body = self.execute_queries() webnotes.msgprint(result) - return result + webnotes.msgprint(email_body) + return result, email_body def execute_queries(self): @@ -294,15 +329,27 @@ class DocType: result = {} if self.doc.use_standard==1: result = self.get_standard_data() + email_body = self.get_standard_body(result) else: - result = self.execute_custom_code() + result, email_body = self.execute_custom_code(self.doc) #webnotes.msgprint(result) - return result + return result, email_body - def execute_custom_code(self): + def get_standard_body(self, result): + """ + Generate email body depending on the result + """ + return """ +
+ Invoiced Amount: %(invoiced_amount)s
+ Payables: %(payables)s
+
""" % result + + + def execute_custom_code(self, doc): """ Execute custom python code """ @@ -314,4 +361,33 @@ class DocType: * Execute get method * Send email to recipients """ - pass + self.sending = True + result, email_body = self.get() + # TODO: before sending, check if user is disabled or not + from webnotes.utils.email_lib import sendmail + try: + sendmail( + recipients=self.doc.recipient_list.split("\n"), + sender='anand@erpnext.com', + reply_to='support@erpnext.com', + subject='Digest', + msg=email_body, + from_defs=1 + ) + except Exception, e: + webnotes.msgprint('There was a problem in sending your email. Please contact support@erpnext.com') + #webnotes.errprint(webnotes.getTraceback()) + + + def schedule(self): + """ + + """ + # Get TimeZone + # Get System TimeZone + import time + from pytz import timezone + server_tz = timezone(time.tzname[0]) + cp = webnotes.model.doc.Document('Control Panel','Control Panel') + app_tz = timezone(cp.time_zone) + diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index d57a04543e7..34822ed74b6 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-12-05 11:55:31', + 'modified': '2011-12-05 18:54:27', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1323066269', + '_last_update': '1323083188', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 51 + 'version': 61 }, # These values are common for all DocField @@ -114,12 +114,10 @@ # DocField { 'doctype': 'DocField', - 'fieldname': 'send_time', - 'fieldtype': 'Select', - 'label': 'At what time?', - 'options': '\n1 AM\n2 AM\n3 AM\n4 AM\n5 AM\n6 AM\n7 AM\n8 AM\n9 AM\n10 AM\n11 AM\nNoon\n1 PM\n2 PM\n3 PM\n4 PM\n5 PM\n6 PM\n7 PM\n8 PM\n9 PM\n10 PM\n11 PM\nMidnight', - 'permlevel': 0, - 'reqd': 1 + 'fieldname': 'next_send_datetime', + 'fieldtype': 'Text', + 'label': 'Next email will be sent on:', + 'permlevel': 1 }, # DocField @@ -128,6 +126,7 @@ 'doctype': 'DocField', 'fieldname': 'use_standard', 'fieldtype': 'Check', + 'hidden': 1, 'label': 'Use standard?', 'permlevel': 0 }, @@ -309,21 +308,13 @@ # DocField { + 'depends_on': 'eval:!doc.use_standard', 'doctype': 'DocField', 'fieldtype': 'Section Break', 'label': 'Enter Custom Code', 'permlevel': 0 }, - # DocField - { - 'doctype': 'DocField', - 'fieldname': 'email_template', - 'fieldtype': 'Code', - 'label': 'Email Template', - 'permlevel': 0 - }, - # DocField { 'default': '\n', @@ -333,5 +324,15 @@ 'fieldtype': 'Code', 'label': 'Custom Python Code', 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:!doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'email_template', + 'fieldtype': 'Code', + 'label': 'Email Template', + 'permlevel': 0 } ] \ No newline at end of file From 590448aaefbe3cefd37992c9e69bb83e29679020 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 6 Dec 2011 18:51:14 +0530 Subject: [PATCH 06/43] Changes in email digest --- .../doctype/email_digest/email_digest.py | 97 ++++++++++++++++++- .../doctype/email_digest/email_digest.txt | 10 +- 2 files changed, 100 insertions(+), 7 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 9c395c3a557..35dcf5ba63a 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -378,8 +378,43 @@ class DocType: webnotes.msgprint('There was a problem in sending your email. Please contact support@erpnext.com') #webnotes.errprint(webnotes.getTraceback()) + + def on_update(self): + """ + + """ + import webnotes + args = { + 'db_name': webnotes.conn.get_value('Control Panel', '', 'account_id'), + 'event': 'setup.doctype.email_digest.email_digest.send' + } + from webnotes.utils.scheduler import Scheduler + sch = Scheduler() + sch.connect() + + if self.doc.enabled == 1: + # Create scheduler entry + res = sch.conn.sql(""" + SELECT * FROM Event + WHERE + db_name = %(db_name)s AND + event = %(event)s + """, args) + + if not (res and res[0]): + args['next_execution'] = self.get_next_execution() + + sch.conn.sql(""" + INSERT INTO Event (db_name, event, `interval`, next_execution, recurring) + VALUES (%(db_name)s, %(event)s, 86400, %(next_execution)s, 1) + """, args) + + else: + # delete scheduler entry + sch.clear(args['db_name'], args['event']) - def schedule(self): + + def get_next_sending(self): """ """ @@ -387,7 +422,65 @@ class DocType: # Get System TimeZone import time from pytz import timezone - server_tz = timezone(time.tzname[0]) + import datetime + import webnotes.defs cp = webnotes.model.doc.Document('Control Panel','Control Panel') app_tz = timezone(cp.time_zone) + server_tz = timezone(getattr(webnotes.defs, 'system_timezone')) + + start_date, end_date = self.get_start_end_dates() + + new_date = end_date + datetime.timedelta(days=1) + new_time = datetime.time(hour=6) + + naive_dt = datetime.datetime.combine(new_date, new_time) + app_dt = app_tz.localize(naive_dt) + server_dt = server_tz.normalize(app_dt.astimezone(server_tz)) + + res = { + 'app_dt': app_dt.replace(tzinfo=None), + 'app_tz': app_tz, + 'server_dt': server_dt.replace(tzinfo=None), + 'server_tz': server_tz + } + + from webnotes.utils import formatdate + str_date = formatdate(str(res['app_dt'].date())) + str_time = res['app_dt'].time().strftime('%I:%M') + + self.doc.next_send = str_date + " at " + str_time + + return res + + + def get_next_execution(self): + """ + + """ + from datetime import datetime, timedelta + dt_args = self.get_next_sending() + server_dt = dt_args['server_dt'] + now_dt = datetime.now(dt_args['server_tz']) + if now_dt.time() <= server_dt.time(): + next_date = now_dt.date() + else: + next_date = now_dt.date() + timedelta(days=1) + + next_time = server_dt.time() + + return datetime.combine(next_date, next_time) + + + def onload(self): + """ + + """ + self.get_next_sending() + + +def send(): + """ + + """ + pass diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 34822ed74b6..af50c744072 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-12-05 18:54:27', + 'modified': '2011-12-06 18:49:23', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1323083188', + '_last_update': '1323177411', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 61 + 'version': 66 }, # These values are common for all DocField @@ -114,8 +114,8 @@ # DocField { 'doctype': 'DocField', - 'fieldname': 'next_send_datetime', - 'fieldtype': 'Text', + 'fieldname': 'next_send', + 'fieldtype': 'Data', 'label': 'Next email will be sent on:', 'permlevel': 1 }, From fd20340576fb4e6f5eb004dd2fde3bf4e5b0b9e5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Dec 2011 17:49:40 +0530 Subject: [PATCH 07/43] Introduced C-form for Indian customer --- .../accounts/Module Def/Accounts/Accounts.txt | 11 +- erpnext/accounts/doctype/c_form/__init__.py | 0 erpnext/accounts/doctype/c_form/c_form.js | 10 + erpnext/accounts/doctype/c_form/c_form.py | 34 ++++ erpnext/accounts/doctype/c_form/c_form.txt | 190 ++++++++++++++++++ .../doctype/c_form_invoice_detail/__init__.py | 0 .../c_form_invoice_detail.txt | 91 +++++++++ .../receivable_voucher/receivable_voucher.py | 24 ++- .../receivable_voucher/receivable_voucher.txt | 31 ++- 9 files changed, 385 insertions(+), 6 deletions(-) create mode 100644 erpnext/accounts/doctype/c_form/__init__.py create mode 100644 erpnext/accounts/doctype/c_form/c_form.js create mode 100644 erpnext/accounts/doctype/c_form/c_form.py create mode 100644 erpnext/accounts/doctype/c_form/c_form.txt create mode 100644 erpnext/accounts/doctype/c_form_invoice_detail/__init__.py create mode 100644 erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt diff --git a/erpnext/accounts/Module Def/Accounts/Accounts.txt b/erpnext/accounts/Module Def/Accounts/Accounts.txt index 0a6921a13c2..f9c36c823f9 100644 --- a/erpnext/accounts/Module Def/Accounts/Accounts.txt +++ b/erpnext/accounts/Module Def/Accounts/Accounts.txt @@ -5,7 +5,7 @@ { 'creation': '2010-09-25 10:50:37', 'docstatus': 0, - 'modified': '2011-09-27 12:44:04', + 'modified': '2011-12-07 16:18:28', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -179,6 +179,15 @@ 'doctype': 'Module Def Item' }, + # Module Def Item + { + 'description': 'Track C-Form received from customers', + 'display_name': 'C-Form', + 'doc_name': 'C-Form', + 'doc_type': 'Setup Forms', + 'doctype': 'Module Def Item' + }, + # Module Def Item { 'display_name': 'General Ledger', diff --git a/erpnext/accounts/doctype/c_form/__init__.py b/erpnext/accounts/doctype/c_form/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js new file mode 100644 index 00000000000..4a90a9d1d61 --- /dev/null +++ b/erpnext/accounts/doctype/c_form/c_form.js @@ -0,0 +1,10 @@ +//c-form js file +// ----------------------------- +cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) { + return 'SELECT `tabReceivable Voucher`.`name` FROM `tabReceivable Voucher` WHERE `tabReceivable Voucher`.`company` = "' +doc.company+'" AND `tabReceivable Voucher`.%(key)s LIKE "%s" AND `tabReceivable Voucher`.`customer` = "' + doc.customer + '" AND `tabReceivable Voucher`.`docstatus` = 1 and `tabReceivable Voucher`.`c_form_applicable` = "Yes" ORDER BY `tabReceivable Voucher`.`name` ASC LIMIT 50'; +} + +cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { + var d = locals[cdt][cdn]; + get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1); +} diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py new file mode 100644 index 00000000000..00016cb053b --- /dev/null +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -0,0 +1,34 @@ +# Please edit this list and import only required elements +import webnotes +from webnotes.utils import add_days, cint, cstr, date_diff, default_fields, flt, getdate, now, nowdate +from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType +from webnotes.model.doclist import getlist, copy_doclist +from webnotes.model.code import get_obj +from webnotes import msgprint, errprint + +sql = webnotes.conn.sql +# ----------------------------------------------------------------------------------------- + + +class DocType: + def __init__(self,d,dl): + self.doc, self.doclist = d,dl + + def autoname(self): + self.doc.name = make_autoname(self.doc.naming_series + '.#####') + + def on_update(self): + inv = "'" + "', '".join([d.invoice_no for d in getlist(self.doclist, 'invoice_details')]) + "'" + sql("""update `tabReceivable Voucher` set c_form_no = '%s', modified ='%s' + where name in (%s)"""%(self.doc.name, self.doc.modified, inv)) + + def get_invoice_details(self, invoice_no): + inv = sql("""select posting_date, territory, net_total, grand_total from + `tabReceivable Voucher` where name = %s""", invoice_no) + ret = { + 'invoice_date' : inv and getdate(inv[0][0]).strftime('%Y-%m-%d') or '', + 'territory' : inv and inv[0][1] or '', + 'net_total' : inv and flt(inv[0][2]) or '', + 'grand_total' : inv and flt(inv[0][3]) or '' + } + return ret diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt new file mode 100644 index 00000000000..987bc9a7b37 --- /dev/null +++ b/erpnext/accounts/doctype/c_form/c_form.txt @@ -0,0 +1,190 @@ +# DocType, C-Form +[ + + # These values are common in all dictionaries + { + 'creation': '2011-12-07 16:16:16', + 'docstatus': 0, + 'modified': '2011-12-07 17:50:17', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + '_last_update': '1323255350', + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'module': 'Accounts', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 0, + 'version': 11 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'C-Form', + 'parentfield': 'fields', + 'parenttype': 'DocType', + 'permlevel': 0 + }, + + # These values are common for all DocPerm + { + 'doctype': 'DocPerm', + 'name': '__common__', + 'parent': 'C-Form', + 'parentfield': 'permissions', + 'parenttype': 'DocType', + 'read': 1 + }, + + # DocType, C-Form + { + 'doctype': 'DocType', + 'name': 'C-Form' + }, + + # DocPerm + { + 'create': 1, + 'doctype': 'DocPerm', + 'permlevel': 0, + 'role': 'Accounts User', + 'write': 1 + }, + + # DocPerm + { + 'create': 1, + 'doctype': 'DocPerm', + 'permlevel': 0, + 'role': 'Accounts Manager', + 'submit': 0, + 'write': 1 + }, + + # DocPerm + { + 'doctype': 'DocPerm', + 'permlevel': 1, + 'role': 'All' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'width': '50%' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'naming_series', + 'fieldtype': 'Select', + 'label': 'Series', + 'options': '\nC-FORM/', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'c_form_no', + 'fieldtype': 'Data', + 'label': 'C-Form No', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'received_date', + 'fieldtype': 'Date', + 'label': 'Received Date', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'customer', + 'fieldtype': 'Link', + 'label': 'Customer', + 'options': 'Customer', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Column Break', + 'width': '50%' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'company', + 'fieldtype': 'Select', + 'label': 'Company', + 'options': 'link:Company' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'fiscal_year', + 'fieldtype': 'Select', + 'label': 'Fiscal Year', + 'options': 'link:Fiscal Year', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'quarter', + 'fieldtype': 'Select', + 'label': 'Quarter', + 'options': '\nI\nII\nIII\nIV' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'total_amount', + 'fieldtype': 'Currency', + 'label': 'Total Amount', + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'state', + 'fieldtype': 'Select', + 'label': 'State', + 'options': "link:State\ncountry='India'", + 'reqd': 1 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldtype': 'Section Break' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'invoice_details', + 'fieldtype': 'Table', + 'label': 'Invoice Details', + 'options': 'C-Form Invoice Detail' + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/__init__.py b/erpnext/accounts/doctype/c_form_invoice_detail/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt new file mode 100644 index 00000000000..d6be6c0d4d3 --- /dev/null +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt @@ -0,0 +1,91 @@ +# DocType, C-Form Invoice Detail +[ + + # These values are common in all dictionaries + { + 'creation': '2011-12-07 16:15:39', + 'docstatus': 0, + 'modified': '2011-12-07 16:21:55', + 'modified_by': 'Administrator', + 'owner': 'Administrator' + }, + + # These values are common for all DocType + { + 'colour': 'White:FFF', + 'doctype': 'DocType', + 'istable': 1, + 'module': 'Accounts', + 'name': '__common__', + 'section_style': 'Simple', + 'show_in_menu': 0, + 'version': 5 + }, + + # These values are common for all DocField + { + 'doctype': 'DocField', + 'name': '__common__', + 'parent': 'C-Form Invoice Detail', + 'parentfield': 'fields', + 'parenttype': 'DocType' + }, + + # DocType, C-Form Invoice Detail + { + 'doctype': 'DocType', + 'name': 'C-Form Invoice Detail' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'invoice_no', + 'fieldtype': 'Link', + 'label': 'Invoice No', + 'options': 'Receivable Voucher', + 'permlevel': 0, + 'width': '160px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'invoice_date', + 'fieldtype': 'Date', + 'label': 'Invoice Date', + 'permlevel': 1, + 'width': '120px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'territory', + 'fieldtype': 'Link', + 'label': 'Territory', + 'options': 'Territory', + 'permlevel': 1, + 'width': '120px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'net_total', + 'fieldtype': 'Currency', + 'label': 'Net Total', + 'permlevel': 1, + 'width': '120px' + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'grand_total', + 'fieldtype': 'Currency', + 'label': 'Grand Total', + 'permlevel': 1, + 'width': '120px' + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index 13ed8d3c5e2..57d8c55facc 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -397,6 +397,14 @@ class DocType(TransactionBase): if flt(self.doc.write_off_amount) and not self.doc.write_off_account: msgprint("Please enter Write Off Account", raise_exception=1) + + def validate_c_form(self): + """ Blank C-form no if C-form applicable marked as 'No'""" + if self.doc.amended_from and self.doc.c_form_applicable == 'No' and self.doc.c_form_no: + sql("""delete from `tabC-Form Invoice Detail` where invoice_no = %s + and parent = %s""", (self.doc.amended_from, self.doc.c_form_no)) + + set(self.doc, 'c_form_no', '') # VALIDATE # ==================================================================================== @@ -432,6 +440,7 @@ class DocType(TransactionBase): self.clear_advances() # Set against account self.set_against_income_account() + self.validate_c_form() # *************************************************** ON SUBMIT ********************************************** @@ -554,10 +563,21 @@ class DocType(TransactionBase): if not cint(self.doc.is_pos) == 1: self.update_against_document_in_jv() - + + self.update_c_form() + # on submit notification # get_obj('Notification Control').notify_contact('Sales Invoice', self.doc.doctype,self.doc.name, self.doc.email_id, self.doc.contact_person) - + + + def update_c_form(self): + """Update amended id in C-form""" + if self.doc.c_form_no and self.doc.amended_from: + sql("""update `tabC-Form Invoice Detail` set invoice_no = %s, + invoice_date = %s, territory = %s, net_total = %s, + grand_total = %s where invoice_no = %s and parent = %s""", (self.doc.name, self.doc.amended_from, self.doc.c_form_no)) + + # *************************************************** ON CANCEL ********************************************** # Check Next Document's docstatus diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt index e2fc0c6416e..eedb01c5dd5 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:18', 'docstatus': 0, - 'modified': '2011-12-06 13:17:26', + 'modified': '2011-12-08 16:28:22', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -21,7 +21,7 @@ # These values are common for all DocType { - '_last_update': '1323156733', + '_last_update': '1323341785', 'change_log': '1. Change in pull_details method dt.-26-06-2009', 'colour': 'White:FFF', 'default_print_format': 'Standard', @@ -34,7 +34,7 @@ 'server_code_error': ' ', 'show_in_menu': 0, 'subject': 'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding', - 'version': 383 + 'version': 388 }, # These values are common for all DocFormat @@ -971,6 +971,31 @@ 'permlevel': 0 }, + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'c_form_applicable', + 'fieldtype': 'Select', + 'label': 'C-Form Applicable', + 'no_copy': 1, + 'options': 'No\nYes', + 'permlevel': 0, + 'print_hide': 1, + 'report_hide': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'c_form_no', + 'fieldtype': 'Link', + 'label': 'C-Form No', + 'no_copy': 1, + 'options': 'C-Form', + 'permlevel': 1, + 'print_hide': 1 + }, + # DocField { 'doctype': 'DocField', From 2577e2ae275b7bfa687d60581741c39b8c067dae Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Dec 2011 18:06:53 +0530 Subject: [PATCH 08/43] Patch for c-form --- erpnext/patches/c_form_patch.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 erpnext/patches/c_form_patch.py diff --git a/erpnext/patches/c_form_patch.py b/erpnext/patches/c_form_patch.py new file mode 100644 index 00000000000..41da19645b6 --- /dev/null +++ b/erpnext/patches/c_form_patch.py @@ -0,0 +1,11 @@ +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + + reload_doc('accounts', 'doctype', 'receivable_voucher') + reload_doc('accounts', 'doctype', 'c_form') + reload_doc('accounts', 'doctype', 'c_form_invoice_details') + + sql = webnotes.conn.sql + sql("update `tabReceivable Voucher` set c_form_applicable = 'Yes' where c_form_applicable = 'Y'") + sql("update `tabReceivable Voucher` set c_form_applicable = 'No' where c_form_applicable = 'N'") From 7e44f9789b1664fce2303626019f281ba4003f7a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 8 Dec 2011 18:07:20 +0530 Subject: [PATCH 09/43] Patch for c-form --- erpnext/patches/c_form_patch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/patches/c_form_patch.py b/erpnext/patches/c_form_patch.py index 41da19645b6..a55768d2b1f 100644 --- a/erpnext/patches/c_form_patch.py +++ b/erpnext/patches/c_form_patch.py @@ -5,6 +5,7 @@ def execute(): reload_doc('accounts', 'doctype', 'receivable_voucher') reload_doc('accounts', 'doctype', 'c_form') reload_doc('accounts', 'doctype', 'c_form_invoice_details') + reload_doc('accounts', 'Module Def', 'Accounts') sql = webnotes.conn.sql sql("update `tabReceivable Voucher` set c_form_applicable = 'Yes' where c_form_applicable = 'Y'") From 633edbef46043a2a8645d693d812ddd0b8aa9eb7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 8 Dec 2011 19:34:01 +0530 Subject: [PATCH 10/43] Email Digest - ready to be deployed --- erpnext/patches/deploy_email_digest.py | 75 +++++ .../doctype/email_digest/email_digest.js | 20 +- .../doctype/email_digest/email_digest.py | 302 ++++++++++++++++-- .../doctype/email_digest/email_digest.txt | 161 +++++----- erpnext/setup/page/setup/setup.js | 3 +- 5 files changed, 450 insertions(+), 111 deletions(-) create mode 100644 erpnext/patches/deploy_email_digest.py diff --git a/erpnext/patches/deploy_email_digest.py b/erpnext/patches/deploy_email_digest.py new file mode 100644 index 00000000000..1dd97e32498 --- /dev/null +++ b/erpnext/patches/deploy_email_digest.py @@ -0,0 +1,75 @@ +import webnotes + +def execute(): + """ + * Reload email_digest doctype + * Create default email digest + """ + from webnotes.modules.module_manager import reload_doc + + # Minor fix in print_format doctype + #reload_doc('core', 'doctype', 'print_format') + + reload_doc('setup', 'doctype', 'email_digest') + + global create_default_email_digest + create_default_email_digest() + + +def create_default_email_digest(): + """ + * Weekly Digest + * For all companies + * Recipients: System Managers + * Full content + * Disabled by default + """ + from webnotes.model.doc import Document + companies_list = webnotes.conn.sql("SELECT company_name FROM `tabCompany`", as_list=1) + global get_system_managers + system_managers = get_system_managers() + for company in companies_list: + if company and company[0]: + edigest = Document('Email Digest') + edigest.name = "Default Weekly Digest - " + company[0] + edigest.company = company[0] + edigest.frequency = 'Weekly' + edigest.recipient_list = system_managers + edigest.new_leads = 1 + edigest.new_enquiries = 1 + edigest.new_quotations = 1 + edigest.new_sales_orders = 1 + edigest.new_purchase_orders = 1 + edigest.new_transactions = 1 + edigest.payables = 1 + edigest.payments = 1 + edigest.expenses_booked = 1 + edigest.invoiced_amount = 1 + edigest.collections = 1 + edigest.income = 1 + edigest.bank_balance = 1 + exists = webnotes.conn.sql("""\ + SELECT name FROM `tabEmail Digest` + WHERE name = %s""", edigest.name) + if (exists and exists[0]) and exists[0][0]: + continue + else: + edigest.save(1) + + +def get_system_managers(): + """ + Returns a string of system managers' email addresses separated by \n + """ + system_managers_list = webnotes.conn.sql("""\ + SELECT DISTINCT p.name + FROM tabUserRole ur, tabProfile p + WHERE + ur.parent = p.name AND + ur.role='System Manager' AND + p.docstatus<2 AND + p.enabled=1 AND + p.name not in ('Administrator', 'Guest')""", as_list=1) + + return "\n".join([sysman[0] for sysman in system_managers_list]) + diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index 4d533ce10cc..98abbb131ec 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -1,10 +1,18 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { - cur_frm.add_custom_button('Execute Now', function() { + cur_frm.add_custom_button('View Now', function() { $c_obj(make_doclist(dt, dn), 'get', '', function(r, rt) { if(r.exc) { msgprint(r.exc); } else { - console.log(arguments); + //console.log(arguments); + var d = new wn.widgets.Dialog({ + title: 'Email Digest: ' + dn, + width: 800 + }); + + $a(d.body, 'div', '', '', r['message'][1]); + + d.show(); } }); }, 1); @@ -13,7 +21,8 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { if(r.exc) { msgprint(r.exc); } else { - console.log(arguments); + //console.log(arguments); + msgprint('Message Sent'); } }); }, 1); @@ -42,6 +51,9 @@ cur_frm.cscript['Add Recipients'] = function(doc, dt, dn) { check.checked = 1; add_or_update = 'Update'; } + if(v.enabled==0) { + v.name = "" + v.name + " (disabled user)" + } var profile = $a($td(tab, i+1, 1), 'span', '', '', v.name); //profile.onclick = function() { check.checked = !check.checked; } }); @@ -72,7 +84,7 @@ cur_frm.cscript.add_to_rec_list = function(doc, tab, length) { } } doc.recipient_list = rec_list.join('\n'); - console.log(doc.recipient_list); + //console.log(doc.recipient_list); cur_frm.rec_dialog.hide(); cur_frm.refresh_fields(); } diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 35dcf5ba63a..e4e12584e28 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -111,7 +111,7 @@ class DocType: for query in query_dict.keys(): if self.doc.fields[query]: #webnotes.msgprint(query) - res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1) + res = webnotes.conn.sql(query_dict[query], as_dict=1) if query == 'income': for r in res: r['value'] = float(r['credit'] - r['debit']) @@ -120,7 +120,7 @@ class DocType: r['value'] = float(r['debit'] - r['credit']) #webnotes.msgprint(query) #webnotes.msgprint(res) - result[query] = (res and res[0]) and res[0] or None + result[query] = (res and len(res)==1) and res[0] or (res and res or None) #webnotes.msgprint(result) return result @@ -180,7 +180,7 @@ class DocType: elif args['type'] == 'bank_balance': query = """ SELECT - ac.name AS 'name', + ac.account_name AS 'name', IFNULL(SUM(IFNULL(gle.debit, 0)), 0) AS 'debit', IFNULL(SUM(IFNULL(gle.credit, 0)), 0) AS 'credit', %(common_select)s @@ -191,7 +191,7 @@ class DocType: ac.account_type = 'Bank or Cash' AND %(end_date_condition)s GROUP BY - ac.name""" % args + ac.account_name""" % args return query @@ -251,11 +251,11 @@ class DocType: elif self.doc.frequency == 'Weekly': if self.sending: - start_date = today - timedelta(weeks=1) - end_date = today - timedelta(days=1) + start_date = today - timedelta(days=today.weekday(), weeks=1) + end_date = start_date + timedelta(days=6) else: start_date = today - timedelta(days=today.weekday()) - end_date = start_date + timedelta(weeks=1) + end_date = start_date + timedelta(days=6) else: import calendar @@ -316,8 +316,8 @@ class DocType: * Prepare Email Body from Print Format """ result, email_body = self.execute_queries() - webnotes.msgprint(result) - webnotes.msgprint(email_body) + #webnotes.msgprint(result) + #webnotes.msgprint(email_body) return result, email_body @@ -327,7 +327,7 @@ class DocType: * If standard==0, execute python code in custom_code field """ result = {} - if self.doc.use_standard==1: + if int(self.doc.use_standard)==1: result = self.get_standard_data() email_body = self.get_standard_body(result) else: @@ -338,17 +338,6 @@ class DocType: return result, email_body - def get_standard_body(self, result): - """ - Generate email body depending on the result - """ - return """ -
- Invoiced Amount: %(invoiced_amount)s
- Payables: %(payables)s
-
""" % result - - def execute_custom_code(self, doc): """ Execute custom python code @@ -363,14 +352,22 @@ class DocType: """ self.sending = True result, email_body = self.get() - # TODO: before sending, check if user is disabled or not + recipient_list = self.doc.recipient_list.split("\n") + + # before sending, check if user is disabled or not + # do not send if disabled + profile_list = webnotes.conn.sql("SELECT name, enabled FROM tabProfile", as_dict=1) + for profile in profile_list: + if profile['name'] in recipient_list and profile['enabled'] == 0: + del recipient_list[recipient_list.index(profile['name'])] + from webnotes.utils.email_lib import sendmail try: sendmail( - recipients=self.doc.recipient_list.split("\n"), - sender='anand@erpnext.com', + recipients=recipient_list, + sender='notifications+email_digest@erpnext.com', reply_to='support@erpnext.com', - subject='Digest', + subject=self.doc.frequency + ' Digest', msg=email_body, from_defs=1 ) @@ -389,9 +386,11 @@ class DocType: 'event': 'setup.doctype.email_digest.email_digest.send' } from webnotes.utils.scheduler import Scheduler + print "before scheduler" sch = Scheduler() sch.connect() + if self.doc.enabled == 1: # Create scheduler entry res = sch.conn.sql(""" @@ -412,6 +411,7 @@ class DocType: else: # delete scheduler entry sch.clear(args['db_name'], args['event']) + print "after on update" def get_next_sending(self): @@ -448,7 +448,7 @@ class DocType: str_date = formatdate(str(res['app_dt'].date())) str_time = res['app_dt'].time().strftime('%I:%M') - self.doc.next_send = str_date + " at " + str_time + self.doc.next_send = str_date + " at about " + str_time return res @@ -478,9 +478,257 @@ class DocType: self.get_next_sending() + def get_standard_body(self, result): + """ + Generate email body depending on the result + """ + from webnotes.utils import fmt_money + from webnotes.model.doc import Document + company = Document('Company', self.doc.company) + currency = company.default_currency + + def table(args): + if type(args['body']) == type(''): + table_body = """\ + + """ + \ + args['body'] + \ + """\ + + """ + + elif type(args['body'] == type([])): + body_rows = [] + for rows in args['body']: + for r in rows: + body_rows.append("""\ + + """ \ + + r + """\ + + """) + + body_rows.append("
") + + table_body = "" + "".join(body_rows) + "" + + table_head = """\ + + """ \ + + args['head'] + """\ + + """ + + return "" \ + + table_head \ + + table_body \ + + "
" + + currency_amount_str = "%s %s" + + body_dict = { + + 'invoiced_amount': { + 'table': 'invoiced_amount' in result and table({ + 'head': 'Invoiced Amount', + 'body': currency_amount_str \ + % (currency, fmt_money(result['invoiced_amount']['debit'])) + }), + 'idx': 300 + }, + + 'payables': { + 'table': 'payables' in result and table({ + 'head': 'Payables', + 'body': currency_amount_str \ + % (currency, fmt_money(result['payables']['credit'])) + }), + 'idx': 200 + }, + + 'collections': { + 'table': 'collections' in result and table({ + 'head': 'Collections', + 'body': currency_amount_str \ + % (currency, fmt_money(result['collections']['credit'])) + }), + 'idx': 301 + }, + + 'payments': { + 'table': 'payments' in result and table({ + 'head': 'Payments', + 'body': currency_amount_str \ + % (currency, fmt_money(result['payments']['debit'])) + }), + 'idx': 201 + }, + + 'income': { + 'table': 'income' in result and table({ + 'head': 'Income', + 'body': currency_amount_str \ + % (currency, fmt_money(result['income']['value'])) + }), + 'idx': 302 + }, + + 'expenses_booked': { + 'table': 'expenses_booked' in result and table({ + 'head': 'Expenses Booked', + 'body': currency_amount_str \ + % (currency, fmt_money(result['expenses_booked']['value'])) + }), + 'idx': 202 + }, + + 'bank_balance': { + 'table': 'bank_balance' in result and table({ + 'head': 'Bank Balance', + 'body': [ + [ + "%s" % bank['name'], + currency_amount_str % (currency, fmt_money(bank['value'])) + ] for bank in result['bank_balance'] + ] + }), + 'idx': 400 + }, + + 'new_leads': { + 'table': 'new_leads' in result and table({ + 'head': 'New Leads', + 'body': '%s' % result['new_leads']['count'] + }), + 'idx': 100 + }, + + 'new_enquiries': { + 'table': 'new_enquiries' in result and table({ + 'head': 'New Enquiries', + 'body': '%s' % result['new_enquiries']['count'] + }), + 'idx': 101 + }, + + 'new_quotations': { + 'table': 'new_quotations' in result and table({ + 'head': 'New Quotations', + 'body': '%s' % result['new_quotations']['count'] + }), + 'idx': 102 + }, + + 'new_sales_orders': { + 'table': 'new_sales_orders' in result and table({ + 'head': 'New Sales Orders', + 'body': '%s' % result['new_sales_orders']['count'] + }), + 'idx': 103 + }, + + 'new_purchase_orders': { + 'table': 'new_purchase_orders' in result and table({ + 'head': 'New Purchase Orders', + 'body': '%s' % result['new_purchase_orders']['count'] + }), + 'idx': 104 + }, + + 'new_transactions': { + 'table': 'new_transactions' in result and table({ + 'head': 'New Transactions', + 'body': '%s' % result['new_transactions']['count'] + }), + 'idx': 105 + } + + #'stock_below_rl': + } + + table_list = [] + + # Sort these keys depending on idx value + bd_keys = sorted(body_dict, key=lambda x: body_dict[x]['idx']) + + + for k in bd_keys: + if self.doc.fields[k]: + table_list.append(body_dict[k]['table']) + + result = [] + + i = 0 + result = [] + op_len = len(table_list) + while(True): + if i>=op_len: + break + elif (op_len - i) == 1: + result.append("""\ + + %s + + """ % (table_list[i])) + else: + result.append("""\ + + %s + %s + """ % (table_list[i], table_list[i+1])) + + i = i + 2 + + from webnotes.utils import formatdate + start_date, end_date = self.get_start_end_dates() + digest_daterange = self.doc.frequency=='Daily' \ + and formatdate(str(start_date)) \ + or (formatdate(str(start_date)) + " to " + (formatdate(str(end_date)))) + + email_body = """ +
+
+

%s

+

%s

+

%s

+
+ """ \ + % ((self.doc.frequency + " Digest"), \ + digest_daterange, self.doc.company) \ + + "".join(result) + """\ +

+
""" + + return email_body + + def send(): """ """ - pass + edigest_list = webnotes.conn.sql(""" + SELECT name FROM `tabEmail Digest` + WHERE enabled=1 + """, as_list=1) + from webnotes.model.code import get_obj + from datetime import datetime, timedelta + now = datetime.now() + now_date = now.date() + now_time = (now + timedelta(hours=2)).time() + + for ed in edigest_list: + if ed[0]: + ed_obj = get_obj('Email Digest', ed[0]) + ed_obj.sending = True + dt_dict = ed_obj.get_next_sending() + send_date = dt_dict['server_dt'].date() + send_time = dt_dict['server_dt'].time() + + if (now_date == send_date) and (send_time <= now_time): + #webnotes.msgprint('sending ' + ed_obj.doc.name) + ed_obj.send() + #else: + # webnotes.msgprint('not sending ' + ed_obj.doc.name) diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index af50c744072..82bd7bc98ba 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -5,14 +5,14 @@ { 'creation': '2011-11-28 13:11:56', 'docstatus': 0, - 'modified': '2011-12-06 18:49:23', + 'modified': '2011-12-08 19:21:26', 'modified_by': 'Administrator', 'owner': 'Administrator' }, # These values are common for all DocType { - '_last_update': '1323177411', + '_last_update': '1323352149', 'autoname': 'Prompt', 'colour': 'White:FFF', 'doctype': 'DocType', @@ -21,7 +21,7 @@ 'name': '__common__', 'section_style': 'Simple', 'show_in_menu': 0, - 'version': 66 + 'version': 78 }, # These values are common for all DocField @@ -52,6 +52,7 @@ # DocPerm { + 'cancel': 1, 'create': 1, 'doctype': 'DocPerm', 'permlevel': 0, @@ -113,6 +114,7 @@ # DocField { + 'depends_on': 'eval:doc.enabled', 'doctype': 'DocField', 'fieldname': 'next_send', 'fieldtype': 'Data', @@ -128,7 +130,8 @@ 'fieldtype': 'Check', 'hidden': 1, 'label': 'Use standard?', - 'permlevel': 0 + 'permlevel': 0, + 'search_index': 0 }, # DocField @@ -149,6 +152,7 @@ # DocField { + 'description': 'Note: Email will not be sent to disabled users', 'doctype': 'DocField', 'fieldname': 'recipient_list', 'fieldtype': 'Text', @@ -166,76 +170,6 @@ 'permlevel': 0 }, - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'invoiced_amount', - 'fieldtype': 'Check', - 'label': 'Invoiced Amount (Receivables)', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'payables', - 'fieldtype': 'Check', - 'label': 'Payables', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'income', - 'fieldtype': 'Check', - 'label': 'Income', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'expenses_booked', - 'fieldtype': 'Check', - 'label': 'Expenses Booked', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'collections', - 'fieldtype': 'Check', - 'label': 'Collections', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'payments', - 'fieldtype': 'Check', - 'label': 'Payments', - 'permlevel': 0 - }, - - # DocField - { - 'depends_on': 'eval:doc.use_standard', - 'doctype': 'DocField', - 'fieldname': 'bank_balance', - 'fieldtype': 'Check', - 'label': 'Bank Balance', - 'permlevel': 0 - }, - # DocField { 'depends_on': 'eval:doc.use_standard', @@ -290,9 +224,9 @@ { 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', - 'fieldname': 'stock_below_rl', + 'fieldname': 'new_transactions', 'fieldtype': 'Check', - 'label': 'Stock Items below re-order level', + 'label': 'New Transactions', 'permlevel': 0 }, @@ -300,9 +234,79 @@ { 'depends_on': 'eval:doc.use_standard', 'doctype': 'DocField', - 'fieldname': 'new_transactions', + 'fieldname': 'payables', 'fieldtype': 'Check', - 'label': 'New Transactions', + 'label': 'Payables', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'payments', + 'fieldtype': 'Check', + 'label': 'Payments', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'expenses_booked', + 'fieldtype': 'Check', + 'label': 'Expenses Booked', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'invoiced_amount', + 'fieldtype': 'Check', + 'label': 'Invoiced Amount (Receivables)', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'collections', + 'fieldtype': 'Check', + 'label': 'Collections', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'income', + 'fieldtype': 'Check', + 'label': 'Income', + 'permlevel': 0 + }, + + # DocField + { + 'depends_on': 'eval:doc.use_standard', + 'doctype': 'DocField', + 'fieldname': 'bank_balance', + 'fieldtype': 'Check', + 'label': 'Bank Balance', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': 'DocField', + 'fieldname': 'stock_below_rl', + 'fieldtype': 'Check', + 'hidden': 1, + 'label': 'Stock Items below re-order level', 'permlevel': 0 }, @@ -317,7 +321,6 @@ # DocField { - 'default': '\n', 'depends_on': 'eval:!doc.use_standard', 'doctype': 'DocField', 'fieldname': 'custom_code', diff --git a/erpnext/setup/page/setup/setup.js b/erpnext/setup/page/setup/setup.js index 92ba9db025c..f536c701c64 100644 --- a/erpnext/setup/page/setup/setup.js +++ b/erpnext/setup/page/setup/setup.js @@ -161,6 +161,7 @@ SetupData = function(cnty){ ['Custom Field',1,'Custom Field','dt'+NEWLINE+'label'+NEWLINE+'fieldtype'+NEWLINE+'options','Add and manage custom fields on forms'], ['Email Settings',3,'Email Settings','','Outgoing email server and address'], ['Notification Settings',3,'Notification Control','','Automatic emails set at selected events'], + ['Email Digest', 1, 'Email Digest', '', 'Schedule Daily / Weekly / Monthly Summary e-mails'], ['Company',1,'Company','id'+NEWLINE+'is_active'+NEWLINE+'email','Manage list of companies'], ['Fiscal Year',1,'Fiscal Year','id'+NEWLINE+'company'+NEWLINE+'is_active'+NEWLINE+'year','Manage list of fiscal years'], ['Personalize',3,'Personalize','','Set your banner'], @@ -168,7 +169,7 @@ SetupData = function(cnty){ ['Import Data',2,'Import Data','','Import data from CSV files'], ['Manage Users',2,'My Company','','Add / remove users and manage their roles'], ['Web Forms',2,'Webforms','', 'Code to embed forms in yor website'], - ['Permissions Manager',2,'Permission Engine','', 'Manage all permissions from one tool (beta)'], + ['Permissions Manager',2,'Permission Engine','', 'Manage all permissions from one tool'], //['Property Setter',1,'Property Setter','', 'Customize properties of a Form (DocType) or Field'], ['Customize Form View',3,'DocLayer','', 'Customize properties of a Form (DocType) or Field'], ['Print Formats', 1, 'Print Format', '', 'Manage Print Formats'], From deb816d30c5accaa8496c6e8f6f491e0a25aefc7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 12 Dec 2011 12:41:36 +0530 Subject: [PATCH 11/43] Patch to remove duplicate entries created due to change in validation_logic in Table Mapper Detail for the following doctypes: * Delivery Note-Receivable Voucher * Purchase Order-Purchase Voucher * Sales Order-Receivable Voucher --- .../remove_duplicate_table_mapper_detail.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 erpnext/patches/remove_duplicate_table_mapper_detail.py diff --git a/erpnext/patches/remove_duplicate_table_mapper_detail.py b/erpnext/patches/remove_duplicate_table_mapper_detail.py new file mode 100644 index 00000000000..aaddd9943cf --- /dev/null +++ b/erpnext/patches/remove_duplicate_table_mapper_detail.py @@ -0,0 +1,22 @@ +""" + Removes duplicate entries created in +""" +import webnotes +def execute(): + res = webnotes.conn.sql("""\ + SELECT a.name + FROM + `tabTable Mapper Detail` a, + `tabTable Mapper Detail` b + WHERE + a.parent = b.parent AND + a.from_table = b.from_table AND + a.to_table = b.to_table AND + a.from_field = b.from_field AND + a.to_field = b.to_field AND + a.name < b.name""") + if res and len(res)>0: + name_string = ", ".join(["'" + str(r[0]) + "'" for r in res]) + res = webnotes.conn.sql("""\ + DELETE FROM `tabTable Mapper Detail` + WHERE name IN (%s)""" % name_string) From 8a6b3b871379376764e64722ba100f895319f880 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 12 Dec 2011 14:16:16 +0530 Subject: [PATCH 12/43] Validation added in c-form --- erpnext/accounts/doctype/c_form/c_form.js | 2 +- erpnext/accounts/doctype/c_form/c_form.py | 31 +++++++++++++++++-- .../receivable_voucher/receivable_voucher.js | 6 ++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js index 4a90a9d1d61..6629de6f3bf 100644 --- a/erpnext/accounts/doctype/c_form/c_form.js +++ b/erpnext/accounts/doctype/c_form/c_form.js @@ -1,7 +1,7 @@ //c-form js file // ----------------------------- cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) { - return 'SELECT `tabReceivable Voucher`.`name` FROM `tabReceivable Voucher` WHERE `tabReceivable Voucher`.`company` = "' +doc.company+'" AND `tabReceivable Voucher`.%(key)s LIKE "%s" AND `tabReceivable Voucher`.`customer` = "' + doc.customer + '" AND `tabReceivable Voucher`.`docstatus` = 1 and `tabReceivable Voucher`.`c_form_applicable` = "Yes" ORDER BY `tabReceivable Voucher`.`name` ASC LIMIT 50'; + return 'SELECT `tabReceivable Voucher`.`name` FROM `tabReceivable Voucher` WHERE `tabReceivable Voucher`.`company` = "' +doc.company+'" AND `tabReceivable Voucher`.%(key)s LIKE "%s" AND `tabReceivable Voucher`.`customer` = "' + doc.customer + '" AND `tabReceivable Voucher`.`docstatus` = 1 and `tabReceivable Voucher`.`c_form_applicable` = "Yes" and ifnull(`tabReceivable Voucher`.c_form_no, "") = "" ORDER BY `tabReceivable Voucher`.`name` ASC LIMIT 50'; } cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index 00016cb053b..7228f11a4fc 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -17,12 +17,23 @@ class DocType: def autoname(self): self.doc.name = make_autoname(self.doc.naming_series + '.#####') + def on_update(self): - inv = "'" + "', '".join([d.invoice_no for d in getlist(self.doclist, 'invoice_details')]) + "'" - sql("""update `tabReceivable Voucher` set c_form_no = '%s', modified ='%s' + """ Update C-Form No on invoices""" + + if len(getlist(self.doclist, 'invoice_details')): + inv = "'" + "', '".join([d.invoice_no for d in getlist(self.doclist, 'invoice_details')]) + "'" + sql("""update `tabReceivable Voucher` set c_form_no = '%s', modified ='%s' where name in (%s)"""%(self.doc.name, self.doc.modified, inv)) + sql("""update `tabReceivable Voucher` set c_form_no = '', modified = %s where name not + in (%s) and ifnull(c_form_no, '') = %s""", (self.doc.modified, self.doc.name, inv)) + else: + msgprint("Please enter atleast 1 invoice in the table below", raise_exception=1) + def get_invoice_details(self, invoice_no): + """ Pull details from invoices for referrence """ + inv = sql("""select posting_date, territory, net_total, grand_total from `tabReceivable Voucher` where name = %s""", invoice_no) ret = { @@ -32,3 +43,19 @@ class DocType: 'grand_total' : inv and flt(inv[0][3]) or '' } return ret + + + def validate_invoice(self): + """Validate invoice that c-form is applicable and no other c-form is + received for that""" + + for d in getlist(self.doclist, 'invoice_details'): + inv = sql("""select c_form_applicable, c_form_no from + `tabReceivable Voucher` where name = %s""", invoice_no) + if not inv: + msgprint("Invoice: %s is not exists in the system, please check." % d.invoice_no, raise_exception=1) + elif inv[0][0] != 'Yes': + msgprint("C-form is not applicable for Invoice: %s" % d.invoice_no, raise_exception=1) + elif inv[0][1] and inv[0][1] != self.doc.name: + msgprint("""Invoice %s is tagged in another C-form: %s. \nIf you want to change C-form no for this invoice, + please remove invoice no from the previous c-form and then try again""" % (d.invoice_no, inv[0][1]), raise_exception=1) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js index 363da2ec573..12b57d94546 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js @@ -67,6 +67,12 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { } } } + + // India related fields + var cp = locals['Control Panel']['Control Panel']; + if (cp.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); + else hide_field(['c_form_applicable', 'c_form_no']); + } From 5245e6547b2bb364dc5a004cacfa7b1eae1d052d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 12 Dec 2011 19:18:23 +0530 Subject: [PATCH 13/43] Change path of images in accounts browser and sales browser --- .../accounts/page/accounts_browser/accounts_browser.js | 8 ++++---- erpnext/selling/page/sales_browser/sales_browser.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 38acfc9dc29..2a2435b0ad3 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -124,7 +124,7 @@ pscript.make_ac_tree = function() { var imgsrc=null; var has_children = true; if(cl[i].group_or_ledger=='Ledger') { - var imgsrc = 'images/icons/page.gif'; + var imgsrc = 'lib/images/icons/page.gif'; has_children = false; } var t = tree.addNode(n, cl[i].account_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null); @@ -137,7 +137,7 @@ pscript.make_ac_tree = function() { var imgsrc=null; var has_children = true; if(cl[i].group_or_ledger=='Ledger') { - var imgsrc = 'images/icons/page.gif'; + var imgsrc = 'lib/images/icons/page.gif'; has_children = false; } var t = tree.addNode(n, cl[i].cost_center_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null); @@ -254,7 +254,7 @@ pscript.make_group_area = function(type) { // refresh ref_btn = $a(pscript.group_area, 'div', '', {fontSize: '14px',marginBottom: '8px', marginTop: '24px', fontWeight: 'bold'}); - ref_btn.innerHTML = 'Refresh Tree'; + ref_btn.innerHTML = 'Refresh Tree'; ref_btn.onclick= function() { pscript.cur_node.clear_child_nodes(); pscript.cur_node.expand(); @@ -312,7 +312,7 @@ pscript.make_ledger_area = function() { //General ledger report link pscript.gl_rep = $a(pscript.ledger_area, 'div','', {fontSize: '14px',marginBottom: '8px', fontWeight: 'bold'}); - pscript.gl_rep.innerHTML = 'Open Ledger'; + pscript.gl_rep.innerHTML = 'Open Ledger'; pscript.gl_rep.onclick = function(){ pscript.make_report('gl'); } //Budget report link diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js index a24c9421d07..c0c4542ba4a 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.js +++ b/erpnext/selling/page/sales_browser/sales_browser.js @@ -139,7 +139,7 @@ SalesBrowser.prototype.make_tree = function() { var has_children = true; if(cl[i].is_group=='No') { - var imgsrc = 'images/icons/page.gif'; + var imgsrc = 'lib/images/icons/page.gif'; has_children = false; } var t = me.tree.addNode(n, cl[i].name, imgsrc,me.tree.std_onclick, has_children ? me.tree.std_onexp : null); @@ -219,7 +219,7 @@ SalesBrowser.prototype.first_level_node = function(){ var has_children = true; if(cl[i].is_group=='No') { - var imgsrc = 'images/icons/page.gif'; + var imgsrc = 'lib/images/icons/page.gif'; has_children = false; } me.tree_area.innerHTML = ''; @@ -418,4 +418,4 @@ MakeDialog.prototype.make_args = function(){ else if(this.cls_obj.sel == 'Sales Person') return {'node_title':nt,'sales_person_name':nm,'parent_sales_person':pnm,'is_group':grp,'old_parent':old_prt} -} \ No newline at end of file +} From 3a23a5740e78a87c5d8f36a8ab39d52155f58925 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 12 Dec 2011 19:50:09 +0530 Subject: [PATCH 14/43] In Dashboard, display a customer friendly error message when the start and end dates are not within a fiscal year --- erpnext/home/page/dashboard/dashboard.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/erpnext/home/page/dashboard/dashboard.py b/erpnext/home/page/dashboard/dashboard.py index 9ead6d688d5..0dc2d6ddd4d 100644 --- a/erpnext/home/page/dashboard/dashboard.py +++ b/erpnext/home/page/dashboard/dashboard.py @@ -133,19 +133,27 @@ class DashboardWidget: webnotes.msgprint('Wrongly defined account: ' + acc) print acc raise e - - return self.glc.get_as_on_balance(acc, self.get_fiscal_year(start), start, debit_or_credit, lft, rgt) + + fiscal_year = self.get_fiscal_year(start) + if fiscal_year: + return self.glc.get_as_on_balance(acc, fiscal_year, start, debit_or_credit, lft, rgt) + else: + webnotes.msgprint('Please select the START DATE and END DATE such that\ + they fall within the same fiscal year as defined in\ + Setup > System > Fiscal Year.', raise_exception=1) + def get_fiscal_year(self, dt): """ get fiscal year from date """ import webnotes - return webnotes.conn.sql(""" + fiscal_year = webnotes.conn.sql(""" select name from `tabFiscal Year` where year_start_date <= %s and DATE_ADD(year_start_date, INTERVAL 1 YEAR) >= %s - """, (dt, dt))[0][0] + """, (dt, dt)) + return fiscal_year and (fiscal_year[0] and fiscal_year[0][0]) or None def get_creation_trend(self, doctype, start, end): """ @@ -257,4 +265,4 @@ if __name__=='__main__': "start": "2011-05-01", "end": "2011-08-01", "interval": "7" - }""") \ No newline at end of file + }""") From 130ae986752dc9a06256372f3c050ebbfebf5ce8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 12 Dec 2011 20:24:06 +0530 Subject: [PATCH 15/43] Changes in dashboard start date and end date default logic such that the conditions for fiscal year range are met --- erpnext/home/page/dashboard/dashboard.js | 16 ++++++++++++++-- erpnext/home/page/dashboard/dashboard.py | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js index 08be0af675c..aac42a3e3b8 100644 --- a/erpnext/home/page/dashboard/dashboard.js +++ b/erpnext/home/page/dashboard/dashboard.js @@ -10,8 +10,20 @@ pscript.onload_dashboard = function() { pscript.dashboard_settings = { company: sys_defaults.company, - start: dateutil.obj_to_str(dateutil.add_days(new Date(), -180)), - end: dateutil.obj_to_str(new Date()), + start: (function() { + var start_date = dateutil.add_days(new Date(), -180); + var year_start_date = dateutil.str_to_obj(sys_defaults.year_start_date); + if (start_date < year_start_date) { start_date = year_start_date; } + console.log(start_date); + return dateutil.obj_to_str(start_date); + })(), + end: (function() { + var end_date = new Date(); + var year_end_date = dateutil.str_to_obj(sys_defaults.year_end_date); + if (end_date > year_end_date) { end_date = year_end_date; } + console.log(end_date); + return dateutil.obj_to_str(end_date); + })(), interval: 30 } diff --git a/erpnext/home/page/dashboard/dashboard.py b/erpnext/home/page/dashboard/dashboard.py index 0dc2d6ddd4d..c2378d3155e 100644 --- a/erpnext/home/page/dashboard/dashboard.py +++ b/erpnext/home/page/dashboard/dashboard.py @@ -139,7 +139,7 @@ class DashboardWidget: return self.glc.get_as_on_balance(acc, fiscal_year, start, debit_or_credit, lft, rgt) else: webnotes.msgprint('Please select the START DATE and END DATE such that\ - they fall within the same fiscal year as defined in\ + they fall within fiscal year(s) as defined in\ Setup > System > Fiscal Year.', raise_exception=1) From 206df20f36a9fa142a179b0f0ea1cc72c776ca18 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 13 Dec 2011 15:57:09 +0530 Subject: [PATCH 16/43] Changes in print formats to include selected print heading and discount appended in description --- .../Sales Invoice Classic.txt | 6 ++-- .../Sales Invoice Modern.txt | 6 ++-- .../Sales Invoice Spartan.txt | 6 ++-- .../Purchase Order Classic.txt | 6 ++-- .../Purchase Order Modern.txt | 6 ++-- .../Purchase Order Spartan.txt | 6 ++-- erpnext/patches/install_print_formats.py | 2 +- .../print_formats/DeliveryNoteClassic.html | 29 +++++++++++------ .../print_formats/DeliveryNoteModern.html | 30 +++++++++++------- .../print_formats/DeliveryNoteSpartan.html | 31 ++++++++++++------- .../print_formats/PurchaseOrderClassic.html | 3 +- .../print_formats/PurchaseOrderModern.html | 3 +- .../print_formats/PurchaseOrderSpartan.html | 4 +-- .../print_formats/QuotationClassic.html | 22 +++++++++++-- .../print_formats/QuotationModern.html | 20 ++++++++++-- .../print_formats/QuotationSpartan.html | 21 ++++++++++--- .../print_formats/SalesInvoiceClassic.html | 21 ++++++++++--- .../print_formats/SalesInvoiceModern.html | 21 ++++++++++--- .../print_formats/SalesInvoiceSpartan.html | 22 ++++++++++--- .../print_formats/SalesOrderClassic.html | 20 ++++++++++-- .../print_formats/SalesOrderModern.html | 20 ++++++++++-- .../print_formats/SalesOrderSpartan.html | 21 ++++++++++--- .../Quotation Classic/Quotation Classic.txt | 6 ++-- .../Quotation Modern/Quotation Modern.txt | 6 ++-- .../Quotation Spartan/Quotation Spartan.txt | 6 ++-- .../Sales Order Classic.txt | 6 ++-- .../Sales Order Modern/Sales Order Modern.txt | 6 ++-- .../Sales Order Spartan.txt | 6 ++-- .../Delivery Note Classic.txt | 6 ++-- .../Delivery Note Modern.txt | 6 ++-- .../Delivery Note Spartan.txt | 6 ++-- 31 files changed, 261 insertions(+), 119 deletions(-) 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 2fed0c4d9cf..d6255d71e7b 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': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 13:46:05', + 'modified': '2011-12-13 13:31:22', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Invoice

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total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n', 'module': 'Accounts', 'name': '__common__', 'standard': '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 ea8a9110829..f7d2c6b3870 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': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 13:44:58', + 'modified': '2011-12-13 13:37:39', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Invoice

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice No.
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\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\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Accounts', 'name': '__common__', 'standard': '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 d466b73be0c..c24cde54648 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': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 14:45:46', + 'modified': '2011-12-13 13:39:55', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Invoice

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\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t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Accounts', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt index bd10b2d3289..604d2d81788 100644 --- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt +++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:44', + 'modified': '2011-12-13 13:51:41', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Purchase Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Purchase Order

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n\n', + 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Buying', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt index 94c5a3f1d81..f5cafe43351 100644 --- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt +++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:45', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:45', + 'modified': '2011-12-13 13:53:52', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Purchase Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Purchase Order

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order No.
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n\n', + 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order No.
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Buying', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt index adb397ab807..70d6961f4d7 100644 --- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt +++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:45', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 14:45:05', + 'modified': '2011-12-13 13:55:23', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Purchase Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Purchase Order

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n\n\n', + 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Purchase Order Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Buying', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/patches/install_print_formats.py b/erpnext/patches/install_print_formats.py index 3b5627bba06..40a008ecfc9 100644 --- a/erpnext/patches/install_print_formats.py +++ b/erpnext/patches/install_print_formats.py @@ -53,7 +53,7 @@ def execute(): Install print formats """ from webnotes.modules.module_manager import reload_doc - #reload_doc('core', 'doctype', 'print_format') + reload_doc('core', 'doctype', 'print_format') #copy_doctype_to_pfs() global pf_to_install diff --git a/erpnext/patches/print_formats/DeliveryNoteClassic.html b/erpnext/patches/print_formats/DeliveryNoteClassic.html index 0db80b9daba..64475d64d48 100644 --- a/erpnext/patches/print_formats/DeliveryNoteClassic.html +++ b/erpnext/patches/print_formats/DeliveryNoteClassic.html @@ -112,16 +112,25 @@ null, { 'description' : function(data_row) { - if(data_row.serial_no) { - return ( - data_row.description + - '
Serial No.:' + - ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + - data_row.serial_no + '
' - ); - } else { - return data_row.description; + var to_append = '' + if(data_row.adj_rate){ + to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } } + + if(data_row.serial_no) { + to_append = '
Serial No.:' + + ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + + data_row.serial_no + '
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } + } + + return data_row.description; } } ); @@ -176,7 +185,7 @@ --> - + diff --git a/erpnext/patches/print_formats/DeliveryNoteModern.html b/erpnext/patches/print_formats/DeliveryNoteModern.html index 634bea0c350..375a8a6a1e1 100644 --- a/erpnext/patches/print_formats/DeliveryNoteModern.html +++ b/erpnext/patches/print_formats/DeliveryNoteModern.html @@ -135,16 +135,25 @@ null, { 'description' : function(data_row) { - if(data_row.serial_no) { - return ( - data_row.description + - '
Serial No.:' + - ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + - data_row.serial_no + '
' - ); - } else { - return data_row.description; + var to_append = '' + if(data_row.adj_rate){ + to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } } + + if(data_row.serial_no) { + to_append = '
Serial No.:' + + ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + + data_row.serial_no + '
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } + } + + return data_row.description; } } ); @@ -199,7 +208,7 @@ -->

Delivery Note

- + @@ -303,4 +312,3 @@

Delivery Note

- diff --git a/erpnext/patches/print_formats/DeliveryNoteSpartan.html b/erpnext/patches/print_formats/DeliveryNoteSpartan.html index 4be12c456c4..5426f134b6c 100644 --- a/erpnext/patches/print_formats/DeliveryNoteSpartan.html +++ b/erpnext/patches/print_formats/DeliveryNoteSpartan.html @@ -134,16 +134,25 @@ null, { 'description' : function(data_row) { - if(data_row.serial_no) { - return ( - data_row.description + - '
Serial No.:' + - ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + - data_row.serial_no + '
' - ); - } else { - return data_row.description; + var to_append = '' + if(data_row.adj_rate){ + to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } } + + if(data_row.serial_no) { + to_append = '
Serial No.:' + + ((data_row.serial_no.indexOf('\n')>-1)?'
':' ') + + data_row.serial_no + '
'; + if(data_row.description.indexOf(to_append)==-1) { + data_row.description = data_row.description + to_append; + } + } + + return data_row.description; } } ); @@ -198,7 +207,7 @@ --> - + @@ -298,5 +307,3 @@

Delivery Note

- - diff --git a/erpnext/patches/print_formats/PurchaseOrderClassic.html b/erpnext/patches/print_formats/PurchaseOrderClassic.html index 0e51c6148aa..e9a9ff8dae7 100644 --- a/erpnext/patches/print_formats/PurchaseOrderClassic.html +++ b/erpnext/patches/print_formats/PurchaseOrderClassic.html @@ -160,7 +160,7 @@ --> - + @@ -246,4 +246,3 @@

Purchase Order

- diff --git a/erpnext/patches/print_formats/PurchaseOrderModern.html b/erpnext/patches/print_formats/PurchaseOrderModern.html index b159242aded..73b607b4ade 100644 --- a/erpnext/patches/print_formats/PurchaseOrderModern.html +++ b/erpnext/patches/print_formats/PurchaseOrderModern.html @@ -183,7 +183,7 @@ --> - + @@ -273,4 +273,3 @@

Purchase Order

- diff --git a/erpnext/patches/print_formats/PurchaseOrderSpartan.html b/erpnext/patches/print_formats/PurchaseOrderSpartan.html index b1c1cd5bc1a..9058e0c5889 100644 --- a/erpnext/patches/print_formats/PurchaseOrderSpartan.html +++ b/erpnext/patches/print_formats/PurchaseOrderSpartan.html @@ -182,7 +182,7 @@ --> - + @@ -268,5 +268,3 @@

Purchase Order

- - diff --git a/erpnext/patches/print_formats/QuotationClassic.html b/erpnext/patches/print_formats/QuotationClassic.html index 2dd24fadd7e..a522ec626ec 100644 --- a/erpnext/patches/print_formats/QuotationClassic.html +++ b/erpnext/patches/print_formats/QuotationClassic.html @@ -107,7 +107,22 @@ [// Here specify the column widths '3%', '10%', '15%', '32%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -160,7 +175,9 @@ --> - + @@ -253,4 +270,3 @@

Quotation

+ +

- diff --git a/erpnext/patches/print_formats/QuotationModern.html b/erpnext/patches/print_formats/QuotationModern.html index 83103b00f91..33db0aa34fa 100644 --- a/erpnext/patches/print_formats/QuotationModern.html +++ b/erpnext/patches/print_formats/QuotationModern.html @@ -130,7 +130,22 @@ [// Here specify the column widths '3%', '10%', '15%', '32%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -183,7 +198,7 @@ --> - + @@ -280,4 +295,3 @@

Quotation

- diff --git a/erpnext/patches/print_formats/QuotationSpartan.html b/erpnext/patches/print_formats/QuotationSpartan.html index e6afe4d9d36..72ed0f71a59 100644 --- a/erpnext/patches/print_formats/QuotationSpartan.html +++ b/erpnext/patches/print_formats/QuotationSpartan.html @@ -129,7 +129,22 @@ [// Here specify the column widths '3%', '10%', '15%', '32%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -182,7 +197,7 @@ --> - + @@ -275,5 +290,3 @@

Quotation

- - diff --git a/erpnext/patches/print_formats/SalesInvoiceClassic.html b/erpnext/patches/print_formats/SalesInvoiceClassic.html index dc0d092e8d7..79da6437119 100644 --- a/erpnext/patches/print_formats/SalesInvoiceClassic.html +++ b/erpnext/patches/print_formats/SalesInvoiceClassic.html @@ -107,7 +107,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -128,7 +143,6 @@ print_other_charges: function(parent) { - console.log(parent); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var rows = '\n'; for(var i=0; i
- + @@ -258,4 +272,3 @@

Invoice

- diff --git a/erpnext/patches/print_formats/SalesInvoiceModern.html b/erpnext/patches/print_formats/SalesInvoiceModern.html index bdffa1cbd9e..3173c55140a 100644 --- a/erpnext/patches/print_formats/SalesInvoiceModern.html +++ b/erpnext/patches/print_formats/SalesInvoiceModern.html @@ -130,7 +130,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -151,7 +166,6 @@ print_other_charges: function(parent) { - console.log(parent); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var rows = '\n'; for(var i=0; i
- + @@ -285,4 +299,3 @@

Invoice

- diff --git a/erpnext/patches/print_formats/SalesInvoiceSpartan.html b/erpnext/patches/print_formats/SalesInvoiceSpartan.html index 6358a424554..b76c49ec7d5 100644 --- a/erpnext/patches/print_formats/SalesInvoiceSpartan.html +++ b/erpnext/patches/print_formats/SalesInvoiceSpartan.html @@ -129,7 +129,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -150,7 +165,6 @@ print_other_charges: function(parent) { - console.log(parent); var oc = getchildren('RV Tax Detail', doc.name, 'other_charges'); var rows = '\n'; for(var i=0; i
- + @@ -280,5 +294,3 @@

Invoice

- - diff --git a/erpnext/patches/print_formats/SalesOrderClassic.html b/erpnext/patches/print_formats/SalesOrderClassic.html index fcf104ebf03..21d8d46c450 100644 --- a/erpnext/patches/print_formats/SalesOrderClassic.html +++ b/erpnext/patches/print_formats/SalesOrderClassic.html @@ -107,7 +107,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -160,7 +175,7 @@ --> - + @@ -257,4 +272,3 @@

Sales Order

- diff --git a/erpnext/patches/print_formats/SalesOrderModern.html b/erpnext/patches/print_formats/SalesOrderModern.html index 7013e5d3f92..48b60f7c81d 100644 --- a/erpnext/patches/print_formats/SalesOrderModern.html +++ b/erpnext/patches/print_formats/SalesOrderModern.html @@ -130,7 +130,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -183,7 +198,7 @@ --> - + @@ -284,4 +299,3 @@

Sales Order

- diff --git a/erpnext/patches/print_formats/SalesOrderSpartan.html b/erpnext/patches/print_formats/SalesOrderSpartan.html index 59ed6a7d364..b3fce740cc2 100644 --- a/erpnext/patches/print_formats/SalesOrderSpartan.html +++ b/erpnext/patches/print_formats/SalesOrderSpartan.html @@ -129,7 +129,22 @@ [// Here specify the column widths '3%', '20%', '37%', '5%', '5%', '15%', '15%' - ] + ], + null, + null, + { + 'description' : function(data_row) { + if(data_row.adj_rate) { + var to_append = '
Discount: ' + + data_row.adj_rate + '%
'; + if(data_row.description.indexOf(to_append)==-1) { + return data_row.description + to_append; + } else { return data_row.description; } + } else { + return data_row.description; + } + } + } ); // This code takes care of page breaks @@ -182,7 +197,7 @@ --> - + @@ -279,5 +294,3 @@

Sales Order

- - diff --git a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt index a20d15fad1f..0650f30abf6 100644 --- a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt +++ b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 12:30:36', + 'modified': '2011-12-13 12:12:22', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Quotation', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Quotation

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Quotation Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n\n', + 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Quotation Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt index f5c02af8f84..89d2e20d63d 100644 --- a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt +++ b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 12:30:57', + 'modified': '2011-12-13 12:20:42', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Quotation', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Quotation

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Quotation No.
Quotation Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt index d253d01b7c0..258060efec4 100644 --- a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt +++ b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-16 13:27:17', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 14:45:26', + 'modified': '2011-12-13 12:24:23', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Quotation', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Quotation

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Quotation Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t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\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt index 28a9d685b70..7d99371ccbc 100644 --- a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt +++ b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:44', + 'modified': '2011-12-13 12:30:15', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Sales Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Sales Order

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\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\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Sales Order Date
Delivery Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt index 80ab0cbd1a4..aaf8c194c50 100644 --- a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt +++ b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:44', + 'modified': '2011-12-13 12:36:06', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Sales Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\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\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Sales Order No.
Sales Order Date
Delivery Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt index 37d8aedd522..14df2e7c4aa 100644 --- a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt +++ b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 14:46:00', + 'modified': '2011-12-13 12:42:52', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Sales Order', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Sales Order

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Sales Order Date
Delivery Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t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t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Selling', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt index 6b815c0f73a..aa90475e806 100644 --- a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt +++ b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:44', + 'modified': '2011-12-13 13:11:24', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Delivery Note', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Delivery Note

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\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\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Delivery Note Date
Sales Order No.\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t()\n\t\t\t\t\t\t
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n\n', 'module': 'Stock', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt index 9b86f5be723..1b10b1631a8 100644 --- a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt +++ b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-15 17:30:44', + 'modified': '2011-12-13 13:20:50', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Delivery Note', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Delivery Note

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Delivery Note No.
Delivery Note Date
Sales Order No.\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t()\n\t\t\t\t\t\t
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t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\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Stock', 'name': '__common__', 'standard': 'Yes' diff --git a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt index f8e989c3a2d..b0931075be0 100644 --- a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt +++ b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2011-11-15 17:30:44', + 'creation': '2011-12-13 11:02:59', 'docstatus': 0, - 'modified': '2011-11-16 14:43:28', + 'modified': '2011-12-13 13:22:53', 'modified_by': 'Administrator', 'owner': 'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': 'Delivery Note', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

Delivery Note

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Delivery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
Sales Order No.\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t()\n\t\t\t\t\t\t
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': 'Stock', 'name': '__common__', 'standard': 'Yes' From f5ff4434df6d554821f351780dd4d1b4fbc0a87e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 13 Dec 2011 18:13:23 +0530 Subject: [PATCH 17/43] Patch to reload Task doctype of Projects Module --- erpnext/patches/reload_project_task.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 erpnext/patches/reload_project_task.py diff --git a/erpnext/patches/reload_project_task.py b/erpnext/patches/reload_project_task.py new file mode 100644 index 00000000000..019a177652e --- /dev/null +++ b/erpnext/patches/reload_project_task.py @@ -0,0 +1,7 @@ +""" + Reload Task Doctype of Project Module +""" +def execute(): + from webnotes.modules.module_manager import reload_doc + reload_doc('Projects', 'DocType', 'Ticket') + From 85e8e01fd60fd6fd974edab471752c489aa56ab9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Dec 2011 18:48:24 +0530 Subject: [PATCH 18/43] notification email for recurring invoice --- .../accounts/doctype/gl_control/gl_control.py | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index 01f31eb7ddc..bab86267c15 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -515,6 +515,7 @@ def manage_recurring_invoices(): send_notification(new_rv) + def create_new_invoice(prev_rv): # clone rv new_rv = clone(prev_rv) @@ -533,6 +534,61 @@ def create_new_invoice(prev_rv): return new_rv + def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" - pass + subject = "Invoice : " + new_rv.doc.name + + com = new_rv.doc.company # get_value('Control Panel', '', 'letter_head') + + hd = '''

%s

+

Invoice: %s

+ + + + + +
Customer
%s
%s
Invoice Date: %s
Due Date: %s
+ ''' % (com, new_rv.doc.name, new_rv.doc.customer, new_rv.doc.address_display, new_rv.doc.posting_date, new_rv.doc.due_date) + + + tbl = ''' + + + + + + + + ''' + for d in getlist(new_rv.doclist, 'entries'): + tbl += '' + tbl += '
ItemDescriptionQtyRateAmount
' + d.item_code +'' + d.description+'' + cstr(d.qty) +'' + cstr(d.basic_rate) +'' + cstr(d.amount) +'
' + + totals =''' + + + + + + +
+ + + + + + + + + + +
Net Total: %s
Total Tax: %s
Grand Total: %s
In Words: %s
+
Terms:
%s
+ ''' % (new_rv.doc.net_total, new_rv.doc.total_tax,new_rv.doc.grand_total, new_rv.doc.in_words,new_rv.doc.terms) + + + msg = hd + tbl + totals + from webnotes.utils.email_lib import sendmail + sendmail(recipients = [new_rv.doc.email_notification_address], \ + sender=new_rv.doc.owner, subject=subject, parts=[['text/plain', msg]]) From 536e0cb1c4668cbf284f16d955c623e76a9583eb Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 13 Dec 2011 19:05:13 +0530 Subject: [PATCH 19/43] fixes in patch --- erpnext/patches/Discount_purchase_cycle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/Discount_purchase_cycle.py b/erpnext/patches/Discount_purchase_cycle.py index 8c41d5dd27b..f786439b5d6 100755 --- a/erpnext/patches/Discount_purchase_cycle.py +++ b/erpnext/patches/Discount_purchase_cycle.py @@ -5,5 +5,5 @@ def execute(): reload_doc('accounts', 'doctype', 'pv_detail') reload_doc('buying', 'doctype', 'po_detail') reload_doc('stock', 'doctype', 'purchase_receipt_detail') - if webnotes.conn.sql("select name from 'tabDocField` where parent = 'PO Detail' and fieldname = 'discount'"): + if webnotes.conn.sql("select name from `tabDocField` where parent = 'PO Detail' and fieldname = 'discount'"): webnotes.conn.sql("update `tabPO Detail` set discount_rate=discount") From cc25954bd6e97129e1943013734f7b8b05c73e4d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 13 Dec 2011 19:30:18 +0530 Subject: [PATCH 20/43] Changes in print format logic to display draft in page header --- index.html | 2 +- versions-master.db | Bin 730112 -> 730112 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index db7c228009a..72b5ec25668 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ ERPNext -