1"use strict";(self.webpackChunkgloss=self.webpackChunkgloss||[]).push([[2015],{2015(e,t,n){n.d(t,{UB:()=>w,YX:()=>C,PaymentBatchIndex:()=>b,PaymentBatchShow:()=>B,q5:()=>$,iK:()=>S});var i=n(5544),s=n(27565),a=n(34546),r=n(84702),d=n(57832),c=n(55334),l=n(286),o=n(26709),h=n(70161),j=n(53919),x=n(58743),g=n(95578),m=n(23627),u=n(83361),v=n(27929),b=()=>{var e=(0,s.useState)({sortColumn:"id",sortDirection:o.UE.Desc}),t=(0,i.A)(e,2),n=t[0],b=t[1],y=(0,a.I)(u.G7,{variables:n}),p=y.loading,Y=y.error,w=y.data;(0,m.rI)({title:"Previous payment batches"});var f=e=>n.sortColumn===e,E=e=>n.sortColumn===e?n.sortDirection:void 0,B=(e,t)=>b({sortColumn:e,sortDirection:t}),P=((null===w||void 0===w?void 0:w.paymentBatches)||[]).filter(e=>e.state!==o.K_.Pending),C=(0,r.sumBy)(P,e=>(0,r.sumBy)(e.outboundPayments,e=>e.amount));return p?(0,v.jsx)(d.uY,{children:(0,v.jsx)(c.N,{variant:"gutter",children:(0,v.jsx)(h.Rh,{css:{minHeight:"60vh"}})})}):Y?(0,v.jsx)(d.uY,{children:(0,v.jsx)(c.N,{variant:"gutter",children:(0,v.jsx)(c.az,{css:{py:"$7"},children:(0,v.jsx)(l.EY,{variant:"h4",children:"Oops, something went wrong"})})})}):(0,v.jsxs)(d.uY,{children:[S,(0,v.jsxs)(c.xI,{children:[(0,v.jsx)(l.EY,{variant:"h2",css:{mt:"$14",mb:"$7"},children:"Previous payment batches"}),(0,v.jsxs)(c.az,{css:{pb:"$7"},children:[0===P.length&&(0,v.jsx)(l.EY,{children:"No previous batches."}),P.length>0&&(0,v.jsxs)(c.az,{children:[(0,v.jsxs)(l.EY,{children:["In total, we've paid out ",(0,x.vv)(C)," via"," ",(0,g.td)(P.length,"batch","batches"),"."]}),(0,v.jsxs)(c.az,{css:{pt:"$13",pb:"$8"},children:[(0,v.jsxs)(j.A,{children:[(0,v.jsx)(j.B,{widthPercentage:25,fieldName:"id",active:f("id"),currentSortDirection:E("id"),onSortChange:B,children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Batch ID"})}),(0,v.jsx)(j.B,{widthPercentage:16,fieldName:"amount",active:f("amount"),currentSortDirection:E("amount"),onSortChange:B,children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Amount"})}),(0,v.jsx)(j.B,{widthPercentage:25,fieldName:"status",active:f("status"),currentSortDirection:E("status"),onSortChange:B,children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Status"})}),(0,v.jsx)(j.B,{widthPercentage:33,fieldName:"paid_on",active:f("paid_on"),currentSortDirection:E("paid_on"),onSortChange:B,children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Paid on"})})]}),P.map(e=>(0,v.jsx)($,{batch:e},e.id))]})]})]})]})]})},y=n(88702),p=n(16005),Y=e=>{var t=e.state;return t===o.K_.Processing?(0,v.jsx)(l.EY,{variant:"b3Bold",color:"orange",css:{background:"$lightOrange",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:"Processing"}):t===o.K_.Sealed?(0,v.jsx)(l.EY,{variant:"b3Bold",color:"red",css:{background:"$rejectedLight",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:"Needs to be paid"}):null},$=e=>{var t=e.batch,n=t.outboundPayments.every(e=>e.state===o.ib.Sent),i=t.outboundPayments.filter(e=>e.state===o.ib.Failed).length;return(0,v.jsxs)(c.az,{css:{borderBottom:"1px solid $grey3",pb:"18px"},children:[(0,v.jsx)(c.so,{css:{flexDirection:"column",gap:"18px","@lg":{display:"none"}},children:(0,v.jsxs)(c.so,{css:{justifyContent:"space-between"},children:[(0,v.jsxs)(c.so,{css:{flexDirection:"column",gap:"$4",justifyContent:"space-between"},children:[(0,v.jsx)(y.N_,{to:"/dashboard/agent/payments/batches/".concat(t.id),children:(0,v.jsxs)(l.EY,{variant:"b2",children:["Batch #",t.id]})}),(0,v.jsx)(l.EY,{variant:"b2",children:(0,x.vv)((0,r.sumBy)(t.outboundPayments,e=>e.amount))})]}),(0,v.jsxs)(c.so,{css:{flexDirection:"column",gap:"$4",alignItems:"end"},children:[(0,v.jsxs)(c.az,{children:[n?(0,v.jsx)(l.EY,{variant:"b3Bold",color:"green",css:{background:"$lightGreen",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:"Paid successfully"}):(0,v.jsx)(Y,{state:t.state}),i>0&&(0,v.jsx)(l.EY,{variant:"b3Bold",color:"red",css:{background:"$rejectedLight",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:(0,g.td)(i,"payment failed","payments failed")})]}),t.sentAt&&(0,v.jsx)(l.EY,{variant:"b2",children:(0,p.Yq)(t.sentAt,"dd LLLL yyyy - h:mmaaa")})]})]})}),(0,v.jsxs)(c.so,{css:{display:"none","@lg":{display:"flex",pt:"$5"}},children:[(0,v.jsx)(c.az,{css:{width:"26%"},children:(0,v.jsxs)(y.N_,{to:"/dashboard/agent/payments/batches/".concat(t.id),children:["Batch #",t.id]})}),(0,v.jsx)(c.az,{css:{width:"16%"},children:(0,v.jsx)(l.EY,{variant:"b2",children:(0,x.vv)((0,r.sumBy)(t.outboundPayments,e=>e.amount))})}),(0,v.jsxs)(c.az,{css:{width:"25%"},children:[n?(0,v.jsx)(l.EY,{variant:"b3Bold",color:"green",css:{background:"$lightGreen",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:"Paid successfully"}):(0,v.jsx)(Y,{state:t.state}),i>0&&(0,v.jsx)(l.EY,{variant:"b3Bold",color:"red",css:{background:"$rejectedLight",width:"fit-content",padding:"$3 $4",borderRadius:"$pill"},children:(0,g.td)(i,"payment failed","payments failed")})]}),(0,v.jsx)(c.az,{css:{width:"33%"},children:t.sentAt&&(0,v.jsx)(l.EY,{variant:"b2",children:(0,p.Yq)(t.sentAt,"dd LLLL yyyy I:M p")})})]})]},t.id)},w=e=>{var t=e.payments;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(j.A,{children:[(0,v.jsx)(j.B,{widthPercentage:25,fieldName:"name",active:!1,currentSortDirection:o.UE.Asc,onSortChange:()=>{},children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Recipient"})}),(0,v.jsx)(j.B,{widthPercentage:20,fieldName:"job",active:!1,currentSortDirection:o.UE.Asc,onSortChange:()=>{},children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Job"})}),(0,v.jsx)(j.B,{widthPercentage:16,fieldName:"amount",active:!1,currentSortDirection:o.UE.Asc,onSortChange:()=>{},children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Amount"})}),(0,v.jsx)(j.B,{widthPercentage:16,fieldName:"status",active:!1,currentSortDirection:o.UE.Asc,onSortChange:()=>{},children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Status"})}),(0,v.jsx)(j.B,{widthPercentage:16,fieldName:"dateAdded",active:!1,currentSortDirection:o.UE.Asc,onSortChange:()=>{},children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Date added"})}),(0,v.jsx)(j.B,{widthPercentage:7,children:(0,v.jsx)(l.EY,{variant:"mini",color:"grey6",children:"Letter"})})]}),0===t.length&&(0,v.jsxs)(c.az,{css:{mt:"$16",spaceY:"$6"},children:[(0,v.jsx)(l.In,{variant:"moneyBudget",size:40,color:"grey6"}),(0,v.jsx)(l.EY,{variant:"h1",color:"grey6",children:"No payments added"})]}),t.length>0&&t.map(e=>(0,v.jsx)(f,{payment:e},e.id))]})},f=e=>{var t=e.payment;return(0,v.jsx)(c.az,{css:{borderBottom:"1px solid $grey3"},children:(0,v.jsxs)(c.xA,{css:{py:"$6",gridColumns:2,gridGap:"$4","@lg":{display:"flex",alignItems:"flex-start"}},children:[(0,v.jsx)(c.az,{css:{width:"100%","@lg":{width:"25%"}},children:t.jobTalent?(0,v.jsx)(y.N_,{to:"/dashboard/agent/talent/".concat(t.jobTalent.talent.slug),children:(0,v.jsx)(l.EY,{variant:"b2",children:t.jobTalent.talent.name})}):(0,v.jsx)(l.EY,{variant:"b2",children:"Unknown creative"})}),(0,v.jsx)(c.az,{css:{width:"100%","@lg":{width:"20%"}},children:t.jobTalent?(0,v.jsx)(y.N_,{to:"/dashboard/agent/jobs/".concat(t.jobTalent.job.slug),children:(0,v.jsx)(l.EY,{variant:"b2",children:t.jobTalent.job.name})}):(0,v.jsx)(l.EY,{variant:"b2",children:"Unknown job"})}),(0,v.jsx)(c.so,{css:{width:"100%",alignItems:"end",textAlign:"end",flexDirection:"column","@lg":{width:"16%",alignItems:"start",textAlign:"start"}},children:(0,v.jsx)(C,{payment:t})}),(0,v.jsxs)(c.so,{css:{width:"100%",gridRow:1,gridColumn:2,justifyContent:"end","@lg":{width:"16%",justifyContent:"start"}},children:[t.state===o.ib.Sent&&(0,v.jsx)(l.EY,{variant:"b3Bold",color:"green",css:{width:"fit-content",background:"$lightGreen",padding:"$3 $4",borderRadius:"$pill"},children:"Paid successfully"}),t.state===o.ib.Failed&&(0,v.jsx)(l.EY,{variant:"b3Bold",color:"red",css:{width:"fit-content",background:"$rejectedLight",padding:"$3 $4",borderRadius:"$pill"},children:"Payment failed"})]}),(0,v.jsx)(c.so,{css:{width:"100%","@lg":{width:"16%"}},children:(0,v.jsx)(l.EY,{variant:"b2",children:(0,p.Yq)(t.createdAt)})}),(0,v.jsx)(c.so,{css:{width:"100%",justifyContent:"end","@lg":{width:"7%",justifyContent:"center"}},children:t.remittanceLetterUrl&&(0,v.jsx)(y.Gr,{to:t.remittanceLetterUrl,eventName:"agencyDashboard:payments:remittanaceLetter",target:"_blank",children:(0,v.jsx)(l.In,{variant:"download",size:16})})})]})},t.id)},E=n(65030),B=()=>{var e=(0,E.g)().id,t=(0,a.I)(u.hY,{variables:{id:e||""}}),n=t.loading,i=t.error,s=t.data,r=null===s||void 0===s?void 0:s.paymentBatch;(0,m.rI)({title:r?"Payment batch #".concat(r.id):""});var j=((null===r||void 0===r?void 0:r.outboundPayments)||[]).filter(e=>e.state===o.ib.Failed).length;return n?(0,v.jsx)(d.uY,{children:(0,v.jsx)(c.N,{variant:"gutter",children:(0,v.jsx)(h.Rh,{css:{minHeight:"60vh"}})})}):!r||i?(0,v.jsx)(d.uY,{children:(0,v.jsx)(c.N,{variant:"gutter",children:(0,v.jsx)(c.az,{css:{py:"$7"},children:(0,v.jsx)(l.EY,{variant:"h4",children:"Oops, something went wrong"})})})}):(0,v.jsxs)(d.uY,{children:[S,(0,v.jsxs)(c.xI,{children:[(0,v.jsxs)(c.so,{css:{my:"$9",justifyContent:"space-between"},children:[(0,v.jsx)(c.az,{children:(0,v.jsxs)(l.EY,{variant:"h2",children:["Batch #",r.id]})}),(0,v.jsxs)(c.so,{css:{flexDirection:"column",alignItems:"flex-end",spaceY:"$2"},children:[(0,v.jsx)(c.so,{css:{alignItems:"center"},children:r.sentAt&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.In,{variant:"check",color:"green",size:20,css:{mr:"$3"}}),(0,v.jsxs)(l.EY,{children:["Paid on:"," ",(0,p.Yq)(r.sentAt,"dd LLLL yyyy - h:mmaaa")]})]})}),j>0&&(0,v.jsx)(l.EY,{color:"red",variant:"meta",children:(0,g.td)(j,"payment failed","payments failed")})]})]}),(0,v.jsx)(c.az,{css:{pb:"$10"},children:(0,v.jsx)(w,{payments:r.outboundPayments})})]})]})},P=n(2078),C=e=>{var t,n=e.payment,i=(0,P.X0)(n),s=(0,P.aq)(n),a=i>0||s>0,r=null===(t=n.lineItems)||void 0===t?void 0:t.some(e=>e.kind===o.ut.JobPayment),d=(0,v.jsxs)(v.Fragment,{children:[i>0&&(0,v.jsxs)("span",{children:[" ",r&&"+ ",(0,x.vv)(i)," expense"]}),s>0&&(0,v.jsxs)("span",{children:[" + ",(0,x.vv)(s)," addition"]})]}),c=(0,v.jsxs)(l.EY,{color:"grey6",variant:"meta",children:[r&&(0,x.vv)((0,P.Qi)(n)),d]});return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.EY,{variant:"b2",children:r?(0,x.vv)(n.amount,n.currency):"Additional Payment"}),a&&c]})}
1,S=(0,v.jsxs)(y.C3,{children:[(0,v.jsx)(d.CR,{url:"/dashboard/agent/payments/invoices",match:/\/dashboard\/agent\/payments(\/invoices)?/,children:"Invoices"}),(0,v.jsx)(d.CR,{url:"/dashboard/agent/payments/batches",match:/\/dashboard\/agent\/payments\/batches/,children:"Previous batches"})]})}}]); 2//# sourceMappingURL=2015.b1fc911f.chunk.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.