"use strict";(self["webpackChunkacctg_ui"]=self["webpackChunkacctg_ui"]||[]).push([[6818],{6818:function(t,a,e){e.r(a),e.d(a,{default:function(){return _}});e(560);var n=e(6252),s=e(2262),l=(e(7303),e(7810)),r=e(4530),o=e(2201),c=e(7530),i=e(466);const u=(0,n.uE)('<div class="d-flex justify-content-between align-items-center mb-4"><h2>Journals</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"},h=(0,n.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),m={class:"d-flex col-3 col-md-6 align-items-center mb-4"},v={class:"row"},p=(0,n._)("thead",null,[(0,n._)("tr",null,[(0,n._)("th",{style:{width:"12%"}},"Entry Date"),(0,n._)("th",{style:{width:"12%"}},"Trans Date"),(0,n._)("th",{style:{width:"15%"}},"Voucher #"),(0,n._)("th",null,"Particulars"),(0,n._)("th",{style:{width:"15%"}},"Amount"),(0,n._)("th",{style:{width:"8%"}},"Status")])],-1),w="journalVoucherTable";var b={__name:"JournalList",setup(t){const a=(0,o.tv)(),e=(0,s.iH)([{data:"entryDate"},{data:"transDate"},{data:"reference"},{data:"particulars"},{data:"amount"},{data:null,render:function(t,a,e,n){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>`}}]),b=(0,s.qj)({}),f=()=>{a.push({name:"journalNew"})};function _(t){const e=window.$("#journalVoucherTable").DataTable();e.on("click","tr",(function(t){const n=e.row(this).data();void 0!==n&&a.push({name:"journalDetails",params:{code:n.code}})}))}const y=async()=>{let t=await(0,c.Z)("journal_entry","list").addPayload("conditions",{type:"journal"}).execute();if(t){if(t.data.code)return void await i.w.failedAlert("Failed to retrieve list!","SERVER ERROR");let a=t.data.data,e=[];for(let t in a){let n={code:a[t].code,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};e.push(n)}b.value=e,console.log(t.data.data)}};return(0,n.bv)((async()=>{_(),await y()})),(t,a)=>((0,n.wg)(),(0,n.iD)("div",null,[u,(0,n._)("div",d,[h,(0,n._)("div",m,[(0,n._)("span",null,[(0,n._)("button",{onClick:f,class:"btn btn-sm btn-success"},[(0,n.Wm)((0,s.SU)(l.GN),{icon:"plus"}),(0,n.Uk)(" New Voucher ")])])])]),(0,n._)("div",v,[(0,n._)("div",null,[(0,n.Wm)(r.Z,{columns:e.value,"table-id":w,data:b.value,class:"ar-list-table journal-voucher-table"},{tableHeader:(0,n.w5)((()=>[p])),_:1},8,["columns","data"])])])]))}};const f=b;var _=f}}]);
//# sourceMappingURL=6818.f619ea4b.js.map