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

fix: derive source document state from effective reversal status (#216)

davoodmehraban89 committed Nov 18, 2026 at 18:09 UTC 739b66244177aa0507bf005e892eab77c6eb23b2
1 file changed +3 -2
js/purchases.js
+3 -2
@@ -64,8 +64,9 @@
64 function purchaseDocumentStatus(p){
65 if(!p)return 'unknown';
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';
67 + const linkedStatus=linked?(typeof jeRpcEffectiveStatus==='function'?jeRpcEffectiveStatus(linked):linked.status):'';
68 + if(linkedStatus==='reversed'||p.accountingStatus==='reversed')return 'reversed';
69 + if(linkedStatus==='posted')return 'posted';
70 if(p.accountingStatus==='draft'&&!p.journalVoucherId)return 'draft';
71 return 'legacy_review';
72 }