Hi, I just starting facing this issue while I didn’t upgrade or modified the system then what could be the reason?
clarkej
December 30, 2019, 9:09pm
#2
This should help explain Debit and Credit not equal for Sales Invoice #. Difference is
That validation message occurs here in the code:
frappe@ubuntu:~/frappe-bench$ find . -name ‘*.py’ | xargs grep ‘Either debit or credit amount is required for’
./apps/erpnext/erpnext/accounts/doctype/gl_entry/gl_entry.py: frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
frappe@ubuntu:~/frappe-bench$ bench version
erpnext 11.1.71
frappe 11.1.39
account_type = frappe.db.get_value("Account", self.account, "account_type")
if not (self.party_type and self.party):
if account_type == "Receivable":
frappe.throw(_("{0} {1}: Customer is required against Receivable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
elif account_type == "Payable":
frappe.throw(_("{0} {1}: Supplier is required against Payable account {2}")
.format(self.voucher_type, self.voucher_no, self.account))
# Zero value transaction is not allowed
if not (flt(self.debit, self.precision("debit")) or flt(self.credit, self.precision("credit"))):
frappe.throw(_("{0} {1}: Either debit or credit amount is required for {2}")
.format(self.voucher_type, self.voucher_no, self.account))
def pl_must_have_cost_center(self):
if frappe.db.get_value("Account", self.account, "report_type") == "Profit and Loss":
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
.format(self.voucher_type, self.voucher_no, self.account))
else:
from erpnext.accounts.utils import get_allow_cost_center_in_entry_of_bs_account