"use strict";(self["webpackChunkacctg_ui"]=self["webpackChunkacctg_ui"]||[]).push([[7107],{9175:function(a,t,e){e.r(t),e.d(t,{default:function(){return k}});var l=e(6252),n=e(9963),o=e(2262),c=e(3577),s=e(4707),r=e(7530),d=e(4850),i=e(7204),u=e(162);const m=a=>((0,l.dD)("data-v-66376260"),a=a(),(0,l.Cn)(),a),f={class:"journal-left-container"},g=m((()=>(0,l._)("div",{class:"d-flex justify-content-between"},[(0,l._)("h2",{class:"page-title"},"Ledger Summary")],-1))),v={class:"date-container mt-3"},b={class:"from-to-date d-flex"},_={class:"fromDate w-100 d-flex align-items-center gap-2"},w=m((()=>(0,l._)("label",{for:"journalFrom",class:"form-label",style:{margin:"0!important"}},"From",-1))),p=m((()=>(0,l._)("div",{class:"middleIcon"},[(0,l._)("div",{class:"icon-container"},[(0,l._)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1.3em",height:"1.3em",viewBox:"0 0 20 20"},[(0,l._)("path",{fill:"black",d:"M12.78 3.22a.75.75 0 1 0-1.06 1.06L13.44 6H4.75a.75.75 0 0 0 0 1.5h8.69l-1.72 1.72a.75.75 0 1 0 1.06 1.06l3-3a.75.75 0 0 0 0-1.06zm-4.5 7.56a.75.75 0 1 0-1.06-1.06l-3 3a.75.75 0 0 0 0 1.06l3 3a.75.75 0 0 0 1.06-1.06L6.56 14h8.69a.75.75 0 0 0 0-1.5H6.56z"})])])],-1))),h={class:"toDate w-100 d-flex align-items-center gap-2"},y=m((()=>(0,l._)("label",{for:"journalTo",class:"form-label",style:{margin:"0!important"}},"To",-1))),C=m((()=>(0,l._)("thead",null,[(0,l._)("tr",null,[(0,l._)("th",{class:"text-center",style:{width:"10%"}},"Code"),(0,l._)("th",{class:"text-center"},"Account Title"),(0,l._)("th",{class:"text-end",style:{width:"20%"}},"Beginning Balance"),(0,l._)("th",{class:"text-end",style:{width:"20%"}},"Ending Balance")])],-1)));var D={__name:"LedgerSummary",setup(a){const t=(0,s.S)();(0,d.S)();let e=(0,o.qj)([]),m=(0,o.iH)({});(0,o.iH)(!0);const D=(0,o.iH)("add"),S=((0,o.iH)(""),(0,o.iH)(!1)),T=(0,u.d)(),k=(0,o.qj)({from:x(),to:x()});function x(){let a=(new Date).getDate(),t=(new Date).getMonth()+1;return t<10&&(t="0"+t),a<10&&(a="0"+a),(new Date).getFullYear()+"-"+t+"-"+a}function j(a="code"){const t=window.$("#generalJournalDataTable").DataTable();t.on("click","tbody tr",(async function(e){e.preventDefault(),S.value=!0;const l=t.row(this).data();void 0!==l&&($("#generalJournalDataTable td").css("background-color",""),e.target&&$(e.target).closest("tr").children("td,th").css("background-color","var(--sidebar-hover-bg"),A(l[a]))}))}async function H(){T.dateFrom=k.from,T.dateTo=k.to;let a=await(0,r.Z)("account_setup","balance").addPayload("conditions",{params:k.from+":"+k.to}).execute();a&&(e.value=a.data.data)}function A(a){D.value="update";let t=e.value.filter((t=>t.code===a));t[0]&&(m.value=t[0]),T.selectedAccount=m.value}const U=(0,o.iH)([{data:"customCode"},{data:"accTitle"},{data:"beginning"},{data:"ending"}]);e.value;function F(){$("#generalJournalDataTable td").css("background-color",""),S.value=!1}return(0,l.bv)((()=>{H(),j()})),(a,s)=>{const r=(0,l.up)("TableContainer"),d=(0,l.up)("SplitColumnContainers");return(0,l.wg)(),(0,l.j4)(d,null,{leftSide:(0,l.w5)((()=>[(0,l._)("div",f,[g,(0,l._)("div",v,[(0,l._)("div",b,[(0,l._)("div",_,[w,(0,l.wy)((0,l._)("input",{type:"date",class:"form-control form-control-sm",id:"journalFrom","onUpdate:modelValue":s[0]||(s[0]=a=>k.from=a)},null,512),[[n.nr,k.from]])]),p,(0,l._)("div",h,[y,(0,l.wy)((0,l._)("input",{type:"date",class:"form-control form-control-sm",id:"journalTo","onUpdate:modelValue":s[1]||(s[1]=a=>k.to=a)},null,512),[[n.nr,k.to]])])]),(0,l._)("div",{class:"btn-container"},[(0,l._)("button",{class:"btn btn-primary btn-sm fw-semibold",onClick:H},"GENERATE")])]),(0,l.Wm)(r,{tableId:"generalJournalDataTable",columns:U.value,data:(0,o.SU)(e).value,class:"mt-3 header-alignment trial-balance-table",style:{cursor:"pointer"}},{tableHeader:(0,l.w5)((()=>[C])),_:1},8,["columns","data"])])])),rightSide:(0,l.w5)((()=>[!(0,o.SU)(t).isSideColumnCollapsed&&S.value?((0,l.wg)(),(0,l.j4)(i.Z,{key:0,class:(0,c.C_)({"coa-viewing":!(0,o.SU)(t).isSideColumnCollapsed}),selectedAccount:(0,o.SU)(m),"date-from":k.from,"date-to":k.to,onCloseAccViewing:F},null,8,["class","selectedAccount","date-from","date-to"])):(0,l.kq)("",!0)])),_:1})}}},S=e(3744);const T=(0,S.Z)(D,[["__scopeId","data-v-66376260"]]);var k=T}}]);
//# sourceMappingURL=7107.68a098ce.js.map