{"version":3,"sources":["webpack:///./src/views/management/modals/EditInvoice.vue","webpack:///./src/views/management/modals/EditInvoice.vue?f61d","webpack:///./src/views/management/modals/EditInvoice.vue?2dba","webpack:///./src/views/management/modals/EditInvoice.vue?b6ac","webpack:///./src/views/student/Student.vue","webpack:///./src/core/helpers/student.ts","webpack:///./src/views/student/Student.vue?1e65","webpack:///./src/views/student/Student.vue?f717","webpack:///./src/views/management/modals/EditInvoice.vue?6fb5","webpack:///./src/types/AddressModel.ts","webpack:///./src/types/StudentModel.ts"],"names":["class","id","tabindex","aria-hidden","style","invoiceId","data-bs-dismiss","resetForm","src","model","invoiceData","rules","ref","prop","invoice_date","type","start-placeholder","format","selectedStudent","fetch-suggestions","getStudent","clearable","placeholder","selectStudent","scope","item","first_name","last_name","student_id","finance_records","length","record","key","value","moment","record_date","record_type","amount","toLocaleString","currency","payment_method","payment_type","payment_memo","title","removeFromInvoice","data","financeRecordList","records","max-height","width","label","row","addToInvoice","memo","submit","loading","name","components","props","Number","students","emits","emit","store","formRef","user","getters","currentUser","getAvailableFinancerecords","Promise","resolve","reject","ApiService","setHeader","get","then","sortByRecordDate","catch","response","console","log","Error","errors","setEmptyInvoiceData","invoice_records","user_id","student","studentObj","Object","assign","cur","prev","setDefaultInvoiceStudent","getInvoice","financeRecords","map","x","finance_record","filter","y","undefined","queryString","callback","selectedList","toLowerCase","includes","push","index","findIndex","d","splice","sort","a","b","Date","parse","required","message","trigger","editInvoice","formData","update","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","post","invoice_id","record_id","validate","valid","closeEditBtn","document","getElementById","click","render","__scopeId","alt","href","data-kt-countup","data-kt-countup-value","data-kt-countup-prefix","profileDetails","photoUrl","status","admission_category","email","phone","data-bs-toggle","data-bs-target","totalReceivable","session","attendanceRate","agent","to","active-class","setStudentProfile","studentProfile","dispatch","SET_STUDENTPROFILE_ACTION","CreateInvoice","route","params","getStudentProfile","address","getProfilePhotoUrl","getStudentTotalReceivable","getSubjects","today","currentData","subject","level","program","semester","start_date","end_date","code","localeCompare","sumOfAttendanceRate","attendance_rate","reduce","curr","Math","floor","photo_id","url","setStudentProfileDetail","Address","BalanceFilterType","ProfileDetails","this"],"mappings":"yIAEIA,MAAM,aACNC,GAAG,qBACHC,SAAS,KACTC,cAAY,Q,GAEPH,MAAM,gD,GACJA,MAAM,iB,GACJA,MAAM,gB,uBAWDA,MAAM,uB,GAMXA,MAAM,gC,GAQFA,MAAM,Y,GAMJA,MAAM,Y,GAYRA,MAAM,Y,GAMJA,MAAM,Y,GAgBRA,MAAM,Y,GAMJA,MAAM,Y,aAIII,MAAA,mK,qDAoDZJ,MAAM,Y,GAMJA,MAAM,Y,GAURA,MAAM,e,wbAvJrB,gCA2KM,MA3KN,EA2KM,CArKJ,gCAmKM,MAnKN,EAmKM,CAlKJ,gCAgKQ,MAhKR,EAgKQ,CA/JN,gCAeM,MAfN,EAeM,CAdF,gCAGK,WAFuB,IAAZ,EAAAK,W,yBAAZ,gCAAyC,SAAb,Y,yBAC5B,gCAAwB,SAAX,S,yCAAW,gBAG9B,gCAQM,OAPJL,MAAM,+CACNM,kBAAgB,QACf,QAAK,eAAE,EAAAC,c,CAER,gCAEO,OAFP,EAEO,CADL,yBAA2D,GAA/CC,IAAI,iDAKtB,gCA6IQ,MA7IR,EA6IQ,CA5IN,yBA2IY,GA1IVP,GAAG,oBACFQ,MAAO,EAAAC,YACPC,MAAO,EAAAA,MACRC,IAAI,UACJZ,MAAM,Q,8BAEN,IAiBM,CAjBN,gCAiBM,MAjBN,EAiBM,C,YAhBJ,gCAIQ,SAHNA,MAAM,wDAAsD,CAE5D,gCAAkC,QAA5BA,MAAM,YAAW,U,IAEzB,gCAUM,MAVN,EAUM,CATJ,yBAQe,GARDa,KAAK,gBAAc,C,6BAC/B,IAMiB,CANjB,yBAMiB,G,WALN,EAAAH,YAAYI,a,qCAAZ,EAAAJ,YAAwB,gBACjCK,KAAK,OACLC,oBAAkB,eAClBC,OAAO,c,mCAMf,gCAq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,OAJA,2BAAc,KACV4C,MAGG,CACH5C,iBACAhJ,KACAyJ,UACAC,iBACAF,sBC9GZ,GAAOf,OAASA,GAED,iB,oCCLf,W,oCCAA,kCAAO,MAAMoD,K,2DCAb,wEA+BYC,EA/BZ,YAEO,MAAMC,EACX,cACEC,KAAK1B,QAAU,IAAI,OACnB0B,KAAK9C,OAAS,WA0BlB,SAAY4C,GACV,qBACA,+BACA,iBACA,4BACA,mBALF,CAAYA,MAAiB","file":"js/chunk-0f24b855.f739ab09.js","sourcesContent":["\r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, onBeforeMount, reactive, ref, toRefs, watch } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport { useStore } from \"vuex\";\r\nimport moment from \"moment\";\r\nimport { useFieldValue } from \"vee-validate\";\r\n\r\nexport default defineComponent({\r\n name: \"edit-invoice-modal\",\r\n components: {\r\n },\r\n props:{\r\n invoiceId : Number,\r\n students: [] as any\r\n },\r\n emits: ['getInvoices', 'updateInvoiceId'],\r\n setup(props, {emit}) {\r\n const store = useStore();\r\n const { students, invoiceId } = toRefs(props);\r\n const formRef = ref(null);\r\n const loading = ref(false);\r\n const user = store.getters.currentUser;\r\n const selectedStudent = ref('');\r\n const invoiceData = ref({} as any);\r\n const financeRecordList = reactive({records : [] as any});\r\n\r\n const resetForm = () =>{\r\n emit(\"updateInvoiceId\", 0);\r\n invoiceData.value = {};\r\n }\r\n\r\n const getAvailableFinancerecords = async (student_id : number) => {\r\n await new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"finance/records/invoice/\"+student_id)\r\n .then(({ data }) => {\r\n financeRecordList.records = data.data;\r\n sortByRecordDate();\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n console.log(response);\r\n reject(new Error ('getAvailableFinancerecords error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n const selectStudent = async(item) => {\r\n if(item){\r\n invoiceData.value.student_id = item.id;\r\n selectedStudent.value = item.first_name +\" \"+ item.last_name +\"(\"+item.student_id+\")\";\r\n await getAvailableFinancerecords(item.id).then(()=>{\r\n invoiceData.value.finance_records = [];\r\n });\r\n }\r\n }\r\n\r\n const setEmptyInvoiceData = () =>{\r\n invoiceData.value = {\r\n invoice_date :'',\r\n student_id : Number(),\r\n invoice_records : [] as any,\r\n finance_records : [] as any,\r\n memo :'',\r\n user_id: user.id,\r\n student: {} as any\r\n };\r\n\r\n if(props.students.length == 1){\r\n let studentObj = Object.assign({},props.students[0]);\r\n selectStudent(studentObj);\r\n }\r\n else{\r\n selectedStudent.value = '';\r\n financeRecordList.records = [];\r\n }\r\n }\r\n\r\n watch(() => props.invoiceId, async(cur, prev)=>{\r\n await setDefaultInvoiceStudent(props.invoiceId);\r\n })\r\n\r\n watch(() => props.students, async(cur, prev)=>{\r\n await setDefaultInvoiceStudent(props.invoiceId);\r\n })\r\n\r\n const setDefaultInvoiceStudent = async(id) =>{\r\n if(id && id > 0 ){\r\n getInvoice(id).then(()=>{\r\n const financeRecords = [...invoiceData.value.invoice_records.map(x=>x.finance_record)];\r\n selectStudent(invoiceData.value.student).then(() =>{\r\n invoiceData.value.finance_records = [...financeRecords];\r\n financeRecordList.records = financeRecordList.records.filter(x=> invoiceData.value.finance_records.filter(y=>y.id == x.id).length == 0);\r\n });\r\n });\r\n }\r\n else{\r\n setEmptyInvoiceData();\r\n }\r\n }\r\n \r\n const getInvoice = async (id : number) => {\r\n return new Promise((resolve, reject) => {\r\n ApiService.setHeader();\r\n ApiService.get(\"invoice/\"+id)\r\n .then(({ data }) => {\r\n Object.assign(invoiceData.value,data.data);\r\n resolve('done');\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getInvoice error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n if(invoiceId.value !== undefined && invoiceId.value !== 0){\r\n getInvoice(invoiceId.value).then(async() =>{\r\n await getAvailableFinancerecords(invoiceData.value.student_id);\r\n });\r\n }\r\n else{\r\n setEmptyInvoiceData();\r\n }\r\n\r\n const getStudent=(queryString, callback)=>{\r\n let selectedList = students.value.filter(data => (!queryString \r\n || (data.first_name +\" \"+ data.last_name +\"(\"+data.student_id+\")\").toLowerCase().includes(queryString.toLowerCase())));\r\n callback(selectedList);\r\n }\r\n\r\n const addToInvoice = (row) => {\r\n invoiceData.value.finance_records.push(row);\r\n sortByRecordDate();\r\n let index = financeRecordList.records.findIndex(d => d.id === row.id);\r\n financeRecordList.records.splice(index,1); \r\n }\r\n\r\n const removeFromInvoice = (row) => {\r\n financeRecordList.records.push(row);\r\n sortByRecordDate();\r\n let index = invoiceData.value.finance_records.findIndex(d => d.id === row.id);\r\n invoiceData.value.finance_records.splice(index,1);\r\n }\r\n\r\n const sortByRecordDate = () =>{\r\n financeRecordList.records.sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.record_date!) < Date.parse(b.record_date!))\r\n return 1;\r\n if (Date.parse(a.record_date!) > Date.parse(b.record_date!))\r\n return -1;\r\n return 0;\r\n });\r\n }\r\n\r\n const rules = ref({\r\n student_id: [\r\n {\r\n required: true,\r\n message: \"Please select student\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n finance_records: [\r\n {\r\n required: true,\r\n message: \"Please select finance records\",\r\n trigger: \"change\",\r\n },\r\n ]\r\n });\r\n\r\n const editInvoice = async (formData) => {\r\n delete formData.finance_records;\r\n ApiService.setHeader();\r\n if(invoiceId.value !== undefined && invoiceId.value !==0)\r\n {\r\n ApiService.update(\"invoice\", invoiceId.value, formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('editInvoice error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to edit invoice\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n }\r\n else\r\n {\r\n ApiService.post(\"invoice\", formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('createInvoice error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new invoice\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n });\r\n }\r\n }\r\n\r\n const submit = () => {\r\n if (!formRef.value) {\r\n return;\r\n }\r\n\r\n invoiceData.value.invoice_records = [...invoiceData.value.finance_records.map(x=>{return {invoice_id: invoiceId.value, record_id: x.id};})]\r\n formRef.value.validate((valid) => {\r\n if (valid) {\r\n loading.value = true;\r\n editInvoice(invoiceData.value).then(() => {\r\n Swal.fire({\r\n text: \"Form has been successfully submitted!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n }).then(() => {\r\n loading.value = false;\r\n emit('getInvoices');\r\n let closeEditBtn = document.getElementById('close_invoice_button');\r\n closeEditBtn?.click();\r\n });\r\n });\r\n } else {\r\n Swal.fire({\r\n text: \"Please fill out all required fields\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n return false;\r\n }\r\n });\r\n };\r\n\r\n return {\r\n invoiceData,\r\n submit,\r\n rules,\r\n loading,\r\n formRef,\r\n getStudent,\r\n selectStudent,\r\n selectedStudent,\r\n financeRecordList,\r\n moment,\r\n addToInvoice,\r\n removeFromInvoice,\r\n resetForm\r\n };\r\n },\r\n});\r\n","import { render } from \"./EditInvoice.vue?vue&type=template&id=76350396&scoped=true\"\nimport script from \"./EditInvoice.vue?vue&type=script&lang=ts\"\nexport * from \"./EditInvoice.vue?vue&type=script&lang=ts\"\n\nimport \"./EditInvoice.vue?vue&type=style&index=0&id=76350396&lang=scss&scoped=true\"\nimport \"./EditInvoice.vue?vue&type=style&index=1&id=76350396&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-76350396\"\n\nexport default script","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./EditInvoice.vue?vue&type=style&index=0&id=76350396&lang=scss&scoped=true\"","\n\n\n","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/SmsStoreEnums\";\r\nimport { ProfileDetails } from \"@/types/StudentModel\";\r\n\r\nexport const setStudentProfile = (\r\n studentProfile: any,\r\n): void => {\r\n store.dispatch(Actions.SET_STUDENTPROFILE_ACTION, {\r\n studentProfile: studentProfile,\r\n });\r\n};\r\n","\nimport { defineComponent, onBeforeMount, reactive, ref } from \"vue\";\nimport { ProfileDetails } from \"@/types/StudentModel\";\nimport { Address } from \"@/types/AddressModel\";\nimport { setStudentProfile } from \"@/core/helpers/student\";\nimport { useRoute } from 'vue-router'\nimport ApiService from \"@/core/services/ApiService\";\nimport CreateInvoice from \"@/views/management/modals/EditInvoice.vue\"\nimport _ from \"lodash\";\nimport moment from \"moment\";\n\nexport default defineComponent({\n name: \"student-detail\",\n components: {\n CreateInvoice\n },\n setup(){\n const route = useRoute();\n const id : number = +route.params.id; \n const profileDetails : any = reactive({});\n const session = ref('N/A');\n const attendanceRate = ref(null);\n const totalReceivable = ref(0);\n \n const getStudentProfile = async () => {\n await new Promise((resolve, reject) => { \n ApiService.setHeader(); \n ApiService.get(\"student/profile/\"+id)\n .then(async({ data }) => {\n if(data.data.address == null){\n data.data.address = new Address();\n }\n Object.assign(profileDetails,data.data);\n await getProfilePhotoUrl();\n setStudentProfile(profileDetails);\n resolve(data.data);\n })\n .catch(({ response }) => {\n console.log('getFinanceRecords error => '+response.data.errors);\n reject(new Error ('getFinanceRecords error => '+response.data.errors));\n });\n });\n }\n\n const getStudentTotalReceivable = async () =>{\n await new Promise((resolve, reject) => { \n ApiService.setHeader(); \n ApiService.get(\"finance/records/receivable/\"+id)\n .then(({ data }) => {\n if(data.data){\n totalReceivable.value = data.data;\n }\n resolve(data.data);\n })\n .catch(({ response }) => {\n console.log('getFinanceRecords error => '+response.data.errors);\n reject(new Error ('getFinanceRecords error => '+response.data.errors));\n });\n });\n }\n\n const getSubjects = async () => {\n await new Promise((resolve, reject) => { \n ApiService.setHeader(); \n ApiService.get(\"class-student/subjects/\"+id)\n .then(({ data }) => {\n var today = moment();\n if(data.data){ \n let currentData = data.data.filter(item => moment(item.subject.session.level.program.semester.start_date) <= today && moment(item.subject.session.level.program.semester.end_date) >= today);\n currentData = currentData.sort((x, y) => x.subject.session.code.toLowerCase().localeCompare(y.subject.session.code.toLowerCase()));\n session.value = currentData ? currentData[0].subject.session.code : \"N/A\";\n let sumOfAttendanceRate = currentData.map(item => item.attendance_rate).reduce((prev, curr) => prev + curr, 0);\n attendanceRate.value = Math.floor(sumOfAttendanceRate / currentData.length);\n }\n resolve(data.data);\n })\n .catch(({ response }) => {\n console.log('getSubjects error => '+response);\n reject(new Error ('getSubjects error => '+response));\n });\n });\n }\n\n const getProfilePhotoUrl = async() =>{\n if(profileDetails && profileDetails.photo_id){\n await ApiService.get(\"file/url/\"+profileDetails.photo_id)\n .then(({ data }) => {\n profileDetails.photoUrl = data.url;\n });\n }\n }\n\n const setStudentProfileDetail = () => {\n if(id != 0){\n getStudentProfile();\n getSubjects();\n getStudentTotalReceivable();\n }\n else{\n Object.assign(profileDetails,new ProfileDetails());\n setStudentProfile(profileDetails);\n }\n }\n\n onBeforeMount(() => {\n setStudentProfileDetail();\n });\n\n return {\n profileDetails,\n id,\n session,\n attendanceRate,\n totalReceivable\n };\n }\n});\n","import { render } from \"./Student.vue?vue&type=template&id=7b1f7fe8\"\nimport script from \"./Student.vue?vue&type=script&lang=ts\"\nexport * from \"./Student.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./EditInvoice.vue?vue&type=style&index=1&id=76350396&scoped=true&lang=css\"","export class Address {\r\n id : number;\r\n address1 : string;\r\n address2 : string;\r\n city : string;\r\n state : string;\r\n zipcode : string;\r\n }","import { Address } from \"./AddressModel\";\r\n\r\nexport class ProfileDetails {\r\n constructor (){\r\n this.address = new Address();\r\n this.status = 'Active';\r\n }\r\n\r\n id: number;\r\n first_name: string;\r\n last_name: string;\r\n student_id : string;\r\n sevis_no : string;\r\n phone: string;\r\n email: string;\r\n address : Address;\r\n nationality: string;\r\n sex: string;\r\n birth_date: Date;\r\n i20_start: Date;\r\n i20_end: Date;\r\n start_date: Date;\r\n end_date: Date;\r\n agent_id : number;\r\n admission_category : string;\r\n status : string;\r\n picture : string;\r\n finance_records: [];\r\n session_code : string;\r\n}\r\n\r\nexport enum BalanceFilterType {\r\n GreaterThan=\">\",\r\n GreaterThanOrEqualTo=\">=\",\r\n EqualTo=\"=\",\r\n LessThanOrEqualTo=\"<=\",\r\n LessThan=\"<\",\r\n}"],"sourceRoot":""}