PageSourceSearch

https://cadbench.ai/_next/static/chunks/pages/app/invoices-1c2ca551b24d70a2.js

js cadbench.ai collected 2026-09-29 04:50:21 UTC 13,550 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3376],{4286:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/invoices",function(){return r(66134)}])},66134:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return ge}});var t=r(92021),o=r.n(t),i=r(52322),a=r(2784),s=r(97729),c=r(11106),u=r(10405),l=r(27149),d=r(24862),f=r(41075),p=r(62197),h=r(83249),x=r(52616),g=r(38738),v=r(65992),b=r(50186),j=r(49170),m=r(28049),y=r(13980),w=r.n(y),Z=r(74630),P=r(85801),S=r(45596),O=r(35469),C=r(35199),D=r(93506),k=r(61035),I=r(17407),R=r(949),E=r(43116),A=r(47944);function _(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function M(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){_(e,n,r[n])}))}return e}function T(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function L(e){return function(e){if(Array.isArray(e)){for(var n=0,r=new Array(e.length);n<e.length;n++)r[n]=e[n];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var q=["Blind Spots Inc.","Dispatcher Inc.","ACME SRL","Novelty I.S","Beauty Clinic SRL","Division Inc."],F=(0,v.ZP)(Z.ZP)({flexShrink:0,width:380,"& .MuiDrawer-paper":{position:"relative",width:380}}),N=(0,v.ZP)(Z.ZP)({maxWidth:"100%",width:380,"& .MuiDrawer-paper":{height:"calc(100% - 64px)",maxWidth:"100%",top:64,width:380}}),z=function(e){var n=e.containerRef,r=e.filters,t=void 0===r?{}:r,o=e.onChange,s=e.onClose,c=e.open,u=T(e,["containerRef","filters","onChange","onClose","open"]),f=(0,a.useRef)(null),h=(0,l.Z)((function(e){return e.breakpoints.up("lg")})),v=function(e){e.target.checked?null===o||void 0===o||o(M({},t,{customer:L(t.customer).concat([e.target.value])})):null===o||void 0===o||o(M({},t,{customer:t.customer.filter((function(n){return n!==e.target.value}))}))},b=(0,i.jsxs)(d.Z,{sx:{pb:3,pt:{xs:3,lg:8},px:3},children:[(0,i.jsx)(d.Z,{sx:{display:{lg:"none"},mb:2},children:(0,i.jsx)(P.Z,{onClick:s,children:(0,i.jsx)(E.X,{fontSize:"small"})})}),(0,i.jsx)(d.Z,{component:"form",onSubmit:function(e){var n;e.preventDefault(),null===o||void 0===o||o(M({},t,{query:null===(n=f.current)||void 0===n?void 0:n.value}))},children:(0,i.jsx)(S.Z,{defaultValue:"",fullWidth:!0,inputProps:{ref:f},InputProps:{startAdornment:(0,i.jsx)(O.Z,{position:"start",children:(0,i.jsx)(R.o,{fontSize:"small"})})},label:"Search",placeholder:"Search by invoice number"})}),(0,i.jsx)(p.Z,{color:"textSecondary",sx:{mt:3},variant:"subtitle2",children:"Issue date"}),(0,i.jsxs)(C.Z,{spacing:2,sx:{mt:2},children:[(0,i.jsx)(I.Z,{inputFormat:"dd/MM/yyyy",label:"From",onChange:function(e){var n=M({},t,{startDate:e});n.endDate&&e>n.endDate&&(n.endDate=e),null===o||void 0===o||o(n)},renderInput:function(e){return(0,i.jsx)(S.Z,M({},e))},value:t.startDate}),(0,i.jsx)(I.Z,{inputFormat:"dd/MM/yyyy",label:"To",onChange:function(e){var n=M({},t,{endDate:e});n.startDate&&e<n.startDate&&(n.startDate=e),null===o||void 0===o||o(n)},renderInput:function(e){return(0,i.jsx)(S.Z,M({},e))},value:t.endDate})]}),(0,i.jsx)(p.Z,{color:"textSecondary",sx:{mt:3},variant:"subtitle2",children:"From customer"}),(0,i.jsx)(d.Z,{sx:{backgroundColor:"background.default",borderColor:"divider",borderRadius:1,borderStyle:"solid",borderWidth:1,mt:2},children:(0,i.jsx)(A.L,{sx:{maxHeight:200},children:(0,i.jsx)(D.Z,{sx:{py:1,px:1.5},children:q.map((function(e){var n;return(0,i.jsx)(x.Z,{control:(0,i.jsx)(k.Z,{checked:null===(n=t.customer)||void 0===n?void 0:n.includes(e)}),onChange:v,label:e,value:e},e)}))})})}),(0,i.jsx)(x.Z,{control:(0,i.jsx)(g.Z,{checked:"paid"===t.status}),label:"Show paid only",onChange:function(e){null===o||void 0===o||o(M({},t,{status:e.target.checked?"paid":void 0}))},sx:{mt:2}})]});return h?(0,i.jsx)(F,M({anchor:"left",open:c,SlideProps:{container:null===n||void 0===n?void 0:n.current},variant:"persistent"},u,{children:b})):(0,i.jsx)(N,M({anchor:"left",ModalProps:{container:null===n||void 0===n?void 0:n.current},onClose:s,open:c,SlideProps:{container:null===n||void 0===n?void 0:n.current},variant:"temporary"},u,{children:b}))};z.propTypes={containerRef:w().any,filters:w().object,onChange:w().func,onClose:w().func,open:w().bool};var W=r(39097),B=r(16044),H=r(1246),X=r.n(H),G=r(86973),Q=r(88206),U=r(81714),V=r(25485),J=r(36284),K=r(95989),Y=r(9680),$=r(55399);function ee(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ne(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){ee(e,n,r[n])}))}return e}function re(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},i=Object.keys(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)r=i[t],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function te(e){return function(e){if(Array.isArray(e)){for(var n=0,r=new Array(e.length);n<e.length;n++)r[n]=e[n];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var oe=function(e){var n=e.invoice;return(0,i.jsxs)(G.Z,{sx:{boxShadow:1,transition:function(e){return e.transitions.create("box-shadow",{easing:e.transitions.easing.easeOut})},"&:hover":{boxShadow:8},"& > td":{backgroundColor:"background.paper",borderBottom:0}},children:[(0,i.jsx)(Q.Z,{width:"25%",children:(0,i.jsx)(W.default,{href:"/app/invoices/1",passHref:!0,children:(0,i.jsxs)(d.Z,{component:"a",sx:{alignItems:"center",display:"inline-flex",textDecoration:"none",whiteSpace:"nowrap"},children:[(0,i.jsx)(U.Z,{sx:{height:42,width:42},children:(0,$.Qm)(n.customer.name)}),(0,i.jsxs)(d.Z,{sx:{ml:2},children:[(0,i.jsx)(p.Z,{color:"textPrimary",variant:"subtitle2",children:n.number}),(0,i.jsx)(p.Z,{color:"textSecondary",variant:"body2",children:n.customer.name})]})]})})}),(0,i.jsx)(Q.Z,{children:(0,i.jsxs)(p.Z,{variant:"body2",children:[n.currency,X()(n.totalAmount).format("0,0.00")]})}),(0,i.jsx)(Q.Z,{children:(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,i.jsx)(p.Z,{variant:"subtitle2",children:"Issued"}),(0,i.jsx)(p.Z,{color:"textSecondary",variant:"body2",children:(0,B.Z)(n.issueDate,"dd/MM/yyyy")})]})}),(0,i.jsx)(Q.Z,{children:(0,i.jsxs)(d.Z,{sx:{display:"flex",flexDirection:"column"},children:[(0,i.jsx)(p.Z,{variant:"subtitle2",children:"Due"}),(0,i.jsx)(p.Z,{color:"textSecondary",variant:"body2",children:(0,B.Z)(n.dueDate,"dd/MM/yyyy")})]})}),(0,i.jsx)(Q.Z,{align:"right",children:(0,i.jsx)(W.default,{href:"/app/invoices/1",passHref:!0,children:(0,i.jsx)(P.Z,{component:"a",children:(0,i.jsx)(Y.o,{fontSize:"small"})})})})]},n.id)},ie=function(e){var n=e.group,r=e.invoices,t=e.invoicesCount,o=e.onPageChange,s=e.onRowsPerPageChange,c=e.page,u=e.rowsPerPage,l=re(e,["group","invoices","invoicesCount","onPageChange","onRowsPerPageChange","page","rowsPerPage"]),d=n&&r.reduce((function(e,n){var r=n.status;return ne({},e,ee({},r,te(e[r]).concat([n])))}),{paid:[],pending:[],canceled:[]});return(0,i.jsxs)("div",ne({},l,{children:[(0,i.jsx)(A.L,{children:(0,i.jsxs)(V.Z,{sx:{borderCollapse:"separate",borderSpacing:function(e){return"0 ".concat(e.spacing(3))},minWidth:600,marginTop:function(e){return"-".concat(e.spacing(3))},p:"1px"},children:[n&&(0,i.jsx)(J.Z,{children:Object.keys(d).map((function(e){return(0,i.jsxs)(a.Fragment,{children:[(0,i.jsx)(G.Z,{children:(0,i.jsx)(Q.Z,{colSpan:5,sx:{px:0},children:(0,i.jsxs)(p.Z,{color:"textSecondary",variant:"h6",children:[e.charAt(0).toUpperCase()+e.slice(1)," ","(",d[e].length,")"]})})}),d[e].map((function(e){return(0,i.jsx)(oe,{invoice:e},e.id)}))]},e)}))}),!n&&(0,i.jsx)(J.Z,{children:r.map((function(e){return(0,i.jsx)(oe,{invoice:e},e.id)}))})]})}),(0,i.jsx)(K.Z,{component:"div",count:t,onPageChange:o,onRowsPerPageChange:s,page:c,rowsPerPage:u,rowsPerPageOptions:[5,10,25]})]}))};
1ie.propTypes={group:w().bool,invoices:w().array.isRequired,invoicesCount:w().number.isRequired,onPageChange:w().func,onRowsPerPageChange:w().func,page:w().number.isRequired,rowsPerPage:w().number.isRequired};var ae=r(76421),se=r(58424),ce=r(17928),ue=r(21924);function le(e,n,r,t,o,i,a){try{var s=e[i](a),c=s.value}catch(u){return void r(u)}s.done?n(c):Promise.resolve(c).then(t,o)}function de(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var fe,pe,he=(0,v.ZP)("div",{shouldForwardProp:function(e){return"open"!==e}})((function(e){var n=e.theme,r=e.open;return function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){de(e,n,r[n])}))}return e}((de(fe={flexGrow:1,overflow:"hidden",paddingLeft:n.spacing(3),paddingRight:n.spacing(3),paddingTop:n.spacing(8),paddingBottom:n.spacing(8),zIndex:1},n.breakpoints.up("lg"),{marginLeft:-380}),de(fe,"transition",n.transitions.create("margin",{easing:n.transitions.easing.sharp,duration:n.transitions.duration.leavingScreen})),fe),r&&(de(pe={},n.breakpoints.up("lg"),{marginLeft:0}),de(pe,"transition",n.transitions.create("margin",{easing:n.transitions.easing.easeOut,duration:n.transitions.duration.enteringScreen})),pe))})),xe=function(){var e=(0,ae.s)(),n=(0,a.useRef)(null),r=(0,l.Z)((function(e){return e.breakpoints.up("md")}),{noSsr:!0}),t=(0,a.useState)(!0),v=t[0],j=t[1],m=(0,a.useState)([]),y=m[0],w=m[1],Z=(0,a.useState)(0),P=Z[0],S=Z[1],O=(0,a.useState)(5),C=O[0],D=O[1],k=(0,a.useState)(r),I=k[0],R=k[1],E=(0,a.useState)({query:"",startDate:null,endDate:null,customer:[]}),A=E[0],_=E[1];(0,a.useEffect)((function(){ue.wT.push({event:"page_view"})}),[]);var M,T=(0,a.useCallback)((M=o().mark((function n(){var r;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,b.n.getInvoices();case 3:r=n.sent,e()&&w(r),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),console.error(n.t0);case 10:case"end":return n.stop()}}),n,null,[[0,7]])})),function(){var e=this,n=arguments;return new Promise((function(r,t){var o=M.apply(e,n);function i(e){le(o,r,t,i,a,"next",e)}function a(e){le(o,r,t,i,a,"throw",e)}i(void 0)}))}),[e]);(0,a.useEffect)((function(){T()}),[]);var L=function(e,n){return e.filter((function(e){var r;return!(n.query&&!e.number.toLowerCase().includes(n.query.toLowerCase()))&&((!n.startDate||(0,c.Z)(e.issueDate)>=(0,u.Z)(n.startDate.getTime()))&&((!n.endDate||(0,u.Z)(e.issueDate)<=(0,c.Z)(n.endDate.getTime()))&&(!((null===(r=n.customer)||void 0===r?void 0:r.length)>0&&!n.customer.includes(e.customer.name))&&("paid"!==n.status||"paid"===e.status))))}))}(y,A),q=function(e,n,r){return e.slice(n*r,n*r+r)}(L,P,C);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.default,{children:(0,i.jsx)("title",{children:"Dashboard: Invoice List | gNucleus"})}),(0,i.jsxs)(d.Z,{component:"main",ref:n,sx:{backgroundColor:"background.default",display:"flex",flexGrow:1,overflow:"hidden"},children:[(0,i.jsx)(z,{containerRef:n,filters:A,onChange:function(e){_(e),S(0)},onClose:function(){R(!1)},open:I}),(0,i.jsxs)(he,{open:I,children:[(0,i.jsxs)(d.Z,{sx:{mb:3},children:[(0,i.jsxs)(f.ZP,{container:!0,spacing:3,justifyContent:"space-between",children:[(0,i.jsx)(f.ZP,{item:!0,children:(0,i.jsx)(p.Z,{variant:"h4",children:"Invoices"})}),(0,i.jsxs)(f.ZP,{item:!0,sx:{m:-1},children:[(0,i.jsx)(h.Z,{endIcon:(0,i.jsx)(se.w,{fontSize:"small"}),onClick:function(){R((function(e){return!e}))},sx:{m:1},variant:"outlined",children:"Filters"}),(0,i.jsx)(h.Z,{startIcon:(0,i.jsx)(ce.v,{fontSize:"small"}),sx:{m:1},variant:"contained",children:"New"})]})]}),(0,i.jsx)(d.Z,{sx:{display:"flex",justifyContent:"flex-end",mt:3},children:(0,i.jsx)(x.Z,{control:(0,i.jsx)(g.Z,{checked:v,onChange:function(e){j(e.target.checked)}}),label:"Show groups"})})]}),(0,i.jsx)(ie,{group:v,invoices:q,invoicesCount:L.length,onPageChange:function(e,n){S(n)},onRowsPerPageChange:function(e){D(parseInt(e.target.value,10))},page:P,rowsPerPage:C})]})]})]})};xe.getLayout=function(e){return(0,i.jsx)(j.a,{children:(0,i.jsx)(m.c,{children:e})})};var ge=xe}},function(e){e.O(0,[186,3718,3414,4601,3497,2942,3340,1075,8779,769,5596,7227,4032,6198,9811,5961,8834,6044,5706,6239,7275,1322,7327,1246,6538,3725,449,9774,2888,179],(function(){return n=4286,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.