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-34eefd2b.js
import{InvoiceListWeb as di,yuyueFDF as y,newInvoiceWeb as _i,invoicePdfWeb as ge,sendEmailWeb as mi,base64image as fi,invoiceDetailWeb as gi,getLicenceServiceWeb as pi,invoicePaymentWeb as hi,prePaidWeb as vi,AccountListWeb as bi,updateShowNumber as yi,getClinicsListByTherapistWeb as wi,setInvoicePaidWeb as Ai,getNoInvoiceBookingsDateWeb as Ci,InvoiceExportWeb as Di,NeedPaymentInvoiceListWeb as xi,ServiceCombinaByServiceNameWeb as Ii,getInvoiceNumberWeb as Si,deleteInvoiceWeb as Ni,getCheckMembersWeb as Pi,saveDefaultTaxWeb as Ei}from"./po-1a9cc2b0.js";import{f as Ti}from"./fabric-17d9428f.js";import{d as pe,u as Wi}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 ki}from"./runtime-core.esm-bundler-6128546f.js";import"./index-2632a64c.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 Gi(v){const{query:he,params:ji}=pe(),Z=Wi();pe();const O=o({}),B=o(""),M=o(!1),x=o(!1),I=o(!1),S=o(!1),ee=o(null),N=o(""),te=o(""),L=o(""),q=o(""),ie=o([]),p=o([]),R=o("");let P=null;const E=o(""),d=o(!1),ae=o(!1),V=o(!1),Y=o(!1),H=o(!1),K=o(!1),z=o(!1),U=o(!1),$=o(!1),ve=o(!1),be=o(""),T=o(1),G=o(""),ne=o([]),oe=o([]),ce=o([]),se=o([]),W=o([]),h=o([]),X=o([]),re=o([]),k=o([]),le=o(!1),ue=o(!1),ye=c({}),we=c({}),Ae=c({}),Ce=c({}),De=c({}),xe=c({}),Ie=c({}),Se=c({}),Ne=c({}),Pe=c({}),Ee=c({}),Te=c({}),We=c({}),ke=c({}),je=c({}),Fe=c({}),Oe=c({}),Be=c({}),Me=c({}),Le=c({}),qe=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:[]}),Q=c({name:"",id:""}),b=c({name:"",id:"",r_ac_name:"",r_ac_register:"",name1:"",rmt_register:""}),u=c({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",account_id:"",time:"",other:""}),Re=o([{value:"normal",text:"Normal"},{value:"outside",text:"Outside"},{value:"third_Pay",text:"Third Pay"},{value:"gift",text:"Gift"}]),Ve=o([{value:"Y",text:"Y"},{value:"N",text:"N"}]),_=o([{id:1,price:0,spend_time:"",treatment_date:"",booking_order_no:"",booking_id:""}]),Ye=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"}]),He=o([{value:"Massage",text:"Massage"},{value:"Acupuncture",text:"Acupuncture"}]);c({destination_comp:"",state:"",city:"",address:"",phone:"",contact:"",customer_id:""});const Ke=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]}),Ue=[{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")}],$e=["勾选列","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"});function Ge(){m()}function Xe(e){A.pageSize=e,m()}function Qe(e){A.currentPage=e,m()}async function m(e){r.export="N",e=="Y"&&(r.export=e),E.value=localStorage.getItem("type");let t="";E.value==1&&(t="therapists"),d.value=!0;const{data:a}=await di(Object.assign(ye,{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:B,customer_id:v.customer_id,pageSize:A.pageSize,page:A.currentPage,export:r.export}));a.code==1?(d.value=!1,r.export=="N"?(ne.value=a.data,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","")))):d.value=!1}function Je(e){return e.assocInfo.booking.length>0?e.assocInfo.booking[0].booking_order_no:""}function Ze(e){return e.assocInfo.note.length>0?e.assocInfo.note[0].id:""}function de(){_.value=[];const e={id:_.value.length+1,price:0,spend_time:"",treatment_date:i.today,booking_order_no:"",booking_id:""};i.date=i.today,_.value.push(e),me(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 F(e,t){i.Invoice_Number="",d.value=!0;let a=e.service_id;t==1&&(a=e.id);const{data:n}=await Si(Object.assign(we,{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),d.value=!1}function et(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 tt(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 it(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 at=e=>{D.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{it(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};function _e(e,t){e?i.is_tax="Y":i.is_tax="N",f(t)}function nt(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 ot(e,t,a){a.spend_time=e,a.during_price_json.forEach((n,l)=>{n.value==e&&(a.price=n.price)}),f(t)}function ct(){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,he.help==1&&de()}function st(){le.value=!0}function rt(){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 lt(){i.Client_id=Q.id,i.Client_name=Q.name,J(i.description_type)}function ut(){ue.value=!0}async function dt(){d.value=!0;let e="";i.invoice_type=="outside"?e=i.description_type1:e=i.description_type;const{data:t}=await _i(Object.assign(Ke,{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}),d.value=!1):(s({type:"error",message:t.msg}),d.value=!1)}async function _t(e){const{data:t}=await Ni(Object.assign(Ae,{invoice_id:e.id}));t.code==1&&(m(),s({type:"success",message:t.msg}))}const mt=e=>{D.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{_t(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};async function ft(e){i.customArr=e;const{data:t}=await ge(Object.assign(Ce,{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 gt(){const{data:e}=await mi(Object.assign(De,{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 pt(e){const{data:t}=await ge(Object.assign(xe,{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 ht(){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 vt(){P.clear(),N.value=""}const bt=()=>{yt(),N.value=P.toDataURL({format:"png"}),At()};function yt(){P.renderAll()}function wt(){P=new Ti.fabric.Canvas(ee.value,{isDrawingMode:!0})}async function At(e){const{data:t}=await fi(Object.assign(Ie,{note_id:"",signal_url:"signal_url1",form_type:"invoice",base64code:N.value,yuyueFDF:y}));t.code==1&&(i.signal_image=t.file_path,V.value=!1)}function Ct(){let e="";me(2),i.signal_image=te.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 Dt=e=>{i.signal_image=e};async function xt(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 gi(Object.assign(Se,{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 me(e){const{data:t}=await pi(Object.assign(Ne,{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),re.value=h.value):s({type:"error",message:t.msg})}function It(e){re.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,F())});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 St(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 Nt(){const{data:e}=await Pi(Object.assign(Pe,{customer_id:u.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 Pt(){const{data:e}=await hi(Object.assign(Ee,{invoice_id:u.invoice_id,pay_amount_details:W.value}));e.code==1?(m(),z.value=!1):s({type:"error",message:e.msg})}async function Et(){if(d.value=!0,u.pay_method!="Cheque"&&(u.cheque_number=""),u.pay_method=="Cheque"&&u.cheque_number==""){s({type:"error",message:"Please enter cheque number"}),d.value=!1;return}let e="";if(u.pay_method=="Other"){if(u.other==""){s({type:"error",message:"Please enter pay method"}),d.value=!1;return}e=u.other}else e=u.pay_method;const{data:t}=await vi(Object.assign(Te,{customer_id:u.customer_id,pay_amount:u.pay_amount,pay_method:e,cheque_number:u.cheque_number,content:u.content,collection_time:u.time,account_id:u.account_id}));t.code==1?(Nt(),s({type:"success",message:t.msg}),U.value=!1,d.value=!1):(s({type:"error",message:t.msg}),d.value=!1)}function Tt(){Wt(),kt(),U.value=!0}function Wt(){const e=new Date,t=e.getFullYear(),a=("0"+(e.getMonth()+1)).slice(-2),n=("0"+e.getDate()).slice(-2);u.time=t+"-"+a+"-"+n}async function kt(){const{data:e}=await bi(Object.assign(Fe,{clinic_id:"",role:"therapists",searchKey:""}));e.code==1&&(ce.value=e.data)}async function jt(e){const{data:t}=await yi(Object.assign(We,{show_number:r.show_number}));s({type:"success",message:t.msg})}function Ft(e){const t=new Date;return t.setHours(0,0,0,0),e.getTime()>t.getTime()}function Ot(){m()}async function Bt(){d.value=!0;const{data:e}=await wi(Object.assign(ke,{searchKey:"",is_therapistInvoice:"Y"}));e.code==1&&(se.value=e.data),d.value=!1}function Mt(e){e==null&&(r.clinic_id="")}async function Lt(e,t){const{data:a}=await Ai(Object.assign(je,{invoice_id:t.id,is_paid:e}));a.code==1&&m(),s({type:"success",message:a.msg})}function qt(){Z.push({path:"/crm/yuyue/licence",query:{invoceGuide:1}})}const Rt=()=>{D.confirm("Invoicing requires services with licence",{confirmButtonText:"Go add",cancelButtonText:"cancel",type:"warning"}).then(()=>{Vt()}).catch(()=>{s({type:"info",message:"Canceled"})})};function Vt(){Z.push({path:"/crm/yuyue/licence",query:{invoceService:1}})}function Yt(){M.value=!M.value}function Ht(){O.value&&(B.value=O.value.value,m())}async function Kt(e,t){i.is_Match=-1,i.is_Match_id=e.id;const{data:a}=await Ci(Object.assign(Oe,{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?(oe.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 Ut(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 $t(){I.value=!0;const{data:e}=await Di(Object.assign(Be,{searchKey:r.searchKey,clinic_id:r.clinic_id,therapists_id:r.therapists_id,role:"therapists",options:B,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 Gt(){m()}function Xt(){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 Qt(e){r.invoice_id_list=[],e.forEach((t,a)=>{r.invoice_id_list.push(t.id)})}function Jt(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 Zt(){i.Invoice_Number="",S.value=!0;const{data:e}=await xi(Object.assign(Me,{invoice_id_list:r.invoice_id_list}));e.code==1?Jt(e.data):s({type:"error",message:e.msg}),S.value=!1}function ei(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 ti(e){e.length&&(ie.value=e,ae.value=!0)}function ii(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 Ii(Object.assign(Le,{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,fe)=>{g.treatment_date=g.treatment_date.substring(0,10)}),_e(n.is_tax,n),F(n)})):s({type:"error",message:a.msg}),S.value=!1}function ai(e){const t=p.value.findIndex(a=>a.service_name===e.service_name);t!==-1&&p.value.splice(t,1)}const ni=e=>{D.confirm("Are you sure you want to delete this item ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ai(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};function oi(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 ci(e,t){let a=1;h.value.forEach((n,l)=>{e==n.service_name&&(F(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,fe)=>{g.default?(a=2,t.service_detail.forEach((C,ui)=>{C.price=g.price,C.spend_time=g.duration}),f(t)):a==1&&(t.service_detail.forEach((C,ui)=>{C.price=n.during_price_json[0].price,C.spend_time=n.during_price_json[0].duration}),f(t))}):(t.service_detail.forEach((g,fe)=>{g.price=0,g.spend_time=0}),f(t)))})}function si(e){p.value.forEach((t,a)=>{F(t)})}async function ri(e){const{data:t}=await Ei(Object.assign(qe,{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 li=e=>{D.confirm("Do you want to change the current tax configuration to the default service configuration ?",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then(()=>{ri(e)}).catch(()=>{s({type:"info",message:"Canceled"})})};return ki(()=>{wt(),ct(),E.value=localStorage.getItem("type"),Bt()}),{searchDetail:r,btnSearchPart:Ge,loading:d,small:ve,selectList:$e,columns:Ue,pagination:A,handleSizeChange:Xe,handleCurrentChange:Qe,PartList:ne,order_date:be,deliverDialog:H,selectClick:Qt,deliverDataArr:ze,btnDeliverConfirm:dt,getBooking:Je,getNote:Ze,addForm:i,InvoiceType:Re,btnAdd:de,descriptionData:He,items:_,during_price_array:k,AddItem:tt,onDelete:at,taxData:Ve,onIs_tax:_e,IncludeTax:nt,duringPrice:ot,onSelectLocation:st,locationDialog:le,ClientDialog:ue,eventIsNumlocation:rt,eventIsNum:lt,onSelClient:ut,ClientData:Q,locationData:b,btnDelInvoice:mt,sandEmailDialog:$,btnSendEmail:ft,onSend:gt,btnPrintPDF:pt,onPrice:f,openAutograph:ht,signatureCanvas:ee,signatureDataUrl:N,saveSignature:bt,clearSignature:vt,autographDialog:V,signalData:w,eventSignal:Ct,handleValueFromChild:Dt,signalUrl:te,InvoiceDetailDialog:Y,btnDetail:xt,detailInfo:X,company_info:L,info:q,type:E,customer_info:R,addServiceData:h,changeServic:It,licenceDetail:G,CollectionDialog:z,btnCollection:St,CollectionData:W,bookingPaymentConfirm:Pt,addCollectionDialog:U,AddCollect:Tt,collectionArr:u,btncollectionConfirm:Et,btnShowNumber:jt,disabledBeforeToday:Ft,onSearch:Ot,clinicData:se,onClinicData:Mt,btnIsPaid:Lt,btnGuide:qt,btnService:Rt,payMethodData:Ye,AccountData:ce,isShowFilter:M,btnFilterQuery:Yt,optionsFilter:O,eventFilter:Ht,getNoInvoiceBookings:Kt,MatchData:oe,MatchDialog:K,selectedTr:oi,btnMatchConfirm:zt,onSelectItemDate:Ut,btnExport:$t,loading1:I,btnAddCharge:Xt,ChargeDialog:x,ChargeArr:j,eventCharge:Gt,str1:T,btnBatchPayment:Zt,loading2:S,uploadSlotFile1:ei,btnFile:ti,onFile:ii,fileDialog:ae,fileArr:ie,ServiceInvoice:p,changeServiceCombina:J,onDeleteService:ni,changeServiceItem:ci,onDeleteI:et,loadPartList:m,invoiceDate:si,btnSaveDefault:li}}export{Gi as useEqu};