def reconcile_against_document(args):
 for d in args:
  check_if_advance_entry_modified(d)
  validate_allocated_amount(d)
  doc = frappe.get_doc(d.voucher_type, d.voucher_no)
  doc.make_gl_entries(cancel=1, adv_adj=1)
  if (d.voucher_type == u'Journal Entry'):
   update_reference_in_journal_entry(d, doc)
  else:
   update_reference_in_payment_entry(d, doc)
  doc = frappe.get_doc(d.voucher_type, d.voucher_no)
  doc.make_gl_entries(cancel=0, adv_adj=1)

def reconcile_against_document ( args ) : for d in args : check_if_advance_entry_modified ( d ) validate_allocated_amount ( d ) doc = frappe . get_doc ( d . voucher_type , d . voucher_no ) doc . make_gl_entries ( cancel = 1 , adv_adj = 1 ) if ( d . voucher_type == u'Journal Entry' ) : update_reference_in_journal_entry ( d , doc ) else : update_reference_in_payment_entry ( d , doc ) doc = frappe . get_doc ( d . voucher_type , d . voucher_no ) doc . make_gl_entries ( cancel = 0 , adv_adj = 1 )
cancel jv .