@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / c656d64
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 09:15 UTC

fix(company): clear stale foreign-company form IDs before switching active company

davoodmehraban89 committed Oct 14, 2026 at 11:40 UTC c656d64dba7cdfe5342df3f55b7c67339ff63066
1 file changed +3
js/companies.js
+3
@@ -144,6 +144,9 @@ function setDefaultCompany(id){
144 if(typeof resetPaymentForm==='function')resetPaymentForm();
145 if(typeof cancelProductEdit==='function')cancelProductEdit(false);
146 if(typeof resetCompanyForm==='function')resetCompanyForm();
147 + for(const fn of ['cancelContactEdit','cancelChequeEdit','cancelExpenseEdit'])if(typeof window[fn]==='function')window[fn]();
148 + // Quick edit dialogs from the previous company must not retain foreign IDs.
149 + document.querySelectorAll('.modal-backdrop.active').forEach(el=>el.classList.remove('active'));
150 const s=getMySettings();s.default_company_id=id;saveDatastore();refreshAllSurfaces();
151 if(typeof navigateShell==='function')navigateShell('settings','view-settings','company');
152 }