make due date, invoice_portion mandatory

This commit is contained in:
tunde 2017-09-22 16:22:15 +01:00
parent e6b3fe1215
commit 3aec78b472
2 changed files with 7 additions and 4 deletions

View File

@ -81,6 +81,7 @@
"bold": 0,
"collapsible": 0,
"columns": 2,
"default": "0",
"fieldname": "invoice_portion",
"fieldtype": "Percent",
"hidden": 0,
@ -101,7 +102,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@ -132,7 +133,7 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@ -143,6 +144,7 @@
"bold": 0,
"collapsible": 0,
"columns": 2,
"default": "0",
"depends_on": "eval:in_list(['Day(s) after invoice date', 'Day(s) after the end of the invoice month'], doc.due_date_based_on)",
"fieldname": "credit_days",
"fieldtype": "Int",
@ -175,6 +177,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0",
"depends_on": "eval:doc.due_date_based_on=='Month(s) after the end of the invoice month'",
"fieldname": "credit_months",
"fieldtype": "Int",
@ -211,7 +214,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-08-10 16:27:31.401380",
"modified": "2017-09-22 11:15:02.585019",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Terms Template Detail",

View File

@ -666,7 +666,7 @@ class AccountsController(TransactionBase):
def validate_invoice_portion(self):
total_portion = 0
for term in self.payment_schedule:
total_portion += term.invoice_portion
total_portion += flt(term.get('invoice_portion', 0))
if flt(total_portion, 2) != 100.00:
frappe.msgprint(_('Combined invoice portion must equal 100%'), raise_exception=1, indicator='red')