PageSourceSearch

https://at4all.com/_next/static/chunks/pages/loan/openendedloancancel-7ce3f883170bf6bd.js

js at4all.com collected 2026-09-24 12:12:06 UTC 17,813 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3787],{48060:(e,n,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/loan/openendedloancancel",function(){return a(66813)}])},53895:(e,n,a)=>{"use strict";a.r(n),a.d(n,{GET_OPEN_ENDED_LOAN:()=>E,GET_OPEN_ENDED_SURVEY:()=>v,default:()=>f});var t=a(28888),r=a(37876),s=a(86191),i=a(31167),d=a(14232),l=a(98949),c=a(89099),o=a.n(c),m=a(48230),p=a.n(m),u=a(71534),h=a(63200),x=a(72631);a(83511);var I=a(73678),N=a(74920),j=a(73333);function D(){let e=(0,t._)(["\n  query GET_OPEN_ENDED_SURVEY(\n    $Id:Int\n  ){reuseSurvey(Id:$Id){\n        ID\n        TransactionIds\n        BenefitAreaId\n        BenefitAreaName\n        PerformanceOutcomeId\n        PerformanceOutcomeName\n        SatisfactionLevelId\n        SatisfactionLevelName\n  }\n  }"]);return D=function(){return e},e}function g(){let e=(0,t._)(["\n  query GET_OPEN_ENDED_LOAN($id:Int)\n  {transaction(id:$id)\n    {\n      TransactionID\n      DateCompleted\n      ItemID\n      ItemName\n      ClosedStatusID\n      ClosedStatus\n      SellingPrice\n      PersonTypeID\n      OpenEndedLoanCheckInDate\n      OpenEndedLoanEmailNotice\n      RecipientPersonID\n      RecipientName\n      Cancelled\n      Comments\n      FacilitatorAccountID\n      ManagerNotes\n      ProgramID\n      ProgramName\n      OwnerID\n      OwnerName\n      RemovedBy\n      ReuseSurveyId\n  }\n  }\n"]);return g=function(){return e},e}let v=(0,s.J1)(D()),E=(0,s.J1)(g()),S=e=>{let{loading:n,error:a,data:t}=(0,i.I)(v,{variables:{Id:parseInt(e.SurveyID)}});return n?(0,r.jsx)(u.A,{}):a?(0,r.jsx)(h.ErrorText,{children:a.message}):(0,r.jsx)(x.Z,{header:(0,r.jsx)("h2",{children:(e=>"Survey Information: (for this item"+(e>1?" and "+(e-1).toString()+" other items )":")"))(t.reuseSurvey.TransactionIds.split(",").length)}),className:"panel-padding",children:(0,r.jsxs)("div",{className:"p-grid",children:[(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Benefit Area:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:null!=t.reuseSurvey.BenefitAreaName?t.reuseSurvey.BenefitAreaName:"Not Specified"})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Loan Outcome:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:t.reuseSurvey.PerformanceOutcomeName})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Satisfaction Level:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:t.reuseSurvey.SatisfactionLevelName})})]})})},O=e=>{let n=(0,d.useContext)(I.A);if(!n)return(0,r.jsx)(h.ErrorText,{children:"Access Denied"});let{loading:a,error:t,data:s}=(0,i.I)(E,{variables:{id:parseInt(e.query.id)}});if(a)return(0,r.jsx)(u.A,{});if(t)return(0,r.jsx)(h.ErrorText,{children:t.message});let{editAuthorization:c,errorMessage:m}=(0,j.permissionToManageLoan)(n,s.transaction.ProgramID);return c?(0,r.jsx)("div",{className:"p-fluid",children:(0,r.jsx)("div",{className:"p-grid",children:(0,r.jsx)("div",{className:"p-col-12",children:(0,r.jsxs)("div",{className:"card card-w-title p-card",children:[(0,r.jsxs)(h.Title,{children:["Open-Ended Loan Details",new Date(s.transaction.OpenEndedLoanCheckInDate)>new Date("9999/12/30")&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.$,{type:"submit",label:"Check In Item",icon:"pi pi-check",style:{marginLeft:"10px",verticalAlign:"Top",width:"130px"},onClick:()=>{o().push({pathname:"/loan/openendedloancheckin",query:{id:s.transaction.TransactionID}})},autoFocus:!0}),(0,r.jsx)(N.A,{label:"Print Agreement With Comments",icon:"pi pi-trash",style:{marginLeft:"10px",verticalAlign:"Top"},reportName:"LTOpenEnded20",parameters:[{Prompt:"ReuseSurveyId",value:s.transaction.ReuseSurveyId.toString()}]}),(0,r.jsx)(l.$,{type:"submit",label:"Cancel Loan",icon:"pi pi-trash",style:{marginLeft:"10px",verticalAlign:"Top",width:"130px"},onClick:()=>{o().push({pathname:"/loan/openendedloancancel",query:{id:s.transaction.TransactionID}})}})]}),s.transaction.OpenEndedLoanCheckInDate<new Date("9999/12/30")&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.$,{type:"submit",label:"Print Return Receipt",icon:"pi pi-print",style:{marginLeft:"20px",verticalAlign:"Top",width:"170px"}}),(0,r.jsx)(l.$,{type:"submit",label:"Cancel Loan",icon:"pi pi-trash",style:{marginLeft:"10px",verticalAlign:"Top",width:"130px"},onClick:()=>{o().push({pathname:"/loan/loancancel",query:{id:s.transaction.TransactionID}})}})]})]}),(0,r.jsx)(x.Z,{header:(0,r.jsx)("h2",{children:"Loan Information"}),className:"panel-padding",children:(0,r.jsxs)("div",{className:"p-grid",children:[(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Item:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)(p(),{href:{pathname:"/item/itemdetails",query:{id:s.transaction.ItemID}},prefetch:!1,children:(0,r.jsx)("strong",{children:s.transaction.ItemName})})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Loan Recipient:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)(p(),{href:{pathname:"/user/userdetails",query:{id:s.transaction.RecipientPersonID}},prefetch:!1,children:(0,r.jsx)("strong",{children:s.transaction.RecipientName})})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Loan Status:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:s.transaction.ClosedStatus})}),s.transaction.OpenEndedLoanCheckInDate>new Date("9999/12/30")&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Loan Date:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:new Date(s.transaction.DateCompleted).toLocaleDateString()})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Email Notice:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:new Date(s.transactions.OpenEndedLoanEmailReminderDate).toLocaleDateString()})})]}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Loan Comments:"}),(0,r.jsxs)("div",{className:"p-col-12 p-md-10",children:["Feedback for the following questions.",(0,r.jsxs)("ul",{children:[(0,r.jsx)("li",{children:"How will this piece of AT help you or the person who used the device?"}),(0,r.jsx)("li",{children:"Why is this device important you or the person(s) who will use it?"})]}),(0,r.jsx)("strong",{children:s.transaction.Comments?s.transaction.Comments:"No Comments"})]}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:"Manager Notes:"}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)("strong",{children:s.transaction.ManagerNotes?s.transaction.ManagerNotes:"No Notes"})})]})}),(0,r.jsx)(S,{SurveyID:s.transaction.ReuseSurveyId,Loan:s.transactions})]})})})}):(0,r.jsx)(h.ErrorText,{children:m})};O.getInitialProps=e=>({query:e.query});let f=O},66813:(e,n,a)=>{"use strict";a.r(n),a.d(n,{default:()=>O});var t=a(28888),r=a(37876),s=a(86191),i=a(31167),d=a(64177),l=a(14232),c=a(89099),o=a.n(c);a(48230);var m=a(98949),p=a(99931),u=a(71534),h=a(63200),x=a(83511),I=a(73678),N=a(73333),j=a(53895),D=a(99188);function g(){let e=(0,t._)(["\n  mutation CANCEL_OPENENDED_LOAN($transactionIds: [Int]) {\n    cancelOpenEndedLoan(transactionIds: $transactionIds)\n  }\n"]);return g=function(){return e},e}let v=(0,s.J1)(g()),E=e=>{let[n,a]=(0,l.useState)(e.selectedItems),t=t=>{t.target.checked&&-1===n.indexOf(t.target.value)&&n.push(t.target.value),t.target.checked||-1==n.indexOf(t.target.value)||n.splice(n.indexOf(t.target.value),1),a(n),e.onChange(n)},{loading:s,error:d,data:c}=(0,i.I)(D.OPEN_ENDED_LOANS_QUERY,{variables:{surveyId:e.surveyId}});if(s)return(0,r.jsx)(u.A,{});if(d)return(0,r.jsx)(h.ErrorText,{children:d.message});let o=c.transactions.filter(n=>n.TransactionID!=e.TransactionID);return(0,r.jsx)("div",{children:0==o.length?"--No other items were given as open-ended loans.":o.map(e=>(0,r.jsxs)("div",{className:"p-col-12",children:[(0,r.jsx)(p.S,{value:e.TransactionID,inputId:"transaction"+e.TransactionID.toString(),checked:n.includes(e.TransactionID),onChange:t},e.TransactionID),(0,r.jsx)("label",{htmlFor:"loan"+e.TransactionID.toString(),className:"p-checkbox-label cursor-pointer",children:e.ItemName})]}))})},S=e=>{let n=(0,l.useContext)(I.A),[a,t]=(0,l.useState)(!1),[s,c]=(0,l.useState)([parseInt(e.query.id)]),[g,{resultsloading:S,resultserror:O}]=(0,d.n)(v,{update(e,n){let{data:{cancelLoan:a}}=n;o().push({pathname:"/loan/openendedloans"})}});if(!n)return(0,r.jsx)(h.ErrorText,{children:"Access Denied"});let{loading:f,error:y,data:L}=(0,i.I)(j.GET_OPEN_ENDED_LOAN,{variables:{id:parseInt(e.query.id)}});if(f)return(0,r.jsx)(u.A,{});if(y)return(0,r.jsx)(h.ErrorText,{children:y.message});let{editAuthorization:_,errorMessage:C}=(0,N.permissionToManageLoan)(n,L.transaction.ProgramID);return _?(0,r.jsx)("div",{className:"p-col-12",children:(0,r.jsxs)("div",{className:"p-grid card p-card",children:[(0,r.jsx)("div",{className:"p-col-12",children:(0,r.jsx)(h.Title,{children:"Open-Ended Loan Details"})}),(0,r.jsxs)("div",{className:"p-col-12",children:[(0,r.jsx)(x.A,{children:L.transaction.ItemID}),(0,r.jsx)(h.Title,{children:L.transaction.ItemName}),(0,r.jsx)("label",{children:"Loan Recipient"}),(0,r.jsx)("div",{children:(0,r.jsx)("strong",{children:L.transaction.RecipientName})})]}),(0,r.jsxs)("div",{className:"p-col-12 p-md-6 p-lg-3",children:[(0,r.jsx)("label",{children:"Other Items in this Open-Ended Loan"}),(0,r.jsx)("div",{children:(0,r.jsx)(E,{surveyId:L.transaction.ReuseSurveyId,TransactionID:L.transaction.TransactionID,onChange:e=>{c(e)},loan:L.transaction,selectedItems:s})})]}),(0,r.jsxs)("div",{className:"p-col-12",children:[(0,r.jsx)(p.S,{onChange:e=>{t(!a)},checked:a,inputId:"confirm",autoFocus:!0}),(0,r.jsx)("label",{htmlFor:"confirm",children:s.length>1?" Yes, I want to cancel all checked items for this loan.":" Yes, I want to cancel the item loan."}),a&&(0,r.jsx)("div",{className:"p-col-12",children:(0,r.jsx)(m.$,{type:"submit",label:"Cancel Loaned Item(s)",onClick:()=>{let n=JSON.parse(localStorage.getItem("OPEN_ENDED_LOANS_VARIABLES"))||{},a=JSON.parse(localStorage.getItem("OPEN_ENDED_STATUS_VARIABLES"))||{};g({variables:{transactionIds:s},refetchQueries:[{query:j.GET_OPEN_ENDED_LOAN,variables:{id:parseInt(e.query.loanId)}},{query:D.OPEN_ENDED_LOANS_QUERY,variables:n},{query:D.OPEN_ENDED_LOAN_STATUS_COUNT,variables:a}]})}})})]})]})}):(0,r.jsx)(h.ErrorText,{children:C})};
1S.getInitialProps=e=>({query:e.query});let O=S},99188:(e,n,a)=>{"use strict";a.r(n),a.d(n,{OPEN_ENDED_LOANS_QUERY:()=>v,OPEN_ENDED_LOAN_STATUS_COUNT:()=>E,default:()=>C});var t=a(28888),r=a(37876),s=a(86191),i=a(31167),d=a(14232),l=a(98949),c=a(37147);a(89099);var o=a(71534),m=a(5967),p=a(73678),u=a(71931),h=a(60357);a(95183);var x=a(48230),I=a.n(x);function N(){let e=(0,t._)(["\nquery OPEN_ENDED_LOANS_QUERY(\n  $RecipientPersonID: Int,\n  $FacilitatorAccountID: Int,\n  $status: ReuseStatus,\n  $DateCompletedStart: DateTime,\n  $DateCompletedEnd: DateTime,\n  $programId: Int,\n  $sortOption: ReuseSort,\n  $surveyId: Int,\n  $searchPhrase: String) {\n  transactions(\n      RecipientPersonID: $RecipientPersonID,\n      FacilitatorAccountID: $FacilitatorAccountID,\n      status: $status,\n      sortOption: $sortOption,\n      programId: $programId,\n      DateCompletedStart: $DateCompletedStart,\n      DateCompletedEnd: $DateCompletedEnd,\n      surveyId:$surveyId,\n      searchPhrase:$searchPhrase\n         ) {\n      TransactionID\n      DateCompleted\n      ItemID\n      ItemName\n      ClosedStatusID\n      ClosedStatus\n      SellingPrice\n      PersonTypeID\n      OpenEndedLoanCheckInDate\n      OpenEndedLoanEmailNotice\n      RecipientPersonID\n      RecipientName\n      Cancelled\n      Comments\n      FacilitatorAccountID\n      VTVRDataID\n      ManagerNotes\n      ProgramID\n      ProgramName\n      OwnerID\n      OwnerName\n      RemovedBy\n      ReuseSurveyId\n  }\n}\n"]);return N=function(){return e},e}function j(){let e=(0,t._)(["\n  query OPEN_ENDED_LOAN_STATUS_COUNT($programId: Int){\n    getOpenEndedLoanStatusCount(programId:$programId){\n      StatusName\n      ItemCount\n    }\n  }\n"]);return j=function(){return e},e}let{Title:D,ErrorText:g}=a(63200),v=(0,s.J1)(N()),E=(0,s.J1)(j()),S=(e,n)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(I(),{prefetch:!1,href:{pathname:"/item/itemdetails",query:{id:e.ItemID}},children:[(0,r.jsx)("strong",{children:e.ItemName}),"(",e.ItemID,")"]}),(0,r.jsxs)("div",{children:["To:",(0,r.jsx)(I(),{prefetch:!1,href:{pathname:"/user/userdetails",query:{id:e.RecipientPersonID}},children:e.RecipientName})]})]}),O=(e,n)=>(0,r.jsxs)("div",{children:[new Date(e.DateCompleted).toLocaleDateString(),(0,r.jsxs)("div",{children:[e.FacilitatorAccountId>0&&"by: ",(0,r.jsx)(I(),{prefetch:!1,href:{pathname:"/user/userdetails",query:{id:e.FacilitatorAccountID}},children:e.RemovedBy})]}),(0,r.jsx)("div",{style:{backgroundColor:"yellow"},children:e.ManagerNotes})]}),f=(e,n)=>(0,r.jsx)("div",{children:e.OpenEndedLoanCheckInDate&&new Date(e.OpenEndedLoanCheckInDate).toLocaleDateString()}),y=(e,n)=>(0,r.jsxs)("div",{style:{lineHeight:"22px"},children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)(I(),{href:{pathname:"/loan/openendedloandetails",query:{id:e.TransactionID}},prefetch:!1,children:[(0,r.jsx)("i",{className:"fa fa-print","aria-hidden":!0,children:"\xa0"}),"Print Forms"]}),"  "]}),new Date(e.OpenEndedLoanCheckInDate)>new Date("9999/12/30")&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)(I(),{href:{pathname:"/loan/openendedloancheckin",query:{id:e.TransactionID}},prefetch:!1,children:[(0,r.jsx)("i",{className:"fa fa-sign-in","aria-hidden":!0,children:"\xa0"}),"Check In Loan"]}),"  "]}),(0,r.jsx)("div",{children:(0,r.jsxs)(I(),{href:{pathname:"/loan/openendedloancancel",query:{id:e.TransactionID}},prefetch:!1,children:[(0,r.jsx)("i",{className:"fa fa-ban","aria-hidden":!0,children:"\xa0"}),"Cancel Loan"]})})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(I(),{href:{pathname:"/item/transactionedit",query:{surveyid:e.ReuseSurveyId}},prefetch:!1,children:[(0,r.jsx)("i",{className:"fa fa-pencil","aria-hidden":!0,children:"\xa0"}),"Edit Loan / Survey"]}),"  "]})]}),L=e=>{let n={status:"Out"==e.listType?"OpenEndedLoanOut":"OpenEndedLoanReturned",sortOption:"RemovalDateDesc",programId:e.programID,searchPhrase:e.searchPhrase},{loading:a,error:t,data:s}=(0,i.I)(v,{variables:n});return(localStorage&&localStorage.setItem("OPEN_ENDED_LOANS_VARIABLES",JSON.stringify(n)),a)?(0,r.jsx)(o.A,{}):t?(0,r.jsxs)(g,{children:["$",t.message]}):(0,r.jsxs)(u.b,{id:"dtItemSearch",value:s.transactions,className:"datatable-inside-card",paginator:!0,rowsPerPageOptions:[10,20,50,100],rows:20,width:"100%",children:[(0,r.jsx)(h.V,{header:"Loan",body:O,field:"DateCompleted",sortable:!0}),(0,r.jsx)(h.V,{header:"Item",body:S,field:"ItemName",sortable:!0}),"Returned"==e.listType&&(0,r.jsx)(h.V,{header:"Return Date",body:f,field:"OpenEndedLoanCheckInDate",sortable:!0}),(0,r.jsx)(h.V,{header:"Action",body:y,field:"OwnerName",sortable:!1})]})},_=e=>{var n,a,t;let s=void 0!=localStorage&&JSON.parse(localStorage.getItem("OPEN_ENDED_LOANS_VARIABLES")),[u,h]=(0,d.useState)(s&&{ProgramID:s.programId,ProgramName:"",__typename:"Program"}),[x,I]=(0,d.useState)((null==s||null==(n=s.status)?void 0:n.search("Out"))>0?"Out":"Returned"),[N,j]=(0,d.useState)(null==s?void 0:s.searchPhrase),v=(0,d.useContext)(p.A),S=e=>{h(e)},O=()=>{"Out"==x?I("Returned"):I("Out")},f={programId:u?u.ProgramID:0},y=(0,i.I)(E,{variables:f});return v?y.loading?(0,r.jsx)(o.A,{}):y.error?(0,r.jsxs)(g,{children:["$",y.error.message]}):(0,r.jsx)("div",{className:"p-fluid",children:(0,r.jsx)("div",{className:"p-grid",children:(0,r.jsxs)("div",{className:"p-col-12",children:[(0,r.jsxs)("div",{className:"card card-w-title p-card",children:[(0,r.jsx)(D,{children:"Open Ended Loan List"}),(0,r.jsxs)("div",{className:"p-grid",children:[(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:(0,r.jsx)("label",{htmlFor:"Program",children:"Program:"})}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:v.Auth.isWebAdmin?(0,r.jsx)(m.A,{inputId:"Program",Program:u,updateProgram:e=>S(e),autoFocus:!0}):(0,r.jsx)(m.A,{inputId:"Program",Program:u,IDs:v.Auth.programs,updateProgram:e=>S(e),autoFocus:!0})}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:(0,r.jsx)("label",{children:"Status:"})}),(0,r.jsxs)("div",{className:"p-col-12 p-md-10",children:[(0,r.jsx)(l.$,{style:{width:"150px"},label:"Out :  ".concat(u&&(null==(a=y.data.getOpenEndedLoanStatusCount)?void 0:a.length)>0&&y.data.getOpenEndedLoanStatusCount.findIndex(e=>"Out"==e.StatusName)>-1?y.data.getOpenEndedLoanStatusCount.find(e=>"Out"==e.StatusName).ItemCount:0),type:"submit",className:"at4-button ".concat("Out"==x?"p-button-primary":"p-button-secondary"),onClick:O}),(0,r.jsx)("span",{children:"\xa0\xa0"}),(0,r.jsx)(l.$,{style:{width:"150px"},label:"Returned : ".concat(u&&(null==(t=y.data.getOpenEndedLoanStatusCount)?void 0:t.length)>0&&y.data.getOpenEndedLoanStatusCount.findIndex(e=>"Returned"==e.StatusName)>-1?y.data.getOpenEndedLoanStatusCount.find(e=>"Returned"==e.StatusName).ItemCount:0),type:"submit",className:"at4-button ".concat("Returned"==x?"p-button-primary":"p-button-secondary"),onClick:O})]}),(0,r.jsx)("div",{className:"p-col-12 p-md-2",children:(0,r.jsx)("label",{htmlFor:"Search",children:"Search:"})}),(0,r.jsx)("div",{className:"p-col-12 p-md-10",children:(0,r.jsx)(c.S,{id:"Search",value:N,onChange:e=>{j(e.target.value)}})})]})]}),(0,r.jsx)("div",{className:"card card-w-title p-card",children:(0,r.jsx)(L,{searchPhrase:N,programID:null==u?void 0:u.ProgramID,listType:x})})]})})}):(0,r.jsx)(g,{children:"Access Denied"})};_.getInitialProps=e=>({query:e.query});let C=_}},e=>{e.O(0,[3333,636,6593,8792],()=>e(e.s=48060)),_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.