Merge pull request #45593 from frappe/mergify/bp/version-14-hotfix/pr-45569
fix: update voucher outstanding from payment ledger (backport #45569)
This commit is contained in:
@@ -10,7 +10,6 @@ from frappe.utils import cint, cstr, flt, formatdate, get_link_to_form, getdate,
|
|||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.accounts.deferred_revenue import validate_service_stop_date
|
from erpnext.accounts.deferred_revenue import validate_service_stop_date
|
||||||
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
|
|
||||||
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
|
from erpnext.accounts.doctype.repost_accounting_ledger.repost_accounting_ledger import (
|
||||||
validate_docs_for_deferred_accounting,
|
validate_docs_for_deferred_accounting,
|
||||||
validate_docs_for_voucher_types,
|
validate_docs_for_voucher_types,
|
||||||
@@ -33,7 +32,7 @@ from erpnext.accounts.general_ledger import (
|
|||||||
merge_similar_entries,
|
merge_similar_entries,
|
||||||
)
|
)
|
||||||
from erpnext.accounts.party import get_due_date, get_party_account
|
from erpnext.accounts.party import get_due_date, get_party_account
|
||||||
from erpnext.accounts.utils import get_account_currency, get_fiscal_year
|
from erpnext.accounts.utils import get_account_currency, get_fiscal_year, update_voucher_outstanding
|
||||||
from erpnext.assets.doctype.asset.asset import is_cwip_accounting_enabled
|
from erpnext.assets.doctype.asset.asset import is_cwip_accounting_enabled
|
||||||
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
|
from erpnext.assets.doctype.asset_category.asset_category import get_asset_category_account
|
||||||
from erpnext.buying.utils import check_on_hold_or_closed_status
|
from erpnext.buying.utils import check_on_hold_or_closed_status
|
||||||
@@ -661,12 +660,12 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
def update_supplier_outstanding(self, update_outstanding):
|
def update_supplier_outstanding(self, update_outstanding):
|
||||||
if update_outstanding == "No":
|
if update_outstanding == "No":
|
||||||
update_outstanding_amt(
|
update_voucher_outstanding(
|
||||||
self.credit_to,
|
voucher_type=self.doctype,
|
||||||
"Supplier",
|
voucher_no=self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
self.supplier,
|
account=self.credit_to,
|
||||||
self.doctype,
|
party_type="Supplier",
|
||||||
self.return_against if cint(self.is_return) and self.return_against else self.name,
|
party=self.supplier,
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_gl_entries(self, warehouse_account=None):
|
def get_gl_entries(self, warehouse_account=None):
|
||||||
|
|||||||
@@ -24,7 +24,11 @@ from erpnext.accounts.doctype.tax_withholding_category.tax_withholding_category
|
|||||||
)
|
)
|
||||||
from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center
|
from erpnext.accounts.general_ledger import get_round_off_account_and_cost_center
|
||||||
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
|
from erpnext.accounts.party import get_due_date, get_party_account, get_party_details
|
||||||
from erpnext.accounts.utils import cancel_exchange_gain_loss_journal, get_account_currency
|
from erpnext.accounts.utils import (
|
||||||
|
cancel_exchange_gain_loss_journal,
|
||||||
|
get_account_currency,
|
||||||
|
update_voucher_outstanding,
|
||||||
|
)
|
||||||
from erpnext.assets.doctype.asset.depreciation import (
|
from erpnext.assets.doctype.asset.depreciation import (
|
||||||
depreciate_asset,
|
depreciate_asset,
|
||||||
get_disposal_account_and_cost_center,
|
get_disposal_account_and_cost_center,
|
||||||
@@ -1019,14 +1023,14 @@ class SalesInvoice(SellingController):
|
|||||||
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
|
make_reverse_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
|
||||||
|
|
||||||
if update_outstanding == "No":
|
if update_outstanding == "No":
|
||||||
from erpnext.accounts.doctype.gl_entry.gl_entry import update_outstanding_amt
|
update_voucher_outstanding(
|
||||||
|
voucher_type=self.doctype,
|
||||||
update_outstanding_amt(
|
voucher_no=self.return_against
|
||||||
self.debit_to,
|
if cint(self.is_return) and self.return_against
|
||||||
"Customer",
|
else self.name,
|
||||||
self.customer,
|
account=self.debit_to,
|
||||||
self.doctype,
|
party_type="Customer",
|
||||||
self.return_against if cint(self.is_return) and self.return_against else self.name,
|
party=self.customer,
|
||||||
)
|
)
|
||||||
|
|
||||||
elif self.docstatus == 2 and cint(self.update_stock) and cint(auto_accounting_for_stock):
|
elif self.docstatus == 2 and cint(self.update_stock) and cint(auto_accounting_for_stock):
|
||||||
|
|||||||
Reference in New Issue
Block a user