سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 00:30 UTC
feat(lifecycle): enforce draft-first source lifecycle and cascade deletion
davoodmehraban89 committed
Nov 18, 2026 at 09:03 UTC
6f3b695688bd178ba3bfa2c58ae714b55a264261
1 file changed
+2
-2
js/purchases.js
+2
-2
@@ -66,7 +66,7 @@
66
const linked=typeof jeSourceVoucher==='function'?jeSourceVoucher(p):null;
67
if(linked?.status==='reversed'||p.accountingStatus==='reversed')return 'reversed';
68
if(linked?.status==='posted')return 'posted';
69
- if(p.accountingStatus==='draft'&&!p.journalVoucherId)return 'draft';
69
+ if(linked?.status==='draft'||p.accountingStatus==='draft'||p.documentStatus==='draft')return 'draft';
70
return 'legacy_review';
71
}
72
window.purchaseDocumentStatus=purchaseDocumentStatus;
@@ -456,4 +456,4 @@
456
window.refreshAllSurfaces=function(){oldRefresh.apply(this,arguments);try{render();}catch(e){console.error('purchases render',e);}};
457
document.addEventListener('DOMContentLoaded',injectUI);
458
injectUI();
459
-})();
459
+})();
\ No newline at end of file