1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b7f46d6a-a946-49b3-830a-a6e1184740d1",e._sentryDebugIdIdentifier="sentry-dbid-b7f46d6a-a946-49b3-830a-a6e1184740d1")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7213],{63149:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/accounting-report/profit-and-loss",function(){return a(66540)}])},7261:(e,s,a)=>{"use strict";a.d(s,{A:()=>n});let n=(e,s)=>{let a=new Intl.NumberFormat("id-ID",s?{}:{style:"currency",currency:"IDR",maximumFractionDigits:0});try{return a.format(parseInt(e))}catch(s){return e}}},82759:(e,s,a)=>{"use strict";a.d(s,{A:()=>i});var n=a(74848),t=a(7261);a(96540);let i=e=>{let{title:s,data:a=[],totalAmount:i,onlyBody:r=!1}=e;return(0,n.jsxs)("div",{children:[!r&&(0,n.jsx)("div",{className:"",children:(0,n.jsx)("p",{className:"",children:s})}),a.map((e,s)=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"px-4 py-2 border-b border-slate-400",children:(0,n.jsx)("p",{className:"",children:e.category.name})},s),e.accounts.map((e,s)=>(0,n.jsxs)("div",{className:"pl-8 pr-4 py-2 border-b border-slate-400 flex justify-between",children:[(0,n.jsx)("p",{className:"font-medium text-slate-500",children:e.account.chart_of_account.name}),(0,n.jsx)("p",{className:"font-medium text-slate-500",children:(0,t.A)(e.balance)})]},s))]})),!r&&(0,n.jsxs)("div",{className:"px-4 py-2 border-t border-black flex justify-between",children:[(0,n.jsxs)("p",{className:"",children:["Total ",s]}),(0,n.jsx)("p",{className:"",children:(0,t.A)(null==i?void 0:i.toString())})]})]})}},66540:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>x,default:()=>_});var n=a(74848),t=a(4340),i=a(69621),r=a(96540),l=a(3959),o=a(86715),p=a(7261),c=a(86818),d=a(82759),u=a(32578);let h=e=>{var s,a,t,i,h,x,_,b,m,f,g,j,y;let{data:v,exportData:N,dataOutlet:w}=e,O=(0,o.useRouter)(),A=(0,u.useTranslations)("GeneralTranslate"),[I,E]=(0,r.useState)([]),[T,S]=(0,r.useState)("Laba Rugi"),[D,P]=(0,r.useState)(w?null===(s=w.outlet.outlets.nodes)||void 0===s?void 0:s.map(e=>({label:e.name,value:e.id})):[]);(0,r.useEffect)(()=>{let e=[];
1if(N){let s=N.report.profit_and_loss;s.operating_revenue.length>0?(e.push({hapus_baris:"Operating Revenue",ini:""}),s.operating_revenue.map(s=>{e.push({hapus_baris:" ".concat(s.category.name),ini:""}),s.accounts.map(s=>e.push({hapus_baris:" ".concat(s.account.chart_of_account.name),ini:"".concat(s.balance)}))}),e.push({hapus_baris:"Total Operating Revenue",ini:s.total_operating_revenue})):e.push({hapus_baris:"Operating Revenue",ini:s.total_operating_revenue}),e.push({hapus_baris:"",ini:""}),s.cogs.length>0?(e.push({hapus_baris:"COGS",ini:""}),s.cogs.map(s=>{e.push({hapus_baris:" ".concat(s.category.name),ini:""}),s.accounts.map(s=>e.push({hapus_baris:" ".concat(s.account.chart_of_account.name),ini:"".concat(s.balance)}))}),e.push({hapus_baris:"Total COGS",ini:s.total_cogs})):e.push({hapus_baris:"COGS",ini:s.total_cogs}),e.push({hapus_baris:"",ini:""}),e.push({hapus_baris:"Gross Profit",ini:s.gross_profit}),e.push({hapus_baris:"",ini:""}),s.operating_expense.length>0?(e.push({hapus_baris:"Operating Expense",ini:""}),s.operating_expense.map(s=>{e.push({hapus_baris:" ".concat(s.category.name),ini:""}),s.accounts.map(s=>e.push({hapus_baris:" ".concat(s.account.chart_of_account.name),ini:"".concat(s.balance)}))}),e.push({hapus_baris:"Total Operating Expense",ini:s.total_operating_expense})):e.push({hapus_baris:"Operating Expense",ini:s.total_operating_expense}),e.push({hapus_baris:"",ini:""}),e.push({hapus_baris:"Operating Profit",ini:s.operating_profit}),e.push({hapus_baris:"",ini:""}),s.other_income_and_expense.length>0?(e.push({hapus_baris:"Other Income & Expense",ini:""}),s.other_income_and_expense.map(s=>{e.push({hapus_baris:" ".concat(s.category.name),ini:""}),s.accounts.map(s=>e.push({hapus_baris:" ".concat(s.account.chart_of_account.name),ini:"".concat(s.balance)}))}),e.push({hapus_baris:"Total Other Income & Expense",ini:s.total_other_income_and_expense})):e.push({hapus_baris:"Other Income & Expense",ini:s.total_other_income_and_expense}),e.push({hapus_baris:"",ini:""}),e.push({hapus_baris:"Net Profit/Loss (Before Tax)",ini:s.net_before_tax}),e.push({hapus_baris:"",ini:""}),s.taxes.length>0&&s.taxes.map(s=>{e.push({hapus_baris:" ".concat(s.account.chart_of_account.name),ini:"".concat(s.balance)})}),e.push({hapus_baris:"",ini:""}),e.push({hapus_baris:"Net Profit/Loss (After Tax)",ini:s.net_after_tax})}E(e)},[N]);let k=null==v?void 0:v.report.profit_and_loss,C=[{type:"DateRange",name:"Outlet",field:"outlet_id"},{type:"Dropdown",name:A("Outlet"),field:"outlet_id",options:D}];return(0,n.jsxs)("div",{className:"flex flex-col gap-8 text-sm",children:[(0,n.jsx)(c.A,{filterOptions:C,onChangeHandler:e=>{O.replace({pathname:O.pathname,query:{...e}})},exports:"export-profit-loss",downloadExcel:()=>{let e=l.Wp.json_to_sheet(I),s=l.Wp.book_new();l.Wp.book_append_sheet(s,e,T),l._h(s,"".concat(T,".xlsx"))}}),(0,n.jsxs)("div",{className:"lg:px-16 flex flex-col ".concat(v?"gap-8":"gap-2"),children:[(null==k?void 0:k.operating_revenue.length)>0?(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-primary font-semibold",children:A("Operating Income")}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.A,{data:null==k?void 0:k.operating_revenue,onlyBody:!0}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:["Total ",A("Operating Income")]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(a=null==k?void 0:k.total_operating_revenue)&&void 0!==a?a:0)})]})]})]}):(0,n.jsxs)("div",{className:"text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:A("Operating Income")}),(0,n.jsx)("p",{children:(0,p.A)(null!==(t=null==k?void 0:k.total_operating_revenue)&&void 0!==t?t:0)})]}),(null==k?void 0:k.cogs.length)>0?(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-primary font-semibold",children:"COGS"}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.A,{data:null==k?void 0:k.cogs,onlyBody:!0}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:"Total COGS"}),(0,n.jsx)("p",{children:(0,p.A)(null!==(i=null==k?void 0:k.total_cogs)&&void 0!==i?i:0)})]})]})]}):(0,n.jsxs)("div",{className:"text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:"COGS"}),(0,n.jsx)("p",{children:(0,p.A)(null!==(h=null==k?void 0:k.total_cogs)&&void 0!==h?h:0)})]}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:A("Gross Income")}),(0,n.jsx)("p",{children:(0,p.A)(null!==(x=null==k?void 0:k.gross_profit)&&void 0!==x?x:0)})]}),(null==k?void 0:k.operating_expense.length)>0?(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-primary font-semibold",children:A("Operating Expenses")}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.A,{data:null==k?void 0:k.operating_expense,onlyBody:!0}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:["Total ",A("Operating Expenses")]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(_=null==k?void 0:k.total_operating_expense)&&void 0!==_?_:0)})]})]})]}):(0,n.jsxs)("div",{className:"text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:A("Operating Expenses")}),(0,n.jsx)("p",{children:(0,p.A)(null!==(b=null==k?void 0:k.total_operating_expense)&&void 0!==b?b:0)})]}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsx)("p",{children:A("Operating Profit")}),(0,n.jsx)("p",{children:(0,p.A)(null!==(m=null==k?void 0:k.operating_profit)&&void 0!==m?m:0)})]}),(null==k?void 0:k.other_income_and_expense.length)>0?(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsxs)("p",{className:"text-primary font-semibold",children:[A("Income")," & ",A("Other Expenses")]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(d.A,{data:null==k?void 0:k.other_income_and_expense,onlyBody:!0}),(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:["Total ",A("Income")," & ",A("Other Expenses")]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(f=null==k?void 0:k.total_other_income_and_expense)&&void 0!==f?f:0)})]})]})]}):(0,n.jsxs)("div",{className:"border-t border-b bg-gray-100 border-gray-400 pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:[A("Income")," & ",A("Other Expenses")]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(g=null==k?void 0:k.total_other_income_and_expense)&&void 0!==g?g:0)})]}),(0,n.jsxs)("div",{className:"pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:[A("Net Income")," / ",A("Loss")," (",A("Before Tax"),")"]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(j=null==k?void 0:k.net_before_tax)&&void 0!==j?j:0)})]}),(null==k?void 0:k.taxes.length)>0&&(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-primary font-semibold",children:"Pajak"}),(0,n.jsx)("div",{children:v.map((e,s)=>{var a;return(0,n.jsxs)("div",{className:"px-12 py-2 flex justify-between",children:[(0,n.jsx)("p",{className:"text-lg font-medium",children:e.account.chart_of_account.name}),(0,n.jsx)("p",{className:"text-lg font-medium",children:(0,p.A)(null!==(a=e.balance)&&void 0!==a?a:0)})]},s)})})]}),(0,n.jsxs)("div",{className:"pl-4 text-primary font-semibold flex justify-between py-3 pr-4",children:[(0,n.jsxs)("p",{children:[A("Net Income")," / ",A("Loss")," (",A("After Tax"),")"]}),(0,n.jsx)("p",{children:(0,p.A)(null!==(y=null==k?void 0:k.net_after_tax)&&void 0!==y?y:0)})]})]})]})};var x=!0;let _=e=>{let{data:s,dataOutlet:a}=e,r=(0,u.useTranslations)("Menu");return(0,n.jsxs)("div",{className:"h-full w-full absolute",children:[(0,n.jsx)(t.A,{title:r("Profit and Loss")}),(0,n.jsx)(i.A,{children:(0,n.jsx)("div",{className:"my-5 rounded-2xl p-6 shadow-lg overflow-auto bg-white",children:(0,n.jsx)(h,{data:s,exportData:s,dataOutlet:a})})})]})}},83686:()=>{},32383:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[4453,3197,971,9965,9190,1106,1348,4967,6485,9785,7796,2434,2809,8150,1323,9621,3111,6818,636,6593,8792],()=>s(63149)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.