From f16bf42045f9ca3361849b542fcb5df2f4738e62 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 30 Nov 2012 18:29:54 +0530 Subject: [PATCH 1/3] communication cleanup + journal voucher: ref no, ref date conditional mandatory --- accounts/doctype/journal_voucher/journal_voucher.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js index 410643d249..e05ffc630c 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.js +++ b/accounts/doctype/journal_voucher/journal_voucher.js @@ -27,6 +27,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.is_opening(doc) erpnext.hide_naming_series(); + cur_frm.cscript.voucher_type(doc); } cur_frm.cscript.load_defaults = function(doc, cdt, cdn) { @@ -211,6 +212,9 @@ cur_frm.cscript.view_ledger_entry = function(doc,cdt,cdn){ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { if(doc.voucher_type == 'Bank Voucher' && cstr(doc.company)) { + cur_frm.set_df_property("cheque_no", "reqd", true); + cur_frm.set_df_property("cheque_date", "reqd", true); + var children = getchildren('Journal Voucher Detail', doc.name, 'entries'); if(!children || children.length==0) { $c('accounts.get_default_bank_account', {company: doc.company }, function(r, rt) { @@ -221,5 +225,8 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { } }); } + } else { + cur_frm.set_df_property("cheque_no", "reqd", false); + cur_frm.set_df_property("cheque_date", "reqd", false); } } From 2f1ede1a5f1277ed7aee48c47ddfbd175696cd2d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 30 Nov 2012 20:39:55 +0530 Subject: [PATCH 2/3] changed communication module to core in patch --- patches/november_2012/communication_sender_and_recipient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/november_2012/communication_sender_and_recipient.py b/patches/november_2012/communication_sender_and_recipient.py index c49bc9bcc9..f8d7a95cfe 100644 --- a/patches/november_2012/communication_sender_and_recipient.py +++ b/patches/november_2012/communication_sender_and_recipient.py @@ -1,7 +1,7 @@ import webnotes def execute(): - webnotes.reload_doc("support", "doctype", "communication") + webnotes.reload_doc("core", "doctype", "communication") webnotes.conn.sql("""update tabCommunication set sender=email_address where ifnull(support_ticket,'') != ''""") webnotes.conn.sql("""update tabCommunication set recipients=email_address where From 79ed5d8c35090f7c294ae237fca71fa85afee708 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 1 Dec 2012 13:09:08 +0530 Subject: [PATCH 3/3] communication print format bugfix --- accounts/doctype/journal_voucher/journal_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/doctype/journal_voucher/journal_voucher.py b/accounts/doctype/journal_voucher/journal_voucher.py index 01b68801ca..8b22f229e6 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.py +++ b/accounts/doctype/journal_voucher/journal_voucher.py @@ -54,9 +54,9 @@ class DocType: r = [] if self.doc.cheque_no : if self.doc.cheque_date: - r.append('Via cheque #%s dated %s' % (self.doc.cheque_no, formatdate(self.doc.cheque_date))) + r.append('Via Reference #%s dated %s' % (self.doc.cheque_no, formatdate(self.doc.cheque_date))) else : - msgprint("Please enter cheque date") + msgprint("Please enter Reference date") raise Exception for d in getlist(self.doclist, 'entries'):