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

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

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

Synced Dec 3, 23:15 UTC

feat(sales): refresh linked draft voucher after invoice edit

davoodmehraban89 committed Nov 18, 2026 at 09:08 UTC ff78784b496873f599538e23052be10533a82b76
1 file changed +1
js/invoices.js
+1
@@ -622,6 +622,7 @@ function commitSaveInvoice(){
622 const finalEdoc=edoc?edoc:(prev.electronicDoc||null);
623 datastore.invoices[existingIndex]={...prev,ownerUserId:currentUser.id,number,date,companyId,companyName,kind,kindLabel:kindLabels[kind],contactId,contactName,projectId,projectName,contractNumber,paymentMethod,paymentMethodLabel,warehouseId,subtotal:totals.subtotal,discount:totals.fixedDiscount,discountType:totals.discountType,discountInput:totals.discountInput,vat:totals.vatAmount,vatType:totals.vatType,vatRate:totals.vatRate,grandTotal:totals.grandTotal,description,items,currencyLabel:cur,electronicDoc:finalEdoc,documentStatus:'draft',accountingStatus:'draft',documentVersion:Number(prev.documentVersion||1)+1,updatedAt:new Date().toISOString()};
624 alert('فاکتور با موفقیت ویرایش شد.');
625 + if(prev?.journalVoucherId&&typeof jeRpcRefreshSourceDraft==='function')void jeRpcRefreshSourceDraft('sale',editId).then(()=>refreshAllSurfaces()).catch(e=>alert('اطلاعات فاکتور ذخیره شد اما سند حسابداری موقت همگام نشد؛ قبل از قطعی‌سازی بررسی کنید: '+e.message));
626 }
627 cancelInvoiceEdit();
628 }else{