1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8703],{97644:function(t,e,n){var r=200,i="__lodash_hash_undefined__",a="[object Function]",o="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,u="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,s="object"==typeof self&&self&&self.Object===Object&&self,l=u||s||Function("return this")();function d(t,e){return!!(t?t.length:0)&&function(t,e,n){if(e!==e)return function(t,e,n,r){var i=t.length,a=n+(r?1:-1);for(;r?a--:++a<i;)if(e(t[a],a,t))return a;return-1}(t,h,n);var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,0)>-1}function f(t,e,n){for(var r=-1,i=t?t.length:0;++r<i;)if(n(e,t[r]))return!0;return!1}function h(t){return t!==t}function p(t,e){return t.has(e)}function v(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var _=Array.prototype,g=Function.prototype,y=Object.prototype,m=l["__core-js_shared__"],b=function(){var t=/[^.]+$/.exec(m&&m.keys&&m.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),x=g.toString,j=y.hasOwnProperty,w=y.toString,I=RegExp("^"+x.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=_.splice,T=Y(l,"Map"),R=Y(l,"Set"),k=Y(Object,"create");function F(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function O(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function G(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function A(t){var e=-1,n=t?t.length:0;for(this.__data__=new G;++e<n;)this.add(t[e])}function N(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!==n&&r!==r)return i;return-1}function P(t){if(!M(t)||(e=t,b&&b in e))return!1;var e,n=function(t){var e=M(t)?w.call(t):"";return e==a||e==o}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(n){}return e}(t)?I:c;return n.test(function(t){if(null!=t){try{return x.call(t)}catch(e){}try{return t+""}catch(e){}}return""}(t))}F.prototype.clear=function(){this.__data__=k?k(null):{}},F.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},F.prototype.get=function(t){var e=this.__data__;if(k){var n=e[t];return n===i?void 0:n}return j.call(e,t)?e[t]:void 0},F.prototype.has=function(t){var e=this.__data__;return k?void 0!==e[t]:j.call(e,t)},F.prototype.set=function(t,e){return this.__data__[t]=k&&void 0===e?i:e,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(t){var e=this.__data__,n=N(e,t);return!(n<0)&&(n==e.length-1?e.pop():C.call(e,n,1),!0)},O.prototype.get=function(t){var e=this.__data__,n=N(e,t);return n<0?void 0:e[n][1]},O.prototype.has=function(t){return N(this.__data__,t)>-1},O.prototype.set=function(t,e){var n=this.__data__,r=N(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},G.prototype.clear=function(){this.__data__={hash:new F,map:new(T||O),string:new F}},G.prototype.delete=function(t){return E(this,t).delete(t)},G.prototype.get=function(t){return E(this,t).get(t)},G.prototype.has=function(t){return E(this,t).has(t)},G.prototype.set=function(t,e){return E(this,t).set(t,e),this},A.prototype.add=A.prototype.push=function(t){return this.__data__.set(t,i),this},A.prototype.has=function(t){return this.__data__.has(t)};var S=R&&1/v(new R([,-0]))[1]==1/0?function(t){return new R(t)}:function(){};function E(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Y(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return P(n)?n:void 0}function M(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}t.exports=function(t){return t&&t.length?function(t,e,n){var i=-1,a=d,o=t.length,c=!0,u=[],s=u;if(n)c=!1,a=f;else if(o>=r){var l=e?null:S(t);if(l)return v(l);c=!1,a=p,s=new A}else s=e?[]:u;t:for(;++i<o;){var h=t[i],_=e?e(h):h;if(h=n||0!==h?h:0,c&&_===_){for(var g=s.length;g--;)if(s[g]===_)continue t;e&&s.push(_),u.push(h)}else a(s,_,n)||(s!==u&&s.push(_),u.push(h))}return u}(t):[]}},9766:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/funding-history/tax-certificates",function(){return n(63826)}])},63826:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return R}});var r=n(85893),i=n(29109),a=n(93212),o=n(14031),c=n(33712),u=n(27060),s=n(67294),l=n(53719),d=n(24276),f=n(23065
1),h=n(75850),p=n(89827),v=n(1523),_=n(73967),g=n(82950),y=n(82999),m=n(70213),b=n.n(m);const x=t=>{let{attachmentId:e,year:n,refetchAttachments:i}=t;const{user:a}=(0,l.a)(),[o,{loading:c}]=(0,p.XRo)({onCompleted:t=>window.location.assign(null===t||void 0===t?void 0:t.regenerate_pdf.PresignedUrl)}),[u,f]=(0,s.useState)(!1),[h,{data:_,stopPolling:m}]=(0,p._zC)({pollInterval:500}),[x]=(0,p.dhA)({onCompleted:t=>{var e;h({variables:{id:null===t||void 0===t||null===(e=t.insert_Attachment_one)||void 0===e?void 0:e.Id}})}}),[j]=(0,p.ofy)({onCompleted:t=>{f(!1),i(),window.location.assign(null===t||void 0===t?void 0:t.presignedUrl)}});(0,s.useEffect)((()=>{const{attachment:t}=_||{},{Generated:e,Filename:n,Failed:r}=t||{};e&&n&&(m(),j({variables:{path:n}})),r&&(m(),f(!1),(0,g.h4)({message:"Could not generate tax receipt",type:g.k$.error}))}),[_]);const w=c||u;return(0,r.jsx)(y.B,{variant:"lime",onClick:()=>{var t;e?o({variables:{input:{AttachmentId:e}}}):(f(!0),x({variables:{input:{ReferenceId:null===a||void 0===a||null===(t=a.Account)||void 0===t?void 0:t.Id,Year:n,Type:v.sf.TaxReceipt}}}))},disabled:w,children:(0,r.jsxs)("div",{className:"flex space-x-2 items-center",children:[(0,r.jsx)(d.T,{size:20,isLoading:w,color:b().forestDeep}),(0,r.jsx)("span",{children:"Download"})]})})};var j=n(97644),w=n.n(j);const I=()=>{var t,e,n;const{user:i}=(0,l.a)(),[a,{data:o,loading:c}]=(0,p.Uzm)(),[g,{data:y,loading:m,refetch:b}]=(0,p.dS2)();(0,s.useEffect)((()=>{var t,e;(null===i||void 0===i||null===(t=i.Account)||void 0===t?void 0:t.FunderId)&&a({variables:{funderId:null===i||void 0===i||null===(e=i.Account)||void 0===e?void 0:e.FunderId}})}),[null===i||void 0===i||null===(t=i.Account)||void 0===t?void 0:t.FunderId]),(0,s.useEffect)((()=>{var t,e;(null===i||void 0===i||null===(t=i.Account)||void 0===t?void 0:t.Id)&&g({variables:{referenceId:null===i||void 0===i||null===(e=i.Account)||void 0===e?void 0:e.Id,type:v.sf.TaxReceipt}})}),[null===i||void 0===i||null===(e=i.Account)||void 0===e?void 0:e.Id]);const j=c||m,{purchases:I}=o||{},C=(0,s.useMemo)((()=>I?(t=>w()(t.map((t=>{let{CreatedOn:e}=t;return(0,_._3)(e)}))).map((t=>({year:t}))))(I):[]),[I]),T=(0,s.useMemo)((()=>[(0,u.Cl)().accessor("year",{cell:t=>{const e=(0,_.p6)({date:new Date(t.getValue()-1,3,1).toISOString(),format:"D MMM YYYY",isUtc:!0}),n=(0,_.p6)({date:new Date(t.getValue(),2,31).toISOString(),format:"D MMM YYYY",isUtc:!0}),i=null===y||void 0===y?void 0:y.attachments.find((e=>e.Year===t.getValue()));return(0,r.jsxs)("div",{className:"flex flex-col md:flex-row justify-between md:items-center mt-4",children:[(0,r.jsxs)(f.nv,{className:"mb-0! pb-2 md:pb-0 font-bold text-left",children:[e," to ",n]}),(0,r.jsx)("div",{className:"justify-self-start",children:(0,r.jsx)(x,{refetchAttachments:b,attachmentId:null===i||void 0===i?void 0:i.Id,year:t.getValue()})})]})},header:""})]),[y]);return(0,r.jsxs)(d.T,{isLoading:j,children:[(0,r.jsx)(f.aC,{children:null===i||void 0===i||null===(n=i.Account)||void 0===n?void 0:n.Name}),(null===I||void 0===I?void 0:I.length)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.nv,{children:"Download tax certificates for different financial years."}),(0,r.jsx)(h.i,{showHeader:!1,rowClasses:()=>"border-t",columns:T,data:C})]}):(0,r.jsx)(f.nv,{className:"mb-0!",children:"Tax certificates are generated at the end of each financial year. You can come here and download them anytime once they're available."})]})};var C=(0,c.hN)((()=>(0,r.jsx)("div",{className:"pt-6",children:(0,r.jsx)(I,{})})));const T=()=>(0,r.jsx)(o.g,{children:(0,r.jsx)(a.O,{activeTab:a.p.TaxCertificates,children:(0,r.jsx)(C,{})})});var R=(0,c.hN)((()=>(0,r.jsx)(i.T,{title:"Payment settings",showBreadcrumbs:!1,children:(0,r.jsx)(T,{})})))},1523:function(t,e,n){"use strict";var r;n.d(e,{F9:function(){return a},Fk:function(){return i},sf:function(){return r}}),function(t){t[t.Unknown=0]="Unknown",t[t.ReceiptFundTree=1]="ReceiptFundTree",t[t.ReceiptGiftTree=2]="ReceiptGiftTree",t[t.CertificateGift=3]="CertificateGift",t[t.CertificateBulk=4]="CertificateBulk",t[t.CertificateBulkSend=5]="CertificateBulkSend",t[t.ReceiptFundPlanting=6]="ReceiptFundPlanting",t[t.InvoiceFundPlanting=7]="InvoiceFundPlanting",t[t.InvoiceGiftTree=8]="InvoiceGiftTree",t[t.ReceiptRegistryGift=9]="ReceiptRegistryGift",t[t.GrabOneFundTree=10]="GrabOneFundTree",t[t.TaxReceipt=11]="TaxReceipt",t[t.CertificatesPackaged=12]="CertificatesPackaged"}(r||(r={}));const i={0:"Unknown",1:"Receipt (donation)",2:"Receipt (gift)",3:"Gift certificate",4:"Gift certificate (bulk)",5:"Gift certificate (bulk)",6:"Receipt (donation)",7:"Invoice (donation)",8:"Invoice (gift)",9:"Receipt (registry)",10:"Grabone",11:"Tax certificate",12:"Certificates"},a=t=>{switch(t){case 1:return[1];case 2:return[2];case 3:return[2,8];case 4:return[6,7];case 5:return[9];default:return[]}}}},function(t){t.O(0,[509,1255,5970,9317,4396,5666,9759,9336,1317,5850,9109,7430,2888,9774,179],(function(){return e=9766,t(t.s=e);var e}));var e=t.O();_N_E=e}]); 2//# sourceMappingURL=tax-certificates-f1a0ae5754c33314.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.