HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.2.20
System: Linux 825a8fd6cf8c 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User: apache (48)
PHP: 8.2.20
Disabled: NONE
Upload Files
File: /var/www/html/public/static/js/hookInvoice2-legacy-db5d6c63.js
System.register(["./po-legacy-4e000543.js","./fabric-legacy-f2668977.js","./vue-router-legacy-a12307c3.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-3f97fe0a.js","./preload-helper-legacy-f8638e03.js","./vue-i18n.runtime.esm-bundler-legacy-720876b1.js","./index-legacy-c9e20962.js","./_commonjsHelpers-legacy-5498c249.js","./utils-legacy-c0023c33.js","./focus-trap-legacy-631b7396.js","./error-legacy-e98f9e58.js"],(function(e,i){"use strict";var t,a,n,c,o,s,r,l,u,d,_,m,g,p,v,h,f,b,y,w,C,I,x,D,N,S,A,k,T,j,P;return{setters:[e=>{t=e.InvoiceListWeb,a=e.yuyueFDF,n=e.newInvoiceWeb,c=e.invoicePdfWeb,o=e.sendEmailWeb,s=e.base64image,r=e.invoiceDetailWeb,l=e.getLicenceServiceWeb,u=e.invoicePaymentWeb,d=e.prePaidWeb,_=e.AccountListWeb,m=e.updateShowNumber,g=e.getManagerClinicsListWeb,p=e.getManageTherapistWeb,v=e.setInvoicePaidWeb,h=e.getNoInvoiceBookingsDateWeb,f=e.InvoiceExportWeb,b=e.NeedPaymentInvoiceListWeb,y=e.ServiceCombinaByServiceNameWeb,w=e.getInvoiceNumberWeb,C=e.deleteInvoiceWeb,I=e.getCheckMembersWeb,x=e.saveDefaultTaxWeb},e=>{D=e.f},e=>{N=e.d,S=e.u},e=>{A=e.b7},e=>{k=e.o},e=>{T=e.r,j=e.A,P=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(e){const{query:i,params:E}=N(),L=S();N();const W=T([]),O=T(null),F=T(""),B=T(1),M=T(""),q=T({}),V=T(""),R=T(""),Y=T(""),z=T("");let H=null;const K=T(""),U=T(!1),$=T(!1),J=T(!1),G=T(!1),X=T(!1),Q=T(!1),Z=T(!1),ee=T(!1),ie=T(!1),te=T(!1),ae=T(!1),ne=T(!1),ce=T(!1),oe=T(!1),se=T(""),re=T(""),le=T(""),ue=T([]),de=T([]),_e=T([]),me=T([]),ge=T([]),pe=T([]),ve=T([]),he=T([]),fe=T([]),be=T([]),ye=T([]),we=T([]),Ce=T(!1),Ie=T(!1),xe=j({}),De=j({}),Ne=j({}),Se=j({}),Ae=j({}),ke=j({}),Te=j({}),je=j({}),Pe=j({}),Ee=j({}),Le=j({}),We=j({}),Oe=j({}),Fe=j({}),Be=j({});j({});const Me=j({}),qe=j({}),Ve=j({}),Re=j({}),Ye=j({}),ze=j({}),He=j({}),Ke=j({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),Ue=j({service_id:"",invoice_type:"normal",loacation_id:"",loacation_name:"",Client_name:"",Client_id:"",date:"",description_type:"",description_type1:"",Invoice_Number:"",hstValue:0,total:0,include_tax:"N",is_tax:"Y",is_tax1:!0,r_ac_name:"",r_ac_register:"",name1:"",rmt_register:"",signal_image:"",signal_desc:"",receive:"",invoice_due_date:"",customArr:"",fileName:"",email_content:"",file_path:"",is_web:1,name:"",licence_number:"",licence_name:"",licence_title:"",description:"",amount1:"",booking_order_no:"",bookingorder_id:"",Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Clinic_id:"",Therapist:"",chapter_image:"",is_use_chapter:"",is_Match:-1,is_Match_id:"",today:"",files:[],files1:[],fileView:[]}),$e=j({name:"",id:"",clinic_id:""}),Je=j({name:"",id:"",r_ac_name:"",r_ac_register:"",name1:"",rmt_register:""}),Ge=j({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),Xe=j({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Qe=T([{id:1,text:"Paypal",value:"Paypal"},{id:2,text:"VISA",value:"VISA"},{id:3,text:"MasterCard",value:"MasterCard"},{id:4,text:"AMERICAN_EXPRESS",value:"AMERICAN_EXPRESS"},{id:5,text:"Cheque",value:"Cheque"},{id:6,text:"BankTransfer",value:"BankTransfer"},{id:7,text:"Cash",value:"Cash"},{id:8,text:"Other",value:"Other"}]),Ze=T([{value:"normal",text:"Normal"},{value:"outside",text:"Outside"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),ei=T([{value:"Y",text:"Y"},{value:"N",text:"N"}]),ii=T([{id:1,price:0,spend_time:"",treatment_date:"",booking_order_no:"",booking_id:""}]),ti=T([{value:"Massage",text:"Massage"},{value:"Acupuncture",text:"Acupuncture"}]);j({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const ai=j({}),ni=j({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),ci=j({total:0,pageSize:10,currentPage:1,background:!0,pageSizes:[10,25,50,100]}),oi=j({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",date:"",amountBegin:"",amountEnd:"",show_number:!0,therapists_id:"",type:"",role:"",is_batch_invoice:"",invoice_id_list:[],sub_amount:"",sub_pay_amount:"",export:"N",show_all:!1,privcat:""});async function si(i){oi.export="N","Y"==i&&(oi.export=i),Ue.Clinic_id=oi.clinic_id,U.value=!0;const{data:n}=await t(Object.assign(xe,{searchKey:oi.searchKey,amountBegin:oi.amountBegin,amountEnd:oi.amountEnd,invoiceDate:oi.date,role:"clinic",clinic_id:oi.clinic_id,therapists_id:oi.therapists_id,options:V,customer_id:e.customer_id,pageSize:ci.pageSize,page:ci.currentPage,export:oi.export,show_all:oi.show_all}));1==n.code?(U.value=!1,"N"==oi.export?(ue.value=n.data,oi.privcat=n.privcat,oi.show_number=n.config.show_number,oi.is_batch_invoice=n.is_batch_invoice,oi.sub_amount=n.sub_amount,oi.sub_pay_amount=n.sub_pay_amount,yi()):(A({type:"success",message:"Export Success"}),window.open(a+n.first_name.replace("var/www/html/public","")))):U.value=!1,ci.total=n.total}function ri(){W.value=[],Ue.Client_name="",Ue.Client_id="",Ue.signal_desc="",Ue.signal_image="",Ue.Invoice_Number="",ii.value=[];const i={id:ii.value.length+1,price:0,spend_time:"",treatment_date:Ue.today,booking_order_no:"",booking_id:""};ii.value.push(i),Ue.date=Ue.today,e.customer_id&&(Ue.Client_name=e.customer_name,Ue.Client_id=e.customer_id),Ue.files=[],Ue.files1=[],ie.value=!0}async function li(e,i){Ue.Invoice_Number="",U.value=!0;let t=e.service_id;1==i&&(t=e.id);const{data:a}=await w(Object.assign(De,{clinic_id:"",service_id:t,invoice_date:Ue.date}));1==a.code&&(1==i?W.value.forEach(((i,t)=>{e.service_name==i.service_name&&(i.invoice_number=a.invoice_number)})):e.invoice_number=a.invoice_number),U.value=!1}function ui(e){const i=ii.value.findIndex((i=>i.id===e.id));-1!==i&&ii.value.splice(i,1),ii.value.forEach(((e,i)=>{e.id=i+1})),_i()}function di(e,i){Ue.is_tax=e?"Y":"N",_i(i)}function _i(e){let i=0;e.service_detail.forEach(((e,t)=>{""!=e.price&&(i=parseFloat(i)+parseFloat(e.price))})),e.is_tax?"N"==e.include_tax?(e.hstValue=Math.round(.13*parseFloat(i)*100)/100,e.total=Math.round(1.13*parseFloat(i)*100)/100):"Y"==e.include_tax&&(e.hstValue=Math.round(parseFloat(i)/1.13*.13*100)/100,e.total=Math.round(100*parseFloat(i))/100):(e.hstValue=0,e.total=Math.round(100*parseFloat(i))/100)}async function mi(e){const{data:i}=await C(Object.assign(Ne,{invoice_id:e.id}));1==i.code&&(si(),A({type:"success",message:i.msg}))}function gi(){H.renderAll()}async function pi(e){const{data:i}=await s(Object.assign(Te,{note_id:"",signal_url:"signal_url1",form_type:"invoice",base64code:F.value,yuyueFDF:a}));1==i.code&&(vi(2),Ue.signal_image=i.file_path,Z.value=!1)}async function vi(e){const{data:i}=await l(Object.assign(Pe,{clinics_id:Ue.Clinic_id,Therapists_id:Ue.Therapist,role:oi.role,clinic_id:le,customer_id:Ue.Client_id,is_licence:!1}));1==i.code?(ve.value=JSON.parse(JSON.stringify(i.data)),ve.value.length>0?(1==e&&(Ue.description_type=ve.value[0].service_name,xi(Ue.description_type),Ue.service_id=ve.value[0].id,we.value=ve.value[0].during_price_json),ye.value=JSON.parse(JSON.stringify(i.data))):(Ue.description_type="",ye.value=[],we.value=[],ii.value.forEach(((e,i)=>{e.price=0,e.spend_time=""})),Ue.hstValue=0,Ue.total=0)):A({type:"error",message:i.msg})}async function hi(){const{data:e}=await I(Object.assign(Ee,{customer_id:Xe.customer_id}));if(1==e.code){pe.value=e.data;let i=Ue.Need_Charge_Amount;pe.value.forEach(((e,t)=>{const a=Math.min(e.remain_amount,i);a>0&&(e.paid_amount=a,i=parseFloat((i-a).toFixed(2)))})),te.value=!0}else A({type:"error",message:e.msg})}function fi(){const e=new Date,i=e.getFullYear(),t=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);Xe.time=i+"-"+t+"-"+a}async function bi(){const{data:e}=await _(Object.assign(qe,{clinic_id:oi.clinic_id,role:"clinic",searchKey:""}));1==e.code&&(fe.value=e.data)}async function yi(){const{data:e}=await p(Object.assign(Be,{clinics_id:Ue.Clinic_id}));1==e.code?(me.value=e.data,e.data.length>0&&(Ue.Therapist=Number(e.data[0].id),wi())):A({type:"error",message:e.msg})}function wi(){Ue.signal_desc="",Ue.signal_image="",Ue.licence_number="",Ue.licence_name="",Ue.name="",Ue.description="",Ue.licence_title="",we.value=[],Ue.service_id="",vi(1)}function Ci(){L.push({path:"/crm/yuyue/clinic/employee",query:{invoceService:1}})}function Ii(e){const i={Invoice_Charge_Number:e.invoice_id_arr,Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:e.need_amount_sum,invoice_id:"",customer_id:e.customer_id,customer_name:e.customer_name};B.value=6,Ge.value=i,J.value=!0}async function xi(e){let i="";ve.value.forEach(((t,a)=>{t.value==e&&(i=t.id,Ue.signal_desc=t.sinal_desc_arr,Ue.signal_image=t.sinal_image_arr)}));const{data:t}=await y(Object.assign(ze,{role:"clinic",clinic_id:oi.clinic_id,service_id:i,service_name:e,customer_id:Ue.Client_id}));1==t.code?(W.value=t.data,W.value.forEach(((e,i)=>{e.service_detail.forEach(((e,i)=>{e.treatment_date=e.treatment_date.substring(0,10)})),di(e.is_tax,e),li(e)}))):A({type:"error",message:t.msg}),$.value=!1}function Di(e){const i=W.value.findIndex((i=>i.service_name===e.service_name));-1!==i&&W.value.splice(i,1)}async function Ni(e){const{data:i}=await x(Object.assign(He,{is_tax:e.is_tax,include_tax:e.include_tax,service_name:e.service_name,service_id:e.service_id}));0==i.code?A({type:"success",message:i.msg}):A({type:"error",message:i.msg}),$.value=!1}return P((()=>{oi.clinic_id=localStorage.getItem("clinicIdOverall"),H=new D.fabric.Canvas(O.value,{isDrawingMode:!0}),function(){const e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),n=("0"+e.getDate()).slice(-2);Ue.date=t+"-"+a+"-"+n,ii.value[0].treatment_date=t+"-"+a+"-"+n,Ue.invoice_due_date=t+"-"+a+"-"+n,Ue.today=t+"-"+a+"-"+n,1==i.help&&ri()}(),async function(){const{data:e}=await g(Object.assign(Fe,{cliniic_name:"",pageSize:1e3,page:1}));1==e.code&&(ge.value=e.data)}(),K.value=localStorage.getItem("type"),le.value=localStorage.getItem("clinicIdOverall"),oi.type=localStorage.getItem("type"),2==oi.type&&(oi.role="clinic"),1==oi.type&&(oi.role="therapists")})),{searchDetail:oi,btnSearchPart:function(){si()},loading:U,small:oe,selectList:["勾选列","Invoice #","Files","Therapist","Customer Name","Invoice Date","Total ($)","Paid Amount $","Service Name","Location","Booking #","PAID IN FULL","Split Rate","Split Amount","Withdraw Amount","Action"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Invoice #",prop:"invoice_number",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Invoice #")},{label:"Files",prop:"file",minWidth:50,slot:"files",hide:({checkList:e})=>!e.includes("Files")},{label:"Therapist",prop:"therapist_name",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Therapist")},{label:"Customer Name",slot:"Customer",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Customer Name")},{label:"Invoice Date",prop:"invoice_date_standard",minWidth:100,hide:({checkList:e})=>!e.includes("Invoice Date")},{label:"Total ($)",prop:"total_amount",minWidth:80,align:"right",hide:({checkList:e})=>!e.includes("Total ($)")},{label:"Paid Amount $",prop:"pay_amount",minWidth:110,align:"right",hide:({checkList:e})=>!e.includes("Paid Amount $")},{label:"Service Name",prop:"description_type",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Service Name")},{label:"Location",prop:"company_comp_name",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Location")},{label:"Booking #",prop:"customer_product_code",minWidth:90,slot:"Booking",align:"left",hide:({checkList:e})=>!e.includes("Booking #")},{label:"PAID IN FULL",prop:"IsPaid",minWidth:100,slot:"IsPaid",hide:({checkList:e})=>!e.includes("PAID IN FULL")},{label:"Split Rate",prop:"split_rate",minWidth:80,align:"right",hide:({checkList:e})=>!e.includes("Split Rate")},{label:"Split Amount",prop:"split_amount",minWidth:90,align:"right",hide:({checkList:e})=>!e.includes("Split Amount")},{label:"Withdraw Amount",prop:"has_withdraw_amount",minWidth:100,align:"right",hide:({checkList:e})=>!e.includes("Withdraw Amount")},{label:"Action",fixed:"right",width:200,slot:"operation",align:"left",hide:({checkList:e})=>!e.includes("Action")}],pagination:ci,handleSizeChange:function(e){ci.pageSize=e,si()},handleCurrentChange:function(e){ci.currentPage=e,si()},PartList:ue,order_date:se,deliverDialog:ie,selectClick:function(e){oi.invoice_id_list=[],e.forEach(((e,i)=>{oi.invoice_id_list.push(e.id)}))},deliverDataArr:ni,btnDeliverConfirm:async function(){U.value=!0;let e="";e="outside"==Ue.invoice_type?Ue.description_type1:Ue.description_type;const{data:i}=await n(Object.assign(ai,{customer_id:Ue.Client_id,company_id:Ue.loacation_id,invoice_type:Ue.invoice_type,invoice_date:Ue.date,invoice_due_date:Ue.invoice_due_date,is_tax:Ue.is_tax,description_type:e,signal_image:Ue.signal_image,items:ii,include_tax:Ue.include_tax,invoice_number:Ue.Invoice_Number,receive_message:Ue.receive,note_id:"",signal_desc:Ue.signal_desc,clinics_id:Ue.Clinic_id,Therapists_id:Ue.Therapist,origin:"new",files:Ue.files,combina_service_arr:W.value}));1==i.code?(si(),ie.value=!1,A({type:"success",message:i.msg}),U.value=!1):(A({type:"error",message:i.msg}),U.value=!1)},getBooking:function(e){return e.assocInfo.booking.length>0?e.assocInfo.booking[0].booking_order_no:""},getNote:function(e){return e.assocInfo.note.length>0?e.assocInfo.note[0].id:""},addForm:Ue,InvoiceType:Ze,btnAdd:ri,descriptionData:ti,items:ii,during_price_array:we,AddItem:function(e){const i={booking_id:"",booking_no:"",during_price_json:e.service_detail[0].during_price_json,id:e.service_detail.length+1,price:e.service_detail[e.service_detail.length-1].price,spend_time:e.service_detail[e.service_detail.length-1].spend_time,treatment_date:e.service_detail[0].treatment_date};e.service_detail.push(i),_i(e)},onDelete:e=>{k.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ui(e)})).catch((()=>{A({type:"info",message:"Canceled"})}))},taxData:ei,onIs_tax:di,IncludeTax:function(e,i){_i(i)},duringPrice:function(e,i,t){t.spend_time=e,t.during_price_json.forEach(((i,a)=>{i.value==e&&(t.price=i.price)})),_i(i)},onSelectLocation:function(){Ce.value=!0},locationDialog:Ce,ClientDialog:Ie,eventIsNumlocation:function(){Ue.loacation_name=Je.name,Ue.loacation_id=Je.id,Ue.r_ac_name=Je.r_ac_name,Ue.r_ac_register=Je.r_ac_register,Ue.name1=Je.name1,Ue.rmt_register=Je.rmt_register},eventIsNum:function(){Ue.Client_id=$e.id,Ue.Client_name=$e.name,xi(Ue.description_type)},onSelClient:function(){""!=Ue.Clinic_id&&null!=Ue.Clinic_id?($e.clinic_id=Ue.Clinic_id,Ie.value=!0):A({type:"error",message:"Please choose a clinic"})},ClientData:$e,locationData:Je,btnDelInvoice:e=>{k.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{mi(e)})).catch((()=>{A({type:"info",message:"Canceled"})}))},sandEmailDialog:ne,btnSendEmail:async function(e){Ue.customArr=e;const{data:i}=await c(Object.assign(Se,{invoice_id:e.id}));1==i.code&&(ne.value=!0,Ue.fileName=i.file_path.replace("/var/www/html/public/pdf/",""),Ue.file_path=i.file_path,Ue.email_content=i.data.config.emailconfig.email_content)},onSend:async function(){const{data:e}=await o(Object.assign(Ae,{invoice_id:Ue.customArr.id,file_path:Ue.file_path,emailContent:Ue.email_content,show_number:oi.show_number}));1==e.code&&(A({type:"success",message:e.msg}),ne.value=!1)},btnPrintPDF:async function(e){const{data:i}=await c(Object.assign(ke,{invoice_id:e.id,show_number:oi.show_number}));1==i.code?window.open(a+i.file_path.replace("var/www/html/public","")):A({type:"error",message:i.msg})},onPrice:_i,openAutograph:function(){Ke.signal_url="signal_url1",Ke.form_type="invoice",Ke.note_id="",Ke.service=Ue.description_type,Ke.service_id=Ue.service_id,Z.value=!0},signatureCanvas:O,signatureDataUrl:F,saveSignature:()=>{gi(),F.value=H.toDataURL({format:"png"}),pi()},clearSignature:function(){H.clear(),F.value=""},autographDialog:Z,signalData:Ke,eventSignal:function(){let e="";vi(2),Ue.signal_image=M.value,Ue.signal_image&&(e=Ue.signal_image.replace(a+"/images/","").substring(0,6),Ue.is_web="fabric"==e?2:1)},handleValueFromChild:e=>{Ue.signal_image=e},signalUrl:M,InvoiceDetailDialog:ee,btnDetail:async function(e){he.value=[],R.value="",Y.value="",z.value="",Ue.chapter_image="",Ue.is_use_chapter="",re.value="",Ue.fileView=e.file;let i="";ee.value=!0,Ue.customArr=e;const{data:t}=await r(Object.assign(je,{invoice_id:e.id}));1==t.code&&(he.value=t.data[0].detail,R.value=t.data[0].company_info,Y.value=t.data[0].info,z.value=t.data[0].customer_info,Ue.chapter_image=t.data[0].config.chapter_image,Ue.is_use_chapter=t.data[0].config.is_use_chapter,t.data[0].info.signal_image&&(i=t.data[0].info.signal_image.replace(a+"/images/","").substring(0,6),Ue.is_web="fabric"==i?2:1),re.value=t.data[0].licence,ee.value=!0)},detailInfo:he,company_info:R,info:Y,type:K,customer_info:z,addServiceData:ve,changeServic:function(e){ye.value.forEach(((i,t)=>{i.service_name==e&&(Ue.licence_number=i.licence_number,Ue.licence_name=i.licence_name,Ue.name=i.name,Ue.description=i.description,Ue.licence_title=i.licence_title,we.value=i.during_price_json,Ue.signal_desc=i.sinal_desc_arr,Ue.signal_image=i.sinal_image_arr,Ue.service_id=i.id,li())}));let i="",t="";ve.value.forEach(((a,n)=>{e==a.service_name&&a.during_price_json.forEach(((e,a)=>{e.default&&(i=e.price,t=e.duration)}))})),ii.value.forEach(((e,a)=>{i||t?(e.price=i,e.duration=t,e.spend_time=t,e.value=t):(e.price=0,e.duration=0,e.value=0,e.spend_time=0)})),_i()},licenceDetail:re,CollectionDialog:te,btnCollection:function(i){const t={Invoice_Charge_Number:i.invoice_number,Customer_Name:i.customer_first_name+i.customer_last_name,Invoice_Total_Charge:i.total_amount,Has_Paid_Amount:i.pay_amount,Need_Charge_Amount:i.need_charge_amount,Total_Paid_Amount:"",customer_id:i.customer_id,customer_name:e.customer_name?e.customer_name:i.customer_first_name+i.customer_last_name,invoice_id:i.id};return B.value=1,Ge.value=t,void(J.value=!0)},CollectionData:pe,bookingPaymentConfirm:async function(){const{data:e}=await u(Object.assign(Le,{invoice_id:Xe.invoice_id,pay_amount_details:pe.value}));1==e.code?(si(),te.value=!1):A({type:"error",message:e.msg})},addCollectionDialog:ae,AddCollect:function(){fi(),bi(),ae.value=!0},collectionArr:Xe,btncollectionConfirm:async function(){if(U.value=!0,"Cheque"!=Xe.pay_method&&(Xe.cheque_number=""),"Cheque"==Xe.pay_method&&""==Xe.cheque_number)return A({type:"error",message:"Please enter cheque number"}),void(U.value=!1);let e="";if("Other"==Xe.pay_method){if(""==Xe.other)return A({type:"error",message:"Please enter pay method"}),void(U.value=!1);e=Xe.other}else e=Xe.pay_method;const{data:i}=await d(Object.assign(We,{customer_id:Xe.customer_id,pay_amount:Xe.pay_amount,pay_method:e,cheque_number:Xe.cheque_number,content:Xe.content,collection_time:Xe.time,account_id:Xe.account_id}));1==i.code?(hi(),A({type:"success",message:i.msg}),ae.value=!1,U.value=!1):(A({type:"error",message:i.msg}),U.value=!1)},btnShowNumber:async function(e){const{data:i}=await m(Object.assign(Oe,{show_number:oi.show_number}));A({type:"success",message:i.msg})},ClinicsList:ge,btnClinic:function(e){yi()},TherapistDate:me,onTherapist:wi,disabledBeforeToday:function(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()},Therapists:_e,onTherapistSelect:function(e){null==e&&(oi.therapists_id="")},btnIsPaid:async function(e,i){const{data:t}=await v(Object.assign(Me,{invoice_id:i.id,is_paid:e}));1==t.code&&si(),A({type:"success",message:t.msg})},btnService:()=>{""!=Ue.Therapist&&null!=Ue.Therapist?k.confirm("Invoicing requires the therapist to provide licence services",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then((()=>{Ci()})).catch((()=>{A({type:"info",message:"Canceled"})})):A({type:"error",message:"Please select therapist"})},payMethodData:Qe,AccountData:fe,isShowFilter:ce,btnFilterQuery:function(){ce.value=!ce.value},optionsFilter:q,eventFilter:function(){q.value&&(V.value=q.value.value,si())},getNoInvoiceBookings:async function(e,i){Ue.is_Match=-1,Ue.is_Match_id=e.id;const{data:t}=await h(Object.assign(Ve,{customer_id:Ue.Client_id,date:i.treatment_date?i.treatment_date.substring(0,10):"",itemData:e.service_detail,service_name:e.service_name,clinic_id:"",therapist_id:"",company_id:Ue.loacation_id}));1==t.code?t.data.length>0?(de.value=t.data,Q.value=!0):A({type:"info",message:"There are no matching Booking available"}):A({type:"error",message:t.msg})},MatchData:de,MatchDialog:Q,selectedTr:function(e,i){W.value.forEach(((i,t)=>{i.service_detail.forEach(((i,t)=>{i.booking_order_no=e.booking_order_no,i.booking_id=e.booking_id,i.spend_time=Number(e.duration),i.price=e.amount}))})),Q.value=!1},onSelectItemDate:function(e){const i=[];ii.value.forEach(((e,t)=>{i.push(new Date(e.treatment_date).getTime())}));const t=Math.max(...i);ii.value.forEach(((e,i)=>{t==new Date(e.treatment_date).getTime()&&t>new Date(Ue.date).getTime()&&(Ue.date=e.treatment_date)}))},btnExport:async function(){X.value=!0;const{data:i}=await f(Object.assign(Re,{searchKey:oi.searchKey,role:"clinic",clinic_id:oi.clinic_id,therapists_id:oi.therapists_id,options:V,customer_id:e.customer_id}));1==i.code?(X.value=!1,A({type:"success",message:i.msg}),window.open(a+i.file_path.replace("var/www/html/public",""))):X.value=!1},loading1:X,btnAddCharge:function(){const i={Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:e.customer_id,customer_name:e.customer_name};B.value=2,Ge.value=i,J.value=!0},ChargeDialog:J,ChargeArr:Ge,eventCharge:function(){si()},str1:B,loading2:$,btnBatchPayment:async function(){Ue.Invoice_Number="",$.value=!0;const{data:e}=await b(Object.assign(Ye,{invoice_id_list:oi.invoice_id_list}));1==e.code?Ii(e.data):A({type:"error",message:e.msg}),$.value=!1},selectableStatus:function(e,i){return!1},uploadSlotFile1:function(e,i,t){1==e.code?(Ue.files.push(a+e.data.file_path.replace("var/www/html/public/","")),Ue.files1.push(e.data.file_name)):A({type:"error",message:e.data.msg})},btnFile:function(e){e.length&&(be.value=e,G.value=!0)},onFile:function(e){window.open(e)},fileDialog:G,fileArr:be,ServiceInvoice:W,changeServiceCombina:xi,onDeleteService:e=>{k.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Di(e)})).catch((()=>{A({type:"info",message:"Canceled"})}))},changeServiceItem:function(e,i){let t=1;ve.value.forEach(((a,n)=>{e==a.service_name&&(li(a,1),i.licence_name=a.licence_name,i.licence_description=a.description,i.licence_title=a.licence_title,i.licence_number=a.licence_number,a.during_price_json.length>0?a.during_price_json.forEach(((e,n)=>{e.default?(t=2,i.service_detail.forEach(((i,t)=>{i.price=e.price,i.spend_time=e.duration})),_i(i)):1==t&&(i.service_detail.forEach(((e,i)=>{e.price=a.during_price_json[0].price,e.spend_time=a.during_price_json[0].duration})),_i(i))})):(i.service_detail.forEach(((e,i)=>{e.price=0,e.spend_time=0})),_i(i)))}))},onDeleteI:function(e,i){const t=e.service_detail.findIndex((e=>e.id===i.id));-1!==t&&e.service_detail.splice(t,1),e.service_detail.forEach(((e,i)=>{e.id=i+1})),_i(e)},loadPartList:si,invoiceDate:function(e){W.value.forEach(((e,i)=>{li(e)}))},btnSaveDefault:e=>{k.confirm("Do you want to change the current tax configuration to the default service configuration ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{Ni(e)})).catch((()=>{A({type:"info",message:"Canceled"})}))},btnShowAll:function(e){si()}}}))}}}));