Views added: - ShiftsView (Schichtplanung) - PatrolsView (Wächterkontrolle) - IncidentsView (Vorfallberichte) - VehiclesView (Fahrzeuge) - DocumentsView (Dokumente) - CustomersView (Kunden/CRM) - BillingView (Abrechnung) - ObjectsView (enhanced with contacts, instructions) Updated: - Router with all new routes - Sidebar with complete navigation
2 lines
5.8 KiB
JavaScript
2 lines
5.8 KiB
JavaScript
import{d as S,q as C,m as c,c as a,a as t,t as n,n as _,F as h,x as v,e as p,r as u,o}from"./index-CWxNv9Fc.js";const B={class:"p-6"},z={class:"grid grid-cols-4 gap-4 mb-6"},R={class:"bg-white rounded-lg shadow p-4"},D={class:"text-2xl font-bold text-blue-600"},$={class:"text-sm text-gray-500"},E={class:"bg-white rounded-lg shadow p-4"},F={class:"text-2xl font-bold text-red-600"},N={class:"text-sm text-gray-500"},A={class:"bg-white rounded-lg shadow p-4"},K={class:"text-2xl font-bold text-green-600"},L={class:"bg-white rounded-lg shadow p-4"},T={class:"text-2xl font-bold"},V={class:"flex space-x-1 border-b mb-6"},j={key:0,class:"text-center py-12"},I={key:1},M={key:0,class:"bg-gray-50 rounded-lg p-12 text-center text-gray-500"},P={key:1,class:"bg-white rounded-lg shadow overflow-hidden"},q={class:"min-w-full divide-y divide-gray-200"},G={class:"divide-y divide-gray-200"},O={class:"px-4 py-3 text-sm font-medium"},U={class:"px-4 py-3 text-sm"},H={class:"px-4 py-3 text-sm"},J={class:"px-4 py-3 text-sm text-right font-semibold"},Q={class:"px-4 py-3"},W={class:"px-4 py-3 text-right text-sm space-x-2"},X=["onClick"],Y=["onClick"],Z={key:2},tt={key:0,class:"bg-gray-50 rounded-lg p-12 text-center text-gray-500"},et={key:1,class:"grid md:grid-cols-2 lg:grid-cols-3 gap-4"},st={class:"flex justify-between items-start"},at={class:"font-semibold"},nt={class:"text-sm text-gray-500"},ot={key:0,class:"px-2 py-1 text-xs bg-blue-100 text-blue-700 rounded"},lt={class:"text-2xl font-bold mt-2"},dt={class:"text-sm text-gray-500"},ct=S({__name:"BillingView",setup(it){const g=u(!0),y=u([]),x=u([]),d=u({}),i=u("invoices");C(async()=>{await m()});async function m(){g.value=!0;try{const[l,e,s]=await Promise.all([c.get("/billing/invoices"),c.get("/billing/rates"),c.get("/billing/stats")]);y.value=l.data.invoices||[],x.value=e.data.rates||[],d.value=s.data.stats||{}}catch(l){console.error(l)}g.value=!1}async function f(l){try{await c.put(`/billing/invoices/${l}/send`,{}),await m()}catch(e){alert("Fehler: "+e.message)}}async function w(l){try{await c.put(`/billing/invoices/${l}/pay`,{payment_method:"Überweisung"}),await m()}catch(e){alert("Fehler: "+e.message)}}function b(l){return{draft:{text:"Entwurf",class:"bg-gray-100 text-gray-700"},sent:{text:"Gesendet",class:"bg-blue-100 text-blue-700"},paid:{text:"Bezahlt",class:"bg-green-100 text-green-700"},overdue:{text:"Überfällig",class:"bg-red-100 text-red-700"},cancelled:{text:"Storniert",class:"bg-gray-100 text-gray-700"}}[l]||{text:l,class:"bg-gray-100"}}function r(l){return new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(l||0)}return(l,e)=>(o(),a("div",B,[e[9]||(e[9]=t("div",{class:"flex justify-between items-center mb-6"},[t("div",null,[t("h1",{class:"text-2xl font-bold"},"💰 Abrechnung"),t("p",{class:"text-gray-500"},"Rechnungen & Sätze")])],-1)),t("div",z,[t("div",R,[e[2]||(e[2]=t("p",{class:"text-sm text-gray-500"},"Offene Rechnungen",-1)),t("p",D,n(d.value.open_invoices||0),1),t("p",$,n(r(d.value.open_amount)),1)]),t("div",E,[e[3]||(e[3]=t("p",{class:"text-sm text-gray-500"},"Überfällig",-1)),t("p",F,n(d.value.overdue_invoices||0),1),t("p",N,n(r(d.value.overdue_amount)),1)]),t("div",A,[e[4]||(e[4]=t("p",{class:"text-sm text-gray-500"},"Bezahlt (30 Tage)",-1)),t("p",K,n(r(d.value.paid_last_30_days)),1)]),t("div",L,[e[5]||(e[5]=t("p",{class:"text-sm text-gray-500"},"Stundensätze",-1)),t("p",T,n(x.value.length),1)])]),t("div",V,[t("button",{onClick:e[0]||(e[0]=s=>i.value="invoices"),class:_(["px-4 py-2 font-medium border-b-2 -mb-px",i.value==="invoices"?"border-blue-600 text-blue-600":"border-transparent"])}," Rechnungen ",2),t("button",{onClick:e[1]||(e[1]=s=>i.value="rates"),class:_(["px-4 py-2 font-medium border-b-2 -mb-px",i.value==="rates"?"border-blue-600 text-blue-600":"border-transparent"])}," Stundensätze ",2)]),g.value?(o(),a("div",j,"Laden...")):i.value==="invoices"?(o(),a("div",I,[y.value.length===0?(o(),a("div",M,[...e[6]||(e[6]=[t("p",{class:"text-4xl mb-4"},"📄",-1),t("p",null,"Keine Rechnungen vorhanden",-1)])])):(o(),a("div",P,[t("table",q,[e[7]||(e[7]=t("thead",{class:"bg-gray-50"},[t("tr",null,[t("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Nr."),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Kunde"),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Datum"),t("th",{class:"px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase"},"Betrag"),t("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase"},"Status"),t("th",{class:"px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase"},"Aktionen")])],-1)),t("tbody",G,[(o(!0),a(h,null,v(y.value,s=>(o(),a("tr",{key:s.id,class:"hover:bg-gray-50"},[t("td",O,n(s.invoice_number),1),t("td",U,n(s.customer_name),1),t("td",H,n(new Date(s.invoice_date).toLocaleDateString("de-DE")),1),t("td",J,n(r(s.total)),1),t("td",Q,[t("span",{class:_(["px-2 py-1 text-xs rounded",b(s.status).class])},n(b(s.status).text),3)]),t("td",W,[s.status==="draft"?(o(),a("button",{key:0,onClick:k=>f(s.id),class:"text-blue-600 hover:underline"},"Senden",8,X)):p("",!0),s.status==="sent"||s.status==="overdue"?(o(),a("button",{key:1,onClick:k=>w(s.id),class:"text-green-600 hover:underline"},"Bezahlt",8,Y)):p("",!0)])]))),128))])])]))])):i.value==="rates"?(o(),a("div",Z,[x.value.length===0?(o(),a("div",tt,[...e[8]||(e[8]=[t("p",{class:"text-4xl mb-4"},"💵",-1),t("p",null,"Keine Stundensätze definiert",-1)])])):(o(),a("div",et,[(o(!0),a(h,null,v(x.value,s=>(o(),a("div",{key:s.id,class:"bg-white rounded-lg shadow p-4"},[t("div",st,[t("div",null,[t("h3",at,n(s.name),1),t("p",nt,n(s.customer_name||"Allgemein"),1)]),s.is_default?(o(),a("span",ot,"Standard")):p("",!0)]),t("p",lt,n(r(s.amount)),1),t("p",dt,"pro "+n(s.rate_type==="hourly"?"Stunde":s.rate_type==="daily"?"Tag":"Monat"),1)]))),128))]))])):p("",!0)]))}});export{ct as default};
|