1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4191],{77518:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/org/all-invoices",function(){return t(65447)}])},92800:function(e,n,t){"use strict";t.d(n,{s_:function(){return components_Panel},NZ:function(){return components_SectionTitle},ZP:function(){return SectionWithTitle_SectionWithTitle}});var i=t(85893),r=t(86010),components_Panel=function(e){var n=e.children,t=e.className;return(0,i.jsx)("div",{className:(0,r.Z)("flex flex-col rounded border border-gray-200 bg-white py-5 px-10",t),children:n})},a=t(6897),components_SectionTitle=function(e){var n=e.children;return(0,i.jsx)("div",{className:"flex items-center justify-between border-b-2 border-black ",children:(0,i.jsx)(a.Z,{className:"pb-2",variant:"h2",children:n})})},o=t(41327),SectionWithTitle_SectionWithTitle=function(e){var n=e.tTitle,t=e.children,r=e.translationNamespace,a=e.className,s=(0,o.$G)([r]).t;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(components_SectionTitle,{children:[s(n,{ns:r})," "]}),(0,i.jsx)(components_Panel,{className:a,children:t})]})}},6897:function(e,n,t){"use strict";var i=t(85893),r=t(67294),a=t(86010);n.Z=function(e){var n=e.children,t=e.variant,o=e.className,s=e.customClasses,c=e.showDot,l=void 0===c||c;return(0,r.useMemo)(function(){return{h1:(0,i.jsxs)("h1",{className:null!=s?s:(0,a.Z)("text-3xl font-bold sm:text-5xl",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]}),h2:(0,i.jsxs)("h2",{className:null!=s?s:(0,a.Z)("text-2xl font-bold",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]}),h3:(0,i.jsxs)("h3",{className:null!=s?s:(0,a.Z)("text-xl font-semibold",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]}),h4:(0,i.jsxs)("h4",{className:null!=s?s:(0,a.Z)("font-semibold",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]}),h5:(0,i.jsxs)("h5",{className:null!=s?s:(0,a.Z)("text-lg font-bold",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]}),h6:(0,i.jsxs)("h6",{className:null!=s?s:(0,a.Z)("text-sm font-bold",o),children:[n,l&&(0,i.jsx)("i",{className:"dot"})]})}},[s,o,n,l])[void 0===t?"h1":t]}},30984:function(e,n,t){"use strict";var i,r,a,o,s,c;t.d(n,{bG:function(){return i},uG:function(){return r}}),(o=i||(i={})).Settled="settled",o.Initial="initial",o.Abandoned="abandoned",(s=r||(r={}))[s.AutoPayment=0]="AutoPayment",s[s.Manual=1]="Manual",(c=a||(a={})).Card="card",c.ProForma="proForma"},45701:function(e,n,t){"use strict";t.d(n,{x:function(){return l}});var i,r=t(11010),a=t(47702),o=t(97582),s=t(9669),c=t.n(s),l=(i=(0,r._)(function(e){var n,t,i,r,s,l,u,d,m,p,f,h,v;return(0,o.Jh)(this,function(o){switch(o.label){case 0:if(n=e.url,(t=(0,a._)(e,["url"])).print)return window.open(c().getUri({url:n,params:t})),[2];return[4,c().get(n,{responseType:"blob",params:t})];case 1:return l=(s=o.sent()).data,m=null===(i=(d=null!==(u=s.headers["content-disposition"])&&void 0!==u?u:"").match(/filename\*=UTF-8''([^;]+)/i))||void 0===i?void 0:i[1],p=null===(r=d.match(/filename=["'â]?(.*?)["'â;]/))||void 0===r?void 0:r[1],f=m?decodeURIComponent(m):p,h=window.URL.createObjectURL(l),(v=document.createElement("a")).href=h,v.setAttribute("download",null!=f?f:"HRizer.pdf"),document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(h),[2]}})}),function(e){return i.apply(this,arguments)})},23670:function(e,n,t){"use strict";t.d(n,{L:function(){return r}});var i=t(248),r={all:["payments"],storedCardInfo:function(){return(0,i._)(r.all).concat(["stored-card-info"])},invoices:function(e){return(0,i._)(r.all).concat(["invoices",e])}}},97086:function(e,n,t){"use strict";t.d(n,{Gy:function(){return h},Mw:function(){return p},eI:function(){return d},sA:function(){return f},v1:function(){return m}});
1var i,r,a,o,s,c=t(11010),l=t(97582),u=t(42978),d=(i=(0,c._)(function(){return(0,l.Jh)(this,function(e){switch(e.label){case 0:return[4,u.authClient.post("/payments/cards")];case 1:return[2,e.sent().data]}})}),function(){return i.apply(this,arguments)}),m=(r=(0,c._)(function(){return(0,l.Jh)(this,function(e){switch(e.label){case 0:return[4,u.authClient.get("/payments/cards/stored")];case 1:return[2,e.sent().data]}})}),function(){return r.apply(this,arguments)}),p=(a=(0,c._)(function(){return(0,l.Jh)(this,function(e){switch(e.label){case 0:return[4,u.authClient.delete("/payments/cards/stored")];case 1:return e.sent(),[2]}})}),function(){return a.apply(this,arguments)}),f=(o=(0,c._)(function(e){var n,t,i;return(0,l.Jh)(this,function(r){switch(r.label){case 0:return[4,u.authClient.get("/payments/invoices",{params:e})];case 1:return t=(n=r.sent()).data,i=n.headers,[2,{invoices:t,pagination:(0,u.parseContentRange)(i)}]}})}),function(e){return o.apply(this,arguments)}),h=(s=(0,c._)(function(e){return(0,l.Jh)(this,function(n){switch(n.label){case 0:return[4,u.authClient.post("/payments/charge",e)];case 1:return[2,n.sent().data]}})}),function(e){return s.apply(this,arguments)});(0,c._)(function(e){var n;return(0,l.Jh)(this,function(t){switch(t.label){case 0:return n=e.id,[4,u.authClient.get("/payments/invoices/".concat(n))];case 1:return[2,t.sent().data]}})})},49240:function(e,n,t){"use strict";var i=t(11010),r=t(97582),a=t(36492),o=t(23670),s=t(97086);n.Z=function(e){var n=e.payload,t=e.options;return(0,a.a)(o.L.invoices(n),(0,i._)(function(){return(0,r.Jh)(this,function(e){switch(e.label){case 0:return[4,(0,s.sA)(n)];case 1:return[2,e.sent()]}})}),t)}},65447:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return w},default:function(){return all_invoices}});var i=t(85893),r=t(24043),a=t(41327),o=t(67294),s=t(24799),c=t(86010),l=t(30405),u=t(48586),d=t(28634),m=t(11010),p=t(97582),f=t(11163),h=t(33299),v=t(45701),g=t(42978),b=t(16756),InvoicesTable_useColumns=function(){var e=(0,a.$G)(["crm","action"]).t,n=(0,f.useRouter)().locale,t=(0,h.useSession)().data,s=(0,r._)((0,o.useState)(null),2),c=s[0],l=s[1],x=(0,o.useMemo)(function(){return{payDate:e("org.payments.invoiceTable.date",{ns:"crm"}),subscription:e("org.payments.invoiceTable.subscription",{ns:"crm"}),paymentReference:e("org.payments.invoiceTable.number",{ns:"crm"}),amount:e("org.payments.invoiceTable.amount",{ns:"crm"}),action:e("org.payments.invoiceTable.action",{ns:"crm"}),type:e("org.payments.invoiceTable.type",{ns:"crm"}),status:e("org.payments.invoiceTable.status",{ns:"crm"})}},[e]),y=(0,o.useMemo)(function(){return{id:"payDate",size:160,header:x.payDate,cell:function(e){var t=e.row;return t.original.payDate?(0,g.shortDate)(new Date(t.original.payDate),n):(0,g.shortDate)(new Date(t.original.createdAt),n)}}},[n,x.payDate]),j=(0,o.useMemo)(function(){return{id:"subscription",header:x.subscription,cell:function(e){var n=e.row;return(0,i.jsxs)("div",{children:["HRizer ",(0,i.jsx)("span",{className:"capitalize",children:n.original.subscription})]})}}},[x.subscription]),w=(0,o.useMemo)(function(){return{id:"paymentNumber",header:x.paymentReference,cell:function(e){var n=e.row;return(0,i.jsx)("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.original.paymentNumber?(0,b.vk)(n.original.paymentNumber,5):"-"})}}},[x.paymentReference]),N=(0,o.useMemo)(function(){return{id:"amount",header:x.amount,cell:function(e){var t=e.row;return(0,g.formatMoney)({amount:t.original.amount,locale:n})}}},[n,x.amount]),_=(0,o.useMemo)(function(){return{id:"actions",header:x.action,size:80,cell:function(n){var r,a=n.row;return(0,i.jsx)("div",{className:"flex",children:(0,i.jsx)(u.Ei,{tooltipContent:e("download",{ns:"actions"}),rounded:!0,isLoading:a.original.id===c,isSpinner:a.original.id===c,onClick:(r=(0,m._)(function(e){return(0,p.Jh)(this,function(n){switch(n.label){case 0:return e.stopPropagation(),l(a.original.id),[4,(0,v.x)({url:"/api/reports/invoice/".concat(a.original.id),token:null==t?void 0:t.jwt})];case 1:return n.sent(),l(null),[2]}})}),function(e){return r.apply(this,arguments)}),children:a.original.id!==c&&(0,i.jsx)(d.Dj,{})})})}}},[null==t?void 0:t.jwt,c,e,x.action]),S=(0,o.useMemo)(function(){return{id:"type",header:x.type,cell:function(n){var t=n.row;return e("org.payments.invoiceType.".concat(t.original.payDate?"finalInvoice":"proForma"),{ns:"crm"})}}},[e,x.type]);return{columns:(0,o.useMemo)(function(){return[y,j,w,N,S,_]},[_,N,y,w,j,S])}},useInvoiceTable=function(e){var n=e.total,t=e.pagination,i=(0,a.$G)(["crm","enums"]).t,r=(0,o.useMemo)(function(){return Math.ceil(n/t.pageSize)||1},[t.pageSize,n]),s=(0,o.useMemo)(function(){return Array(r).fill(1)},[r]);return{pages:r,paginationPages:s,totalInRow:(0,o.useMemo)(function(){var e=t.pageIndex*t.pageSize||1,i=t.pageSize*t.pageIndex+t.pageSize;return{start:e,end:n<i?n:i}},[t.pageIndex,t.pageSize,n]),t:i}},InvoicesTable_InvoicesTable=function(e){var n=e.invoices,t=e.total,r=e.pagination,a=e.onChangePage,o=r.pageIndex,m=r.pageSize,p=InvoicesTable_useColumns().columns,f=useInvoiceTable({total:t,pagination:r}),h=f.pages,v=f.paginationPages,g=f.totalInRow,b=f.t,x=(0,s.useReactTable)({data:n,columns:p,getCoreRowModel:(0,s.getCoreRowModel)(),getFilteredRowModel:(0,s.getFilteredRowModel)(),getSortedRowModel:(0,s.getSortedRowModel)()});return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"overflow-auto pb-5",children:[(0,i.jsx)("div",{className:"pb-5",children:(0,i.jsxs)("table",{className:"mt-5 table w-full table-fixed",style:{minWidth:x.getCenterTotalSize()},children:[(0,i.jsx)("thead",{className:"border-b-2 border-black",children:x.getHeaderGroups().map(function(e){return(0,i.jsx)("tr",{children:e.headers.map(function(e){var n;return(0,i.jsx)("th",{className:"table-cell",style:{width:180===e.getSize()?"auto":e.getSize()}
1,children:e.isPlaceholder?null:(0,i.jsxs)("div",{className:(0,c.Z)("select-none pb-2 text-left font-medium",e.column.getCanSort()&&"cursor-pointer"),onClick:e.column.getToggleSortingHandler(),children:[(0,s.flexRender)(e.column.columnDef.header,e.getContext()),null!==(n=({asc:(0,i.jsx)(d.Qb,{}),desc:(0,i.jsx)(d.lg,{})})[e.column.getIsSorted()])&&void 0!==n?n:null]})},e.id)})},e.id)})}),(0,i.jsx)("tbody",{className:"table-row-group hover:cursor-pointer",children:x.getRowModel().rows.map(function(e){return(0,i.jsx)("tr",{className:"table-row even:bg-gray-50 hover:bg-gray-200",children:e.getVisibleCells().map(function(e){return(0,i.jsx)("td",{className:"table-cell h-[60px] items-center break-all p-2",children:(0,s.flexRender)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)})})]})}),(0,i.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,i.jsx)("span",{className:"text-gray-400",children:"".concat(g.start,"-").concat(g.end," of ").concat(t||"-")}),(0,i.jsxs)("div",{className:"flex items-center font-bold",children:[o>=1&&(0,i.jsx)(u.Ei,{rounded:!0,onClick:function(){return a({pageIndex:o-1,pageSize:m})},children:(0,i.jsx)(d.CC,{className:"rotate-180"})}),v.map(function(e,n){return(0,i.jsx)(u.zx,{size:l.SizeVariant.Small,className:"border-none",disabled:n===o,onClick:function(){return a({pageIndex:n,pageSize:m})},children:n+1},n)}),o<h-1&&(0,i.jsx)(u.Ei,{rounded:!0,onClick:function(){return a({pageIndex:o+1,pageSize:m})},children:(0,i.jsx)(d.CC,{})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("select",{className:"focus:border-b-1 border-b-2 border-l-0 border-r-0 border-t-0 border-black text-sm text-gray-400 focus:border-black focus:shadow-none focus:ring-0",value:m,onChange:function(e){a({pageSize:Number(e.target.value),pageIndex:0})},children:[5,10,15,20,25].map(function(e){return(0,i.jsx)("option",{value:e,children:e},e)})}),(0,i.jsx)("span",{children:b("candidate.table.perPage",{ns:"crm"})})]})]})]})})},x=t(92800),y=t(49240),j=t(30984),AllInvoices_AllInvoices=function(){var e,n,t,s=(0,r._)((0,o.useState)({pageSize:5,pageIndex:0}),2),c=s[0],l=s[1],u=(0,y.Z)({payload:{limit:c.pageSize,offset:c.pageIndex*c.pageSize,statuses:[j.bG.Settled,j.bG.Initial]}}).data,d=(0,a.$G)(["crm"]).t;return(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"mx-2 sm:mx-0",children:(0,i.jsxs)(x.NZ,{children:[d("org.payments.invoices",{ns:"crm"})," "]})}),(0,i.jsx)("div",{className:"mt-4 px-2 sm:px-0",children:(0,i.jsx)(InvoicesTable_InvoicesTable,{invoices:null!==(n=null==u?void 0:u.invoices)&&void 0!==n?n:[],total:null!==(t=null==u?void 0:null===(e=u.pagination)||void 0===e?void 0:e.total)&&void 0!==t?t:0,pagination:c,onChangePage:l})})]})},w=!0,all_invoices=function(){return(0,i.jsx)(AllInvoices_AllInvoices,{})}},16756:function(e,n,t){"use strict";t.d(n,{_S:function(){return skipDecimalNumber},fE:function(){return skipNumbers},in:function(){return skipCharacters},vk:function(){return pad}});var skipDecimalNumber=function(e){"."===e.key&&e.preventDefault()},skipNumbers=function(e,n){var t=new Set(["0","1","2","3","4","5","6","7","8","9"]);(n?t.has(e.key):!t.has(e.key)&&"Backspace"!==e.key)&&e.preventDefault()},skipCharacters=function(e){["+",",","-","/","*"].includes(e.key)&&e.preventDefault()},pad=function(e,n){for(var t="".concat(e);t.length<n;)t="0"+t;return t}}},function(e){e.O(0,[4799,9774,2888,179],function(){return e(e.s=77518)}),_N_E=e.O()}]); 2//# sourceMappingURL=all-invoices-57fda69fed233356.js.map
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.