Merge pull request #4525 from nabinhait/jv_fix_10
[fix] Validate advance entry based on party
This commit is contained in:
commit
332ec15dd7
@ -105,6 +105,12 @@ class JournalEntry(AccountsController):
|
|||||||
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
|
elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes":
|
||||||
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
|
frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx))
|
||||||
|
|
||||||
|
if d.is_advance == "Yes":
|
||||||
|
if d.party_type == 'Customer' and flt(d.debit) > 0:
|
||||||
|
frappe.throw(_("Row {0}: Advance against Customer must be credit").format(d.idx))
|
||||||
|
elif d.party_type == 'Supplier' and flt(d.credit) > 0:
|
||||||
|
frappe.throw(_("Row {0}: Advance against Supplier must be debit").format(d.idx))
|
||||||
|
|
||||||
def validate_against_jv(self):
|
def validate_against_jv(self):
|
||||||
for d in self.get('accounts'):
|
for d in self.get('accounts'):
|
||||||
if d.reference_type=="Journal Entry":
|
if d.reference_type=="Journal Entry":
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user