"use strict";(self["webpackChunkacctg_ui"]=self["webpackChunkacctg_ui"]||[]).push([[5723],{5723:function(t,e,a){a.r(e),a.d(e,{default:function(){return y}});a(560);var s=a(6252),n=a(2262),l=(a(7303),a(7810)),r=a(4530),c=a(2201),i=a(8291),o=a(7530);const u=(0,s.uE)('<div class="d-flex justify-content-between align-items-center mb-4"><h2>Disbursements</h2><span><button class="btn btn-sm btn-primary mx-1"><svg xmlns="http://www.w3.org/2000/svg" width="1.3em" height="1.3em" viewBox="0 0 24 24"><path fill="white" d="M19 8h-1V3H6v5H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3M8 5h8v3H8zm8 12v2H8v-4h8zm2-2v-2H6v2H4v-4c0-.55.45-1 1-1h14c.55 0 1 .45 1 1v4z"></path><circle cx="18" cy="11.5" r="1" fill="white"></circle></svg> Print </button></span></div>',1),d={class:"row"},m=(0,s.uE)('<div class="d-flex col-8 col-md-5 align-items-center mb-4"><div class="flex-pill text-nowrap">Transaction Dates: </div><input type="date" class="form-control form-control-sm mx-2"><span>-</span><input type="date" class="form-control form-control-sm mx-2"><button class="btn btn-primary btn-sm">Generate</button></div>',1),h={class:"d-flex col-3 col-md-6 align-items-center mb-4"},b={class:"row"},p=(0,s._)("thead",null,[(0,s._)("tr",null,[(0,s._)("th",{style:{width:"10%"}},"Entry Date"),(0,s._)("th",{style:{width:"10%"}},"Trans Date"),(0,s._)("th",{style:{width:"15%"}},"Voucher #"),(0,s._)("th",{style:{width:"10%"}},"Payee"),(0,s._)("th",null,"Particulars"),(0,s._)("th",{style:{width:"12%"}},"Amount"),(0,s._)("th",{style:{width:"8%"}},"Status")])],-1);var v={__name:"DisbursementList",setup(t){const e=(0,n.qj)({}),a=(0,n.iH)([]),v=(0,c.tv)(),w=(0,n.iH)([{data:"entryDate"},{data:"transDate"},{data:"reference"},{data:"entityName"},{data:"particulars"},{data:"amount"},{data:null,render:function(t,e,a,s){return"posted"===t.status?`<span style="color: #009e1a" class="fw-bold"> ${t.status.toUpperCase()}</span>`:`<span class="fw-bold" style="color: #999999"> ${t.status.toUpperCase()}</span>`}}]);function y(t){const e=window.$("#disbursementVoucherTable").DataTable();e.on("click","tr",(function(t){const a=e.row(this).data();void 0!==a&&v.push({name:"disbursementDetails",params:{code:a.code}})}))}const f=async()=>{a.value=await(0,i.go)("entities",{type:"customer"})},_=t=>{let e=a.value.filter((e=>e.code===t));if(e[0])return e[0].name},g=async()=>{let t=await(0,o.Z)("journal_entry","list").addPayload("conditions",{type:"disbursement"}).execute();if(t){let a=t.data.data,s=[];for(let t in a){let e={code:a[t].code,entityName:_(a[t].entity),entryDate:a[t].entry_date,transDate:a[t].transaction_date,reference:a[t].reference_number,particulars:a[t].particulars,amount:a[t].amount,status:a[t].status};s.push(e)}e.value=s,console.log(e)}},x=()=>{v.push({name:"disbursementNew"})};return(0,s.bv)((async()=>{y(),await f(),await g()})),(t,a)=>((0,s.wg)(),(0,s.iD)("div",null,[u,(0,s._)("div",d,[m,(0,s._)("div",h,[(0,s._)("span",null,[(0,s._)("button",{onClick:x,class:"btn btn-sm btn-success"},[(0,s.Wm)((0,n.SU)(l.GN),{icon:"plus"}),(0,s.Uk)(" New Voucher ")])])])]),(0,s._)("div",b,[(0,s._)("div",null,[(0,s.Wm)(r.Z,{columns:w.value,"table-id":"disbursementVoucherTable",data:e.value,class:"ar-list-table disbursement-voucher-table"},{tableHeader:(0,s.w5)((()=>[p])),_:1},8,["columns","data"])])])]))}};const w=v;var y=w}}]);
//# sourceMappingURL=5723.066abaa5.js.map