"use strict";(self["webpackChunkacctg_ui"]=self["webpackChunkacctg_ui"]||[]).push([[6818],{6818:function(t,a,e){e.r(a),e.d(a,{default:function(){return f}});e(560);var n=e(6252),s=e(2262),l=(e(7303),e(7810)),c=e(4530),r=e(2201),o=e(7530);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),i={class:"row"},d=(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),h={class:"d-flex col-3 col-md-6 align-items-center mb-4"},m={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),v="journalVoucherTable";var b={__name:"JournalList",setup(t){const a=(0,r.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)({}),w=()=>{a.push({name:"journalNew"})};function f(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 _=async()=>{let t=await(0,o.Z)("journal_entry","list").addPayload("conditions",{type:"journal"}).execute();if(t){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()=>{f(),await _()})),(t,a)=>((0,n.wg)(),(0,n.iD)("div",null,[u,(0,n._)("div",i,[d,(0,n._)("div",h,[(0,n._)("span",null,[(0,n._)("button",{onClick:w,class:"btn btn-sm btn-success"},[(0,n.Wm)((0,s.SU)(l.GN),{icon:"plus"}),(0,n.Uk)(" New Voucher ")])])])]),(0,n._)("div",m,[(0,n._)("div",null,[(0,n.Wm)(c.Z,{columns:e.value,"table-id":v,data:b.value,class:"ar-list-table journal-voucher-table"},{tableHeader:(0,n.w5)((()=>[p])),_:1},8,["columns","data"])])])]))}};const w=b;var f=w}}]);
//# sourceMappingURL=6818.8c0e4fea.js.map