Ye error by-design hai — poora message (English screen): 'TT chain: this treatment's bill (INV-…) still exists. Delete the bill to the Recycle Bin first, then this treatment can be deleted.' (Hinglish screen: 'TT chain: is treatment ka bill (…) abhi maujood hai. Pehle bill ko Recycle Bin me delete karo, phir ye treatment delete hoga.')
KYUN
agar treatment chupchaap delete ho jaye aur bill reh jaye to accounts me aisi line bachegi jiska koi clinical record nahi — ghapla ya galti pakadna namumkin. Isliye chain ulta khulta hai: pehle paisa-record (bill) Recycle Bin me, tab clinical record.
STEPS
- Error me diya bill number note karo.
- Visits ke "● Bills" table me (ya Billing → Bills me) us bill par 🗑 Delete dabao — Action Guard on ho to Staff PIN mangega. Bill par payment juda ho to pehle owner / admin wo payment void kare. Bill 30 din Recycle Bin me recoverable rahega; permanent delete sirf owner.
- Ab owner / admin treatment par 🗑 dabaye — is baar delete (archive) ho jayega, aur uske pending post-op WhatsApp messages bhi ruk jaate hain. Doosre role ko 'Forbidden: DELETE restricted to owner/admin/super_admin' aata hai.
EDGE CASE
bill already cancelled/recycled hai phir bhi error aa raha ho — page refresh karke dobara try karo; phir bhi aaye to Billing me check karo kahin duplicate bill to nahi bana tha usi treatment par.