PageSourceSearch

https://app.abcinvoice.eu/_nuxt/BZ6IGmba.js

js abcinvoice.eu collected 2026-10-08 19:57:12 UTC 5,330 bytes, 1 lines download raw bytes

1import{e as ee,f as oe,H as ie,r as u,aj as se,i as te,m as ne,k as C,c as x,b as k,w as ae,j as a,F as re,af as ce,o as g,B as ue,q as le,a as ve,t as de}from"./cFqdfEOq.js";import{u as me}from"./CxGUDrBz.js";import{u as N}from"./DYSqn4TR.js";import{I as fe}from"./CdaJkoG2.js";import{P as pe}from"./DwMXAxvD.js";import{B as E}from"./D_uyo7vb.js";import{u as ge}from"./D9ejHvCz.js";import{i as P}from"./Dn0ctB5c.js";import"./DuYTUK7u.js";import"./Cqa52n8e.js";import"./BpWgA2Ra.js";import"./DTgK4ydm.js";import"./CL9osH8b.js";import"./DlAUqK2U.js";import"./CEa-WzfH.js";import"./C9KiFPfc.js";import"./M2TX6z01.js";import"./CdDmFmrZ.js";import"./ChMqMpVj.js";import"./-bRXWTK3.js";import"./CGa6Bbaj.js";import"./7ufB_RY3.js";import"./DcCJutnn.js";const _e={key:1,class:"flex h-64 items-center justify-center"},ye={key:2,class:"p-4 text-center font-semibold text-red-500"},He=ee({__name:"index",setup(he){const{t:n}=oe(),_=se(),r=ce(),s=me(),{setCurrentItem:S,items:Ie,syncInvoiceStatus:we,goToNextInvoice:A,goToPreviousInvoice:B,getNavigationState:K,ensureNavigationContext:$,fetchInvoiceEvents:b}=N(),{currentItem:c,currentEvents:T,isLoadingEvents:q}=ie(N()),o=u(_.params.id||null),y=u(!0),f=u(""),h=u(!1),p=u(!1),l=u(null),{showDeleteConfirmation:V,pendingDeleteInvoiceId:F,isDeleting:G,handleDeleteConfirmation:R,cancelDelete:j,handleDelete:L}=ge("customer",{currentItem:c}),M=te(()=>o.value?K(o.value):{canGoNext:!1,canGoPrevious:!1}),O=async()=>{if(o.value)try{const e=await A(o.value);e.success&&e.nextId?r.push({name:"invoice-customers-id",params:{id:e.nextId}}):e.messageKey&&s.info(n(e.messageKey))}catch(e){console.error("Error navigating to next invoice:",e),s.error(e.message||n("invoices.navigation_error"))}},H=async()=>{if(o.value)try{const e=await B(o.value);e.success&&e.prevId?r.push({name:"invoice-customers-id",params:{id:e.prevId}}):e.messageKey&&s.info(n(e.messageKey))}catch(e){console.error("Error navigating to previous invoice:",e),s.error(e.message||n("invoices.navigation_error"))}},J=()=>{r.push("/invoice/customers")},z=()=>{o.value&&r.push({name:"invoice-customers-id-update",params:{id:o.value}})},Q=()=>{o.value&&(s.info(n("invoices.duplicating_invoice")),r.push({path:"/invoice/customers/create",query:{duplicateFrom:o.value}}))},U=()=>{o.value&&(s.info(n("invoices.duplicating_as_credit_note")),r.push({path:"/invoice/customers/create",query:{duplicateFrom:o.value,creditNote:"true"}}))},W=async e=>{var t,I;h.value=!0;try{const i=P(c.value),D=i?"sending_credit_note":"sending_invoice",w=i?"credit_note_sent_successfully":"invoice_sent_successfully",d=i?"failed_to_send_credit_note":"failed_to_send_invoice";s.info(n(`invoices.${D}`));const m=await $fetch(`/api/v1/invoice/${e}/send`,{method:"POST"});s.success(n(`invoices.${w}`)),await v(o.value)}catch(i){console.error("Erreur lors de l'envoi de la facture:",i);const w=P(c.value)?"failed_to_send_credit_note":"failed_to_send_invoice";let d=n(`invoices.${w}`);if((t=i==null?void 0:i.data)!=null&&t.statusMessage)try{const m=JSON.parse(i.data.statusMessage);(I=m==null?void 0:m.error)!=null&&I.message&&(d=m.error.message)}catch{d=i.data.statusMessage}else i!=null&&i.statusMessage&&(d=i.statusMessage);s.error(d)}finally{h.value=!1}},X=e=>{l.value=e,p.value=!0},Y=()=>{p.value=!1,l.value=null},Z=async()=>{if(p.value=!1,!l.value){console.error("Erreur: ID de facture B2B manquant");return}try{await N().markInvoiceAsPaid(l.value),s.success(n("invoices.paid_success")),o.value&&await v(o.value)}catch(e){console.error("Erreur lors du marquage de la facture comme payée:",e),s.error(e.message||n("invoices.paid_error"))}finally{l.value=null}},v=async e=>{try{if(y.value=!0,await S(e),!c.value)throw new Error("error.invoice_not_found");await b(e),await $(e)}catch(t){f.value=t.message||"error.invoice_not_found",s.error(f.value)}finally{y.value=!1}};return ne(async()=>{o.value&&await v(o.value)}),C(()=>_.params.id,async e=>{o.value=e||null,o.value?await v(o.value):(s.error("error.invoice_not_found"),r.push({name:"invoices"}))}),C(()=>_.fullPath,async(e,t)=>{t!=null&&t.includes("/update")&&!e.includes("/update")&&o.value&&await v(o.value)}
1),C(()=>{var e;return(e=c.value)==null?void 0:e.type},e=>{e==="ReceivedInvoice"&&o.value&&r.replace(`/invoice/suppliers/${o.value}`)},{immediate:!0}),(e,t)=>(g(),x(re,null,[k(pe,null,{default:ae(()=>[a(c)?(g(),ue(fe,{key:0,invoice:a(c),events:a(T),"loading-events":a(q),"can-go-next":M.value.canGoNext,"can-go-previous":M.value.canGoPrevious,"is-sending":h.value,onNext:O,onPrevious:H,onClose:J,onEdit:z,onSend:W,onDuplicate:Q,onDuplicateAsCreditNote:U,onDelete:a(R),onMarkAsPaid:X},null,8,["invoice","events","loading-events","can-go-next","can-go-previous","is-sending","onDelete"])):y.value?(g(),x("div",_e,[...t[1]||(t[1]=[ve("div",{class:"mx-auto h-12 w-12 animate-spin rounded-full border-b-2 border-blue-500"},null,-1)])])):f.value?(g(),x("div",ye,de(f.value),1)):le("",!0),k(E,{show:p.value,title:"invoices.mark_invoice_paid_confirmation_title",message:"invoices.mark_invoice_paid_confirmation_message",onConfirm:Z,onCancel:Y},null,8,["show"])]),_:1}),k(E,{show:a(V),loading:a(G),title:"invoices.delete_confirmation_title",message:"invoices.delete_confirmation_message",onConfirm:t[0]||(t[0]=I=>a(L)(a(F))),onCancel:a(j)},null,8,["show","loading","onCancel"])],64))}});export{He as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.