How to cancel journal entry affect to general ledger

Hi ,
i use this method to write a journal entry

so when my doctype is submit , the method triggers … and write it in the general ledger .
but when i cancel it , i need to delete or do some movement in general ledger , to cancel the first one . !!
still don’t know how ? should i make new gournal entry to reverse or cancel the old one ?
any one try it or know how to do it in accounts way or programming way , ?
thank you

1 Like

Check on_cancel method in


hi @ahmadRagheb did you solved this proplem ?
please share your solution
all the best

sorry for not writing the soluation or what i have done with this issue, from last year i start to write the solution on the discuss so any one refere to it , i think you should cancel the je .
you can refer the code it does every thing for you on cancel when you just
frappe.get_doc(“Jorunal Entry”, name).cancel()
it will trigger this

1 Like