fix: Don't allocate advance if pos

This commit is contained in:
Nabin Hait
2019-04-25 17:47:26 +05:30
parent 6643156df6
commit 619bf561da
3 changed files with 4 additions and 2 deletions

View File

@@ -88,7 +88,8 @@ class AccountsController(TransactionBase):
self.validate_paid_amount()
if self.doctype in ['Purchase Invoice', 'Sales Invoice']:
if cint(self.allocate_advances_automatically) and not cint(self.is_pos):
pos_check_field = "is_pos" if self.doctype=="Sales Invoice" else "is_paid"
if cint(self.allocate_advances_automatically) and not cint(self.get(pos_check_field)):
self.set_advances()
if self.is_return: