mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-16 19:49:18 +00:00
verify payment entry amount is positive (#13066)
* verify payment entry amount is positive * Update sales_invoice.py * Update sales_invoice.py
This commit is contained in:
@@ -101,6 +101,8 @@ class SalesInvoice(SellingController):
|
|||||||
self.set_billing_hours_and_amount()
|
self.set_billing_hours_and_amount()
|
||||||
self.update_timesheet_billing_for_project()
|
self.update_timesheet_billing_for_project()
|
||||||
self.set_status()
|
self.set_status()
|
||||||
|
if self.is_pos and not self.is_return:
|
||||||
|
self.verify_payment_amount_is_positive()
|
||||||
|
|
||||||
def before_save(self):
|
def before_save(self):
|
||||||
set_account_for_mode_of_payment(self)
|
set_account_for_mode_of_payment(self)
|
||||||
@@ -903,6 +905,11 @@ class SalesInvoice(SellingController):
|
|||||||
project.update_billed_amount()
|
project.update_billed_amount()
|
||||||
project.save()
|
project.save()
|
||||||
|
|
||||||
|
def verify_payment_amount_is_positive(self):
|
||||||
|
for entry in self.payments:
|
||||||
|
if entry.amount < 0:
|
||||||
|
frappe.throw(_("Row #{0} (Payment Table): Amount must be positive").format(entry.idx))
|
||||||
|
|
||||||
def get_list_context(context=None):
|
def get_list_context(context=None):
|
||||||
from erpnext.controllers.website_list_for_contact import get_list_context
|
from erpnext.controllers.website_list_for_contact import get_list_context
|
||||||
list_context = get_list_context(context)
|
list_context = get_list_context(context)
|
||||||
|
|||||||
Reference in New Issue
Block a user