mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-26 21:35:19 +00:00
[test-case] test cases for delinking advance payments
This commit is contained in:
@@ -129,11 +129,16 @@ class TransactionBase(StatusUpdater):
|
||||
def delink_advance_entries(self, jv):
|
||||
total_allocated_amount = 0
|
||||
for adv in self.advances:
|
||||
consider_for_total_advance = True
|
||||
if adv.reference_name == jv:
|
||||
frappe.db.sql("""delete from `tab{0} Advance`
|
||||
where name = %s""".format(self.doctype), adv.name)
|
||||
total_allocated_amount += flt(adv.allocated_amount, adv.precision("allocated_amount"))
|
||||
self.db_set("total_advance", total_allocated_amount)
|
||||
consider_for_total_advance = False
|
||||
|
||||
if consider_for_total_advance:
|
||||
total_allocated_amount += flt(adv.allocated_amount, adv.precision("allocated_amount"))
|
||||
|
||||
frappe.db.set_value(self.doctype, self.name, "total_advance", total_allocated_amount, update_modified=False)
|
||||
|
||||
def delete_events(ref_type, ref_name):
|
||||
frappe.delete_doc("Event", frappe.db.sql_list("""select name from `tabEvent`
|
||||
|
||||
Reference in New Issue
Block a user