PageSourceSearch

https://mobirec.in/_next/static/chunks/pages/reports/ledger-reports-fa1676dce940eda1.js

js mobirec.in collected 2026-10-02 01:57:09 UTC 7,776 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4617],{38903:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/reports/ledger-reports",function(){return t(20707)}])},1851:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var a=t(74848);t(96540);let r=e=>(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 584 584",...e,children:[(0,a.jsx)("defs",{children:(0,a.jsx)("style",{children:".cls-1{fill:#e6e6e6;}\n          .cls-2{fill:#3e5e9b;}\n          .cls-3{fill:#fff;}"})}),(0,a.jsx)("g",{id:"Layer_2","data-name":"Layer 2",children:(0,a.jsxs)("g",{id:"Layer_1-2","data-name":"Layer 1",children:[(0,a.jsx)("path",{className:"cls-3",d:"M340.47,235.55h27.19a11.69,11.69,0,0,1,11.69,11.69h0A11.68,11.68,0,0,1,367.7,259H340.47m-.05,0a61.25,61.25,0,0,1-60.09,49.46H237.74a.07.07,0,0,0,0,.09h0l95.4,95.4a11.69,11.69,0,1,1-16.26,16.8l-.27-.27-107-107a16.63,16.63,0,0,1,11.75-28.36h58.28A38.82,38.82,0,0,0,316.21,259a.05.05,0,0,0,0-.07H216.37a11.69,11.69,0,0,1-11.69-11.68h0a11.7,11.7,0,0,1,11.69-11.69h99.85s.06,0,.07-.05a0,0,0,0,0,0,0,37.82,37.82,0,0,0-35.95-26.05h-64a11.69,11.69,0,0,1,0-23.38H367.25a12,12,0,0,1,12.08,11,11.72,11.72,0,0,1-10.95,12.44c-.24,0-.48,0-.72,0H328.57a.07.07,0,0,0,0,.07,0,0,0,0,0,0,0,61.07,61.07,0,0,1,11.89,26Z"}),(0,a.jsx)("path",{className:"cls-3",d:"M292,504.19C175,504.19,79.81,409,79.81,292S175,79.81,292,79.81,504.19,175,504.19,292,409,504.19,292,504.19Zm0-401c-104.11,0-188.81,84.7-188.81,188.81S187.89,480.81,292,480.81,480.81,396.11,480.81,292,396.11,103.19,292,103.19Z"})]})})]});var l=t(55929);function n(){return(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-white overflow-hidden",role:"status","aria-label":"Loading",children:[(0,a.jsx)(r,{className:"z-50 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-fade-in an"}),(0,a.jsx)(l.bQ,{autoplay:!0,loop:!0,className:"absolute -top-1 -left-1 -bottom-1 -right-1 h-[calc(100vh+1rem)] w-[calc(100vw+1rem)]"})]})}},80405:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var a=t(74848);let{FaRegCircle:r}=t(62813),{IoClose:l}=t(86291);function n(e){let{filter:s,setFilter:t,onClose:n,options:c=["All","Success","Failure","Pending"]}=e;return(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-40 flex items-end z-50",children:(0,a.jsxs)("div",{className:"bg-white dark:bg-secondary-900 w-full rounded-t-2xl p-4 pb-8",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-3 border-b py-4 px-2",children:[(0,a.jsx)(l,{size:24,className:"text-secondary-400 cursor-pointer",onClick:n}),(0,a.jsx)("h3",{children:"Filter Transaction"})]}),(0,a.jsx)("div",{className:"space-y-2",children:c.map(e=>(0,a.jsxs)("button",{onClick:()=>{t(e),n()},className:"w-full flex items-center gap-3 text-left px-4 py-2 rounded-lg",children:[(0,a.jsx)(r,{className:s===e?"bg-primary-500 text-primary-500 rounded-full":"text-secondary-400 dark:text-secondary-500"}),e]},e))})]})})}},20707:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>j});var a=t(74848),r=t(96540),l=t(22828),n=t(94650),c=t(77037),d=t(33877),i=t(29965),o=t.n(i),x=t(82869),u=t(71793),h=t(9665),m=t(1851),p=t(46262),b=t(80405),f=t(30020),y=t(74353),g=t.n(y);function j(){let{authToken:e}=(0,x.L)(),[s,t]=(0,r.useState)(null),[i,y]=(0,r.useState)(null),[j,N]=(0,r.useState)(""),[w,k]=(0,r.useState)("All"),[C,S]=(0,r.useState)(D),[_,A]=(0,r.useState)(v),[L,Y]=(0,r.useState)(!1),[E,M]=(0,r.useState)(!1),[z,F]=(0,r.useState)([{startDate:new Date(C),endDate:new Date(_),key:"selection"}]),H=(0,r.useCallback)(async()=>{if(e)try{let s=(0,h.M2)({search:j,from:C,to:_,page:0,for:"Ledger"}),a=await (0,u.A)({url:"".concat("https://auto.mobirec.in/api","/history"),method:"POST",authToken:e,body:{hashKey:s},cacheKey:"LedgerHistory"+C+_+j,cacheDuration:C||_||j?6e5:12e4});t(a.data),y(a.data)}catch(e){console.error("Error fetching ledger history:",e)}},[e,C,_,j]);return(0,r.useEffect)(()=>{H()},[H]),(0,r.useEffect)(()=>{if(!s)return;let e=[...s];"Credit"===w?e=e.filter(e=>e.status.toLowerCase().includes("credit")):"Debit"===w&&(e=e.filter(e=>e.status.toLowerCase().includes("debit"))),y(e)},[w,s]),(0,a.jsx)(p.A,{children:(0,a.jsxs)("div",{className:"p-4 sm:p-6 lg:p-8",children:[(0,a.jsxs)("div",{className:"flex justify-between mb-4",children:[(0,a.jsxs)("button",{onClick:()=>{M(!0)},className:"flex items-center gap-2 px-3 py-2 bg-secondary-100 dark:bg-secondary-800 rounded-full text-sm font-medium",children:[(0,a.jsx)(c.LyP,{})," ",(0,a.jsx)("span",{children:"Date"}),(0,a.jsx)(n.q2p,{})]}),(0,a.jsxs)("button",{onClick:()=>Y(!0),className:"flex items-center gap-2 px-3 py-2 bg-secondary-100 dark:bg-secondary-800 rounded-full text-sm font-medium",children:[(0,a.jsx)(d.uJN,{})," ",(0,a.jsx)("span",{children:"Filter"}),(0,a.jsx)(n.q2p,{})]})]}),i?i.length?(0,a.jsx)("div",{className:"space-y-4",children:i.map((e,s)=>(0,a.jsxs)("div",{className:"block bg-white dark:bg-secondary-900 border border-secondary-200 dark:border-secondary-700 shadow-lg rounded-2xl p-4 hover:shadow-xl transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 border-b border-secondary-300 dark:border-secondary-700 pb-3",children:[e.icon&&(0,a.jsx)(o(),{className:"object-scale-down p-1 border-secondary-300 dark:border-secondary-600",width:40,height:40,src:e.icon,alt:"icon"}),(0,a.jsxs)("div",{className:"flex-1",children:[e.head&&(0,a.jsx)("p",{className:"font-semibold text-secondary-800 dark:text-secondary-100 text-sm",children:e.head}),e.subhead&&(0,a.jsx)("p",{className:"text-secondary-500 dark:text-secondary-400 text-sm",children:e.subhead}),e.date&&(0,a.jsx)("p",{className:"text-xs text-secondary-400 dark:text-secondary-500",children:e.date})]}),(0,a.jsxs)("div",{className:"text-right",children:[e.amount&&(0,a.jsxs)("p",{className:"font-semibold text-lg text-secondary-900 dark:text-secondary-100",children:["₹ ",e.amount]}),e.status&&(0,a.jsx)("span",{className:"rounded-full px-3 py-1 text-xs font-medium text-white ".concat(e.status.toLowerCase().includes("credit")?"bg-green-500":e.status.toLowerCase().includes("debit")?"bg-red-500":"bg-blue-500"),children:e.status})]})]}),(0,a.jsxs)("div",{className:"pt-2 flex justify-between items-center text-xs text-secondary-500 dark:text-secondary-400",children:[(0,a.jsxs)("span",{children:["Open Balance: ",e.open_bal]}),(0,a.jsxs)("span",{children:["Close Balance: ",e.close_bal]})]})]},s))}):(0,a.jsxs)("div",{className:"flex flex-col justify-center items-center gap-2 text-sm text-secondary-500",children:[(0,a.jsx)(l.jAR,{size:50,className:"text-secondary-400"}
1),"No ledger records found."]}):(0,a.jsx)(m.A,{}),L&&(0,a.jsx)(b.A,{filter:w,options:["All","Credit","Debit"],setFilter:k,onClose:()=>Y(!1)}),E&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-40 flex items-end z-50",children:(0,a.jsxs)("div",{className:"bg-white w-full rounded-t-2xl p-4",children:[(0,a.jsx)("h3",{className:"text-base text-secondary-800 font-semibold mb-3",children:"Select Date Range"}),(0,a.jsx)(f.DateRange,{editableDateInputs:!1,onChange:e=>F([e.selection]),moveRangeOnFirstSelection:!1,ranges:z,direction:"horizontal",className:"rounded-lg",rangeColors:["#3c5c9c"]}),(0,a.jsx)("button",{onClick:()=>{S(g()(z[0].startDate).format("YYYY-MM-DD")),A(g()(z[0].endDate).format("YYYY-MM-DD")),M(!1)},className:"mt-4 w-full py-2 text-center bg-primary-500 text-white rounded-lg",children:"Apply"})]})})]})})}function N(e){let s=e.getFullYear(),t=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return"".concat(s,"-").concat(t,"-").concat(a)}let w=new Date,v=N(w),k=new Date(w);k.setDate(w.getDate()-6);let D=N(k)}},e=>{var s=s=>e(e.s=s);e.O(0,[2777,7551,7690,3342,3958,2893,5687,8563,5589,7331,8673,4392,9965,6901,9709,6262,5929,636,6593,8792],()=>s(38903)),_N_E=e.O()}]);

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.