"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)),i=a(4530),r=a(2201),c=a(8291),o=a(7530),u=a(466);const d=(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),m={class:"row"},h=(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),v={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 w={__name:"DisbursementList",setup(t){const e=(0,n.qj)({}),a=(0,n.iH)([]),w=(0,r.tv)(),f=(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&&w.push({name:"disbursementDetails",params:{code:a.code}})}))}const _=async()=>{a.value=await(0,c.go)("entities",null,null,"all")},g=t=>{let e=a.value?.filter((e=>e.code===t));if(void 0!==e)return e[0].name},x=async()=>{let t=await(0,o.Z)("journal_entry","list").addPayload("conditions",{type:"disbursement"}).execute();if(t){if(t.data.code)return void await u.w.failedAlert("Failed to retrieve list!","SERVER ERROR");let a=t.data.data,s=[];for(let t in a){let e={code:a[t].code,entityName:g(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)}},D=()=>{w.push({name:"disbursementNew"})};return(0,s.bv)((async()=>{y(),await _(),await x()})),(t,a)=>((0,s.wg)(),(0,s.iD)("div",null,[d,(0,s._)("div",m,[h,(0,s._)("div",v,[(0,s._)("span",null,[(0,s._)("button",{onClick:D,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)(i.Z,{columns:f.value,"table-id":"disbursementVoucherTable",data:e.value,class:"ar-list-table disbursement-voucher-table"},{tableHeader:(0,s.w5)((()=>[p])),_:1},8,["columns","data"])])])]))}};const f=w;var y=f}}]);
//# sourceMappingURL=5723.23d1157c.js.map