PageSourceSearch

https://business.veendhq.com/_next/static/chunks/pages/expenses/bulk/send-c9b10a2461b21cee.js

js veendhq.com collected 2026-10-05 22:06:13 UTC 17,500 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8874],{23430:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var a=t(1413),r=t(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},i=t(89099),s=function(e,n){return r.createElement(i.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:n,icon:o}))};s.displayName="DownloadOutlined";var l=r.forwardRef(s)},60419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/expenses/bulk/send",function(){return t(61451)}])},47913:function(e,n,t){"use strict";var a=t(85893),r=t(59876),o=t(67294),i=t(95924);n.Z=function(e){var n=o.useRef(null);return(0,a.jsxs)(i.Z,{mt:"16px",colorScheme:"primary",onClick:function(){return n.current.click()},leftIcon:(0,a.jsx)(r.Uj,{fontSize:"0.9rem",color:"#ffffff"}),children:[e.title||"Upload File",(0,a.jsx)("input",{ref:n,type:"file",accept:e.accept,onChange:function(n){e.onChange&&e.onChange(n),n.target.value=""},style:{width:"100%",display:"none"}})]})}},61451:function(e,n,t){"use strict";t.r(n);var a=t(34051),r=t.n(a),o=t(85893),i=t(7335),s=t(54641),l=t(89154),u=t(23100),c=t(5197),d=t(39849),f=t(204),m=t(33838),p=t(41052),h=t(76684),v=t(78133),b=t(3454),x=t(11163),g=t(82580),y=t(98430),k=t(23430),j=t(47913),C=t(32228),S=t(71511),N=t(76104),w=t.n(N),P=t(32355),D=t(5148),_=t(59876),F=t(22470),O=t(96486),I=t.n(O),B=t(55857),E=t(81747),R=t(67294),M=t(20111),T=t(40827),z=t(35550);function L(e,n,t,a,r,o,i){try{var s=e[o](i),l=s.value}catch(u){return void t(u)}s.done?n(l):Promise.resolve(l).then(a,r)}function V(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function G(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(n){V(e,n,t[n])}))}return e}n.default=function(){var e=(0,x.useRouter)(),n=e.query.freq,t=(0,D.CG)((function(e){return e.settings.profile})).record,a=(0,R.useState)(!1),N=a[0],O=a[1],V=(0,D.CG)(T.Pt),q=(0,R.useMemo)((function(){return null===t||void 0===t?void 0:t.transactionPinSet}),[t]),U=(0,i.q)(),Z=(0,i.q)(),H=(0,C.r8)(E.oo),A=(0,R.useMemo)((function(){return{label:"Subaccounts",value:"",options:V.map((function(e){return{label:null===e||void 0===e?void 0:e.name,value:null===e||void 0===e?void 0:e._id,type:"subaccount"}}))||[]}}),[t,V]),K=(0,R.useMemo)((function(){return[{label:"Business Balance",value:"main"},A]}),[A]),W=(0,R.useMemo)((function(){return[{label:"Other Banks",value:"bank"},{label:"Veend Account",value:"veend"}]}),[]),Y={transferFrom:K[0],transferTo:W[0],naration:"",productDetails:[],name:"",csvFileName:""},Q=(0,g.TA)({initialValues:Y,onSubmit:function(n,a){return(o=r().mark((function o(){var i,s,l,u,c;return r().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!q||!1!==Z.isOpen){r.next=6;break}return Z.onOpen(),r.abrupt("return");case 6:if(!1!==q){r.next=11;break}return U.onOpen(),r.abrupt("return");case 11:Z.onClose();case 12:return l=[],n.productDetails.forEach((function(e){var a=G({},e,{purchaseReference:w()("VEEND-".concat(H,"-")),naration:n.naration,description:e.narration+" - "+n.naration,currency:"NGN",senderName:"".concat(null===t||void 0===t?void 0:t.firstName," ").concat(null===t||void 0===t?void 0:t.lastName),type:"onetime"});l.push(a)})),u=G({},"subaccount"===(null===(i=n.transferFrom)||void 0===i?void 0:i.type)?{account:null===(s=n.transferFrom)||void 0===s?void 0:s.value}:{},{productId:"67693654252a2bc50fbb45df",recipientDetails:l,name:"bank"===n.transferTo.value?"Other banks transfer":"Veend transfer",productCategory:"transfer",description:n.naration}),r.next=17,(0,S.Wj)(u);case 17:"success"===(null===(c=r.sent)||void 0===c?void 0:c.status)&&((0,P.tv)("Processing payment"),a.resetForm(),e.back());case 19:case"end":return r.stop()}}),o)})),function(){var e=this,n=arguments;return new Promise((function(t,a){var r=o.apply(e,n);function i(e){L(r,t,a,i,s,"next",e)}function s(e){L(r,t,a,i,s,"throw",e)}i(void 0)}))})();var o}}),J=Q.values,X=Q.setFieldValue,$=Q.handleSubmit,ee=Q.handleChange,ne=Q.submitForm,te=Q.isSubmitting,ae=(0,R.useMemo)((function(){return"bank"===J.transferTo.value?["firstName","lastName","accountNumber","amount","bankcode","senderName","narration"]:["firstName","lastName","veendEmail","amount","senderName","narration"]}),[J.transferTo]),re=(0,R.useMemo)((function(){return"bank"===J.transferTo.value?[{title:"First Name",dataIndex:"firstName",key:"firstName"},{title:"Last Name",dataIndex:"lastName",key:"firstName"},{title:"Account Number",dataIndex:"accountNumber",key:"accountNumber"}
1,{title:"Amount",dataIndex:"amount",key:"amount"},{title:"Bank Code",dataIndex:"bankcode",key:"bankcode"}]:[{title:"First Name",dataIndex:"firstName",key:"firstName"},{title:"Last Name",dataIndex:"lastName",key:"firstName"},{title:"Veend Email",dataIndex:"veendEmail",key:"veendEmail"},{title:"Amount",dataIndex:"amount",key:"amount"}]}),[J.transferTo]);return(0,R.useEffect)((function(){(0,z.z3)()}),[]),(0,R.useEffect)((function(){X("productDetails",[])}),[J.transferTo]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(b.HJ,{prefix:"Bulk Expenses",path:y.Z5.expenses+"/bulk/send"}),N?(0,o.jsx)(s.U,{children:(0,o.jsx)(l.h,{"aria-label":"back",bg:"white",borderRadius:"full",children:(0,o.jsx)(_.Rp,{onClick:function(){O(!1)},fontSize:"32px"})})}):(0,o.jsx)(b.ln,{text:"Send"}),!N&&(0,o.jsx)("form",{onSubmit:function(e){e.preventDefault(),$()},children:(0,o.jsxs)(u.xu,{maxW:"container.md",mt:"48px",mb:"32px",children:[(0,o.jsx)(b.Vt,{fontSize:"18px",mb:6,children:"Instructions"}),(0,o.jsxs)(c.GS,{children:[(0,o.jsx)(c.HC,{color:"neutral.400",children:"Select the account type you want to make a transfer to"}),(0,o.jsxs)(d.M,{columns:[1,1,2],columnGap:10,children:[(0,o.jsx)(b.Nw,{options:K,onChange:X,id:"transferFrom",placeholder:"",label:"Transfer From",error:!1,value:J.transferFrom,isDisabled:K.length<=1}),(0,o.jsx)(b.Nw,{options:W,onChange:X,id:"transferTo",placeholder:"",label:"Transfer To",error:!1,value:J.transferTo})]}),(0,o.jsx)(c.HC,{color:"neutral.400",mb:"22px",children:(0,o.jsxs)(f.k,{gap:4,align:"center",children:["Download a sample bulk disburse CSV file after selecting the account type.",(0,o.jsx)(m.r,{download:!0,href:"bank"===J.transferTo.value?"/downloadable/bulk_transfer.csv":"/downloadable/bulk_veend_transfer.csv",children:(0,o.jsx)(b.r3,{size:"sm",colorScheme:"primary",rightIcon:(0,o.jsx)(k.Z,{rev:"undefined"}),children:"Download sample"})})]})}),(0,o.jsxs)(c.QI,{children:[(0,o.jsxs)(c.HC,{color:"neutral.400",mb:"22px",maxW:"500px",children:["CSV file should contain the following colums -"," ",ae.map((function(e,n){return n+1!==ae.length?"".concat(e,", "):"".concat(e,".")}))]}),(0,o.jsx)(c.HC,{color:"neutral.400",mb:"22px",maxW:"500px",children:"The order of the columns should be same as the order in which they are listed above with the first row as headers"})]}),(0,o.jsx)(c.HC,{color:"neutral.400",children:"Upload copy of CSV file"}),(0,o.jsx)(j.Z,{title:"Upload CSV File",accept:".csv",onChange:function(e){e.target.files&&e.target.files[0]&&(X("csvFileName",e.target.files?e.target.files[0].name:""),(0,C.ci)(e,(function(e,n){if(!e)return(0,P.ux)("Failed to read CSV file");var t=JSON.parse(n),a=t[0],r=Object.keys(a);if(!I().isEqual(r.sort(),ae.sort()))return F.M.error("Invalid column format.");var o=t.map((function(e){var n=String(null===e||void 0===e?void 0:e.bankcode);return"bank"===J.transferTo.value&&e.bankcode&&(n.length<3?n=n.padStart(3,"0"):n.length>3&&(n=n.padStart(6,"0"))),G({},e,{bankcode:n})}));X("productDetails",o)})))}}),J.productDetails.length>0&&(0,o.jsxs)(s.U,{mt:8,maxW:"450px",children:[(0,o.jsxs)(f.k,{flex:1,gap:4,px:4,py:5,alignItems:"center",justifyContent:"space-between",boxShadow:"0px 0px 20px rgba(6, 0, 137, 0.05)",children:[(0,o.jsx)(b.G2,{color:"nuetral.500",fontSize:"1rem",text:J.csvFileName,wordBreak:"break-all"}),(0,o.jsx)(b.r3,{size:"md",fontSize:"0.8rem",variant:"outline",colorScheme:"primary",onClick:function(){return O(!0)},children:"View"})]}),(0,o.jsx)(u.Cd,{size:"40px",bg:"error.50",onClick:function(){return X("productDetails",[])},cursor:"pointer",children:(0,o.jsx)(_.pJ,{boxSize:"20px",fontSize:"24px",color:"error.700"})})]}),(0,o.jsx)(b.xn,{error:"",label:"Description",name:"naration",onChange:ee,value:J.naration,isRequired:!0}),"recurring"==n&&(0,o.jsxs)(u.xu,{mt:"32px",children:[(0,o.jsx)("label",{style:{fontSize:"1.2rem",color:"900"},htmlFor:"firstName",children:"Label"}),(0,o.jsx)(p.E,{mt:"24px",children:(0,o.jsxs)(h.K,{spacing:"24px",direction:["column","row"],children:[(0,o.jsx)(v.Y,{color:"neutral.500",fontSize:"0.8rem",value:"1",children:"Daily"}),(0,o.jsx)(v.Y,{color:"neutral.500",fontSize:"0.8rem",value:"2",children:"Weekly"}),(0,o.jsx)(v.Y,{color:"neutral.500",fontSize:"0.8rem",value:"3",children:"Monthly"}),(0,o.jsx)(v.Y,{color:"neutral.500",fontSize:"0.8rem",value:"4",children:"Quaterly"}),(0,o.jsx)(v.Y,{color:"neutral.500",fontSize:"0.8rem",value:"5",children:"Yearly"})]})})]}),(0,o.jsxs)(f.k,{mt:"32px",gap:4,flexDirection:["column-reverse","row"],justifyContent:"space-between",children:[(0,o.jsx)(b.r3,{variant:"outline",colorScheme:"primary",onClick:function(){return e.back()},children:"Cancel"}),(0,o.jsx)(b.r3,{colorScheme:"primary",type:"submit",isLoading:te,isDisabled:te||J.productDetails.length<1||!J.naration,children:"Log Expense"})]})]})]})}),N&&(0,o.jsxs)(u.xu,{mt:"48px",children:[(0,o.jsx)(b.Vt,{mb:"16px",title:"List ( ".concat(J.productDetails.length," )")}),(0,o.jsx)(b.Pr,{dataSource:J.productDetails,columns:re})]}),(0,o.jsx)(M.Z,{isOpen:U.isOpen,onClose:U.onClose,onSuccessfulCreation:function(){return ne()}}),(0,o.jsx)(B.Z,{isOpen:Z.isOpen,onClose:Z.onClose,onSuccessfulVerification:function(){return ne()}})]})}},5197:function(e,n,t){"use strict";t.d(n,{DE:function(){return b},GS:function(){return p},HC:function(){return v},QI:function(){return h},aV:function(){return m}});var a=t(56877),r=t(55227),o=t(92495),i=t(35059),s=t(91639),l=t(33
1179),u=t(26848),c=t(85893),[d,f]=(0,r.k)({name:"ListStylesContext",errorMessage:"useListStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<List />\" "}),m=(0,i.G)((function(e,n){const t=(0,s.jC)("List",e),{children:a,styleType:r="none",stylePosition:i,spacing:f,...m}=(0,l.Lr)(e),p=(0,o.W)(a),h=f?{"& > *:not(style) ~ *:not(style)":{mt:f}}:{};return(0,c.jsx)(d,{value:t,children:(0,c.jsx)(u.m.ul,{ref:n,listStyleType:r,listStylePosition:i,role:"list",__css:{...t.container,...h},...m,children:p})})}));m.displayName="List";var p=(0,i.G)(((e,n)=>{const{as:t,...a}=e;return(0,c.jsx)(m,{ref:n,as:"ol",styleType:"decimal",marginStart:"1em",...a})}));p.displayName="OrderedList";var h=(0,i.G)((function(e,n){const{as:t,...a}=e;return(0,c.jsx)(m,{ref:n,as:"ul",styleType:"initial",marginStart:"1em",...a})}));h.displayName="UnorderedList";var v=(0,i.G)((function(e,n){const t=f();return(0,c.jsx)(u.m.li,{ref:n,...e,__css:t.item})}));v.displayName="ListItem";var b=(0,i.G)((function(e,n){const t=f();return(0,c.jsx)(a.J,{ref:n,role:"presentation",...e,__css:t.icon})}));b.displayName="ListIcon"},78133:function(e,n,t){"use strict";t.d(n,{Y:function(){return h}});var a=t(41052),r=t(70654),o=t(25432),i=t(46256),s=t(67294),l={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"};function u(e){e.preventDefault(),e.stopPropagation()}var c=t(35059),d=t(91639),f=t(33179),m=t(26848),p=t(85893);var h=(0,c.G)(((e,n)=>{var t;const c=(0,a.X)(),{onChange:h,value:v}=e,b=(0,d.jC)("Radio",{...c,...e}),x=(0,f.Lr)(e),{spacing:g="0.5rem",children:y,isDisabled:k=(null==c?void 0:c.isDisabled),isFocusable:j=(null==c?void 0:c.isFocusable),inputProps:C,...S}=x;let N=e.isChecked;null!=(null==c?void 0:c.value)&&null!=v&&(N=c.value===v);let w=h;(null==c?void 0:c.onChange)&&null!=v&&(w=(0,o.PP)(c.onChange,h));const P=null!=(t=null==e?void 0:e.name)?t:null==c?void 0:c.name,{getInputProps:D,getCheckboxProps:_,getLabelProps:F,getRootProps:O,htmlProps:I}=function(e={}){const{defaultChecked:n,isChecked:t,isFocusable:c,isDisabled:d,isReadOnly:f,isRequired:m,onChange:p,isInvalid:h,name:v,value:b,id:x,"data-radiogroup":g,"aria-describedby":y,...k}=e,j=`radio-${(0,s.useId)()}`,C=(0,r.NJ)(),S=(0,a.X)();let N=!C||S||g?j:C.id;N=null!=x?x:N;const w=null!=d?d:null==C?void 0:C.isDisabled,P=null!=f?f:null==C?void 0:C.isReadOnly,D=null!=m?m:null==C?void 0:C.isRequired,_=null!=h?h:null==C?void 0:C.isInvalid,[F,O]=(0,s.useState)(!1),[I,B]=(0,s.useState)(!1),[E,R]=(0,s.useState)(!1),[M,T]=(0,s.useState)(!1),[z,L]=(0,s.useState)(Boolean(n)),V="undefined"!==typeof t,G=V?t:z;(0,s.useEffect)((()=>(0,i.BT)(O)),[]);const q=(0,s.useCallback)((e=>{P||w?e.preventDefault():(V||L(e.target.checked),null==p||p(e))}),[V,w,P,p]),U=(0,s.useCallback)((e=>{" "===e.key&&T(!0)}),[T]),Z=(0,s.useCallback)((e=>{" "===e.key&&T(!1)}),[T]),H=(0,s.useCallback)(((e={},n=null)=>({...e,ref:n,"data-active":(0,o.PB)(M),"data-hover":(0,o.PB)(E),"data-disabled":(0,o.PB)(w),"data-invalid":(0,o.PB)(_),"data-checked":(0,o.PB)(G),"data-focus":(0,o.PB)(I),"data-focus-visible":(0,o.PB)(I&&F),"data-readonly":(0,o.PB)(P),"aria-hidden":!0,onMouseDown:(0,o.v0)(e.onMouseDown,(()=>T(!0))),onMouseUp:(0,o.v0)(e.onMouseUp,(()=>T(!1))),onMouseEnter:(0,o.v0)(e.onMouseEnter,(()=>R(!0))),onMouseLeave:(0,o.v0)(e.onMouseLeave,(()=>R(!1)))})),[M,E,w,_,G,I,P,F]),{onFocus:A,onBlur:K}=null!=C?C:{},W=(0,s.useCallback)(((e={},n=null)=>{const t=w&&!c;return{...e,id:N,ref:n,type:"radio",name:v,value:b,onChange:(0,o.v0)(e.onChange,q),onBlur:(0,o.v0)(K,e.onBlur,(()=>B(!1))),onFocus:(0,o.v0)(A,e.onFocus,(()=>B(!0))),onKeyDown:(0,o.v0)(e.onKeyDown,U),onKeyUp:(0,o.v0)(e.onKeyUp,Z),checked:G,disabled:t,readOnly:P,required:D,"aria-invalid":(0,o.Qm)(_),"aria-disabled":(0,o.Qm)(t),"aria-required":(0,o.Qm)(D),"data-readonly":(0,o.PB)(P),"aria-describedby":y,style:l}}),[w,c,N,v,b,q,K,A,U,Z,G,P,D,_,y]);return{state:{isInvalid:_,isFocused:I,isChecked:G,isActive:M,isHovered:E,isDisabled:w,isReadOnly:P,isRequired:D},getCheckboxProps:H,getRadioProps:H,getInputProps:W,getLabelProps:(e={},n=null)=>({...e,ref:n,onMouseDown:(0,o.v0)(e.onMouseDown,u),"data-disabled":(0,o.PB)(w),"data-checked":(0,o.PB)(G),"data-invalid":(0,o.PB)(_)}),getRootProps:(e,n=null)=>({...e,ref:n,"data-disabled":(0,o.PB)(w),"data-checked":(0,o.PB)(G),"data-invalid":(0,o.PB)(_)}),htmlProps:k}}({...S,isChecked:N,isFocusable:j,isDisabled:k,onChange:w,name:P}),[B,E]=function(e,n){const t={},a={};for(const[r,o]of Object.entries(e))n.includes(r)?t[r]=o:a[r]=o;return[t,a]}(I,f.oE),R=_(E),M=D(C,n),T=F(),z=Object.assign({},B,O()),L={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...b.container},V={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...b.control},G={userSelect:"none",marginStart:g,...b.label};return(0,p.jsxs)(m.m.label,{className:"chakra-radio",...z,__css:L,children:[(0,p.jsx)("input",{className:"chakra-radio__input",...M}
1),(0,p.jsx)(m.m.span,{className:"chakra-radio__control",...R,__css:V}),y&&(0,p.jsx)(m.m.span,{className:"chakra-radio__label",...T,__css:G,children:y})]})}));h.displayName="Radio"},41052:function(e,n,t){"use strict";t.d(n,{E:function(){return m},X:function(){return f}});var a=t(25432),r=t(81103),o=t(67294);function i(e={}){const{onChange:n,value:t,defaultValue:i,name:s,isDisabled:l,isFocusable:u,isNative:c,...d}=e,[f,m]=(0,o.useState)(i||""),p="undefined"!==typeof t,h=p?t:f,v=(0,o.useRef)(null),b=(0,o.useCallback)((()=>{const e=v.current;if(!e)return;let n="input:not(:disabled):checked";const t=e.querySelector(n);if(t)return void t.focus();n="input:not(:disabled)";const a=e.querySelector(n);null==a||a.focus()}),[]),x=(0,o.useId)(),g=s||`radio-${x}`,y=(0,o.useCallback)((e=>{const t=function(e){return e&&(0,a.Kn)(e)&&(0,a.Kn)(e.target)}(e)?e.target.value:e;p||m(t),null==n||n(String(t))}),[n,p]);return{getRootProps:(0,o.useCallback)(((e={},n=null)=>({...e,ref:(0,r.lq)(n,v),role:"radiogroup"})),[]),getRadioProps:(0,o.useCallback)(((e={},n=null)=>{const t=c?"checked":"isChecked";return{...e,ref:n,name:g,[t]:null!=h?e.value===h:void 0,onChange(e){y(e)},"data-radiogroup":!0}}),[c,g,y,h]),name:g,ref:v,focus:b,setValue:m,value:h,onChange:y,isDisabled:l,isFocusable:u,htmlProps:d}}var s=t(35059),l=t(26848),u=t(55227),c=t(85893),[d,f]=(0,u.k)({name:"RadioGroupContext",strict:!1}),m=(0,s.G)(((e,n)=>{const{colorScheme:t,size:r,variant:s,children:u,className:f,isDisabled:m,isFocusable:p,...h}=e,{value:v,onChange:b,getRootProps:x,name:g,htmlProps:y}=i(h),k=(0,o.useMemo)((()=>({name:g,size:r,onChange:b,colorScheme:t,value:v,variant:s,isDisabled:m,isFocusable:p})),[g,r,b,t,v,s,m,p]);return(0,c.jsx)(d,{value:k,children:(0,c.jsx)(l.m.div,{...x(y,n),className:(0,a.cx)("chakra-radio-group",f),children:u})})}));m.displayName="RadioGroup"}},function(e){e.O(0,[5857,9774,2888,179],(function(){return n=60419,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.