PageSourceSearch

https://app.encontrable.com/assets/deliveryPayments-DO5PqzOY.js

js encontrable.com collected 2026-10-02 01:29:24 UTC 4,891 bytes, 1 lines download raw bytes

1import{r as a,G as e,aN as L,aO as s,ap as S,aP as i,a1 as f,al as k,U as v,V as b,W as y,T as l,a8 as C}from"./vendor-BvYDHPOR.js";import{u as G}from"./useResponsive-D6oHVrOF.js";import"./index-CQWuR6TJ.js";import{c as A}from"./orders.service-BA7Ft87f.js";import{l as H}from"./locale-Rog6nREm.js";import{d as B}from"./vendor-mui-icons-CrMwg7iZ.js";import{D as V}from"./vendor-mui-grid-C7uZP1uA.js";const U=r=>new Intl.NumberFormat("es-CO",{style:"currency",currency:"COP",minimumFractionDigits:0}).format(r),_={pending:{label:"Pendiente",color:"warning"},completed:{label:"Completado",color:"success"},failed:{label:"Fallido",color:"error"},refunded:{label:"Reembolsado",color:"default"}};function Z(){const{isMobile:r}=G(),[z,P]=a.useState([]),[D,M]=a.useState(0),[T,g]=a.useState(!0),[d,W]=a.useState(""),[c,F]=a.useState(""),[m,I]=a.useState(""),[u,N]=a.useState(""),[h,w]=a.useState(""),[x,o]=a.useState(0),[p,E]=a.useState(25),j=a.useCallback(async()=>{try{g(!0);const t=await A({status:c||void 0,payment_method:m||void 0,date_from:u||void 0,date_to:h||void 0,search:d||void 0,page:x,pageSize:p});P(t.rows),M(t.total)}catch{}finally{g(!1)}},[c,m,u,h,d,x,p]);a.useEffect(()=>{j()},[j]);const O=[{field:"id",headerName:"ID",width:60},{field:"place_name",headerName:"Lugar",flex:1,minWidth:140,renderCell:({row:t})=>e.jsx(s,{fontSize:13,fontWeight:500,children:t.place_name||`#${t.place_id}`})},{field:"customer_name",headerName:"Cliente",flex:1,minWidth:130,renderCell:({row:t})=>e.jsxs(i,{spacing:0,children:[e.jsx(s,{fontSize:13,children:t.customer_name||"-"}),t.customer_email&&e.jsx(s,{fontSize:11,color:"text.secondary",children:t.customer_email})]})},{field:"amount",headerName:"Monto",width:130,renderCell:({value:t})=>e.jsx(s,{fontWeight:700,fontSize:13,children:U(t)})},{field:"payment_method",headerName:"Metodo",width:130,renderCell:({row:t})=>e.jsxs(i,{spacing:0,alignItems:"flex-start",children:[e.jsx(C,{label:t.payment_method==="card"?"Tarjeta":"PSE",size:"small",color:t.payment_method==="card"?"primary":"secondary",variant:"outlined",sx:{height:20,fontSize:11}}),t.card_last_four&&e.jsxs(s,{fontSize:11,color:"text.secondary",children:["****",t.card_last_four]})]})},{field:"status",headerName:"Estado",width:110,renderCell:({value:t})=>{const n=_[t]||_.pending;return e.jsx(C,{label:n.label,size:"small",color:n.color})}},{field:"order_code",headerName:"Pedido",width:130,renderCell:({row:t})=>e.jsxs(i,{spacing:0,children:[e.jsx(s,{fontSize:12,fontWeight:500,children:t.order_code||"-"}),t.order_status&&e.jsx(s,{fontSize:11,color:"text.secondary",children:t.order_status})]})},{field:"created_at",headerName:"Fecha",width:150,renderCell:({value:t})=>{const n=new Date(t);return e.jsxs(i,{spacing:0,children:[e.jsx(s,{fontSize:12,children:n.toLocaleDateString("es-CO")}),e.jsx(s,{fontSize:11,color:"text.secondary",children:n.toLocaleTimeString("es-CO",{hour:"2-digit",minute:"2-digit"})})]})}}],R=r?{id:!1,customer_name:!1,payment_method:!1,order_code:!1}:{};return e.jsxs(L,{children:[e.jsx(s,{variant:"h5",fontWeight:700,mb:3,children:"Pagos de Domicilios"}),e.jsx(S,{elevation:0,sx:{p:2,mb:2,borderRadius:3},children:e.jsxs(i,{direction:r?"column":"row",spacing:2,alignItems:r?"stretch":"center",flexWrap:"wrap",children:[e.jsx(f,{placeholder:"Buscar cliente, lugar, orden...",value:d,onChange:t=>{W(t.target.value),o(0)},size:"small",sx:{minWidth:220},InputProps:{startAdornment:e.jsx(k,{position:"start",children:e.jsx(B,{fontSize:"small"})})}}),e.jsxs(v,{size:"small",sx:{minWidth:130},children:[e.jsx(b,{children:"Estado"}),e.jsxs(y,{value:c,label:"Estado",onChange:t=>{F(t.target.value),o(0)},children:[e.jsx(l,{value:"",children:"Todos"}),e.jsx(l,{value:"completed",children:"Completado"}),e.jsx(l,{value:"pending",children:"Pendiente"}),e.jsx(l,{value:"failed",children:"Fallido"}),e.jsx(l,{value:"refunded",children:"Reembolsado"})]})]}),e.jsxs(v,{size:"small",sx:{minWidth:130},children:[e.jsx(b,{children:"Metodo"}),e.jsxs(y,{value:m,label:"Metodo",onChange:t=>{I(t.target.value),o(0)},children:[e.jsx(l,{value:"",children:"Todos"}),e.jsx(l,{value:"card",children:"Tarjeta"}),e.jsx(l,{value:"pse",children:"PSE"})]})]}),e.jsx(f,{type:"date",label:"Desde",value:u,onChange:t=>{N(t.target.value),o(0)},size:"small",InputLabelProps:{shrink:!0},sx:{minWidth:150}}),e.jsx(f,{type:"date",label:"Hasta",value:h,onChange:t=>{w(t.target.value),o(0)},size:"small",InputLabelProps:{shrink:!0},sx:{minWidth:150}})]})}),e.jsx(S,{elevation:0,sx:{borderRadius:3},children:e.jsx(V,{rows:z,columns:O,rowCount:D,loading:T,paginationMode:"server",paginationModel:{page:x,pageSize:p},onPaginationModelChange:t=>{o(t.page),E(t.pageSize)},pageSizeOptions:[10,25,50],columnVisibilityModel:R,disableRowSelectionOnClick:!0,autoHeight:!0,localeText:H,sx:{border:"none","& .MuiDataGrid-cell":{py:1},"& .MuiDataGrid-columnHeaders":{bgcolor:"#f8f9fa"}}})})]})}export{Z 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.