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