PageSourceSearch

https://photodecor.it/_nuxt/DCa521QE2.js

js photodecor.it collected 2026-10-03 18:50:16 UTC 11,099 bytes, 1 lines download raw bytes

1import{G as t,H as e,J as a,Ot as o,at as s,bt as r,d as l,en as n,ht as i,lt as d,m as p,p as c,r as g,u as m,v as y,x}from"./3xMQmu_c.js";import{u}from"./BHyipOjY.js";import{t as b}from"./BdX5S4iW.js";import{t as f}from"./DgLP3hnZ.js";import{t as v}from"./DZ8S0lCE2.js";import{t as h}from"./BqoQZ1h_2.js";var k={class:"p-4 sm:p-6 lg:p-8"},T={class:"report-filters mb-6 border-b border-gray-200 pb-4"},z={class:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between"},I={class:"flex flex-wrap items-end gap-3"},w=["disabled"],O=["disabled"],C={key:0,class:"text-sm text-gray-500"},D={key:1,class:"rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-700"},j={key:2,class:"rounded-lg border border-gray-200 bg-gray-50 p-6 text-center text-sm text-gray-600"},P={key:3,class:"report-printable"},R={class:"report-periodo text-sm text-gray-800 mb-4"},A={class:"report-table w-full border-collapse text-sm"},S={class:"py-2 px-3"},E={class:"py-2 px-3 text-right font-mono"},F={class:"border-b border-gray-200 bg-gray-50"},N={class:"py-2 px-3"},L={class:"text-xs text-gray-600"},V={class:"py-2 px-3 text-right font-mono"},W={class:"border-t border-gray-400"},B={class:"py-2 px-3 text-right font-mono text-gray-700"},_={class:"py-2 px-3 text-right font-mono text-gray-700"},U={key:1,class:"border-t border-gray-400"},G={class:"py-2 px-3 text-gray-700"},M={class:"text-xs text-gray-600"},Z={class:"py-2 px-3 text-right font-mono text-gray-700"},q={class:"border-t border-gray-400"},H={class:"py-2 px-3 text-right font-mono text-gray-700"},J={class:"py-2 px-3 text-gray-700"},K={class:"text-xs text-gray-600"},Q={class:"py-2 px-3 text-right font-mono text-gray-700"},X={class:"report-totale-row border-t-2 border-gray-900"},Y={class:"py-3 px-3 text-right font-mono font-bold"},$={key:0,class:"report-net-block mt-6 text-sm"},tt={key:0,class:"flex justify-between pt-1"},et={class:"font-mono text-gray-700"},at={key:1,class:"flex justify-between pt-1"},ot={class:"font-mono text-gray-700"},st={key:2,class:"flex justify-between pt-1"},rt={class:"font-mono text-gray-700"},lt={key:3,class:"flex justify-between pt-1"},nt={class:"font-mono text-gray-700"},it={class:"mt-1 flex justify-end"},dt={class:"flex w-52 justify-between border-t border-gray-400 pt-1 font-bold text-gray-900"},pt={class:"font-mono"},ct={key:4,class:"mt-2 text-xs italic text-gray-500"},gt={class:"mt-6 text-sm"},mt={class:"font-semibold mb-2"},yt={class:"space-y-1 text-gray-700"},xt={class:"font-mono"},ut={key:1,class:"report-orders-block mt-6"},bt={class:"font-semibold mb-2 border-b border-gray-300 pb-1 text-sm text-gray-900"},ft={class:"text-sm text-gray-700"},vt={class:"text-xs text-gray-500"},ht={class:"font-mono"},kt={key:2,class:"report-amazon-block mt-6 text-sm"},Tt={class:"font-semibold mb-2"},zt={class:"space-y-1 text-gray-700"},It={class:"font-mono"},wt={class:"font-mono"},Ot={class:"mt-2 flex justify-between border-t border-gray-300 pt-1 font-semibold text-gray-900"},Ct={class:"font-mono"},Dt=f(x({__name:"report-spedizioni",setup(x){v({layout:"admin"});const{todayISODate:f,formatDateIT:Dt,formatDateITLong:jt}=h();function Pt(t){return"€ "+t.toLocaleString("it-IT",{minimumFractionDigits:2,maximumFractionDigits:2})}const Rt=r(f()),At=r(f()),St=r(!1),Et=r(null),Ft=r(null),Nt=m(()=>{if(!Ft.value)return 0;const t=Ft.value;return Math.round(100*(t.amazonTotal+t.totalNet+t.totalFees+t.bankTotal))/100});async function Lt(){St.value=!0,Et.value=null;try{const t=await b("/api/admin/shipping-report",{query:{from:Rt.value,to:At.value}});Ft.value=t}catch(t){Et.value=t?.statusMessage||t?.message||"Errore sconosciuto",Ft.value=null}finally{St.value=!1}}function Vt(t){const e=f(),a=new Date(e);if("today"===t)Rt.value=e,At.value=e;else if("yesterday"===t){a.setDate(a.getDate()-1);const t=a.toLocaleDateString("en-CA",{timeZone:"Europe/Rome"});Rt.value=t,At.value=t}else if("last7"===t){const t=new Date(e);t.setDate(t.getDate()-6),Rt.value=t.toLocaleDateString("en-CA",{timeZone:"Europe/Rome"}),At.value=e}Lt()}function Wt(){window.print()}let Bt=null;return s([Rt,At],()=>{Bt&&clearTimeout(Bt),Bt=setTimeout(()=>Lt(),300)}),e(()=>{Lt()}),(e,s)=>(t(),p("div",k,[l("div",T,[l("div",z,[s[9]||(s[9]=l("div",null,[l("h1",{class:"text-xl font-semibold text-gray-900 sm:text-2xl"}," Riepilogo Corrispettivi "),l("p",{class:"mt-1 text-sm text-gray-600"}," Report sintetico delle vendite spedite senza fattura. ")],-1)),l("div",I,[l("div",null,[s[7
1]||(s[7]=l("label",{class:"block text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1"}," Da ",-1)),d(l("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>i(Rt)?Rt.value=t:null),type:"date",class:"rounded-lg border border-gray-300 px-3 py-1.5 text-sm text-gray-800 focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 focus:outline-none"},null,512),[[u,o(Rt)]])]),l("div",null,[s[8]||(s[8]=l("label",{class:"block text-xs font-semibold text-gray-500 uppercase tracking-wider mb-1"}," A ",-1)),d(l("input",{"onUpdate:modelValue":s[1]||(s[1]=t=>i(At)?At.value=t:null),type:"date",class:"rounded-lg border border-gray-300 px-3 py-1.5 text-sm text-gray-800 focus:border-indigo-400 focus:ring-1 focus:ring-indigo-400 focus:outline-none"},null,512),[[u,o(At)]])]),l("button",{class:"rounded-lg bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-200",onClick:s[2]||(s[2]=t=>Vt("today"))}," Oggi "),l("button",{class:"rounded-lg bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-200",onClick:s[3]||(s[3]=t=>Vt("yesterday"))}," Ieri "),l("button",{class:"rounded-lg bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-200",onClick:s[4]||(s[4]=t=>Vt("last7"))}," Ultimi 7gg "),l("button",{class:"rounded-lg bg-brand px-3 py-1.5 text-xs font-medium text-white hover:bg-brand/90",disabled:o(St),onClick:s[5]||(s[5]=t=>Lt())}," Aggiorna ",8,w),l("button",{class:"rounded-lg border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-700 hover:bg-gray-100",disabled:o(St)||!o(Ft),onClick:Wt}," Stampa ",8,O)])])]),o(St)?(t(),p("div",C,"Caricamento report…")):o(Et)?(t(),p("div",D,[y(" Errore: "+n(o(Et))+" ",1),l("button",{class:"ml-2 underline",onClick:s[6]||(s[6]=t=>Lt())},"Riprova")])):o(Ft)&&0===o(Ft).orders.length&&0===o(Ft).amazonOrders.length?(t(),p("div",j," Nessuna spedizione (senza fattura) nel periodo selezionato. ")):o(Ft)?(t(),p("div",P,[s[27]||(s[27]=l("div",{class:"report-print-header"},[l("h1",{class:"text-xl font-bold"},"RIEPILOGO CORRISPETTIVI"),l("p",{class:"text-sm"},"Photodecor Srl")],-1)),l("p",R,[s[10]||(s[10]=l("span",{class:"font-bold"},"Periodo: ",-1)),o(Ft).period.from===o(Ft).period.to?(t(),p(g,{key:0},[y(n(o(jt)(o(Ft).period.from)),1)],64)):(t(),p(g,{key:1},[y(" dal "+n(o(jt)(o(Ft).period.from))+" al "+n(o(jt)(o(Ft).period.to)),1)],64))]),l("table",A,[s[18]||(s[18]=l("thead",null,[l("tr",{class:"border-b-2 border-gray-900"},[l("th",{class:"text-left py-2 px-3 font-semibold"},"PRODOTTO"),l("th",{class:"text-right py-2 px-3 font-semibold w-48"}," TOTALE VENDITA ")])],-1)),l("tbody",null,[(t(!0),p(g,null,a(o(Ft).categories,e=>(t(),p("tr",{key:e.categoryId,class:"border-b border-gray-200"},[l("td",S,n(e.name),1),l("td",E,n(Pt(e.total)),1)]))),128)),l("tr",F,[l("td",N,[s[11]||(s[11]=y(" Rivalsa Spese di Trasporto ",-1)),l("span",L," ("+n(o(Ft).shipping.count)+" "+n(1===o(Ft).shipping.count?"ordine":"ordini")+" × "+n(Pt(o(Ft).shipping.unitPrice))+") ",1)]),l("td",V,n(Pt(o(Ft).shipping.total)),1)])]),l("tfoot",null,[o(Ft).discountsTotal>0?(t(),p(g,{key:0},[l("tr",W,[s[12]||(s[12]=l("td",{class:"py-2 px-3 text-gray-700"},"Subtotale",-1)),l("td",B,n(Pt(o(Ft).grandTotal)),1)]),l("tr",null,[s[13]||(s[13]=l("td",{class:"py-2 px-3 text-gray-700"},"Sconti applicati",-1)),l("td",_," − "+n(Pt(o(Ft).discountsTotal)),1)])],64)):c("",!0),o(Ft).refunds.length>0?(t(),p("tr",U,[l("td",G,[s[14]||(s[14]=y(" Rimborsi ",-1)),l("span",M," ("+n(o(Ft).refunds.length)+" "+n(1===o(Ft).refunds.length?"ordine":"ordini")+") ",1)]),l("td",Z," − "+n(Pt(o(Ft).refundsTotal)),1)])):c("",!0),o(Ft).amazonOrders.length>0?(t(),p(g,{key:2},[l("tr",q,[s[15]||(s[15]=l("td",{class:"py-2 px-3 text-gray-700"},"Totale vendite Website",-1)),l("td",H,n(Pt(o(Ft).ordersTotal)),1)]),l("tr",null,[l("td",J,[s[16]||(s[16]=y(" Totale vendite Amazon ",-1)),l("span",K," ("+n(o(Ft).amazonOrders.length)+" "+n(1===o(Ft).amazonOrders.length?"ordine":"ordini")+") ",1)]),l("td",Q,n(Pt(o(Ft).amazonTotal)),1)])],64)):c("",!0),l("tr",X,[s[17]||(s[17]=l("td",{class:"py-3 px-3 font-bold"},"TOTALE CORRISPETTIVI",-1)),l("td",Y,n(Pt(o(Ft).combinedTotal)),1)])])]),0!==o(Ft).amazonTotal||0!==o(Ft).totalNet||0!==o(Ft).totalFees||0!==o(Ft).bankTotal?(t(),p("div",$,[s[24]||(s[24]=l("p",{class:"font-semibold mb-2 border-b border-gray-300 pb-1 text-gray-900"}," Riepilogo Contabile ",-1)),0!==o(Ft).amazonTotal?(t(),p("div",tt,[s[19]||(s[19]=l("span",{class:"text-gray-700"},"Credito Vendite Amazon",-1)),l("span",et,n(Pt(o(Ft).amazonTotal)),1)])):c("",!0),0!==o(Ft).totalNet?(t(),p("div",at,[s[20]||(s[20]=l("span",{class:"text-gray-700"},"Paypal C/C",-1)),l("span",ot,n(Pt(o(Ft).totalNet)),1)])):c("",!0),0!==o(Ft).totalFees?(t(),p("div",st,[s[21]||(s[21]=l("span",{class:"text-gray-700"},"Commissioni Paypal",-1)),l("span",rt,n(Pt(o(Ft).totalFees)),1)])):c("",!0),0!==o(Ft).bankTotal?(t(),p("div",lt,[s[22]||(s[22]=l("span",{class:"text-gray-700"},"Banca Tot C/C",-1)),l("span",nt,n(Pt(o(Ft).bankTotal)),1)])):c("",!0),l("div",it,[l("div",dt,[s[23]||(s[23]=l("span",null,"Totale",-1)),l("span",pt,n(Pt(o(Nt))),1)])]),o(Ft).ordersWithoutFeeData>0?(t(),p("p",ct,n(o(Ft).ordersWithoutFeeData)+" "+n(1===o(Ft).ordersWithoutFeeData?"ordine senza dati commissione PayPal":"ordini senza dati commissione PayPal")+" (bonifici inclusi) ",1)):c("",!0)])):c("",!0),l("div",gt,[l("p",mt," Ordini Website considerati ("+n(o(Ft).orders.length)+"): ",1),l("ul",yt,[(t(!0),p(g,
1null,a(o(Ft).orders,e=>(t(),p("li",{key:e.orderId},[l("span",xt,n(e.orderId),1),y(" — "+n(e.customerName),1)]))),128))])]),o(Ft).refunds.length>0?(t(),p("div",ut,[l("p",bt," Rimborsi del periodo ("+n(o(Ft).refunds.length)+"): ",1),l("ul",ft,[(t(!0),p(g,null,a(o(Ft).refunds,e=>(t(),p("li",{key:e.orderId,class:"flex justify-between py-0.5"},[l("span",null,[y(" #"+n(e.orderId)+" — "+n(e.customerName)+" ",1),l("span",vt," ("+n(o(Dt)(e.refundedAt))+", "+n("paypal"===e.method?"PayPal":"bonifico")+") ",1)]),l("span",ht,"− "+n(Pt(e.amount)),1)]))),128))])])):c("",!0),o(Ft).amazonOrders.length>0?(t(),p("div",kt,[l("p",Tt," Ordini Amazon considerati ("+n(o(Ft).amazonOrders.length)+"): ",1),l("ul",zt,[(t(!0),p(g,null,a(o(Ft).amazonOrders,e=>(t(),p("li",{key:e.orderId},[l("span",It,n(e.orderId),1),y(" — "+n(e.customerName)+" — ",1),l("span",wt,n(Pt(e.total)),1)]))),128))]),l("div",Ot,[s[25]||(s[25]=l("span",null,"Totale vendite Amazon",-1)),l("span",Ct,n(Pt(o(Ft).amazonTotal)),1)]),s[26]||(s[26]=l("p",{class:"mt-1 text-xs italic text-gray-500"}," Solo clienti privati: ordini Amazon Business (B2B) esclusi. ",-1))])):c("",!0)])):c("",!0)]))}}),[["__scopeId","data-v-eb50c5f1"]]);export{Dt 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.