File: /var/www/html/public/static/js/hookReconciliation-legacy-33b38ba7.js
System.register(["./po-legacy-b0431e4e.js","./vue-router-legacy-a12307c3.js","./message-legacy-10af7c73.js","./index-legacy-42c17c53.js","./runtime-core.esm-bundler-legacy-c5df00b7.js","./index-legacy-f612e930.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,t){"use strict";var a,n,i,o,c,l,s,r,u,d,m,g;return{setters:[e=>{a=e.getScheduleInvoiceWeb,n=e.getCheckMembersWeb,i=e.invoiceBalanceWeb,o=e.prePaidWeb,c=e.deleteCompanyWeb},e=>{l=e.d,s=e.u},e=>{r=e.b7},e=>{u=e.o},e=>{d=e.r,m=e.A,g=e.o},null,null,null,null,null,null,null,null],execute:function(){e("useEqu",(function(){l(),s(),l();const e=d(),t=d(!1),h=d(!1),_=d(!1),y=d(!1),p=d(!1),b=d(!1),v=d(""),C=d([]),f=d([]),j=d([]),k=m({}),A=m({tableIndex:0,note:""}),L=m({Client_name:"",Client_id:""}),I=m({name:"",id:"",clinic_id:""}),P=m({name:"",customer_id:"",pay_amount:"",pay_method:"",cheque_number:"",content:"",invoice_id:"",total_amount1:"",total_amount2:""}),W=m({}),w=m({}),x=m({}),D=m({}),S=m({}),T=m({total:0,pageSize:10,currentPage:1,background:!0,currentPage:1,pageSizes:[10,25,50,100]}),N=m({order_key:"",material_key:"",truck_key:"",truck_id:"",comment:"",show:"",searchKey:"",searchKey1:""});async function O(){if(""==L.Client_name)return void r({type:"error",message:"Please select a Client"});t.value=!0;const{data:e}=await a(Object.assign(k,{customer_id:L.Client_id,searchKey:N.searchKey1}));C.value=e.data,P.total_amount1=e.total_amount,t.value=!1}async function B(e){const{data:t}=await c(Object.assign(x,{company_id:e.id}));1==t.code?(O(),r({type:"success",message:t.msg})):r({type:"error",message:t.msg})}async function F(){const{data:e}=await n(Object.assign(D,{customer_id:L.Client_id}));1==e.code?(j.value=e.data,P.total_amount2=e.total_amount):r({type:"error",message:e.msg})}return g((()=>{})),{searchDetail:N,btnSearchPart:function(){O()},loading:t,small:b,selectList:["Invoice No","Total Charge","Paid Amount","Need Charge","Invoice Time","Charge Amount"],columns:[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"Invoice No",prop:"invoice_number",minWidth:100,hide:({checkList:e})=>!e.includes("Invoice No")},{label:"Total Charge",prop:"total_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Total Charge")},{label:"Paid Amount",prop:"pay_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Paid Amount")},{label:"Need Charge",prop:"need_charge_amount",minWidth:100,hide:({checkList:e})=>!e.includes("Need Charge")},{label:"Invoice Time",prop:"invoice_date",minWidth:150,hide:({checkList:e})=>!e.includes("Invoice Time")},{label:"Charge Amount",prop:"email",minWidth:150,slot:"operation",hide:({checkList:e})=>!e.includes("Charge Amount")}],pagination:T,handleSizeChange:function(e){T.pageSize=e,O()},handleCurrentChange:function(e){T.currentPage=e,O()},PartList:C,order_date:v,deliverDialog:h,selectClick:(e,t)=>{},itemArr:A,addLocationDialog:y,locationArr:W,EditLocation:function(e){Object.keys(e).map((t=>{W[t]=e[t]}))},btnDellocation:e=>{u.confirm("Are you sure you want to delete this location",{confirmButtonText:"confirm",cancelButtonText:"cancel",type:"warning"}).then((()=>{B(e)})).catch((()=>{r({type:"info",message:"Canceled"})}))},singleTableRef:e,addForm:L,ClientDialog:_,eventIsNum:function(){L.Client_id=I.id,L.Client_name=I.name,O(),F()},ClientData:I,onSelClient:function(){I.clinic_id=localStorage.getItem("clinicIdOverall"),_.value=!0},loadPartList:O,invoiceBalanceData:f,AddCollect:function(){p.value=!0},addCollectionDialog:p,collectionArr:P,CollectionData:j,btncollectionConfirm:async function(){const{data:e}=await o(Object.assign(S,{customer_id:L.Client_id,pay_amount:P.pay_amount,pay_method:P.pay_method,cheque_number:P.cheque_number,content:P.content}));1==e.code?(F(),r({type:"success",message:e.msg}),p.value=!1):r({type:"error",message:e.msg})},invoiceBalanceConfirm:async function(){t.value=!0;const{data:e}=await i(Object.assign(w,{customer_id:L.Client_id,invoice_details:C.value,pay_detail:j.value}));1==e.code?(r({type:"success",message:e.msg}),O(),F()):r({type:"error",message:e.msg}),t.value=!1},AutoBalance:function(){const e=P.total_amount1,t=P.total_amount2;let a=Math.min(e,t),n=Math.min(e,t);C.value.forEach(((e,t)=>{const n=e.need_charge_amount,i=Math.min(n,a);i>0&&(e.paid_amount=i,a=parseFloat((a-i).toFixed(2)))})),j.value.forEach(((e,t)=>{const a=Math.min(e.remain_amount,n);a>0&&(e.paid_amount=a,n=parseFloat((n-a).toFixed(2)))}))}}}))}}}));