[fix] on advance payment entry cancellation delink invoice and pyament entry references

This commit is contained in:
Saurabh
2016-11-17 13:40:43 +05:30
parent 7fc05d6432
commit 1d210968de
4 changed files with 106 additions and 5 deletions

View File

@@ -126,11 +126,11 @@ class TransactionBase(StatusUpdater):
return ret
def delink_advance_entries(self, jv):
def delink_advance_entries(self, linked_doc_name):
total_allocated_amount = 0
for adv in self.advances:
consider_for_total_advance = True
if adv.reference_name == jv:
if adv.reference_name == linked_doc_name:
frappe.db.sql("""delete from `tab{0} Advance`
where name = %s""".format(self.doctype), adv.name)
consider_for_total_advance = False