PageSourceSearch

https://milarivera.lovable.app/assets/admin.betalingen.peppol-DJZ3hjoa.js

js milarivera.lovable.app collected 2026-10-03 04:39:56 UTC 4,930 bytes, 1 lines download raw bytes

1import{e as v,f as r,g as c,r as d,j as e,t as s}from"./index-BSeo_c75.js";import{u as m}from"./useMutation-Dpm_n2i6.js";import{g as b,u as j,A as _}from"./AdminShell-DDLF5zaM.js";import{B as P}from"./button-Buprgu7b.js";import{S as N}from"./switch-78ZlrtxH.js";import{I as k,P as w}from"./service-integrations-CnJTM3fB.js";import{t as S,l as B}from"./peppol.functions-BrbeNZbW.js";import{A as u,i as F,g as E}from"./kit-DirKoajS.js";import"./index-DVMAVJAD.js";import"./index-LHNt3CwB.js";import"./utils-BQHNewu7.js";import"./index-DaSGHnCu.js";import"./index-BQg3Tcaw.js";import"./input-riC9C9Em.js";import"./service-integrations.functions-DXpMzpA3.js";function $(){const x=v(),y=r(b),h=r(j),g=r(S),f=r(B),n=c({queryKey:["payment_settings"],queryFn:()=>y()}),p=c({queryKey:["peppol_recent"],queryFn:()=>f()}),[o,i]=d.useState(null);d.useEffect(()=>{n.data&&!o&&i({peppol_enabled:n.data.peppol_enabled,peppol_provider:n.data.peppol_provider??"b2brouter",peppol_sender_id:n.data.peppol_sender_id??"",peppol_auto_send:n.data.peppol_auto_send})},[n.data,o]);const l=m({mutationFn:async a=>{if(!n.data)throw new Error("no_settings");const t=n.data;return h({data:{company_name:t.company_name,company_vat:t.company_vat,company_address:t.company_address,company_email:t.company_email,company_phone:t.company_phone,company_iban:t.company_iban,company_bic:t.company_bic,logo_url:t.logo_url,default_currency:t.default_currency,default_vat_rate:t.default_vat_rate,invoice_prefix:t.invoice_prefix,credit_note_prefix:t.credit_note_prefix,invoice_footer_text:t.invoice_footer_text,payment_terms_days:t.payment_terms_days,accent_hex:t.accent_hex,notify_internal_email:t.notify_internal_email,combine_paid_and_invoice_email:t.combine_paid_and_invoice_email,email_reply_to:t.email_reply_to,peppol_enabled:a.peppol_enabled,peppol_provider:a.peppol_provider,peppol_sender_id:a.peppol_sender_id.trim()||null,peppol_auto_send:a.peppol_enabled}})},onSuccess:()=>{s.success("Peppol-instellingen opgeslagen"),x.invalidateQueries({queryKey:["payment_settings"]})},onError:a=>s.error(`Opslaan mislukt: ${a.message}`)});return m({mutationFn:async()=>g(),onSuccess:a=>{a.ok?s.success(a.message??"Peppol-verbinding OK"):s.error(`Test mislukt: ${a.message??"onbekende fout"}`)},onError:a=>s.error(a.message)}),n.isLoading||!o?e.jsx(_,{title:"Peppol configuratie",subtitle:"Laden...",children:e.jsx("p",{className:"text-sm text-cocoa/55",children:"Instellingen laden."})}):e.jsxs(_,{title:"Peppol configuratie",subtitle:"Optionele koppeling met B2BRouter voor elektronische B2B-facturatie. Standaard uit; nooit verplicht.",card:!1,children:[e.jsxs("form",{className:"max-w-2xl space-y-6",onSubmit:a=>{a.preventDefault(),l.mutate(o)},children:[e.jsx(u,{children:e.jsx(F,{label:"Peppol inschakelen",description:"Zet aan om via B2BRouter of manuele UBL-export te werken.",control:e.jsx(N,{checked:o.peppol_enabled,onCheckedChange:a=>i(t=>t&&{...t,peppol_enabled:a})})})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{kind:"peppol",providers:w,title:"Peppol-koppeling",description:"Kies je Peppol-dienst en vul hier je API-sleutel in. De sleutel wordt op de server bewaard en nooit meer getoond.",disabled:!o.peppol_enabled,onSaved:a=>i(t=>t&&{...t,peppol_provider:a})}),e.jsx(E,{tone:"info",children:"Zodra Peppol aanstaat, wordt elke uitgereikte factuur met een BTW-nummer automatisch via het Peppol-netwerk verstuurd. Lukt dat niet, dan gaat de factuur gewoon als pdf per e-mail — de uitgifte faalt nooit."})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(P,{type:"submit",disabled:l.isPending,children:l.isPending?"Opslaan...":"Opslaan"})})]}),e.jsx(u,{title:"Recent verzonden via Peppol",className:"mt-8",children:p.isLoading?e.jsx("p",{className:"text-sm text-cocoa/55",children:"Laden..."}):!p.data||p.data.rows.length===0?e.jsx("p",{className:"text-sm text-cocoa/55",children:"Nog geen Peppol-verzendingen."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-cocoa/10",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-cream/60 text-left text-xs uppercase tracking-[0.06em] text-cocoa/55",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"Factuurnr"}),e.jsx("th",{className:"px-3 py-2",children:"Ontvanger"}),e.jsx("th",{className:"px-3 py-2",children:"Status"}),e.jsx("th",{className:"px-3 py-2",children:"Verstuurd"})]})}),e.jsx("tbody",{children:p.data.rows.map(a=>e.jsxs("tr",{className:"border-t border-cocoa/8",children:[e.jsx("td",{className:"px-3 py-2 font-mono text-xs text-cocoa",children:a.number}),e.jsx("td",{className:"px-3 py-2 text-cocoa",children:a.peppol_receiver_id??"-"}),e.jsx("td",{className:"px-3 py-2 text-cocoa",children:a.peppol_status??"-"}),e.jsx("td",{className:"px-3 py-2 text-xs text-cocoa/55",children:a.peppol_sent_at?new Date(a.peppol_sent_at).toLocaleStr
1ing("nl-BE"):"-"})]},a.id))})]})})})]})}export{$ as component};

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.