PageSourceSearch

https://assets-netstorage.groww.in/web-assets/billion_groww_deskto…/[isin]/add-transaction-cd1850eaadc936e6.js

js groww.in collected 2026-10-01 10:43:26 UTC 13,069 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="1d8ed106-3faf-421a-a2e5-46a8c9d4fd32",e._sentryDebugIdIdentifier="sentry-dbid-1d8ed106-3faf-421a-a2e5-46a8c9d4fd32")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[35889],{261901:(e,l,n)=>{"use strict";n.d(l,{DH:()=>d,ZY:()=>c,bm:()=>g,bx:()=>o,qy:()=>T,xS:()=>s,yL:()=>y});var i=n(951402),a=n(789991),t=n(424766),r=n(306796),u=n(908065);let o="--",d=e=>{let{holdings:l}=e;return l.map(e=>{var l,n,a,t,u,o,d,s,c,v,y,p,g,T,m;let{symbolData:R,holdingDetail:b,bondDetails:A,activeDematTransferQty:f}=e,E=b.holdingQty,L=b.holdingAveragePrice;return{symbolIsin:null!==(l=R.symbolIsin)&&void 0!==l?l:"",name:null!==(n=R.name)&&void 0!==n?n:"",maturityDate:null!==(a=null==A?void 0:A.maturityDate)&&void 0!==a?a:null,interestPayoutType:(null==A?void 0:A.interestPayoutType)?(0,r.H3)(A.interestPayoutType,r.aS):null,principalPayoutType:(null==A?void 0:A.principalPayoutType)?(0,r.H3)(A.principalPayoutType,r.qp):null,searchId:null!==(t=R.searchId)&&void 0!==t?t:"",scripCode:R.nseScripCode||R.bseScripCode||"",nseTradingSymbol:null!==(u=R.nseTradingSymbol)&&void 0!==u?u:"",bseTradingSymbol:null!==(o=R.bseTradingSymbol)&&void 0!==o?o:"",instrumentType:R.instrumentType,logoUrl:null!==(d=R.logoUrl)&&void 0!==d?d:"",isRfqEnabled:null!==(s=R.isRfqEnabled)&&void 0!==s&&s,isNseTradable:null!==(c=R.isNseTradable)&&void 0!==c&&c,isBseTradable:null!==(v=R.isBseTradable)&&void 0!==v&&v,validPayout:null===(y=null==A?void 0:A.isPayoutValid)||void 0===y||y,values:{totalUnits:null!=E?E:null,averagePrice:null!=L?L:null,investedValue:(0,i.a)(E)||(0,i.a)(L)?null:E*L,interestReceived:null!==(p=null==A?void 0:A.interestCredited)&&void 0!==p?p:null,principalReceived:null!==(g=null==A?void 0:A.principalReturned)&&void 0!==g?g:null,principalRemaining:null!==(T=null==A?void 0:A.principalRemaining)&&void 0!==T?T:null,interestRemaining:null!==(m=null==A?void 0:A.interestRemaining)&&void 0!==m?m:null,activeDematTransferQty:null!=f?f:0}}})},s=function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return l.reduce((e,l)=>null==l?e:(null!=e?e:0)+l,null)},c=(e,l)=>{let n=null,i=null,a=null,t=!1;for(let r of e){let{values:e,validPayout:u}=r;(!l||u)&&(t=!0,n=s(n,e.investedValue),i=s(i,e.interestRemaining,e.principalRemaining),a=s(a,e.interestReceived,e.principalReceived))}let r=s(i,a);return{investedValue:n,upcomingValue:i,receivedValue:a,totalMaturityValue:r,hasValidPayoutHolding:t}},v=(e,l)=>(0,i.a)(e)||!l.ignorePayoutValidity&&l.holdingSummaryEnabled&&l.invalidPayout,y=(e,l,n)=>v(e,l)?o:(0,a.a)(null!=e?e:0,{...t.m,...n}),p=e=>null===e?o:(0,a.a)(Math.floor(e),{...t.g,...t.m}),g=e=>({investedValue:p(e.investedValue),upcomingValue:p(e.upcomingValue),receivedValue:p(e.receivedValue),totalMaturityValue:p(e.totalMaturityValue)}),T=(e,l,n)=>e.toSorted((e,i)=>{var a,t,r,o,d,s,c,v,y,p;let g=0;return g=l===u.R.bondName?e.name.localeCompare(i.name):l===u.R.upcomingValue?(null!==(a=e.values.interestRemaining)&&void 0!==a?a:0)+(null!==(t=e.values.principalRemaining)&&void 0!==t?t:0)-((null!==(r=i.values.interestRemaining)&&void 0!==r?r:0)+(null!==(o=i.values.principalRemaining)&&void 0!==o?o:0)):l===u.R.receivedValue?(null!==(d=e.values.interestReceived)&&void 0!==d?d:0)+(null!==(s=e.values.principalReceived)&&void 0!==s?s:0)-((null!==(c=i.values.interestReceived)&&void 0!==c?c:0)+(null!==(v=i.values.principalReceived)&&void 0!==v?v:0)):(null!==(y=e.values.investedValue)&&void 0!==y?y:0)-(null!==(p=i.values.investedValue)&&void 0!==p?p:0),n?g:-g})},306796:(e,l,n)=>{"use strict";n.d(l,{H3:()=>d,Re:()=>t,VJ:()=>s,aS:()=>u,k$:()=>r,qp:()=>o});var i=n(853215),a=n(347604);function t(e){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(e);return l?"".concat(n.getDate()," ").concat(n.toLocaleString("default",{month:"short"})):"".concat(n.getDate()," ").concat(n.toLocaleString("default",{month:"short"}),", ").concat(n.getFullYear())}function r(e){let l=Math.floor(e/12),n=e%12;return 0!==l&&0!==n?"".concat(l,"y ").concat(n,"m"):0===l?"".concat(n,"m"):"".concat(l,"y")}function u(e){switch(e){case a.$.CUMULATIVE:return"Cumulative";case a.$.MONTHLY:return"Monthly";
1case a.$.QUARTERLY:return"Quarterly";case a.$.ANNUALLY:return"Annually";case a.$.HALF_YEARLY:return"Half-Yearly";default:return e?(0,i.e)(e.toLowerCase()):""}}function o(e){switch(e){case a.l.MATURITY:return"Maturity";case a.l.CUMULATIVE:return"Cumulative";case a.l.MONTHLY:return"Monthly";case a.l.QUARTERLY:return"Quarterly";case a.l.ANNUALLY:return"Annually";case a.l.HALF_YEARLY:return"Half-Yearly";default:return e?(0,i.e)(e.toLowerCase()):""}}let d=(e,l)=>e===a.$.ANNUALLY?"Annual":l(e),s=e=>[a.l.MONTHLY,a.l.QUARTERLY,a.l.HALF_YEARLY,a.l.ANNUALLY].includes(e)},319658:(e,l,n)=>{"use strict";n.r(l),n.d(l,{default:()=>N});var i=n(986594),a=n(407178),t=n(368725),r=n(165766),u=n(109063),o=n(765117),d=n(1678),s=n(615836),c=n(43430),v=n(108478),y=n(771646),p=n(209254),g=n(471165),T=n(211670),m=n(624857),R=n(137265),b=n(683770);let A=(e,l,n)=>{let[i,t]=(0,a.useState)(!1),r=()=>{t(e=>!e)},u=(0,c.V$)(m.y,{onSuccess:()=>{r(),T.t.success({title:y.ZJ.SUCCESS.TITLE,description:y.ZJ.SUCCESS.SUBTITLE}),n()},onError:e=>{r(),console.error(e),T.t.error({title:y.ZJ.ERROR.TITLE,description:y.ZJ.ERROR.SUBTITLE})}});return{showConfirmPopup:i,toggleConfirmPopup:r,addTransactionsApi:u,onConfirmClick:()=>{(0,p.s)(b.A.Bonds,R.A.AddTransactionsConfirmClick);let n=l.filter(e=>null!==e.buyDate).map(e=>{let{buyDate:l,avgPrice:n,sharesQty:i}=e;return{buyDate:(0,g.b)(l,y.DX),qty:Number(i),price:Number(n)}});u.execute(e,n)}}};var f=n(951402),E=n(977468);let L=e=>{let[l,n]=(0,a.useState)([{...y.iX,uniqueId:Math.random()}]),i=l.reduce((e,l)=>{var n;return e-Number(null!==(n=l.sharesQty)&&void 0!==n?n:0)},e),t=(e,l)=>{(0,f.a)(l)?n(l=>l.filter(l=>l.uniqueId!==e)):n(n=>n.map(n=>n.uniqueId===e?{...l}:n))},r=async(e,l)=>{let{buyDate:n}=e;if((null==n?void 0:n.getFullYear())>2021){let i,a=(0,g.b)(n,y.DX);try{await (0,m.p)(a),i={...e,buyDateValidationMssg:""}}catch(l){i={...e,buyDateValidationMssg:y.eX.INVALID_BUYDATE}}t(l,i)}};return{txnList:l,remainingQty:i,addNewTransaction:()=>{n(e=>[...e,{...y.iX,uniqueId:Math.random()}])},handleTransactionChange:(e,l,n)=>{let i=(0,f.a)(l)?{}:(0,E.Fm)(l);t(e,i),n&&r(i,e)}}},Y=e=>{var l,n,i,a,r;let{dematTransferQty:u,onSuccessNavigateBack:o}=e,d=(0,t.useRouter)().query.isin,{result:s}=(0,c.Yb)(()=>d?(0,v.getHoldingTransactionBySymbol)(d,0,y.vT):Promise.resolve(null),[d]),p=null!==(r=null==s?void 0:null===(a=s.data)||void 0===a?void 0:null===(i=a.data)||void 0===i?void 0:null===(n=i.transactions)||void 0===n?void 0:null===(l=n[0])||void 0===l?void 0:l.tradeDate)&&void 0!==r?r:new Date,{txnList:g,remainingQty:T,addNewTransaction:m,handleTransactionChange:R}=L(u),{showConfirmPopup:b,toggleConfirmPopup:f,addTransactionsApi:E,onConfirmClick:Y}=A(d,g,o);return{remainingQty:T,txnList:g,addNewTransaction:m,handleTransactionChange:R,toggleConfirmPopup:f,onConfirmClick:Y,dematTransferDate:p,showConfirmPopup:b,addTransactionsApi:E}};var h=n(631764),S=n.n(h);let N=()=>{var e;let l=(0,t.useRouter)(),n=null!==(e=l.query.isin)&&void 0!==e?e:"",[c,v]=(0,a.useState)(null);(0,a.useEffect)(()=>{n&&(0,s._)(n).then(e=>{var i,a,t;let r=null!==(t=null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(i=a.holding)||void 0===i?void 0:i.activeDematTransferQty)&&void 0!==t?t:0;if(r<=0){l.replace((0,u.CY2)(n));return}v(r)}).catch(()=>{l.replace((0,u.CY2)(n))})},[n]);let y=()=>{n?l.push((0,u.CY2)(n)):l.back()},{txnList:p,addNewTransaction:g,handleTransactionChange:T,toggleConfirmPopup:m,onConfirmClick:R,showConfirmPopup:b,addTransactionsApi:A,dematTransferDate:f,remainingQty:E}=Y({dematTransferQty:null!=c?c:0,onSuccessNavigateBack:()=>{y()}});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.G,{text:"Back to Holding details",handleOnClick:y}),(0,i.jsx)("div",{className:"web-align",children:(0,i.jsxs)("div",{className:"layout-container flex flex-column ".concat(S().pageContainer),children:[(0,i.jsxs)("div",{className:"flex flex-column ".concat(S().pageHeading),children:[(0,i.jsx)("span",{className:"headingLarge contentPrimary",children:"Add transactions"}),null!==c&&(0,i.jsx)("span",{className:"bodyBase contentSecondary",children:"Add buy price & date for ".concat(Math.max(E,0),"/").concat(c," qty to see accurate returns and avg price.")})]}),null!==c&&(0,i.jsx)(o.A,{txnList:p,addNewTransaction:g,handleTransactionChange:T,toggleConfirmPopup:m,dematTransferQty:c,dematTransferDate:f})]})}),(0,i.jsx)(d.A,{toggleConfirmPopup:m,onConfirmClick:R,isPopupVisible:b,isRequestLoading:A.loading})]})}},347604:(e,l,n)=>{"use strict";n.d(l,{$:()=>i,l:()=>a});var i=function(e){return e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.ANNUALLY="ANNUALLY",e.CUMULATIVE="CUMULATIVE",e.HALF_YEARLY="HALF_YEARLY",e}({}),a=function(e){return e.MONTHLY="MONTHLY",e.QUARTERLY="QUARTERLY",e.ANNUALLY="ANNUALLY",e.MATURITY="MATURITY",e.CUMULATIVE="CUMULATIVE",e.HALF_YEARLY="HALF_YEARLY",e}({})},358961:(e,l,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/bonds/holdings/[isin]/add-transaction",function(){return n(319658)}])},615836:(e,l,n)=>{"use strict";n.d(l,{_:()=>a});var i=n(271703);let a=e=>i.SP.get("".concat("/v2/api/stocks/holdings/bonds","/").concat(e))},631764:e=>{e.exports={pageContainer:"addTransactionPage_pageContainer__ErFCM",pageHeading:"addTransactionPage_pageHeading__OMRTQ"}},771646:(e,l,n)=>{"use strict";n.d(l,{DX:()=>u,ZJ:()=>t,eX:()=>a,iX:()=>i,vT:()=>r});let i={buyDate:null,sharesQty:"",avgPrice:"",totalValue:"--",basicValidationMssg:"",buyDateValidationMssg:""},a={EMPTY_SHARES:"Please enter qty",EMPTY_PRICE:"Please enter avg. price",EMPTY_BUYDATE:"Please enter buy date",ZERO_SHARES:"Qty cannot be zero",INVALID_BUYDATE:"Buy date cannot be a trade holiday"}
1,t={SUCCESS:{TITLE:"Request confirmed",SUBTITLE:"Transactions will reflect within 2-3 working days"},ERROR:{TITLE:"Request failed",SUBTITLE:"Something went wrong"}},r="ACTIVE_DEMAT_TRANSFER",u="YYYY-MM-DD"},908065:(e,l,n)=>{"use strict";n.d(l,{R:()=>i});let i={bondName:"bondName",investedValue:"investedValue",upcomingValue:"upcomingValue",receivedValue:"receivedValue"}},977468:(e,l,n)=>{"use strict";n.d(l,{Fm:()=>c,YI:()=>o,ph:()=>s,te:()=>d});var i=n(569443),a=n.n(i),t=n(951402),r=n(261901),u=n(771646);let o=e=>a()(e).format("DD MMM 'YY"),d=()=>{var e;return null!==(e=(0,t.i)(window.location.href))&&void 0!==e?e:""},s=e=>{var l,n,i,a,u,o,d,s,c,v,y,p,g,T,m,R,b,A,f,E,L,Y,h,S,N;let{symbolData:C,holdingDetail:U,bondDetails:P,activeDematTransferQty:M}=e;return{bondName:null!==(l=C.name)&&void 0!==l?l:"",symbolIsin:null!==(n=C.symbolIsin)&&void 0!==n?n:"",gsin:null!==(i=C.gsin)&&void 0!==i?i:"",searchId:null!==(a=C.searchId)&&void 0!==a?a:"",instrumentType:null!==(u=C.instrumentType)&&void 0!==u?u:"",logoUrl:null!==(o=C.logoUrl)&&void 0!==o?o:null,nseScripCode:null!==(d=C.nseScripCode)&&void 0!==d?d:null,bseScripCode:null!==(s=C.bseScripCode)&&void 0!==s?s:null,nseTradingSymbol:null!==(c=C.nseTradingSymbol)&&void 0!==c?c:null,bseTradingSymbols:null!==(v=C.bseTradingSymbol)&&void 0!==v?v:null,isRfqEnabled:null!==(y=C.isRfqEnabled)&&void 0!==y&&y,isNseTradable:null!==(p=C.isNseTradable)&&void 0!==p&&p,isBseTradable:null!==(g=C.isBseTradable)&&void 0!==g&&g,validPayout:null===(T=null==P?void 0:P.isPayoutValid)||void 0===T||T,totalUnits:null!==(m=null==U?void 0:U.holdingQty)&&void 0!==m?m:0,averagePrice:null!==(R=null==U?void 0:U.holdingAveragePrice)&&void 0!==R?R:0,investedAmount:(0,t.a)(null==U?void 0:U.holdingQty)||(0,t.a)(null==U?void 0:U.holdingAveragePrice)?null:(null!==(b=null==U?void 0:U.holdingQty)&&void 0!==b?b:0)*(null!==(A=null==U?void 0:U.holdingAveragePrice)&&void 0!==A?A:0),maturityValue:(0,r.xS)(null==P?void 0:P.interestCredited,null==P?void 0:P.interestRemaining,null==P?void 0:P.principalReturned,null==P?void 0:P.principalRemaining),interestReceived:null!==(f=null==P?void 0:P.interestCredited)&&void 0!==f?f:null,upcomingInterest:null!==(E=null==P?void 0:P.interestRemaining)&&void 0!==E?E:null,principalReceived:null!==(L=null==P?void 0:P.principalReturned)&&void 0!==L?L:null,upcomingPrincipal:null!==(Y=null==P?void 0:P.principalRemaining)&&void 0!==Y?Y:null,maturityDate:null!==(h=null==P?void 0:P.maturityDate)&&void 0!==h?h:null,interestPayoutType:null!==(S=null==P?void 0:P.interestPayoutType)&&void 0!==S?S:null,principalPayoutType:null!==(N=null==P?void 0:P.principalPayoutType)&&void 0!==N?N:null,activeDematTransferQty:null!=M?M:0}},c=e=>{let{buyDate:l,sharesQty:n,avgPrice:i}=e,a="";switch(!0){case null===l:a=u.eX.EMPTY_BUYDATE;break;case(0,t.a)(n):a=u.eX.EMPTY_SHARES;break;case 0===Number(n):a=u.eX.ZERO_SHARES;break;case(0,t.a)(i):a=u.eX.EMPTY_PRICE}return{...e,basicValidationMssg:a}}}},e=>{var l=l=>e(e.s=l);e.O(0,[71925,58875,8478,74732,64560,90636,46593,38792],()=>l(358961)),_N_E=e.O()}]);

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.