1import{d as _,o as i,c as m,a as n,l as a,u as d,K as w,B as e,H as u,x as o,k as l,F as g,E as h,C as x,e as c,s as k,I as C}from"./app-CFsgqP1j.js";import{s as F}from"./InvoiceController-d3Up1sxy.js";import{A as N}from"./AdminLayout-CKpIvQP8.js";import{A as V}from"./arrow-left-Do-Kuzhi.js";import{R as B}from"./user-D29teeXA.js";import{E as L}from"./external-link-D6PBlbIZ.js";import{C as S}from"./users-BefwP3yW.js";import{C as E}from"./settings-CclVfPKo.js";import"./index-C_SHgnPd.js";import"./ToastNotifications-l0oNMqvD.js";import"./createLucideIcon-CaR9SJZR.js";import"./circle-x-B-qYi6ty.js";import"./circle-check-DxM-V2IU.js";import"./x-DOzTIvCn.js";import"./_plugin-vue_export-helper-BecJeOls.js";import"./useNotificationPolling-1Si_P3xx.js";import"./log-out-BYu8YCA4.js";import"./search-CBXXJewK.js";import"./key-round-BY7MRI5T.js";import"./shopping-cart-y3xshjut.js";import"./landmark-DyZgAb07.js";import"./wallet-BXpWnQsG.js";import"./tag-O-5qGdEu.js";import"./mail-B9YElltF.js";import"./rss-DkLu0xM3.js";import"./shopping-bag-A0FubH0O.js";import"./dollar-sign-Cbx-TiGs.js";import"./shield-DCH2-rTP.js";import"./share-2-DId9laY7.js";import"./log-in-CaTw8toY.js";import"./code-xml-MmUq5RWp.js";import"./calendar-COZgZyOG.js";import"./clock-BCJBWsud.js";import"./wrench-0m2QhsKB.js";import"./shield-check-B_kOIHy7.js";import"./shield-alert-5l-Swexv.js";import"./smartphone-Cq9h_fss.js";import"./credit-card-DXOlPka8.js";import"./file-text-5DFqbhDC.js";import"./server-utF9gkXT.js";import"./message-square-Dm0ArbK1.js";const A={class:"p-4 lg:p-6 space-y-6 pb-24 lg:pb-6"},R={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-4"},$={class:"flex items-center gap-3"},j={class:"w-9 h-9 rounded-xl bg-primary/10 flex items-center justify-center"},T={class:"text-xs text-muted-foreground"},I={class:"flex items-center gap-2 flex-wrap"},z=["onClick"],D={class:"app-card rounded-2xl overflow-hidden"},H={class:"overflow-x-auto"},K={class:"w-full text-sm"},M={class:"divide-y divide-border"},P={key:0},q={class:"px-4 py-3 font-mono font-medium text-foreground text-xs"},G={class:"px-4 py-3"},J={class:"px-4 py-3 text-right font-medium text-foreground tabular-nums text-xs"},O={class:"px-4 py-3 text-xs text-muted-foreground"},Q={class:"px-4 py-3 text-xs text-muted-foreground"},U={class:"px-4 py-3 text-right"},W={key:0,class:"flex items-center justify-between px-4 py-3 border-t border-border"},X={class:"text-xs text-muted-foreground"},Y={class:"flex items-center gap-1"},Z={class:"px-3 py-1 text-xs font-medium text-foreground"},Me=_({__name:"Invoices",props:{client:{},invoices:{},filters:{}},setup(r){const b=r,y={paid:"bg-green-500/10 text-green-500 border border-green-500/20",unpaid:"bg-yellow-500/10 text-yellow-500 border border-yellow-500/20",overdue:"bg-destructive/10 text-destructive border border-destructive/20",cancelled:"bg-muted text-muted-foreground border border-border",refunded:"bg-muted text-muted-foreground border border-border"},p={paid:"Pagada",unpaid:"Sin pagar",overdue:"Vencida",cancelled:"Cancelada",refunded:"Reembolsada"};function v(f,s){C.get(`/admin/clients/${b.client.id}/invoices`,{...s?{[f]:s}:{}},{preserveState:!0,replace:!0})}return(f,s)=>(i(),m(N,null,{default:n(()=>[a(d(w),{title:`Facturas â ${r.client.name}`},null,8,["title"]),e("div",A,[e("div",R,[e("div",$,[a(d(u),{href:`/admin/clients/${r.client.id}`,class:"p-1.5 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"},{default:n(()=>[a(d(V),{class:"w-4 h-4"})]),_:1},8,["href"]),e("div",j,[a(d(B),{class:"w-5 h-5 text-primary"})]),e("div",null,[s[0]||(s[0]=e("h1",{class:"text-lg font-semibold text-foreground"},"Facturas",-1)),e("p",T,o(r.client.name),1)])]),e("div",I,[(i(),l(g,null,h([null,"unpaid","paid","overdue","cancelled"],t=>e("button",{key:String(t),class:x(["px-3 py-1.5 rounded-lg text-xs font-medium transition-colors border",r.filters.status===t||t===null&&!r.filters.status?"bg-primary text-primary-foreground border-primary":"bg-muted/50 text-muted-foreground border-border hover:bg-muted"]),onClick:ee=>v("status",t)},o(t?p[t]??t:"Todas"),11,z)),64))])]),e("div",D,[e("div",H,[e("table",K,[s[3]||(s[3]=e("thead",null,[e("tr",{class:"border-b border-border bg-muted/30"},[e("th",{class:"px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wide"},"#"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wide"},"Estado"),e("th",{class:"px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase tracking-wide"},"Total"),e("th",{class:"px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase tracking-wide"},"Saldo"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wide"},"Fecha"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wide"},"Vencimiento"),e("th",{class:"px-4 py-3"})])],-1)),e("tbody",M,[r.invoices.data.length===0?(i(),l("tr",P,[...s[1]||(s[1]=[e("td",{colspan:"7",class:"px-4 py-12 text-center text-sm text-muted-foreground"},"Sin facturas",-1)])])):c("",!0),(i(!0),l(g,null,h(r.invoices.data,t=>(i(),l("tr",{key:t.id,class:"hover:bg-muted/30 transition-colors"},[e("td",q,o(t.invoice_number),1),e("td",G,[e("span",{class:x(["inline-flex px-2 py-0.5 rounded-full text-xs font-medium",y[t.status]??"bg-muted text-muted-foreground"])},o(p[t.status]??t.status),3)]),e("td",J,o(Number(t.total).toFixed(2))+" "+o(t.currency_code),1),e("td",{class:x(["px-4 py-3 text-right text-xs tabular-nums",Number(t.balance)>0?"text-destructive font-medium":"text-muted-foreground"])},o(Number(t.balance).toFixed(2))+" "+o(t.currency_code),3),e("td",O,o(t.date),1),e("td",Q,o(t.due_date??"â"),1),e("td",U,[a(d(u),{href:d(F).url(t.id),class:"inline-flex items-center gap-1 text-xs text-primary hover:underline"},{default:n(()=>[s[2]||(s[2]=k(" Ver ",-1)),a(d(L),{class:"w-3 h-3"})]),_:1},8,["href"])])]))),128))])])]),r.invoices.last_page>1?(i(),l("div",W,[e("p",X," Mostrando "+o(r.invoices.from??0)+"â"+o(r.invoices.to??0)+" de "+o(r.invoices.total),1),e("div",Y,[r.invoices.prev_page_url?(i(),m(d(u),{key:0,href:r.invoices.prev_page_url,class:"p-1.5 rounded-lg hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"},{default:n(()=>[a(d(S),{class:"w-4 h-4"})]),_:1},8,["href"])):c("",!0),e("span",Z,o(r.invoices.current_page)+" / "+o(r.invoices.last_page),1),r.invoices.next_page_url?(i(),m(d(u),{key:1,href:r.invoices.next_page_url,class:"p-1.5 rounded-lg hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"},{default:n(()=>[a(d(E),{class:"w-4 h-4"})]),_:1},8,["href"])):c("",!0)])])):c("",!0)])])]),_:1}))}});
1export{Me 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.