import{_ as h,l as d,b as c,c as l,d as e,h as v,t as a,F as x,s as C,g as _,v as X}from"./main.84523976.js";const j={class:"corte-report"},y={key:0,class:"corte-report__section mb-4"},Z={class:"corte-report__title"},$={class:"row g-2 mb-3"},w={class:"col-6 col-md-4"},N={class:"corte-kpi"},E={class:"corte-kpi__value"},M={class:"col-6 col-md-4"},O={class:"corte-kpi"},T={class:"corte-kpi__value text-success"},F={class:"col-6 col-md-4"},R={class:"corte-kpi"},S={class:"corte-kpi__value"},V={class:"col-6 col-md-4"},B={class:"corte-kpi corte-kpi--muted"},D={class:"corte-kpi__value"},z={class:"col-6 col-md-4"},I={class:"corte-kpi corte-kpi--danger"},G={class:"corte-kpi__value"},H={class:"col-6 col-md-4"},L={class:"corte-kpi corte-kpi--success"},P={class:"corte-kpi__value"},q={key:0,class:"mb-2"},A={class:"d-flex flex-wrap gap-2"},J={class:"small text-muted mb-0"},K={key:1,class:"corte-report__section corte-report__z"},Q={class:"corte-report__title"},U={class:"row g-3 align-items-center"},W={class:"col-md-4"},Y={class:"corte-kpi corte-kpi--highlight"},ee={class:"corte-kpi__value fs-5"},te={class:"col-md-4"},se={class:"corte-kpi"},oe={class:"corte-kpi__value fs-5"},ae={class:"col-md-4"},re={class:"corte-kpi__value fs-4 fw-bold"},ie={class:"corte-kpi__hint small"},ce={__name:"CorteCajaReport",props:{reporteX:{type:Object,default:null},reporteZ:{type:Object,default:null}},setup(s){const n=s,u={efectivo:"Efectivo",tarjeta:"Tarjeta",transferencia:"Transferencia",credito:"Cr\xE9dito"};function i(o){return Number(o!=null?o:0).toFixed(2)}function m(o){return u[o]||o}const p=d(()=>{var t,r;const o=((t=n.reporteX)==null?void 0:t.pagos_por_metodo)||((r=n.reporteZ)==null?void 0:r.pagos_por_metodo)||{};return Object.entries(o).map(([f,g])=>({metodo:f,monto:g}))}),k=d(()=>{var t,r;const o=Number((r=(t=n.reporteZ)==null?void 0:t.diferencia)!=null?r:0);return Math.abs(o)<.01?"corte-kpi--ok":o>0?"corte-kpi--sobrante":"corte-kpi--faltante"}),b=d(()=>{var t,r;const o=Number((r=(t=n.reporteZ)==null?void 0:t.diferencia)!=null?r:0);return Math.abs(o)<.01?"Cuadre exacto":o>0?"Sobrante en caja":"Faltante en caja"});return(o,t)=>(c(),l("div",j,[s.reporteX?(c(),l("div",y,[e("h6",Z,[t[0]||(t[0]=e("span",{class:"badge bg-info me-2"},"X",-1)),v(" "+a(s.reporteX.descripcion||"Reporte de ventas"),1)]),e("div",$,[e("div",w,[e("div",N,[t[1]||(t[1]=e("span",{class:"corte-kpi__label"},"Monto inicial",-1)),e("span",E,"$ "+a(i(s.reporteX.monto_inicial)),1)])]),e("div",M,[e("div",O,[t[2]||(t[2]=e("span",{class:"corte-kpi__label"},"Ventas (ingreso)",-1)),e("span",T,"$ "+a(i(s.reporteX.total_ventas_ingreso)),1)])]),e("div",F,[e("div",R,[t[3]||(t[3]=e("span",{class:"corte-kpi__label"},"Total cobrado",-1)),e("span",S,"$ "+a(i(s.reporteX.total_cobrado)),1)])]),e("div",V,[e("div",B,[t[4]||(t[4]=e("span",{class:"corte-kpi__label"},"Sin cobro (ref.)",-1)),e("span",D,"$ "+a(i(s.reporteX.total_donativos)),1)])]),e("div",z,[e("div",I,[t[5]||(t[5]=e("span",{class:"corte-kpi__label"},"Gastos",-1)),e("span",G,"$ "+a(i(s.reporteX.total_gastos)),1)])]),e("div",H,[e("div",L,[t[6]||(t[6]=e("span",{class:"corte-kpi__label"},"Ingresos manuales",-1)),e("span",P,"$ "+a(i(s.reporteX.total_ingresos_manuales)),1)])])]),p.value.length?(c(),l("div",q,[t[7]||(t[7]=e("p",{class:"small fw-semibold text-muted mb-2"},"Cobros por m\xE9todo de pago",-1)),e("div",A,[(c(!0),l(x,null,C(p.value,r=>(c(),l("span",{key:r.metodo,class:"badge rounded-pill bg-light text-dark border px-3 py-2"},a(m(r.metodo))+": $ "+a(i(r.monto)),1))),128))])])):_("",!0),e("p",J,a(s.reporteX.cantidad_ventas)+" venta(s) en el per\xEDodo",1)])):_("",!0),s.reporteZ?(c(),l("div",K,[e("h6",Q,[t[8]||(t[8]=e("span",{class:"badge bg-warning text-dark me-2"},"Z",-1)),v(" "+a(s.reporteZ.descripcion||"Cierre de jornada"),1)]),e("div",U,[e("div",W,[e("div",Y,[t[9]||(t[9]=e("span",{class:"corte-kpi__label"},"Efectivo esperado",-1)),e("span",ee,"$ "+a(i(s.reporteZ.efectivo_esperado)),1)])]),e("div",te,[e("div",se,[t[10]||(t[10]=e("span",{class:"corte-kpi__label"},"Efectivo contado",-1)),e("span",oe,"$ "+a(i(s.reporteZ.monto_final)),1)])]),e("div",ae,[e("div",{class:X(["corte-kpi corte-kpi--diff",k.value])},[t[11]||(t[11]=e("span",{class:"corte-kpi__label"},"Diferencia",-1)),e("span",re,"$ "+a(i(s.reporteZ.diferencia)),1),e("span",ie,a(b.value),1)],2)])])])):_("",!0)]))}},ne=h(ce,[["__scopeId","data-v-45148162"]]);export{ne as C};
