From f02c9e7b6c14210b6234663186f9e8b59464a5ae Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 19 Mar 2012 11:43:24 +0530 Subject: [PATCH 1/2] fix in due_date fetching for receivable voucher --- .../receivable_voucher/receivable_voucher.js | 14 ++++++++++++-- version.num | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js index 391bbcd8ae1..7b3c6eff1f5 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js @@ -162,14 +162,24 @@ cur_frm.cscript.warehouse = function(doc, cdt , cdn) { cur_frm.cscript.customer = function(doc,dt,dn,onload) { var callback = function(r,rt) { + var callback2 = function(doc, dt, dn) { + doc = locals[dt][dn]; + if(doc.debit_to && doc.posting_date){ + get_server_fields('get_cust_and_due_date','','',doc,dt,dn,1, + function(doc, dt, dn) { + cur_frm.refresh(); + }); + + } + } var doc = locals[cur_frm.doctype][cur_frm.docname]; - get_server_fields('get_debit_to','','',doc, dt, dn, 0); - cur_frm.refresh(); + get_server_fields('get_debit_to','','',doc, dt, dn, 0, callback2); } var args = onload ? 'onload':'' if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', args, callback); if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); + } diff --git a/version.num b/version.num index e7fd4bfbe1e..f08bce7b1cd 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -838 \ No newline at end of file +841 \ No newline at end of file From b6cd3316c4e9c41bf05aa4557ea9b499120da9bc Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 19 Mar 2012 13:27:06 +0530 Subject: [PATCH 2/2] error fixed in lease receipts client wise --- .../lease_receipts_client_wise/lease_receipts_client_wise.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql b/erpnext/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql index f951388aaf8..af49c813f1c 100644 --- a/erpnext/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql +++ b/erpnext/accounts/search_criteria/lease_receipts_client_wise/lease_receipts_client_wise.sql @@ -1,5 +1,5 @@ SELECT gl.account,sum(gl.credit) as amount FROM `tabGL Entry` gl, `tabAccount` a -WHERE gl.account=a.name and a.master_type='Customer' and gl.posting_date between '%(date)s' and '%(date1)s' +WHERE gl.account=a.name and a.master_type='Customer' and gl.posting_date between '%(date)s' and '%(date1)s' and ifnull(gl.is_cancelled, 'No') = 'No' GROUP BY gl.account ORDER BY posting_date