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

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

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

Synced Dec 3, 17:00 UTC

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

davoodmehraban89 committed Nov 18, 2026 at 18:08 UTC 9633f002f5b6cd36c6468e03379d8438fdd1df30
1 file changed +3 -2
js/invoices.js
+3 -2
@@ -367,8 +367,9 @@ async function commitInvoiceSeamlessAmendment(id,changes){
367 function invoiceDocumentStatus(inv){
368 if(!inv)return 'unknown';
369 const linked=inv.journalVoucherId&&typeof jeSourceVoucher==='function'?jeSourceVoucher(inv):null;
370 - if(linked?.status==='reversed'||inv.accountingStatus==='reversed'||inv.documentStatus==='reversed')return 'reversed';
371 - if(linked?.status==='posted'||inv.journalVoucherId||inv.accountingStatus==='posted'||inv.documentStatus==='posted')return 'posted';
370 + const linkedStatus=linked?(typeof jeRpcEffectiveStatus==='function'?jeRpcEffectiveStatus(linked):linked.status):'';
371 + if(linkedStatus==='reversed'||inv.accountingStatus==='reversed'||inv.documentStatus==='reversed')return 'reversed';
372 + if(linkedStatus==='posted'||inv.journalVoucherId||inv.accountingStatus==='posted'||inv.documentStatus==='posted')return 'posted';
373 if(inv.documentStatus==='draft'||inv.accountingStatus==='draft')return 'draft';
374 if(invoiceCreatesAccountingEntry(inv.kind))return 'legacy_review';
375 return 'operational';