PageSourceSearch

https://shopflow-pos.vercel.app/assets/index-C_aWpBKh.js

js shopflow-pos.vercel.app collected 2026-10-03 07:42:13 UTC 3,712 bytes, 1 lines download raw bytes

1import{K as y,j as e,Q as v,v as j,ah as k,ai as P,a1 as I,ak as m}from"./vendor-jvUcc8dT.js";import{c as N,o as S,a0 as T,S as w,C as p,I as R,T as C,D as L,d as i,a1 as B}from"./index-zei_sS0W.js";import{i as F,p as A}from"./colors-CKIPPvVC.js";const E=N.injectEndpoints({endpoints:a=>({getLedger:a.query({query:o=>({url:T("ledger",o)}),onQueryStarted:S})}),overrideExisting:!1}),{useLazyGetLedgerQuery:G}=E,c=[{field:"invoiceId",header:"Invoice ID"},{field:"createdAt",header:"Date",body:({createdAt:a})=>I(a).format("DD/MMM/YYYY")},{field:"invoice.party.name",header:"Name"},{field:"invoice.invoiceType.name",header:"Type",body:({invoice:a})=>e.jsx(m,{severity:F[a.invoiceType.name],value:a.invoiceType.name})},{field:"paymentType",header:"Payment Type",body:({paymentType:a})=>e.jsx(m,{severity:A[a],value:a})},{field:"amountPaid",header:"Paid",body:({amountPaid:a})=>e.jsx("span",{children:i.format(a)})},{field:"remainingAmount",header:"Balance",body:({remainingAmount:a})=>e.jsx("span",{children:i.format(a)})}],Y=()=>{const a=y({resolver:B}),[o,{currentData:s}]=G(),{data:l,isFetching:u}=w({invoiceType:"all"}),x=()=>{if(!(s!=null&&s.tableData))return null;const t=s==null?void 0:s.tableData,d=t.reduce((r,n)=>r+parseInt(n.amountPaid),0),b=t.reduce((r,n)=>(r.some(h=>h.invoiceId===n.invoiceId)||r.push(n),r),[]).reduce((r,n)=>r+parseInt(n.remainingAmount),0);return e.jsxs("div",{className:"flex gap-4 text-lg font-semibold dark:text-bodydark1",children:[e.jsxs("span",{children:["Paid: ",i.format(d)]}),e.jsxs("span",{children:["Balance: ",i.format(b)]})]})},g=async t=>{try{if(t.invoiceId||t.partyId)await o(t).unwrap();else return}catch(d){console.log("err",d)}},f=()=>e.jsx("p",{className:"p-2 -m-2 dark:bg-strokedark dark:text-bodydark1",children:"No records are found."});return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(p,{children:e.jsx(v,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(g),className:"flex items-center justify-between gap-6",children:[e.jsxs("div",{className:"flex w-full gap-6",children:[e.jsx(R,{label:"Search By Invoice ID",name:"invoiceId",type:"number",placeholder:"Enter Invoice ID"}),e.jsx(C,{label:"Search By Party Name",name:"partyId",isDisable:u,placeholder:"Select party name",options:l==null?void 0:l.data}),e.jsxs("div",{className:"w-full",children:[e.jsx("label",{className:"mb-2.5 block font-medium text-black dark:text-bodydark1",children:"Select Date Range"}),e.jsx(L,{mode:"range",name:"dateRange"})]})]}),e.jsx("div",{className:"h-4",children:e.jsx(j,{label:"Filter",raised:!0,className:"px-8 py-3",size:"small"})})]})})}),e.jsxs(p,{className:"flex justify-between",children:[e.jsxs("span",{className:"text-2xl font-semibold",children:["Opening Balance:"," ",i.format((s==null?void 0:s.openBalance)||0)]}),e.jsxs("span",{className:"text-2xl font-semibold",children:["Closing Balance:"," ",i.format((s==null?void 0:s.closingBalance)||0)]})]}),e.jsx(k,{value:s==null?void 0:s.tableData,emptyMessage:f(),showGridlines:!0,resizableColumns:!0,size:"small",stripedRows:!0,paginator:!0,rows:10,rowsPerPageOptions:[5,10,15],tableStyle:{minWidth:"50rem"},paginatorTemplate:"RowsPerPageDropdown FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink  CurrentPageReport",currentPageReportTemplate:"{first} to {last} of {totalRecords}",rowClassName:"dark:bg-boxdark dark:text-slate-300",paginatorClassName:"custom-paginator",paginatorRight:x,className:"[&_.p-datatable-footer]:!bg-transparent [&_.p-datatable-footer]:!border-0 [&_.p-datatable-footer]:!p-0",children:c==null?void 0:c.map(t=>e.jsx(P,{field:t.field,header:t.header,body:t.body,headerClassName:"dark:bg-strokedark dark:text-bodydark1"},t.field))})]})};export{Y 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.