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/hookInvoice-legacy-7bc89a37.js
System.register(["./po-legacy-706db15a.js","./fabric-legacy-c65ee5a0.js","./vue-router-legacy-a12307c3.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-ad509c6f.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,v,p,h,f,b,y,w,C,x,I,D,A,k,N,S,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.getClinicsListByTherapistWeb,v=e.setInvoicePaidWeb,p=e.getNoInvoiceBookingsDateWeb,h=e.InvoiceExportWeb,f=e.NeedPaymentInvoiceListWeb,b=e.ServiceCombinaByServiceNameWeb,y=e.getInvoiceNumberWeb,w=e.deleteInvoiceWeb,C=e.getCheckMembersWeb,x=e.saveDefaultTaxWeb},e=>{I=e.f},e=>{D=e.d,A=e.u},e=>{k=e.b7},e=>{N=e.o},e=>{S=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}=D(),T=A();D();const L=S({}),W=S(""),F=S(!1),O=S(!1),B=S(!1),M=S(!1),q=S(null),V=S(""),Y=S(""),R=S(""),H=S(""),K=S([]),z=S([]),U=S("");let $=null;const G=S(""),X=S(!1),Q=S(!1),J=S(!1),Z=S(!1),ee=S(!1),ie=S(!1),te=S(!1),ae=S(!1),ne=S(!1),ce=S(!1),oe=S(""),se=S(1),re=S(""),le=S([]),ue=S([]),de=S([]),_e=S([]),me=S([]),ge=S([]),ve=S([]),pe=S([]),he=S([]),fe=S(!1),be=S(!1),ye=j({}),we=j({}),Ce=j({}),xe=j({}),Ie=j({}),De=j({}),Ae=j({}),ke=j({}),Ne=j({}),Se=j({}),je=j({}),Pe=j({}),Ee=j({}),Te=j({}),Le=j({}),We=j({}),Fe=j({}),Oe=j({}),Be=j({}),Me=j({}),qe=j({}),Ve=j({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),Ye=j({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:"",invoice_id:""}),Re=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:"",chapter_image:"",is_use_chapter:"",is_Match:-1,is_Match_id:"",today:"",files:[],files1:[],fileView:[]}),He=j({name:"",id:""}),Ke=j({name:"",id:"",r_ac_name:"",r_ac_register:"",name1:"",rmt_register:""}),ze=j({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Ue=S([{value:"normal",text:"Normal"},{value:"outside",text:"Outside"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),$e=S([{value:"Y",text:"Y"},{value:"N",text:"N"}]),Ge=S([{id:1,price:0,spend_time:"",treatment_date:"",booking_order_no:"",booking_id:""}]),Xe=S([{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"}]),Qe=S([{value:"Massage",text:"Massage"},{value:"Acupuncture",text:"Acupuncture"}]);j({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const Je=j({}),Ze=j({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),ei=j({total:0,pageSize:10,currentPage:1,background:!0,pageSizes:[10,25,50,100]}),ii=j({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",date:"",amountBegin:"",amountEnd:"",show_number:!0,clinic_id:"",therapists_id:"",is_batch_invoice:"",invoice_id_list:[],sub_amount:"",sub_pay_amount:"",export:"N",show_all:!1,privcat:""});async function ti(i){ii.export="N","Y"==i&&(ii.export=i),G.value=localStorage.getItem("type");let n="";1==G.value&&(n="therapists"),X.value=!0;const{data:c}=await t(Object.assign(ye,{searchKey:ii.searchKey,amountBegin:ii.amountBegin,amountEnd:ii.amountEnd,invoiceDate:ii.date,clinic_id:ii.clinic_id,therapists_id:ii.therapists_id,role:n,options:W,customer_id:e.customer_id,pageSize:ei.pageSize,page:ei.currentPage,export:ii.export,show_all:ii.show_all}));1==c.code?(X.value=!1,"N"==ii.export?(le.value=c.data,ii.privcat=c.privcat,ii.show_number=c.config.show_number,ii.is_batch_invoice=c.is_batch_invoice,ei.total=c.total,ii.sub_amount=c.sub_amount,ii.sub_pay_amount=c.sub_pay_amount):(k({type:"success",message:"Export Success"}),window.open(a+c.first_name.replace("var/www/html/public","")))):X.value=!1}function ai(){Ge.value=[];const i={id:Ge.value.length+1,price:0,spend_time:"",treatment_date:Re.today,booking_order_no:"",booking_id:""};Re.date=Re.today,Ge.value.push(i),di(1),e.customer_id&&(Re.Client_name=e.customer_name,Re.Client_id=e.customer_id),Re.files=[],Re.files1=[],ee.value=!0}async function ni(e,i){Re.Invoice_Number="",X.value=!0;let t=e.service_id;1==i&&(t=e.id);const{data:a}=await y(Object.assign(we,{clinic_id:"",service_id:t,invoice_date:Re.date}));1==a.code&&(1==i?z.value.forEach(((i,t)=>{e.service_name==i.service_name&&(i.invoice_number=a.invoice_number)})):e.invoice_number=a.invoice_number),X.value=!1}function ci(e){const i=Ge.value.findIndex((i=>i.id===e.id));-1!==i&&Ge.value.splice(i,1),Ge.value.forEach(((e,i)=>{e.id=i+1})),si()}function oi(e,i){Re.is_tax=e?"Y":"N",si(i)}function si(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 ri(e){const{data:i}=await w(Object.assign(Ce,{invoice_id:e.id}));1==i.code&&(ti(),k({type:"success",message:i.msg}))}function li(){$.renderAll()}async function ui(e){const{data:i}=await s(Object.assign(Ae,{note_id:"",signal_url:"signal_url1",form_type:"invoice",base64code:V.value,yuyueFDF:a}));1==i.code&&(Re.signal_image=i.file_path,J.value=!1)}async function di(e){const{data:i}=await l(Object.assign(Ne,{customer_id:Re.Client_id,is_licence:!1}));1==i.code?(ge.value=i.data,ge.value.length>0&&1==e&&(Re.description_type=ge.value[0].value,hi(Re.description_type),Re.service_id=ge.value[0].id,he.value=ge.value[0].during_price_json),pe.value=ge.value):k({type:"error",message:i.msg})}async function _i(){const{data:e}=await C(Object.assign(Se,{customer_id:ze.customer_id}));if(1==e.code){me.value=e.data;let i=Re.Need_Charge_Amount;me.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 k({type:"error",message:e.msg})}function mi(){const e=new Date,i=e.getFullYear(),t=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);ze.time=i+"-"+t+"-"+a}async function gi(){const{data:e}=await _(Object.assign(We,{clinic_id:"",role:"therapists",searchKey:""}));1==e.code&&(de.value=e.data)}function vi(){T.push({path:"/crm/yuyue/licence",query:{invoceService:1}})}function pi(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};se.value=6,Ye.value=i,O.value=!0}async function hi(e){let i="";ge.value.forEach(((t,a)=>{t.value==e&&(i=t.id,Re.signal_desc=t.sinal_desc_arr,Re.signal_image=t.sinal_image_arr)}));const{data:t}=await b(Object.assign(Me,{role:"therapists",clinic_id:"",service_id:i,service_name:e,customer_id:Re.Client_id}));1==t.code?(z.value=t.data,z.value.forEach(((e,i)=>{e.service_detail.forEach(((e,i)=>{e.treatment_date=e.treatment_date.substring(0,10)})),oi(e.is_tax,e),ni(e)}))):k({type:"error",message:t.msg}),M.value=!1}function fi(e){const i=z.value.findIndex((i=>i.service_name===e.service_name));-1!==i&&z.value.splice(i,1)}async function bi(e){const{data:i}=await x(Object.assign(qe,{is_tax:e.is_tax,include_tax:e.include_tax,service_name:e.service_name,service_id:e.service_id}));0==i.code?k({type:"success",message:i.msg}):k({type:"error",message:i.msg})}return P((()=>{$=new I.fabric.Canvas(q.value,{isDrawingMode:!0}),function(){const e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),n=("0"+e.getDate()).slice(-2);Re.date=t+"-"+a+"-"+n,Ge.value[0].treatment_date=t+"-"+a+"-"+n,Re.invoice_due_date=t+"-"+a+"-"+n,Re.today=t+"-"+a+"-"+n,1==i.help&&ai()}(),G.value=localStorage.getItem("type"),async function(){X.value=!0;const{data:e}=await g(Object.assign(Te,{searchKey:"",is_therapistInvoice:"Y"}));1==e.code&&(_e.value=e.data),X.value=!1}()})),{searchDetail:ii,btnSearchPart:function(){ti()},loading:X,small:ce,selectList:["勾选列","Invoice #","Files","Customer Name","Invoice Date","Total ($)","Paid Amount $","Split Rate","Split Amount","Withdraw Amount","Service Name","Location","Booking #","PAID IN FULL","Origin","Action"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,align:"left",hide:({checkList:e})=>!e.includes("序号列")},{label:"Invoice #",prop:"invoice_number",minWidth:120,align:"left",hide:({checkList:e})=>!e.includes("Invoice #")},{label:"Files",prop:"file",minWidth:50,slot:"files",hide:({checkList:e})=>!e.includes("Files")},{label:"Customer Name",slot:"Customer",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Customer Name")},{label:"Invoice Date",prop:"invoice_date_standard",minWidth:92,hide:({checkList:e})=>!e.includes("Invoice Date")},{label:"Total ($)",prop:"total_amount",minWidth:85,align:"right",hide:({checkList:e})=>!e.includes("Total ($)")},{label:"Paid Amount $",prop:"pay_amount",minWidth:105,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:100,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:"Origin",prop:"clinic_name",slot:"Origin",minWidth:100,align:"left",hide:({checkList:e})=>!e.includes("Origin")},{label:"Action",fixed:"right",width:200,slot:"operation",align:"left",hide:({checkList:e})=>!e.includes("Action")}],pagination:ei,handleSizeChange:function(e){ei.pageSize=e,ti()},handleCurrentChange:function(e){ei.currentPage=e,ti()},PartList:le,order_date:oe,deliverDialog:ee,selectClick:function(e){ii.invoice_id_list=[],e.forEach(((e,i)=>{ii.invoice_id_list.push(e.id)}))},deliverDataArr:Ze,btnDeliverConfirm:async function(){X.value=!0;let e="";e="outside"==Re.invoice_type?Re.description_type1:Re.description_type;const{data:i}=await n(Object.assign(Je,{customer_id:Re.Client_id,company_id:Re.loacation_id,invoice_type:Re.invoice_type,invoice_date:Re.date,invoice_due_date:Re.invoice_due_date,is_tax:Re.is_tax,description_type:e,signal_image:Re.signal_image,items:Ge,include_tax:Re.include_tax,receive_message:Re.receive,note_id:"",signal_desc:Re.signal_desc,origin:"new",files:Re.files,combina_service_arr:z.value}));1==i.code?(ti(),ee.value=!1,k({type:"success",message:i.msg}),X.value=!1):(k({type:"error",message:i.msg}),X.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:Re,InvoiceType:Ue,btnAdd:ai,descriptionData:Qe,items:Ge,during_price_array:he,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),si(e)},onDelete:e=>{N.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ci(e)})).catch((()=>{k({type:"info",message:"Canceled"})}))},taxData:$e,onIs_tax:oi,IncludeTax:function(e,i){si(i)},duringPrice:function(e,i,t){t.spend_time=e,t.during_price_json.forEach(((i,a)=>{i.value==e&&(t.price=i.price)})),si(i)},onSelectLocation:function(){fe.value=!0},locationDialog:fe,ClientDialog:be,eventIsNumlocation:function(){Re.loacation_name=Ke.name,Re.loacation_id=Ke.id,Re.r_ac_name=Ke.r_ac_name,Re.r_ac_register=Ke.r_ac_register,Re.name1=Ke.name1,Re.rmt_register=Ke.rmt_register},eventIsNum:function(){Re.Client_id=He.id,Re.Client_name=He.name,hi(Re.description_type)},onSelClient:function(){be.value=!0},ClientData:He,locationData:Ke,btnDelInvoice:e=>{N.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{ri(e)})).catch((()=>{k({type:"info",message:"Canceled"})}))},sandEmailDialog:ne,btnSendEmail:async function(e){Re.customArr=e;const{data:i}=await c(Object.assign(xe,{invoice_id:e.id}));1==i.code&&(ne.value=!0,Re.fileName=i.file_path.replace("/var/www/html/public/pdf/",""),Re.file_path=i.file_path,Re.email_content=i.data.config.emailconfig.email_content)},onSend:async function(){const{data:e}=await o(Object.assign(Ie,{invoice_id:Re.customArr.id,file_path:Re.file_path,emailContent:Re.email_content,show_number:ii.show_number}));1==e.code&&(k({type:"success",message:e.msg}),ne.value=!1)},btnPrintPDF:async function(e){const{data:i}=await c(Object.assign(De,{invoice_id:e.id,show_number:ii.show_number}));1==i.code?window.open(a+i.file_path.replace("var/www/html/public","")):k({type:"error",message:i.msg})},onPrice:si,openAutograph:function(){Ve.signal_url="signal_url1",Ve.form_type="invoice",Ve.note_id="",Ve.service=Re.description_type,Ve.service_id=Re.service_id,J.value=!0},signatureCanvas:q,signatureDataUrl:V,saveSignature:()=>{li(),V.value=$.toDataURL({format:"png"}),ui()},clearSignature:function(){$.clear(),V.value=""},autographDialog:J,signalData:Ve,eventSignal:function(){let e="";di(2),Re.signal_image=Y.value,Re.signal_image&&(e=Re.signal_image.replace(a+"/images/","").substring(0,6),Re.is_web="fabric"==e?2:1)},handleValueFromChild:e=>{Re.signal_image=e},signalUrl:Y,InvoiceDetailDialog:Z,btnDetail:async function(e){ve.value=[],R.value="",H.value="",U.value="",Re.chapter_image="",Re.is_use_chapter="",re.value="",Re.fileView=e.file;let i="";Z.value=!0,Re.customArr=e;const{data:t}=await r(Object.assign(ke,{invoice_id:e.id}));1==t.code&&(ve.value=t.data[0].detail,R.value=t.data[0].company_info,H.value=t.data[0].info,U.value=t.data[0].customer_info,Re.chapter_image=t.data[0].config.chapter_image,Re.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),Re.is_web="fabric"==i?2:1),re.value=t.data[0].licence,Z.value=!0)},detailInfo:ve,company_info:R,info:H,type:G,customer_info:U,addServiceData:ge,changeServic:function(e){pe.value.forEach(((i,t)=>{i.service_name==e&&(Re.licence_number=i.licence_number,Re.licence_name=i.licence_name,Re.name=i.name,Re.description=i.description,Re.licence_title=i.licence_title,he.value=i.during_price_json,Re.signal_desc=i.sinal_desc_arr,Re.signal_image=i.sinal_image_arr,Re.service_id=i.id,ni())}));let i="",t="";he.value.forEach(((e,a)=>{e.default&&(i=e.duration,t=e.price)})),Ge.value.forEach(((e,a)=>{e.spend_time=i,e.price=t})),(""==i||""==t)&&Ge.value.forEach(((e,i)=>{e.spend_time=0,e.price=0})),si()},licenceDetail:re,CollectionDialog:te,btnCollection:function(e){const i={Invoice_Charge_Number:e.invoice_number,Customer_Name:e.customer_first_name?e.customer_first_name+e.customer_last_name:e.customer_show,Invoice_Total_Charge:e.total_amount,Has_Paid_Amount:e.pay_amount,Need_Charge_Amount:e.need_charge_amount,Total_Paid_Amount:"",customer_id:e.customer_id,customer_name:e.customer_first_name?e.customer_first_name+e.customer_last_name:e.customer_show,invoice_id:e.id};return se.value=1,Ye.value=i,void(O.value=!0)},CollectionData:me,bookingPaymentConfirm:async function(){const{data:e}=await u(Object.assign(je,{invoice_id:ze.invoice_id,pay_amount_details:me.value}));1==e.code?(ti(),te.value=!1):k({type:"error",message:e.msg})},addCollectionDialog:ae,AddCollect:function(){mi(),gi(),ae.value=!0},collectionArr:ze,btncollectionConfirm:async function(){if(X.value=!0,"Cheque"!=ze.pay_method&&(ze.cheque_number=""),"Cheque"==ze.pay_method&&""==ze.cheque_number)return k({type:"error",message:"Please enter cheque number"}),void(X.value=!1);let e="";if("Other"==ze.pay_method){if(""==ze.other)return k({type:"error",message:"Please enter pay method"}),void(X.value=!1);e=ze.other}else e=ze.pay_method;const{data:i}=await d(Object.assign(Pe,{customer_id:ze.customer_id,pay_amount:ze.pay_amount,pay_method:e,cheque_number:ze.cheque_number,content:ze.content,collection_time:ze.time,account_id:ze.account_id}));1==i.code?(_i(),k({type:"success",message:i.msg}),ae.value=!1,X.value=!1):(k({type:"error",message:i.msg}),X.value=!1)},btnShowNumber:async function(e){const{data:i}=await m(Object.assign(Ee,{show_number:ii.show_number}));k({type:"success",message:i.msg})},disabledBeforeToday:function(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()},onSearch:function(){ti()},clinicData:_e,onClinicData:function(e){null==e&&(ii.clinic_id="")},btnIsPaid:async function(e,i){const{data:t}=await v(Object.assign(Le,{invoice_id:i.id,is_paid:e}));1==t.code&&ti(),k({type:"success",message:t.msg})},btnGuide:function(){T.push({path:"/crm/yuyue/licence",query:{invoceGuide:1}})},btnService:()=>{N.confirm("Invoicing requires services with licence",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then((()=>{vi()})).catch((()=>{k({type:"info",message:"Canceled"})}))},payMethodData:Xe,AccountData:de,isShowFilter:F,btnFilterQuery:function(){F.value=!F.value},optionsFilter:L,eventFilter:function(){L.value&&(W.value=L.value.value,ti())},getNoInvoiceBookings:async function(e,i){Re.is_Match=-1,Re.is_Match_id=e.id;const{data:t}=await p(Object.assign(Fe,{customer_id:Re.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:Re.loacation_id}));1==t.code?t.data.length>0?(ue.value=t.data,ie.value=!0):k({type:"info",message:"There are no matching Booking available"}):k({type:"error",message:t.msg})},MatchData:ue,MatchDialog:ie,selectedTr:function(e,i){z.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}))})),ie.value=!1},btnMatchConfirm:function(){},onSelectItemDate:function(e){const i=[];Ge.value.forEach(((e,t)=>{i.push(new Date(e.treatment_date).getTime())}));const t=Math.max(...i);Ge.value.forEach(((e,i)=>{t==new Date(e.treatment_date).getTime()&&t>new Date(Re.date).getTime()&&(Re.date=e.treatment_date)}))},btnExport:async function(){B.value=!0;const{data:i}=await h(Object.assign(Oe,{searchKey:ii.searchKey,clinic_id:ii.clinic_id,therapists_id:ii.therapists_id,role:"therapists",options:W,customer_id:e.customer_id}));1==i.code?(B.value=!1,k({type:"success",message:i.msg}),window.open(a+i.file_path.replace("var/www/html/public",""))):B.value=!1},loading1:B,btnAddCharge:function(){const i={Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",invoice_id:"",customer_id:e.customer_id,customer_name:e.customer_name};se.value=2,Ye.value=i,O.value=!0},ChargeDialog:O,ChargeArr:Ye,eventCharge:function(){ti()},str1:se,btnBatchPayment:async function(){Re.Invoice_Number="",M.value=!0;const{data:e}=await f(Object.assign(Be,{invoice_id_list:ii.invoice_id_list}));1==e.code?pi(e.data):k({type:"error",message:e.msg}),M.value=!1},loading2:M,uploadSlotFile1:function(e,i,t){1==e.code?(Re.files.push(a+e.data.file_path.replace("var/www/html/public/","")),Re.files1.push(e.data.file_name)):k({type:"error",message:e.data.msg})},btnFile:function(e){e.length&&(K.value=e,Q.value=!0)},onFile:function(e){window.open(e)},fileDialog:Q,fileArr:K,ServiceInvoice:z,changeServiceCombina:hi,onDeleteService:e=>{N.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{fi(e)})).catch((()=>{k({type:"info",message:"Canceled"})}))},changeServiceItem:function(e,i){let t=1;ge.value.forEach(((a,n)=>{e==a.service_name&&(ni(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})),si(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})),si(i))})):(i.service_detail.forEach(((e,i)=>{e.price=0,e.spend_time=0})),si(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})),si(e)},loadPartList:ti,invoiceDate:function(e){z.value.forEach(((e,i)=>{ni(e)}))},btnSaveDefault:e=>{N.confirm("Do you want to change the current tax configuration to the default service configuration ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{bi(e)})).catch((()=>{k({type:"info",message:"Canceled"})}))},btnShowAll:function(e){ti()}}}))}}}));