@davoodmehraban89 / Factor-easy / commits / df5afc5
Fork 0

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

Protect contract parties from destructive deletion

davoodmehraban89 committed Sep 29, 2026 at 12:50 UTC df5afc57cb53a76d04c9535a8594b7cb65ae05bb
1 file changed +1
js/contacts.js
+1
@@ -40,6 +40,7 @@ function renderContacts(){
40 function deleteContact(id){
41 if(!requireWrite())return;
42 if(!currentUser)return;
43 + if(typeof getMyContractParties==='function'&&getMyContractParties().some(x=>x.contactId===id&&x.active!==false)){alert('این شخص در قرارداد/پیمان استفاده شده و برای حفظ سابقه قابل حذف نیست.');return;}
44 if(confirm('حذف شود؟')){
45 datastore.contacts=datastore.contacts.filter(c=>!(c.id===id&&c.ownerUserId===currentUser.id));
46 saveDatastore();refreshAllSurfaces();