Paid amount + Write Off Amount can not be greater than Grand Total in return POS
This commit is contained in:
parent
799a9cabe7
commit
258f7da778
@ -411,10 +411,10 @@ class SalesInvoice(SellingController):
|
||||
throw(_("Customer {0} does not belong to project {1}").format(self.customer,self.project))
|
||||
|
||||
def validate_pos(self):
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) \
|
||||
- flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)) and self.is_return:
|
||||
frappe.throw(_("""Paid amount + Write Off Amount can not be greater than Grand Total"""))
|
||||
|
||||
if self.is_return:
|
||||
if flt(self.paid_amount) + flt(self.write_off_amount) - flt(self.grand_total) < \
|
||||
1/(10**(self.precision("grand_total") + 1)):
|
||||
frappe.throw(_("Paid amount + Write Off Amount can not be greater than Grand Total"))
|
||||
|
||||
def validate_item_code(self):
|
||||
for d in self.get('items'):
|
||||
|
@ -7,13 +7,15 @@ def execute():
|
||||
frappe.rename_doc("DocType", "Grade Interval", "Grading Scale Interval", force=True)
|
||||
|
||||
frappe.reload_doc("schools", "doctype", "grading_scale_interval")
|
||||
rename_field("Grading Scale Interval", "to_score", "threshold")
|
||||
if "to_score" in frappe.db.get_table_columns("Grading Scale Interval"):
|
||||
rename_field("Grading Scale Interval", "to_score", "threshold")
|
||||
|
||||
frappe.rename_doc("DocType", "Assessment", "Assessment Plan", force=True)
|
||||
|
||||
#Rename Assessment Results
|
||||
frappe.reload_doc("schools", "doctype", "assessment_plan")
|
||||
rename_field("Assessment Plan", "grading_structure", "grading_scale")
|
||||
if "grading_structure" in frappe.db.get_table_columns("Assessment Plan"):
|
||||
rename_field("Assessment Plan", "grading_structure", "grading_scale")
|
||||
|
||||
frappe.reload_doc("schools", "doctype", "assessment_result")
|
||||
frappe.reload_doc("schools", "doctype", "assessment_result_detail")
|
||||
|
Loading…
x
Reference in New Issue
Block a user