From 1e4e2c81e99efd91becee61093953deca432d6c9 Mon Sep 17 00:00:00 2001 From: frappe user Date: Sun, 16 Jun 2019 23:17:48 +0200 Subject: [PATCH 1/3] fix(payment entry): payment to shareholder --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 6cec259d0b8..862a033cf3c 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -558,7 +558,7 @@ def get_outstanding_reference_documents(args): # Get negative outstanding sales /purchase invoices negative_outstanding_invoices = [] - if args.get("party_type") not in ["Student", "Employee"] and not args.get("voucher_no"): + if args.get("party_type") not in ["Student", "Employee", "Shareholder"] and not args.get("voucher_no"): negative_outstanding_invoices = get_negative_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"), party_account_currency, company_currency) @@ -603,6 +603,8 @@ def get_orders_to_be_billed(posting_date, party_type, party, party_account_curre voucher_type = 'Purchase Order' elif party_type == "Employee": voucher_type = None + else: + voucher_type = None # Add cost center condition if voucher_type: From c79c8dae19a795de629ac70910a2de548b2212ac Mon Sep 17 00:00:00 2001 From: Harouna Sow Date: Sun, 16 Jun 2019 23:17:48 +0200 Subject: [PATCH 2/3] fix(payment entry): payment to shareholder --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 6cec259d0b8..862a033cf3c 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -558,7 +558,7 @@ def get_outstanding_reference_documents(args): # Get negative outstanding sales /purchase invoices negative_outstanding_invoices = [] - if args.get("party_type") not in ["Student", "Employee"] and not args.get("voucher_no"): + if args.get("party_type") not in ["Student", "Employee", "Shareholder"] and not args.get("voucher_no"): negative_outstanding_invoices = get_negative_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"), party_account_currency, company_currency) @@ -603,6 +603,8 @@ def get_orders_to_be_billed(posting_date, party_type, party, party_account_curre voucher_type = 'Purchase Order' elif party_type == "Employee": voucher_type = None + else: + voucher_type = None # Add cost center condition if voucher_type: From ceaedd0f9530cb98e06beb25cad390a2bbfb0b7e Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Fri, 12 Jul 2019 16:28:03 +0530 Subject: [PATCH 3/3] fix: handle shareholder option in payment entry --- erpnext/accounts/doctype/payment_entry/payment_entry.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py index 862a033cf3c..8a17c075b48 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.py +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py @@ -558,7 +558,7 @@ def get_outstanding_reference_documents(args): # Get negative outstanding sales /purchase invoices negative_outstanding_invoices = [] - if args.get("party_type") not in ["Student", "Employee", "Shareholder"] and not args.get("voucher_no"): + if args.get("party_type") in ("Supplier", "Customer") and not args.get("voucher_no"): negative_outstanding_invoices = get_negative_outstanding_invoices(args.get("party_type"), args.get("party"), args.get("party_account"), party_account_currency, company_currency) @@ -589,7 +589,7 @@ def get_outstanding_reference_documents(args): # Get all SO / PO which are not fully billed or aginst which full advance not paid orders_to_be_billed = [] - if (args.get("party_type") != "Student"): + if (args.get("party_type") in ("Supplier", "Customer")): orders_to_be_billed = get_orders_to_be_billed(args.get("posting_date"),args.get("party_type"), args.get("party"), party_account_currency, company_currency) @@ -601,8 +601,6 @@ def get_orders_to_be_billed(posting_date, party_type, party, party_account_curre voucher_type = 'Sales Order' elif party_type == "Supplier": voucher_type = 'Purchase Order' - elif party_type == "Employee": - voucher_type = None else: voucher_type = None