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-969a9fc6.js
import{InvoiceListWeb as mt,yuyueFDF as y,newInvoiceWeb as ft,invoicePdfWeb as ve,sendEmailWeb as gt,base64image as pt,invoiceDetailWeb as ht,getLicenceServiceWeb as vt,invoicePaymentWeb as bt,prePaidWeb as yt,AccountListWeb as wt,updateShowNumber as Ct,getManagerClinicsListWeb as At,getManageTherapistWeb as It,setInvoicePaidWeb as Dt,getNoInvoiceBookingsDateWeb as xt,InvoiceExportWeb as Nt,NeedPaymentInvoiceListWeb as St,ServiceCombinaByServiceNameWeb as Tt,getInvoiceNumberWeb as Pt,deleteInvoiceWeb as Et,getCheckMembersWeb as Wt}from"./po-399a971b.js";import{f as kt}from"./fabric-566ce268.js";import{d as be,u as jt}from"./vue-router-a383d220.js";import{b7 as r}from"./message-2472a54a.js";import{o as O}from"./index-81e4a901.js";import{r as o,A as s,o as Ot}from"./runtime-core.esm-bundler-6128546f.js";import"./index-23ee140c.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./utils-2ab4f76a.js";import"./focus-trap-53f1c6ab.js";import"./error-78e43d3e.js";function Xt(h){const{query:ye,params:Ft}=be(),we=jt();be();const g=o([]),ie=o(null),D=o(""),x=o(1),te=o(""),F=o({}),M=o(""),B=o(""),L=o(""),q=o("");let N=null;const ae=o(""),_=o(!1),S=o(!1),T=o(!1),ne=o(!1),P=o(!1),V=o(!1),R=o(!1),Y=o(!1),z=o(!1),H=o(!1),K=o(!1),U=o(!1),$=o(!1),Ce=o(!1),Ae=o(""),J=o(""),oe=o(""),ce=o([]),se=o([]),Ie=o([]),re=o([]),le=o([]),E=o([]),v=o([]),G=o([]),de=o([]),ue=o([]),X=o([]),A=o([]),_e=o(!1),me=o(!1),De=s({}),xe=s({}),Ne=s({}),Se=s({}),Te=s({}),Pe=s({}),Ee=s({}),We=s({}),ke=s({}),je=s({}),Oe=s({}),Fe=s({}),Me=s({}),Be=s({}),Le=s({});s({});const qe=s({}),Ve=s({}),Re=s({}),Ye=s({}),ze=s({}),He=s({}),w=s({signal_url:"",form_type:"",note_id:"",service:"",service_id:""}),t=s({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:[]}),W=s({name:"",id:"",clinic_id:""}),b=s({name:"",id:"",r_ac_name:"",r_ac_register:"",name1:"",rmt_register:""}),k=s({Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:"",customer_name:""}),d=s({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Ke=o([{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"}]),Ue=o([{value:"normal",text:"Normal"},{value:"outside",text:"Outside"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),$e=o([{value:"Y",text:"Y"},{value:"N",text:"N"}]),m=o([{id:1,price:0,spend_time:"",treatment_date:"",booking_order_no:"",booking_id:""}]),Je=o([{value:"Massage",text:"Massage"},{value:"Acupuncture",text:"Acupuncture"}]);s({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const Ge=s({}),Xe=s({qo_item_str:"",name:"",address:"",way:"",shipping:[],itemsDetail:[],trackingNo:"",courier:"",comment:""}),C=s({total:0,pageSize:10,currentPage:1,background:!0,pageSizes:[10,25,50,100]}),Qe=[{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")}],Ze=["勾选列","Invoice #","Files","Therapist","Customer Name","Invoice Date","Total ($)","Paid Amount $","Service Name","Location","Booking #","PAID IN FULL","Split Rate","Split Amount","Withdraw Amount","Action"],c=s({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"});function ei(){p()}function ii(e){C.pageSize=e,p()}function ti(e){C.currentPage=e,p()}async function p(e){c.export="N",e=="Y"&&(c.export=e),t.Clinic_id=c.clinic_id,_.value=!0;const{data:i}=await mt(Object.assign(De,{searchKey:c.searchKey,amountBegin:c.amountBegin,amountEnd:c.amountEnd,invoiceDate:c.date,role:"clinic",clinic_id:c.clinic_id,therapists_id:c.therapists_id,options:M,customer_id:h.customer_id,pageSize:C.pageSize,page:C.currentPage,export:c.export}));i.code==1?(_.value=!1,c.export=="N"?(ce.value=i.data,c.show_number=i.config.show_number,c.is_batch_invoice=i.is_batch_invoice,c.sub_amount=i.sub_amount,c.sub_pay_amount=i.sub_pay_amount,pe()):(r({type:"success",message:"Export Success"}),window.open(y+i.first_name.replace("var/www/html/public","")))):_.value=!1,C.total=i.total}function ai(e){return e.assocInfo.booking.length>0?e.assocInfo.booking[0].booking_order_no:""}function ni(e){return e.assocInfo.note.length>0?e.assocInfo.note[0].id:""}function fe(){g.value=[],t.Client_name="",t.Client_id="",t.signal_desc="",t.signal_image="",t.Invoice_Number="",m.value=[];const e={id:m.value.length+1,price:0,spend_time:"",treatment_date:t.today,booking_order_no:"",booking_id:""};m.value.push(e),t.date=t.today,h.customer_id&&(t.Client_name=h.customer_name,t.Client_id=h.customer_id),t.files=[],t.files1=[],z.value=!0}async function j(e,i){t.Invoice_Number="",_.value=!0;let n=e.service_id;i==1&&(n=e.id);const{data:a}=await Pt(Object.assign(xe,{clinic_id:"",service_id:n,invoice_date:t.date}));a.code==1&&(i==1?g.value.forEach((l,u)=>{e.service_name==l.service_name&&(l.invoice_number=a.invoice_number)}):e.invoice_number=a.invoice_number),_.value=!1}function oi(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),f(e)}function ci(e){const i=m.value.findIndex(n=>n.id===e.id);i!==-1&&m.value.splice(i,1),m.value.forEach((n,a)=>{n.id=a+1}),f()}const si=e=>{O.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ci(e)}).catch(()=>{r({type:"info",message:"Canceled"})})};function ge(e,i){e?t.is_tax="Y":t.is_tax="N",f(i)}function ri(e,i){f(i)}function f(e){let i=0;e.service_detail.forEach((n,a)=>{n.price!=""&&(i=parseFloat(i)+parseFloat(n.price))}),e.is_tax?e.include_tax=="N"?(e.hstValue=Math.round(parseFloat(i)*.13*100)/100,e.total=Math.round(parseFloat(i)*1.13*100)/100):e.include_tax=="Y"&&(e.hstValue=Math.round(parseFloat(i)/1.13*.13*100)/100,e.total=Math.round(parseFloat(i)*100)/100):(e.hstValue=0,e.total=Math.round(parseFloat(i)*100)/100)}function li(e,i,n){n.spend_time=e,n.during_price_json.forEach((a,l)=>{a.value==e&&(n.price=a.price)}),f(i)}function di(){const e=new Date,i=e.getFullYear(),n=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);t.date=i+"-"+n+"-"+a,m.value[0].treatment_date=i+"-"+n+"-"+a,t.invoice_due_date=i+"-"+n+"-"+a,t.today=i+"-"+n+"-"+a,ye.help==1&&fe()}function ui(){_e.value=!0}function _i(){t.loacation_name=b.name,t.loacation_id=b.id,t.r_ac_name=b.r_ac_name,t.r_ac_register=b.r_ac_register,t.name1=b.name1,t.rmt_register=b.rmt_register}function mi(){t.Client_id=W.id,t.Client_name=W.name,Z(t.description_type)}function fi(){if(t.Clinic_id==""||t.Clinic_id==null){r({type:"error",message:"Please choose a clinic"});return}W.clinic_id=t.Clinic_id,me.value=!0}async function gi(){_.value=!0;let e="";t.invoice_type=="outside"?e=t.description_type1:e=t.description_type;const{data:i}=await ft(Object.assign(Ge,{customer_id:t.Client_id,company_id:t.loacation_id,invoice_type:t.invoice_type,invoice_date:t.date,invoice_due_date:t.invoice_due_date,is_tax:t.is_tax,description_type:e,signal_image:t.signal_image,items:m,include_tax:t.include_tax,invoice_number:t.Invoice_Number,receive_message:t.receive,note_id:"",signal_desc:t.signal_desc,clinics_id:t.Clinic_id,Therapists_id:t.Therapist,origin:"new",files:t.files,combina_service_arr:g.value}));i.code==1?(p(),z.value=!1,r({type:"success",message:i.msg}),_.value=!1):(r({type:"error",message:i.msg}),_.value=!1)}async function pi(e){const{data:i}=await Et(Object.assign(Ne,{invoice_id:e.id}));i.code==1&&(p(),r({type:"success",message:i.msg}))}const hi=e=>{O.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{pi(e)}).catch(()=>{r({type:"info",message:"Canceled"})})};async function vi(e){t.customArr=e;const{data:i}=await ve(Object.assign(Se,{invoice_id:e.id}));i.code==1&&(U.value=!0,t.fileName=i.file_path.replace("/var/www/html/public/pdf/",""),t.file_path=i.file_path,t.email_content=i.data.config.emailconfig.email_content)}async function bi(){const{data:e}=await gt(Object.assign(Te,{invoice_id:t.customArr.id,file_path:t.file_path,emailContent:t.email_content,show_number:c.show_number}));e.code==1&&(r({type:"success",message:e.msg}),U.value=!1)}async function yi(e){const{data:i}=await ve(Object.assign(Pe,{invoice_id:e.id,show_number:c.show_number}));i.code==1?window.open(y+i.file_path.replace("var/www/html/public","")):r({type:"error",message:i.msg})}function wi(){w.signal_url="signal_url1",w.form_type="invoice",w.note_id="",w.service=t.description_type,w.service_id=t.service_id,R.value=!0}function Ci(){N.clear(),D.value=""}const Ai=()=>{Ii(),D.value=N.toDataURL({format:"png"}),xi()};function Ii(){N.renderAll()}function Di(){N=new kt.fabric.Canvas(ie.value,{isDrawingMode:!0})}async function xi(e){const{data:i}=await pt(Object.assign(Ee,{note_id:"",signal_url:"signal_url1",form_type:"invoice",base64code:D.value,yuyueFDF:y}));i.code==1&&(Q(2),t.signal_image=i.file_path,R.value=!1)}function Ni(){let e="";Q(2),t.signal_image=te.value,t.signal_image&&(e=t.signal_image.replace(y+"/images/","").substring(0,6),e=="fabric"?t.is_web=2:t.is_web=1)}const Si=e=>{t.signal_image=e};async function Ti(e){G.value=[],B.value="",L.value="",q.value="",t.chapter_image="",t.is_use_chapter="",J.value="",t.fileView=e.file;let i="";Y.value=!0,t.customArr=e;const{data:n}=await ht(Object.assign(We,{invoice_id:e.id}));n.code==1&&(G.value=n.data[0].detail,B.value=n.data[0].company_info,L.value=n.data[0].info,q.value=n.data[0].customer_info,t.chapter_image=n.data[0].config.chapter_image,t.is_use_chapter=n.data[0].config.is_use_chapter,n.data[0].info.signal_image&&(i=n.data[0].info.signal_image.replace(y+"/images/","").substring(0,6),i=="fabric"?t.is_web=2:t.is_web=1),J.value=n.data[0].licence,Y.value=!0)}async function Q(e){const{data:i}=await vt(Object.assign(ke,{clinics_id:t.Clinic_id,Therapists_id:t.Therapist,role:c.role,clinic_id:oe,customer_id:t.Client_id,is_licence:!1}));i.code==1?(v.value=JSON.parse(JSON.stringify(i.data)),v.value.length>0?(e==1&&(t.description_type=v.value[0].service_name,Z(t.description_type),t.service_id=v.value[0].id,A.value=v.value[0].during_price_json),X.value=JSON.parse(JSON.stringify(i.data))):(t.description_type="",X.value=[],A.value=[],m.value.forEach((n,a)=>{n.price=0,n.spend_time=""}),t.hstValue=0,t.total=0)):r({type:"error",message:i.msg})}function Pi(e){X.value.forEach((a,l)=>{a.service_name==e&&(t.licence_number=a.licence_number,t.licence_name=a.licence_name,t.name=a.name,t.description=a.description,t.licence_title=a.licence_title,A.value=a.during_price_json,t.signal_desc=a.sinal_desc_arr,t.signal_image=a.sinal_image_arr,t.service_id=a.id,j())});let i="",n="";v.value.forEach((a,l)=>{e==a.service_name&&a.during_price_json.forEach((u,ee)=>{u.default&&(i=u.price,n=u.duration)})}),m.value.forEach((a,l)=>{i||n?(a.price=i,a.duration=n,a.spend_time=n,a.value=n):(a.price=0,a.duration=0,a.value=0,a.spend_time=0)}),f()}function Ei(){const e={Invoice_Charge_Number:"",Customer_Name:"",Invoice_Total_Charge:"",Has_Paid_Amount:"",Need_Charge_Amount:"",Total_Paid_Amount:"",customer_id:h.customer_id,customer_name:h.customer_name};x.value=2,k.value=e,T.value=!0}function Wi(e){const i={Invoice_Charge_Number:e.invoice_number,Customer_Name:e.customer_first_name+e.customer_last_name,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:h.customer_name?h.customer_name:e.customer_first_name+e.customer_last_name,invoice_id:e.id};x.value=1,k.value=i,T.value=!0}async function ki(){const{data:e}=await Wt(Object.assign(je,{customer_id:d.customer_id}));if(e.code==1){E.value=e.data;let i=t.Need_Charge_Amount;E.value.forEach((n,a)=>{const l=Math.min(n.remain_amount,i);l>0&&(n.paid_amount=l,i=parseFloat((i-l).toFixed(2)))}),H.value=!0}else r({type:"error",message:e.msg})}async function ji(){const{data:e}=await bt(Object.assign(Oe,{invoice_id:d.invoice_id,pay_amount_details:E.value}));e.code==1?(p(),H.value=!1):r({type:"error",message:e.msg})}async function Oi(){if(_.value=!0,d.pay_method!="Cheque"&&(d.cheque_number=""),d.pay_method=="Cheque"&&d.cheque_number==""){r({type:"error",message:"Please enter cheque number"}),_.value=!1;return}let e="";if(d.pay_method=="Other"){if(d.other==""){r({type:"error",message:"Please enter pay method"}),_.value=!1;return}e=d.other}else e=d.pay_method;const{data:i}=await yt(Object.assign(Fe,{customer_id:d.customer_id,pay_amount:d.pay_amount,pay_method:e,cheque_number:d.cheque_number,content:d.content,collection_time:d.time,account_id:d.account_id}));i.code==1?(ki(),r({type:"success",message:i.msg}),K.value=!1,_.value=!1):(r({type:"error",message:i.msg}),_.value=!1)}function Fi(){Mi(),Bi(),K.value=!0}function Mi(){const e=new Date,i=e.getFullYear(),n=("0"+(e.getMonth()+1)).slice(-2),a=("0"+e.getDate()).slice(-2);d.time=i+"-"+n+"-"+a}async function Bi(){const{data:e}=await wt(Object.assign(Ve,{clinic_id:c.clinic_id,role:"clinic",searchKey:""}));e.code==1&&(de.value=e.data)}async function Li(e){const{data:i}=await Ct(Object.assign(Me,{show_number:c.show_number}));r({type:"success",message:i.msg})}async function qi(){const{data:e}=await At(Object.assign(Be,{cliniic_name:"",pageSize:1e3,page:1}));e.code==1&&(le.value=e.data)}function Vi(e){pe()}async function pe(){const{data:e}=await It(Object.assign(Le,{clinics_id:t.Clinic_id}));e.code==1?(re.value=e.data,e.data.length>0&&(t.Therapist=Number(e.data[0].id),he())):r({type:"error",message:e.msg})}function he(){t.signal_desc="",t.signal_image="",t.licence_number="",t.licence_name="",t.name="",t.description="",t.licence_title="",A.value=[],t.service_id="",Q(1)}function Ri(e){const i=new Date;return i.setHours(0,0,0,0),e.getTime()>i.getTime()}function Yi(e){e==null&&(c.therapists_id="")}async function zi(e,i){const{data:n}=await Dt(Object.assign(qe,{invoice_id:i.id,is_paid:e}));n.code==1&&p(),r({type:"success",message:n.msg})}const Hi=()=>{if(t.Therapist==""||t.Therapist==null){r({type:"error",message:"Please select therapist"});return}O.confirm("Invoicing requires the therapist to provide licence services",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then(()=>{Ki()}).catch(()=>{r({type:"info",message:"Canceled"})})};function Ki(){we.push({path:"/crm/yuyue/clinic/employee",query:{invoceService:1}})}function Ui(){$.value=!$.value}function $i(){F.value&&(M.value=F.value.value,p())}async function Ji(e,i){t.is_Match=-1,t.is_Match_id=e.id;const{data:n}=await xt(Object.assign(Re,{customer_id:t.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:t.loacation_id}));n.code==1?n.data.length>0?(se.value=n.data,V.value=!0):r({type:"info",message:"There are no matching Booking available"}):r({type:"error",message:n.msg})}function Gi(e){const i=[];m.value.forEach((a,l)=>{i.push(new Date(a.treatment_date).getTime())});const n=Math.max(...i);m.value.forEach((a,l)=>{n==new Date(a.treatment_date).getTime()&&n>new Date(t.date).getTime()&&(t.date=a.treatment_date)})}async function Xi(){P.value=!0;const{data:e}=await Nt(Object.assign(Ye,{searchKey:c.searchKey,role:"clinic",clinic_id:c.clinic_id,therapists_id:c.therapists_id,options:M,customer_id:h.customer_id}));e.code==1?(P.value=!1,r({type:"success",message:e.msg}),window.open(y+e.file_path.replace("var/www/html/public",""))):P.value=!1}function Qi(){p()}function Zi(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};x.value=6,k.value=i,T.value=!0}function et(e){c.invoice_id_list=[],e.forEach((i,n)=>{c.invoice_id_list.push(i.id)})}async function it(){t.Invoice_Number="",S.value=!0;const{data:e}=await St(Object.assign(ze,{invoice_id_list:c.invoice_id_list}));e.code==1?Zi(e.data):r({type:"error",message:e.msg}),S.value=!1}function tt(e,i){return!1}function at(e,i,n){e.code==1?(t.files.push(y+e.data.file_path.replace("var/www/html/public/","")),t.files1.push(e.data.file_name)):r({type:"error",message:e.data.msg})}function nt(e){e.length&&(ue.value=e,ne.value=!0)}function ot(e){window.open(e)}async function Z(e){let i="";v.value.forEach((a,l)=>{a.value==e&&(i=a.id,t.signal_desc=a.sinal_desc_arr,t.signal_image=a.sinal_image_arr)});const{data:n}=await Tt(Object.assign(He,{role:"clinic",clinic_id:c.clinic_id,service_id:i,service_name:e,customer_id:t.Client_id}));n.code==1?(g.value=n.data,g.value.forEach((a,l)=>{a.service_detail.forEach((u,ee)=>{u.treatment_date=u.treatment_date.substring(0,10)}),ge(a.is_tax,a),j(a)})):r({type:"error",message:n.msg}),S.value=!1}function ct(e){const i=g.value.findIndex(n=>n.service_name===e.service_name);i!==-1&&g.value.splice(i,1)}const st=e=>{O.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ct(e)}).catch(()=>{r({type:"info",message:"Canceled"})})};function rt(e,i){g.value.forEach((n,a)=>{n.service_detail.forEach((l,u)=>{l.booking_order_no=e.booking_order_no,l.booking_id=e.booking_id,l.spend_time=Number(e.duration),l.price=e.amount})}),V.value=!1}function lt(e,i){let n=1;v.value.forEach((a,l)=>{e==a.service_name&&(j(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((u,ee)=>{u.default?(n=2,i.service_detail.forEach((I,_t)=>{I.price=u.price,I.spend_time=u.duration}),f(i)):n==1&&(i.service_detail.forEach((I,_t)=>{I.price=a.during_price_json[0].price,I.spend_time=a.during_price_json[0].duration}),f(i))}):(i.service_detail.forEach((u,ee)=>{u.price=0,u.spend_time=0}),f(i)))})}function dt(e,i){const n=e.service_detail.findIndex(a=>a.id===i.id);n!==-1&&e.service_detail.splice(n,1),e.service_detail.forEach((a,l)=>{a.id=l+1}),f(e)}function ut(e){g.value.forEach((i,n)=>{j(i)})}return Ot(()=>{c.clinic_id=localStorage.getItem("clinicIdOverall"),Di(),di(),qi(),ae.value=localStorage.getItem("type"),oe.value=localStorage.getItem("clinicIdOverall"),c.type=localStorage.getItem("type"),c.type==2&&(c.role="clinic"),c.type==1&&(c.role="therapists")}),{searchDetail:c,btnSearchPart:ei,loading:_,small:Ce,selectList:Ze,columns:Qe,pagination:C,handleSizeChange:ii,handleCurrentChange:ti,PartList:ce,order_date:Ae,deliverDialog:z,selectClick:et,deliverDataArr:Xe,btnDeliverConfirm:gi,getBooking:ai,getNote:ni,addForm:t,InvoiceType:Ue,btnAdd:fe,descriptionData:Je,items:m,during_price_array:A,AddItem:oi,onDelete:si,taxData:$e,onIs_tax:ge,IncludeTax:ri,duringPrice:li,onSelectLocation:ui,locationDialog:_e,ClientDialog:me,eventIsNumlocation:_i,eventIsNum:mi,onSelClient:fi,ClientData:W,locationData:b,btnDelInvoice:hi,sandEmailDialog:U,btnSendEmail:vi,onSend:bi,btnPrintPDF:yi,onPrice:f,openAutograph:wi,signatureCanvas:ie,signatureDataUrl:D,saveSignature:Ai,clearSignature:Ci,autographDialog:R,signalData:w,eventSignal:Ni,handleValueFromChild:Si,signalUrl:te,InvoiceDetailDialog:Y,btnDetail:Ti,detailInfo:G,company_info:B,info:L,type:ae,customer_info:q,addServiceData:v,changeServic:Pi,licenceDetail:J,CollectionDialog:H,btnCollection:Wi,CollectionData:E,bookingPaymentConfirm:ji,addCollectionDialog:K,AddCollect:Fi,collectionArr:d,btncollectionConfirm:Oi,btnShowNumber:Li,ClinicsList:le,btnClinic:Vi,TherapistDate:re,onTherapist:he,disabledBeforeToday:Ri,Therapists:Ie,onTherapistSelect:Yi,btnIsPaid:zi,btnService:Hi,payMethodData:Ke,AccountData:de,isShowFilter:$,btnFilterQuery:Ui,optionsFilter:F,eventFilter:$i,getNoInvoiceBookings:Ji,MatchData:se,MatchDialog:V,selectedTr:rt,onSelectItemDate:Gi,btnExport:Xi,loading1:P,btnAddCharge:Ei,ChargeDialog:T,ChargeArr:k,eventCharge:Qi,str1:x,loading2:S,btnBatchPayment:it,selectableStatus:tt,uploadSlotFile1:at,btnFile:nt,onFile:ot,fileDialog:ne,fileArr:ue,ServiceInvoice:g,changeServiceCombina:Z,onDeleteService:st,changeServiceItem:lt,onDeleteI:dt,loadPartList:p,invoiceDate:ut}}export{Xt as useEqu};