Validation for duplicate offline pos (#11281)
This commit is contained in:
parent
f4283a3ebf
commit
2672c331af
@ -70,6 +70,7 @@ class SalesInvoice(SellingController):
|
||||
self.clear_unallocated_advances("Sales Invoice Advance", "advances")
|
||||
self.add_remarks()
|
||||
self.validate_write_off_account()
|
||||
self.validate_duplicate_offline_pos_entry()
|
||||
self.validate_account_for_change_amount()
|
||||
self.validate_fixed_asset()
|
||||
self.set_income_account_for_fixed_assets()
|
||||
@ -462,6 +463,12 @@ class SalesInvoice(SellingController):
|
||||
if flt(self.write_off_amount) and not self.write_off_account:
|
||||
msgprint(_("Please enter Write Off Account"), raise_exception=1)
|
||||
|
||||
def validate_duplicate_offline_pos_entry(self):
|
||||
if self.is_pos and self.offline_pos_name \
|
||||
and frappe.db.get_value('Sales Invoice',
|
||||
{'offline_pos_name': self.offline_pos_name, 'docstatus': 1}):
|
||||
frappe.throw(_("Duplicate offline pos sales invoice {0}").format(self.offline_pos_name))
|
||||
|
||||
def validate_account_for_change_amount(self):
|
||||
if flt(self.change_amount) and not self.account_for_change_amount:
|
||||
msgprint(_("Please enter Account for Change Amount"), raise_exception=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user