1import{Q as y}from"./QItemSection.9ce39042.js";import{Q as g}from"./QItem.87526ac7.js";import{Q as C}from"./QList.e2c3d9ec.js";import{Q as H}from"./QMenu.983d6cc8.js";import{_ as A,dr as P,z as D,k as n,u as m,v as e,K as r,B as u,C as c,A as i,V as z,J as d,Z as R,U as j,l as p,W as B,X as T,Y as w,F as k,a4 as W,E as q,G as X,g as Q,dy as Z,a3 as x,a2 as O,ds as $}from"./index.960394f4.js";import{C as I}from"./ClosePopup.ef37900a.js";import{S as ee}from"./SetSchoolsPO.54241357.js";import{u as S}from"./useCurrentOlympiad.b1c68096.js";import{u as te}from"./useJsUtils.ca2a23db.js";import{u as M}from"./useNotifications.5f72e479.js";import{u as oe}from"./useOlympusTools.eeb8d649.js";import{u as V}from"./useScreen.9257e644.js";import{c as U}from"./common.4ee7ada2.js";import{o as re}from"./onceOff.5e6bdb10.js";import{g as G}from"./general.cc4ad627.js";import{p as N}from"./portal.24ea9ff1.js";import{M as ne}from"./MyHeading.6e52ef9e.js";import{S as J}from"./SiteCopyNew.afea6335.js";import{a as L}from"./QSelect.f5103062.js";import{J as le}from"./Json.94144405.js";import"./selection.85e69b02.js";import"./QItemLabel.70107885.js";import"./useCurrentUser.4aed9a51.js";import"./vue.runtime.esm-bundler.132ed0a5.js";import"./Editor.21229c8d.js";import"./QChip.f9c9317b.js";import"./format.2bc25e5f.js";import"./styles.2c217f06.js";const ie={name:"GenerateInvoiceSchool",setup(){const t=V(),o=M(),v=S();return{myScreen:t,notify:o,myOlympiad:v}},components:{SiteCopyNew:J},data(){return{numberOfLearnersToAdd:"",inProgress:!1,confirmCreateInvoiceDialog:!1,showMoreInvoiceInfo:!1}},mixins:[G,U,N],props:["totalLearnersToEnter","olympiadData"],methods:{ensureNumericValueForNumLearners(){this.numberOfLearnersToAdd=this.numberOfLearnersToAdd.replace(/[^0-9]/g,""),this.numberOfLearnersToAdd!==""&&(this.numberOfLearnersToAdd*=1)},clickCreateInvoice(){if(this.numberOfLearnersToAdd===""||this.numberOfLearnersToAdd*1===0)return;if(this.numberOfLearnersToAdd+this.totalLearnersToEnter<this.olympiadData.minimumEntry){this.notify.error("A minimum of "+this.olympiadData.minimumEntry+" learners may be entered.");return}this.totalLearnersToEnter===0?this.createInvoice():this.confirmCreateInvoiceDialog=!0},createInvoice(){this.inProgress||(this.numberOfLearnersToAdd.length===0?this.notify.error("Please enter the number of learners you would like, first."):(this.inProgress=!0,P.createInvoice({numberOfLearnersToAdd:this.numberOfLearnersToAdd,customerParticipantId:this.currentOlympiad.customerParticipantId}).then(t=>{this.inProgress=!1,this.numberOfLearnersToAdd=0,this.$store.dispatch("general/GET_USER_DATA",{olympiadId:this.myOlympiad.getId()})})))}}},se={key:0},ae=e("br",null,null,-1),de={key:1,class:"table",style:{"max-width":"790px"}},ue=e("td",null,"Enter the number of learners for which you would like a new invoice generated",-1),ce={key:2,class:"table",style:{}},me=e("tr",null,[e("td",null,"Enter the number of learners for which you would like a new invoice generated")],-1),pe={key:0},he={key:1},ye={style:{"font-size":"140%"}},fe=e("strong",null,"TOTAL NUMBER",-1),ve={style:{border:"1px solid black","border-radius":"25%",background:"lightblue",padding:"2px","font-size":"160%"}},_e=e("br",null,null,-1),be=e("br",null,null,-1),Te=e("strong",null,"YES",-1),Ie=e("br",null,null,-1),ge=e("strong",null,"NO",-1);function Oe(t,o,v,h,s,l){const f=D("SiteCopyNew");return n(),m("div",null,[t.currentOlympiad.hideGenerateNewInvoice?(n(),m("div",se,[e("strong",null,[r("The first invoice you generate for your school will contain the R"+u(t.currentOlympiad.olympiad.schoolFee)+" school entry fee. ",1),ae,r(" If you wish to generate another invoice to enter additional learners, the above invoice will have to be paid first.")])])):c("",!0),h.myScreen.isMobi.value?c("",!0):(n(),m("table",de,[e("tr",null,[ue,e("td",null,[i(z,{type:"text",modelValue:s.numberOfLearnersToAdd,"onUpdate:modelValue":o[0]||(o[0]=b=>s.numberOfLearnersToAdd=b),dense:"",outlined:"",onKeyup:l.ensureNumericValueForNumLearners,style:{width:"50px"}},null,8,["modelValue","onKeyup"])]),e("td",null,[e("div",{class:"my-button",onClick:o[1]||(o[1]=(...b)=>l.clickCreateInvoice&&l.clickCreateInvoice(...b)),style:{float:"left","margin-top":"5px","margin-left":"10px"}},"Generate New Invoice")])])])),h.myScreen.isMobi.value?(n(),m("table",ce,[me,e("tr",null,[e("td",null,[i(z,{type:"text",modelValue:s.numberOfLearnersToAdd,"onUpdate:modelValue":o[2]||(o[2]=b=>s.numberOfLearnersToAdd=b),dense:"",onKeyup:l.ensureNumericValueForNumLearners,outlined:"",style:{width:"50px",float:"left"}},null,8,["modelValue","onKeyup"]),e("div",{class:"my-button",onClick:o[3]||(o[3]=(...b)=>l.clickCreateInvoice&&l.clickCreateInvoice(...b)),style:{float:"left","margin-top":"5px","margin-left":"10px"}},"Generate New Invoice")])])])):c("",!0),i(W,{modelValue:s.confirmCreateInvoiceDialog,"onUpdate:modelValue":o[6]||(o[6]=b=>s.confirmCreateInvoiceDialog=b),persistent:""},{default:d(()=>[i(R,null,{default:d(()=>[i(j,{class:"row items-center"},{default:d(()=>[s.showMoreInvoiceInfo?(n(),m("div",pe,[t.userData.isSponsored?c("",!0):(n(),p(f,{key:0,"admin-name":`${v.olympiadData.subProjectVarName}: Invoices`,"var-name":`${v.olympiadData.subProjectVarName}-portal-invoices`,"allow-edit":t.user.allowEdit&&t.editMode},null,8,["admin-name","var-name","allow-edit"]))])):c("",!0),s.showMoreInvoiceInfo?c("",!0):(n(),m("div",he,[r(" Adding this invoice for "),e("strong",ye,u(s.numberOfLearnersToAdd),1),r(" learners will bring the "),fe,r(" of learners you wish to enter in "),e("strong",null,u(v.olympiadData.listingName),1),r(" to "),e("strong",ve,"\xA0"+u(s.numberOfLearnersToAdd+v.totalLearnersToEnter)+"\xA0",1),_e,be,r(" If this is what wish to do click "),Te,r(","),Ie,r("else click "),ge,r(" for more information.")]))]),_:1}),i(B,{align:"right"},{default:d(()=>[s.showMoreInvoiceInfo?T((n(),p(w,{key:0,flat:"",label:"Close",color:"black",onClick:o[4]||(o[4]=b=>{s.showMoreInvoiceInfo=!1,s.confirmCreateInvoiceDialog=!1})},null,512)),[[I]]):c("",!0),s.showMoreInvoiceInfo?c("",!0):(n(),m(k,{key:1},[i(w,{flat:"",label:"No",color:"black",onClick:o[5]||(o[5]=b=>s.showMoreInvoiceInfo=!0)}),T(i(w,{flat:"",label:"Yes",color:"primary",onClick:l.createInvoice},null,8,["onClick"]),[[I]])],64))]),_:1})]),_:1})]),_:1},8,["modelValue"])])}var ke=A(ie,[["render",Oe]]);const we={name:"GenerateInvoiceCountry",components:{Json:le},setup(){const t=V(),o=M(),v=S();return{myScreen:t,notify:o,myOlympiad:v}},data(){return{invoiceData:{student:0,teamLeader:0,observer:0,roomUpgradeTL:0,roomUpgradeObs:0,postEventTrip:0,postEventTrip2:0},showForm:!0,lineItems:{loading:!0}}}
1,watch:{collapsed(t){t&&(this.showForm=!1)},"invoiceData.teamLeader"(){this.invoiceData.postEventTrip>this.invoiceData.student+this.invoiceData.teamLeader&&(this.invoiceData.postEventTrip=this.invoiceData.student+this.invoiceData.teamLeader)},"invoiceData.student"(){this.invoiceData.postEventTrip>this.invoiceData.student+this.invoiceData.teamLeader&&(this.invoiceData.postEventTrip=this.invoiceData.student+this.invoiceData.teamLeader)}},computed:{currencySymbol(){return this.currentOlympiad.olympiad.currency==="USD"?"$":this.currentOlympiad.olympiad.currency==="EUR"?"\u20AC":"?"},totalCost(){let t=0;return t+=this.lineItems.student.price*this.invoiceData.student,t+=this.lineItems.teamLeader.price*this.invoiceData.teamLeader,t+=this.lineItems.observer.price*this.invoiceData.observer,t+=this.lineItems.roomUpgradeTL.price*this.invoiceData.roomUpgradeTL,t+=this.lineItems.roomUpgradeObs.price*this.invoiceData.roomUpgradeObs,t+=this.lineItems.postEventTrip.price*this.invoiceData.postEventTrip,t+=this.lineItems.postEventTrip2.price*this.invoiceData.postEventTrip2,t},numberOfStudentsAvailable(){const t=[];for(let o=0;o<=4-this.totalLearnersToEnter;o++)t.push(o);return t},numberOfObserversAvailable(){const t=[];for(let o=0;o<=3-this.totalObserversToEnter;o++)t.push(o);return t},numberOfTeamLeadersAvailable(){const t=[];for(let o=0;o<=2-this.totalTeamLeadersToEnter;o++)t.push(o);return t},numberOfTripsAvailable(){return[0,1,2,3,4,5,6,7,8,9,10]}},mounted(){this.olympiadData.customInvoiceConfig&&(this.lineItems=this.olympiadData.customInvoiceConfig.lineItems),this.collapsed&&(this.showForm=!1)},mixins:[G,U,N],props:["totalLearnersToEnter","totalObserversToEnter","totalTeamLeadersToEnter","totalPostTripsToEnter","collapsed"],methods:{createInvoice(){this.numberOfLearnersToAdd*1===0?this.notify.error("Please enter a number larger than 0 for at least one item."):P.createInvoice({customer:this.userData.customer,invoiceData:JSON.stringify(this.invoiceData),customerParticipantId:this.currentOlympiad.customerParticipantId}).then(t=>{this.$store.dispatch("general/GET_USER_DATA",{olympiadId:this.myOlympiad.getId()}),this.showForm=!1})}}},_=t=>(q("data-v-cb5d2fca"),t=t(),X(),t),Le={key:2},De={key:0,class:"table",style:{"max-width":"600px"}},Ee=_(()=>e("tr",null,[e("td",{colspan:"3"},"Please complete the below for which you would like a new invoice generated")],-1)),Ce=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section-main"},"iGeo Event")],-1)),Ae=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section"},"Attendance")],-1)),Pe=["innerHTML"],Se=_(()=>e("br",null,null,-1)),Me=["innerHTML"],Ve=_(()=>e("br",null,null,-1)),Ue=["innerHTML"],Ge=_(()=>e("br",null,null,-1)),Ne=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section"},"Accommodation Upgrades (Optional)")],-1)),Fe={key:0},He={valign:"top"},ze=["innerHTML"],Qe=_(()=>e("br",null,null,-1)),xe={valign:"top"},Re={key:1},je={valign:"top"},Be=["innerHTML"],We=_(()=>e("br",null,null,-1)),Je={valign:"top"},Ke=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section-main"},[r(" Post-Event Trip Options (2 nights)"),e("br"),e("div",{style:{"font-size":"80%"}},[r("Trip options run in parallel, for full trip details, please see the "),e("a",{href:"https://igeo2026.org/",class:"plain-link"},"iGeo 2026 website")])])],-1)),Ye=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section"},[r(" OPTION 1"),e("br"),r(" Volcanic Landscape and Human-Nature Interaction "),e("br"),r("Cappadocia (17-19 August) ")])],-1)),qe={key:2},Xe={valign:"top"},Ze=["innerHTML"],$e=_(()=>e("br",null,null,-1)),et={valign:"top"},tt=_(()=>e("tr",null,[e("td",{colspan:"2",class:"invoice-section"},[r(" OPTION 2"),e("br"),r(" From Geological Times to Ancient Times"),e("br"),r(" Pamukkale, Ephesus, \u015Eirince, Ku\u015Fadas\u0131 (17-19 August) ")])],-1)),ot={key:3},rt={valign:"top"},nt=["innerHTML"],lt=_(()=>e("br",null,null,-1)),it={valign:"top"},st={colspan:"2",align:"center"},at={style:{"font-size":"120%","font-weight":"bold"}},dt=_(()=>e("br",null,null,-1)),ut=_(()=>e("br",null,null,-1)),ct=_(()=>e("tr",null,[e("td",{colspan:"2"},[e("strong",null,"Note:"),e("ul",{style:{width:"90%",margin:"auto"}},[e("li",null,"Standard accommodation during the iGeo event will be in 2 or 3 person shared rooms, with separate sections for girls and boys. Bathrooms and toilets are en-suite."),e("li",null,"For the duration of the iGeo event, a total additional charge of \u20AC100 per single room per person is available to Team Leaders & Observers only."),e("li",null,"The Istanbul city tour during the Olympiad is included in the \u20AC600 registration fee."),e("li",null,[r("Post-event trips options 1 and 2 are "),e("strong",null,"mutually exclusive as they are happening over the same dates"),r(".")]),e("li",null,[r("For full post-event trip details, please see the iGeo 2026 website: "),e("a",{href:"https://igeo2026.org/",target:"_blank"},"https://igeo2026.org/"),r(". ")]),e("li",null,"When sending participation fees, the full participation fee must be received in the LOC account before a receipt will be issued; bank charges for the transfer are the responsibility of the sender."),e("li",null,"Countries that withdraw from participation will have 30% of the total fee deducted if they notify this by April 1, 2026. Those who notify by May 1, 2026 will have 50% deducted. No refunds will be issued after May 1, 2026. In both cases, bank charges for refunds will be borne by the respective countries.")])])],-1));function mt(t,o,v,h,s,l){return D("Json"),n(),m("div",null,[c("",!0),v.collapsed&&!s.showForm?(n(),p(w,{key:1,label:"Add another invoice",color:"primary",onClick:o[0]||(o[0]=f=>s.showForm=!0)})):c("",!0),!s.lineItems.loading&&(l.numberOfStudentsAvailable.length>1||l.numberOfTeamLeadersAvailable>1||l.numberOfObserversAvailable>1||l.numberOfTripsAvailable.length>1)&&s.showForm?(n(),m("div",Le,[(n(),m("table",De,[Ee,Ce,Ae,e("tr",null,[e("td",null,[e("span",{innerHTML:s.lineItems.teamLeader.shortLabel},null,8,Pe),Se,r(u(l.currencySymbol)+u(s.lineItems.teamLeader.price)+" "+u(t.currentOlympiad.olympiad.currency)+" each ",1)]),e("td",null,[i(L,{modelValue:s.invoiceData.teamLeader,"onUpdate:modelValue":o[1]||(o[1]=f=>s.invoiceData.teamLeader=f),options:l.numberOfTeamLeadersAvailable,dense:"",outlined:"",class:"item-dropdown"},null,8,["modelValue","options"])])]),e("tr",null,[e("td",null,[e("span",{innerHTML:s.lineItems.student.shortLabel},null,8,Me),Ve,r(u(l.currencySymbol)+u(s.lineItems.student.price)+" "+u(t.currentOlympiad.olympiad.currency)+" each ",1)]),e("td",null,[i(L,{modelValue:s.invoiceData.student,"onUpdate:modelValue":o[2]||(o[2]=f=>s.invoiceData.student=f),options:l.numberOfStudentsAvailable,dense:"",outlined:"",class:"item-dropdown"},null,8,["modelValue","options"])])]),e("tr",null,[e("td",null,[e("span",{innerHTML:s.lineItems.observer.shortLabel},null,8,Ue),Ge,r(u(l.currencySymbol)+u(s.lineItems.student.price)+" "+u(t.currentOlympiad.olympiad.currency)+" each ",1)]),e("td",null,[i(L,{modelValue:s.invoiceData.observer,"onUpdate:modelValue":o[3]||(o[3]=f=>s.invoiceData.observer=f),options:l.numberOfObserversAvailable,dense:"",outlined:"",class:"item-dropdown"},null,8,["modelValue","options"])])]),Ne,(n(),m("tr",Fe,[e("td",He,[e("span",{innerHTML:s.lineItems.roomUpgradeTL.shortL
1abel},null,8,ze),Qe,r(" "+u(l.currencySymbol)+u(s.lineItems.roomUpgradeTL.price)+" "+u(t.currentOlympiad.olympiad.currency)+" each ",1)]),e("td",xe,[i(L,{modelValue:s.invoiceData.roomUpgradeTL,"onUpdate:modelValue":o[4]||(o[4]=f=>s.invoiceData.roomUpgradeTL=f),options:l.numberOfTripsAvailable,outlined:"",dense:"",class:"item-dropdown"},null,8,["modelValue","options"])])])),(n(),m("tr",Re,[e("td",je,[e("span",{innerHTML:s.lineItems.roomUpgradeObs.shortLabel},null,8,Be),We,r(" "+u(l.currencySymbol)+u(s.lineItems.roomUpgradeObs.price)+" "+u(t.currentOlympiad.olympiad.currency)+" each ",1)]),e("td",Je,[i(L,{modelValue:s.invoiceData.roomUpgradeObs,"onUpdate:modelValue":o[5]||(o[5]=f=>s.invoiceData.roomUpgradeObs=f),options:l.numberOfTripsAvailable,outlined:"",dense:"",class:"item-dropdown"},null,8,["modelValue","options"])])])),Ke,Ye,(n(),m("tr",qe,[e("td",Xe,[e("span",{innerHTML:s.lineItems.postEventTrip.shortLabel},null,8,Ze),$e,r(" "+u(l.currencySymbol)+u(s.lineItems.postEventTrip.price)+" "+u(t.currentOlympiad.olympiad.currency)+" per person ",1)]),e("td",et,[i(L,{modelValue:s.invoiceData.postEventTrip,"onUpdate:modelValue":o[6]||(o[6]=f=>s.invoiceData.postEventTrip=f),options:l.numberOfTripsAvailable,outlined:"",dense:"",class:"item-dropdown"},null,8,["modelValue","options"])])])),tt,(n(),m("tr",ot,[e("td",rt,[e("span",{innerHTML:s.lineItems.postEventTrip2.shortLabel},null,8,nt),lt,r(" "+u(l.currencySymbol)+u(s.lineItems.postEventTrip2.price)+" "+u(t.currentOlympiad.olympiad.currency)+" per person ",1)]),e("td",it,[i(L,{modelValue:s.invoiceData.postEventTrip2,"onUpdate:modelValue":o[7]||(o[7]=f=>s.invoiceData.postEventTrip2=f),options:l.numberOfTripsAvailable,dense:"",outlined:"",class:"item-dropdown"},null,8,["modelValue","options"])])])),e("tr",null,[e("td",st,[e("div",at,"Total Cost: "+u(l.currencySymbol)+u(l.totalCost)+" "+u(t.currentOlympiad.olympiad.currency),1),dt,ut,l.totalCost>0?(n(),m("div",{key:0,class:"my-button",onClick:o[8]||(o[8]=(...f)=>l.createInvoice&&l.createInvoice(...f))},"Generate New Invoice")):c("",!0)])]),ct]))])):c("",!0)])}var pt=A(we,[["render",mt],["__scopeId","data-v-cb5d2fca"]]);const ht={name:"Teachers-Application",setup(){const t=oe(),o=V(),v=M(),h=te(),s=S();return{olympusTools:t,myScreen:o,notify:v,jsUtils:h,myOlympiad:s}},components:{SetSchoolsPO:ee,GenerateInvoiceCountry:pt,GenerateInvoiceSchool:ke,SiteCopyNew:J,MyHeading:ne},mixins:[U,re,G,N],data(){return{inProgress:!1,confirmDelete:!1,toDelete:{schoolParticipantId:-1,purchaseOrderId:1}}},watch:{userData(){this.fetchInvoices()},currentOlympiad(t,o){o==null&&this.$store.dispatch("general/GET_USER_DATA",{olympiadId:t.olympiad.id})}},computed:{currency(){return this.olympiadData.currency},totalLearnersToEnter(){let t=0;return this.invoices.forEach(o=>{t+=o.learners}),t},totalObserversToEnter(){let t=0;return this.invoices.forEach(o=>{t+=o.observers}),t},totalTeamLeadersToEnter(){let t=0;return this.invoices.forEach(o=>{t+=o.teamLeaders}),t},totalPostTripsToEnter(){let t=0;return this.invoices.forEach(o=>{t+=o.postEventTrips}),t},totalInvoiceCost(){let t=0;return this.invoices.forEach(o=>{t+=o.totalFee}),t},getValuesForCopy(){return{principalEmail:this.userData.principalEmail}},invoices(){let t=null;return this.userData.customer==="school"?t=this.$store.getters["purchaseOrders/forSchool"]:t=this.$store.getters["purchaseOrders/forIgeoCountry"],t.loading?[]:t}},created(){this.user.mustChangePassword&&this.$router.push("/portal/update-password"),setTimeout(()=>{this.fetchInvoices()},500)},methods:{fetchInvoices(){this.currentOlympiad&&(this.userData.customer==="school"?this.$store.dispatch("purchaseOrders/getForSchool",this.currentOlympiad.customerParticipantId):this.$store.dispatch("purchaseOrders/getForIgeoCountry",this.currentOlympiad.customerParticipantId))},spaceToBreak(t){return t.replace(/ /,"<br/>")},downloadInvoice(t,o){this.notify.success("Your invoice will download in a moment.");const v=Q().apiUrl+"/api/teacher-downloads/invoice?customerParticipantId="+t+"&purchaseOrderId="+o;this.jsUtils.downloadFile(v,this.currentOlympiad.olympiad.varName+"-invoice-"+o+".pdf")},downloadReceipt(t,o){this.notify.success("Your receipt will download in a moment.");const v=Q().apiUrl+"/api/teacher-downloads/receipt?customerParticipantId="+t+"&purchaseOrderId="+o;this.jsUtils.downloadFile(v,this.currentOlympiad.olympiad.varName+"-receipt-"+
1o+".pdf")},confirmDeleteInvoice(t,o){this.confirmDelete=!0,this.toDelete.customerParticipantId=t,this.toDelete.purchaseOrderId=o},deleteInvoice(t,o){P.deleteInvoice(o).then(v=>{v.success?this.$store.dispatch("general/GET_USER_DATA",{olympiadId:this.myOlympiad.getId()}):this.notify.error("Could not delete invoice! Please contact us.")})},sendEmail(){if(this.inProgress)return;this.inProgress=!0;const t=this;Z.do({method:"post",path:"/api/school-participant/participant/declaration/send/"+this.userData.schoolParticipationId}).then(o=>{o.success&&t.$store.dispatch("GET_USER_DATA",{olympiadId:t.olympiadId}),t.inProgress=!1},o=>{console.error("error",o),t.inProgress=!1})}}},yt={key:0,class:"home q-pa-lg"},ft={style:{"max-width":"1100px",margin:"auto"}},vt={key:0,bordered:""},_t={key:1,bordered:""},bt=e("br",null,null,-1),Tt={style:{width:"100%"},class:"mobi-invoices"},It={style:{}},gt=e("td",null,"Invoice #",-1),Ot={colspan:"3"},kt=e("br",null,null,-1),wt=e("td",null,"Created",-1),Lt=["innerHTML"],Dt={key:0},Et={key:0},Ct={key:0},At=e("td",null,"Amount",-1),Pt=["innerHTML"],St={key:0},Mt=e("br",null,null,-1),Vt=["innerHTML"],Ut=e("td",null,"Status",-1),Gt=e("td",null,"Paid on",-1),Nt=["innerHTML"],Ft=e("br",null,null,-1),Ht=["innerHTML"],zt={key:0},Qt=e("br",null,null,-1),xt=["innerHTML"],Rt={style:{border:"1px solid black",padding:"10px","border-radius":"10px",background:"lightgray"}},jt={class:"totals-table"},Bt={key:0},Wt=e("td",{style:{width:"300px"}},"Total team leaders you wish to enter:",-1),Jt={class:"total-value"},Kt={class:"total-value"},Yt=e("td",null," Total observers you wish to enter:",-1),qt={class:"total-value"},Xt=e("td",null,"Total post-iGeo trips booked:",-1),Zt={class:"total-value"},$t=e("td",null,"Total cost of all invoices raised for payment:",-1),eo=["innerHTML"],to=e("br",null,null,-1),oo={key:3},ro=e("br",null,null,-1),no=e("strong",null,"Legend:",-1),lo={style:{"max-width":"500px"}},io={style:{width:"33.3%"}},so={style:{width:"33.3%"}},ao={style:{width:"33.3%"}},uo=e("span",{class:"q-ml-sm"},"Are you sure you want to delete this?",-1);function co(t,o,v,h,s,l){const f=D("MyHeading"),b=D("SiteCopyNew"),F=D("SetSchoolsPO"),K=D("GenerateInvoiceSchool"),Y=D("GenerateInvoiceCountry");return n(),m("div",null,[!t.userData.loading&&!t.olympiadData.loading?(n(),m("div",yt,[i(f,{text:"Invoices"}),e("div",ft,[t.userData.canCreateInvoice?c("",!0):(n(),m("div",vt," Please click go to the '"+u(h.myOlympiad.isIGeo.value?"My Team":"School")+"' tab to complete your details before you can create an invoice. ",1)),t.userData.canCreateInvoice?(n(),m("div",_t,[t.userData.isSponsored?c("",!0):(n(),p(b,{key:0,"admin-name":"Generic: Invoices","var-name":"portal-invoices","allow-edit":t.user.allowEdit&&t.editMode,"project-data":t.olympiadData},null,8,["allow-edit","project-data"])),t.userData.isSponsored?c("",!0):(n(),p(b,{key:1,"admin-name":`${t.olympiadData.subProjectVarName}: Invoices`,"var-name":`${t.olympiadData.subProjectVarName}-portal-invoices`,"allow-edit":t.user.allowEdit&&t.editMode,"project-data":t.olympiadData},null,8,["admin-name","var-name","allow-edit","project-data"]))])):c("",!0),bt,l.invoices.length>0?(n(),m(k,{key:2},[h.myScreen.isMobi.value?(n(),p(C,{key:0},{default:d(()=>[(n(!0),m(k,null,x(l.invoices,a=>(n(),p(g,{key:a.id,clickable:"",style:{border:"1px solid grey","margin-bottom":"5px",position:"relative"}},{default:d(()=>[i(w,{class:"",size:"12px",flat:"",dense:"",icon:"more_vert",style:{position:"absolute",bottom:"0",right:"0"}},{default:d(()=>[i(H,{"transition-show":"flip-left","transition-hide":"flip-left"},{default:d(()=>[i(C,{style:{width:"190px"}},{default:d(()=>[i(F,{"purchase-order-id":a.id,vuex:!1,onUpdated:l.fetchInvoices},null,8,["purchase-order-id","onUpdated"]),T((n(),p(g,{clickable:"",onClick:E=>l.downloadInvoice(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Download Invoice")]),_:1})]),_:2},1032,["onClick"])),[[I]]),a.paid?T((n(),p(g,{key:0,clickable:"",onClick:E=>l.downloadReceipt(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Download Receipt")]),_:1})]),_:2},1032,["onClick"])),[[I]]):c("",!0),!a.paid&&!a.preApproved?T((n(),p(g,{key:1,clickable:"",onClick:E=>l.confirmDeleteInvoice(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Delete Invoice")]),_:1})]),_:2},1032,["onClick"])),[[I]]):c("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024),e("table",Tt,[e("tr",It,[gt,e("td",Ot,[r(u(a.reference)+" ",1),a.schoolsPO?(n(),m(k,{key:0},[kt,r("PO: "+u(a.schoolsPO),1)],64)):c("",!0)])]),e("tr",null,[wt,e("td",{style:{background:"none"},innerHTML:a.invoiceDate,colspan:"3"},null,8,Lt)]),(n(),m("tr",Dt,[e("td",null,[r(u(h.olympusTools.learnerLabel("Learners"))+" ",1),h.myOlympiad.isIGeo.value?(n(),m("div",Et,"Team Leaders")):c("",!0)]),e("td",null,[r(u(a.learners)+" ",1),h.myOlympiad.isIGeo.value?(n(),m("div",Ct,u(a.teamLeaders),1)):c("",!0)]),At,e("td",null,[e("span",{innerHTML:l.currency},null,8,Pt),r(u(t.formatCurrency(a.totalFee))+" ",1),a.totalFee-a.totalFeeWithDiscount!=0?(n(),m("div",St,[r(" With Discount:"),Mt,e("span",{innerHTML:l.currency},null,8,Vt),r(u(t.formatCurrency(a.totalFeeWithDiscount)),1)])):c("",!0)])])),e("tr",null,[Ut,e("td",null,[a.paid?(n(),p(O,{key:0,name:"check",size:"30px",color:"green"})):c("",!0),a.preApproved&&!a.paid?(n(),p(O,{key:1,name:"check",size:"30px",color:"orange"})):c("",!0),!a.paid&&!a.preApproved?(n(),p(O,{key:2,name:"far fa-clock",size:"30px",color:"grey"})):c("",!0)]),Gt,e("td",{innerHTML:l.spaceToBreak(a.paidDate)},null,8,Nt)])])]),_:2},1024))),128))]),_:1})):c("",!0),h.myScreen.isMobi.value?c("",!0):(n(),p(C,{key:1},{default:d(()=>[i(g,{style:{"font-size":"15px","font-weight":"bold"}},{default:d(()=>[i(y,null,{default:d(()=>[r("Invoice #")]),_:1}),i(y,null,{default:d(()=>[r(u(h.olympusTools.learnerLabel("Learners")),1)]),_:1}),h.myOlympiad.isIGeo.value?(n(),p(y,{key:0},{default:d(()=>[r("Team Leaders")]),_:1})):c("",!0),h.myOlympiad.isIGeo.value?(n(),p(y,{key:1},{default:d(()=>[r("Observers")]),_:1})):c("",!0),h.myOlympiad.isIGeo.value?(n(),p(y,{key:2},{default:d(()=>[r("Trips")]),_:1})):c("",!0),i(y,null,{default:d(()=>[r("Fee")]),_:1}),i(y,null,{default:d(()=>[r("Invoice Date")]),_:1}),i(y,null,{default:d(()=>[r("Paid Date")]),_:1}),i(y,null,{default:d(()=>[r("Status")]),_:1}),i(y,null,{default:d(()=>[r("Actions")]),_:1})]),_:1}),(n(!0),m(k,null,x(l.invoices,a=>(n(),p(g,{key:a.id,clickable:"",style:{border:"1px solid grey","margin-bottom":"5px"}},{default:d(()=>[i(y,null,{default:d(()=>[r(u(a.reference)+" ",1),a.schoolsPO?(n(),m(k,{key:0},[Ft,r("PO: "+u(a.schoolsPO),1)],64)):c("",!0)]),_:2},1024),i(y,null,{default:d(()=>[r(u(a.learners),1)]),_:2},1024),h.myOlympiad.isIGeo.value?(n(),p(y,{key:0},{default:d(()=>[r(u(a.teamLeaders),1)]),_:2},1024)):c("",!0),h.myOlympiad.isIGeo.value?(n(),p(y,{key:1},{default:d(()=>[r(u(a.observers),1)]),_:2},1024)):c("",!0),h.myOlympiad.isIGeo.value?(n(),p(y,{key:2},{default:d(()=>[r(u(a.postEventTrips),1)]),_:2},1024)):c("",!0),i(y,null,{default:d(()=>[e("div",null,[e("span",{innerHTML:l.currency+t.formatCurrency(a.totalFee)},null,8,Ht),a.totalFee-a.totalFeeWithDiscount!=0?(n(),m("div",zt,[r(" With Discount:"),Qt,e("span",{innerHTML:l.currency},null,8,xt),r(u(t.formatCurrency(a.totalFeeWithDiscount)),1)])):c("",!0)])]),_:2},1024),i(y,null,{default:d(()=>[r(u(a.invoiceDate),1)]),_:2},1024),i(y,null,{default:d(()=>[r(u(a.paidDate),1)]),_:2},1024),i(y,null,{default:d(()=>[a.paid?(n(),p(O,{key:0,name:"check",size:"30px",color:"green"})):c("",!0),a.preApproved&&!a.paid?(n(),p(O,{key:1,name:"check",size:"30px",color:"orange"})):c("",!0),!a.paid&&!a.preApproved?(n(),p(O,{key:2,name:"far fa-clock",size:"30px",color:"grey"})):c("",!0)]),_:2},1024),i(y,null,{default:d(()=>[i(w,{class:"gt-xs",size:"12px",flat:"",dense:"",icon:"more_vert"},{default:d(()=>[i(H,{"transition-show":"flip-left","transition-hide":"flip-left"},{default:d(()=>[i(C,{style:{width:"190px"}},{default:d(()=>[i(F,{"purchase-order-id":a.id,vuex:!1,onUpdated:l.fetchInvoices},null,8,["purchase-order-id","onUpdated"]),h.myOlympiad.isIGeo.value?c("",!0):T((n(),p(g,{key:0,clickable:"",to:`/portal/pay/${a.uuid}`,target:"_blank"},{default:d(()=>[i(y,null,{default:d(()=>[r("Pay with PayFast")]),_:1})]),_:2},1032,["to"])),[[I]]),T((n(),p(g,{clickable:"",onClick:E=>l.downloadInvoice(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Download Invoice")]),_:1})]),_:2},1032,["onClick"])),[[I]]),a.paid?T((n(),p(g,{key:1,clickable:"",onClick:E=>l.downloadReceipt(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Download Receipt")]),_:1})]),_:2},1032,["onClick"])),[[I]]):c("",!0),!a.paid&&!a.preApproved?T((n(),p(g,{key:2,clickable:"",onClick:E=>l.confirmDeleteInvoice(t.currentOlympiad.customerParticipantId,a.id)},{default:d(()=>[i(y,null,{default:d(()=>[r("Delete Invoice")]),_:1})]),_:2},1032,["onClick"])),[[I]]):c("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),e("div",Rt,[e("table",jt,[h.myOlympiad.isIGeo.value?(n(),m("tr",Bt,[Wt,e("td",Jt,u(l.totalTeamLeadersToEnter),1)])):c("",!0),e("tr",null,[e("td",null,"Total "+u(h.olympusTools.learnerLabel("learners"))+" you wish to enter:",1),e("td",Kt,u(l.totalLearnersToEnter),1)]),h.myOlympiad.isIGeo.value?(n(),m(k,{key:1},[e("tr",null,[Yt,e("td",qt,u(l.totalObserversToEnter),1)]),e("tr",null,[Xt,e("td",Zt,u(l.totalPostTripsToEnter),1)])],64)):c("",!0),e("tr",null,[$t,e("td",{class:"total-value",innerHTML:l.currency+t.formatCurrency(l.totalInvoiceCost)},null,8,eo)])])])]),_:1}))],64)):c("",!0),to,t.userData.canCreateInvoice?(n(),m("div",oo,[!t.currentOlympiad.hideGenerateNewInvoice&&t.olympiadData.active&&!h.myOlympiad.isIGeo.value?(n(),p(K,{key:0,totalLearnersToEnter:l.totalLearnersToEnter,olympiadData:t.olympiadData},null,8,["totalLearnersToEnter","olympiadData"])):c("",!0),!t.currentOlympiad.hideGenerateNewInvoice&&t.olympiadData.active&&h.myOlympiad.isIGeo.value?(n(),p(Y,{key:1,totalLearnersToEnter:l.totalLearnersToEnter,totalTeamLeadersToEnter:l.totalTeamLeadersToEnter,totalPostTripsToEnter:l.totalPostTripsToEnter,"total-observers-to-enter":l.totalObserversToEnter,collapsed:l.invoices.length>0},null,8,["totalLearnersToEnter","totalTeamLeadersToEnter","totalPostTripsToEnter","total-observers-to-enter","collapsed"])):c("",!0)])):c("",!0),l.invoices.length>0?(n(),m(k,{key:4},[ro,no,e("table",lo,[e("tr",null,[e("td",io,[i(O,{name:"check",size:`${h.myScreen.isMobi.value?20:30}px`,color:"green"},null,8,["size"]),r(" Paid ")]),e("td",so,[i(O,{name:"check",size:`${h.myScreen.isMobi.value?20:30}px`,color:"orange"},null,8,["size"]),r(" Pre-Approved ")]),e("td",ao,[i(O,{name:"far fa-clock",size:`${h.myScreen.isMobi.value?20:30}px`,color:"grey"},null,8,["size"]),r(" Waiting for Payment ")])])])],64)):c("",!0),i(W,{modelValue:s.confirmDelete,"onUpdate:modelValue":o[1]||(o[1]=a=>s.confirmDelete=a),persistent:""},{default:d(()=>[i(R,null,{default:d(()=>[i(j,{class:"row items-center"},{default:d(()=>[i($,{icon:"delete",color:"red","text-color":"white"}),uo]),_:1}),i(B,{align:"right"},{default:d(()=>[T(i(w,{flat:"",label:"Cancel",color:"primary"},null,512),[[I]]),T(i(w,{flat:"",label:"Delete",color:"primary",onClick:o[0]||(o[0]=a=>l.deleteInvoice(s.toDelete.customerParticipantId,s.toDelete.purchaseOrderId))},null,512),[[I]])]),_:1})]),_:1})]),_:1},8,["modelValue"])])])):c("",!0)])}var zo=A(ht,[["render",co]]);export{zo as default};
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.