PageSourceSearch

https://accounts.wisedatafinances.com/assets/index.BRVqiLyC.js

js wisedatafinances.com collected 2026-10-02 01:02:29 UTC 7,802 bytes, 2 lines download raw bytes

1import{j as e,S as n,p as $,aw as Y,m as T,n as F,A as N,q as C,o as A,T as w,h as M,D as V,G as U,E as O}from"./index.BwUXLkFh.js";import{C as K}from"./Card.zQOWx7Px.js";import{E as Q}from"./ExportDropdown.BELPiG08.js";import{T as W}from"./Table.CDyw2KKg.js";import{r as d,f as X}from"./router.B4US41S0.js";import{b as I}from"./businessDREService.D6nBFsTU.js";import{u as B}from"./i18n.B4W-8BMJ.js";import"./charts.Gne8QePF.js";import"./http.DMMU_82U.js";import"./forms.BYD48-P7.js";import"./Dropdown.CXb-ayUE.js";import"./Pagination.C-UAZzoN.js";import"./Checkbox.Df_fexKO.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"4cf4b14821181d0b2151bcf8ce751df0f4a42924"};var i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="1300bca7-0284-4fb9-a72a-8b2fb51ad183",s._sentryDebugIdIdentifier="sentry-dbid-1300bca7-0284-4fb9-a72a-8b2fb51ad183")}catch{}})();const G="DRESkeleton-module__searchBar___NbhP9",Z="DRESkeleton-module__filterField___6b8lr",z="DRESkeleton-module__summaryCards___RKXjp",H="DRESkeleton-module__summaryCard___2BOFD",J="DRESkeleton-module__summaryInfo___X6ZQ6",ee="DRESkeleton-module__tableCard___hBGgb",se="DRESkeleton-module__tableRow___tsu0f",h={searchBar:G,filterField:Z,summaryCards:z,summaryCard:H,summaryInfo:J,tableCard:ee,tableRow:se};function ae(){return e.jsxs("div",{children:[e.jsx("div",{className:h.searchBar,children:e.jsxs("div",{className:h.filterField,children:[e.jsx(n,{variant:"text",width:30,height:12}),e.jsx(n,{variant:"rect",width:140,height:38})]})}),e.jsx("div",{className:h.summaryCards,children:Array.from({length:3},(s,i)=>e.jsxs("div",{className:h.summaryCard,children:[e.jsx(n,{variant:"rect",width:18,height:18}),e.jsxs("div",{className:h.summaryInfo,children:[e.jsx(n,{variant:"text",width:90,height:12}),e.jsx(n,{variant:"text",width:110,height:16})]})]},i))}),e.jsx("div",{className:h.tableCard,children:Array.from({length:12},(s,i)=>e.jsxs("div",{className:h.tableRow,children:[e.jsx(n,{variant:"text",width:80,height:14}),e.jsx(n,{variant:"text",width:90,height:14}),e.jsx(n,{variant:"text",width:70,height:14}),e.jsx(n,{variant:"text",width:90,height:14}),e.jsx(n,{variant:"text",width:80,height:14}),e.jsx(n,{variant:"text",width:90,height:14})]},i))})]})}function re(){const{t:s}=B("pages"),{showSuccess:i,showError:y}=$(),{currentBusiness:c}=Y(),f=T(),o=c?.company_id,x=new Date().getFullYear(),[l,j]=d.useState(x),[E,g]=d.useState(!1),u=F({queryKey:C.dre.yearly(o,l),queryFn:async()=>{const t=await I.getYearly(o,l);return t?.success?t.data:null},enabled:!!o,placeholderData:A}),_=u.data??null;d.useEffect(()=>{u.isError&&y(s("business.dre.notifications.fetchError"))},[u.isError]);const b=d.useMemo(()=>{const t=_?.summary||{};return{receitaLiquida:t.netRevenue||0,lucroBruto:t.grossProfit||0,resultadoLiquido:t.netResult||0}},[_]),v=d.useCallback(t=>{j(parseInt(t))},[]),L=d.useCallback(async(t="pdf")=>{if(!o)return;const r=t==="excel"?"xlsx":t,q={pdf:"application/pdf",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",csv:"text/csv"};g(!0);try{const R=await I.exportYearly(o,l,r),P=new Blob([R],{type:q[r]||"application/octet-stream"}),D=window.URL.createObjectURL(P),p=document.createElement("a");p.href=D,p.download=`dre-${l}.${r}`,document.body.appendChild(p),p.click(),p.remove(),window.URL.revokeObjectURL(D),i(s("business.dre.notifications.exportSuccess"))}catch{y(s("business.dre.notifications.exportError"))}finally{g(!1)}},[o,l,i,y,s]),S=d.useMemo(()=>[{key:"month",title:s("business.dre.table.month")},{key:"receitaBruta",title:s("business.dre.table.receitaBruta"),align:"right"},{key:"deducoes",title:s("business.dre.table.deducoes"),align:"right"},{key:"receitaLiquida",title:s("business.dre.table.receitaLiquida"),align:"right"},{key:"lucroBruto",title:s("business.dre.table.lucroBruto"),align:"right"},{key:"resultadoLiquido",title:s("business.dre.table.resultadoLiquido"),align:"right"}],[s]);function k(){const t=[];for(let r=x;r>=x-3;r--)t.push({value:r,label:r.toString()});return t}const m=N.formatCurrency.bind(N);return{tableData:d.useMemo(()=>(_?.months||[]).map(r=>({month:s(`business.dre.months.${r.month}`),monthNumber:r.month,receitaBruta:m(r.grossRevenue),deducoes:m(-r.totalDeductions),receitaLiquida:m(r.netRevenue),lucroBruto:m(r.grossProfit),resultadoLiquido:m(r.netResult),_resultadoLiquidoRaw:r.netRe
1sult})),[_,m,s]),summary:b,selectedYear:l,loading:u.isLoading,exporting:E,columns:S,handleYearChange:v,handleExport:L,generateYearOptions:k,formatCurrency:m,refetch:()=>f.invalidateQueries({queryKey:C.dre.all})}}const te="DRE-module__header___N8asT",ie="DRE-module__subtitle___CjKWE",ne="DRE-module__headerActions___ia5E3",oe="DRE-module__searchBar___H4VOA",le="DRE-module__summaryCards___Y85ix",ue="DRE-module__summaryCard___jnEVQ",de="DRE-module__summaryIconPrimary___SU3qg",ce="DRE-module__summaryIconSuccess___il8NS",me="DRE-module__summaryIconNet___aIvDP",he="DRE-module__summaryInfo___V3WRI",ye="DRE-module__summaryLabel___wZn-E",_e="DRE-module__summaryValue___RcIUR",be="DRE-module__positive___PcWWb",xe="DRE-module__negative___o37UM",a={header:te,subtitle:ie,headerActions:ne,searchBar:oe,summaryCards:le,summaryCard:ue,summaryIconPrimary:de,summaryIconSuccess:ce,summaryIconNet:me,summaryInfo:he,summaryLabel:ye,summaryValue:_e,positive:be,negative:xe};function Se(){const{t:s}=B("pages"),i=X(),{tableData:y,summary:c,selectedYear:f,loading:o,exporting:x,columns:l,handleYearChange:j,handleExport:E,generateYearOptions:g,formatCurrency:u}=re();function _(b){i(`/business/dre/${f}/${b.monthNumber}`)}return o?e.jsxs("div",{children:[e.jsx(w,{}),e.jsx("header",{className:a.header,children:e.jsxs("div",{children:[e.jsx("h1",{children:s("business.dre.title")}),e.jsx("p",{className:a.subtitle,children:s("business.dre.subtitle")})]})}),e.jsx(ae,{})]}):e.jsxs("div",{children:[e.jsx(w,{}),e.jsxs("header",{className:a.header,children:[e.jsxs("div",{children:[e.jsx("h1",{children:s("business.dre.title")}),e.jsx("p",{className:a.subtitle,children:s("business.dre.subtitle")})]}),e.jsx("div",{className:a.headerActions,children:e.jsx(Q,{onExport:E,loading:x,feature:"EXPORTS"})})]}),e.jsx("div",{className:a.searchBar,children:e.jsx(M,{label:s("business.dre.filters.year"),options:g(),value:f,onChange:j,placeholder:""})}),e.jsxs("div",{className:a.summaryCards,children:[e.jsxs("div",{className:a.summaryCard,children:[e.jsx(V,{className:a.summaryIconPrimary}),e.jsxs("div",{className:a.summaryInfo,children:[e.jsx("span",{className:a.summaryLabel,children:s("business.dre.summary.receitaLiquida")}),e.jsx("span",{className:a.summaryValue,children:u(c.receitaLiquida)})]})]}),e.jsxs("div",{className:a.summaryCard,children:[e.jsx(U,{className:a.summaryIconSuccess}),e.jsxs("div",{className:a.summaryInfo,children:[e.jsx("span",{className:a.summaryLabel,children:s("business.dre.summary.lucroBruto")}),e.jsx("span",{className:`${a.summaryValue} ${c.lucroBruto>=0?a.positive:a.negative}`,children:u(c.lucroBruto)})]})]}),e.jsxs("div",{className:a.summaryCard,children:[e.jsx(O,{className:a.summaryIconNet}),e.jsxs("div",{className:a.summaryInfo,children:[e.jsx("span",{className:a.summaryLabel,children:s("business.dre.summary.resultadoLiquido")}),e.jsx("span",{className:`${a.summaryValue} ${c.resultadoLiquido>=0?a.positive:a.negative}`,children:u(c.resultadoLiquido)})]})]})]}),e.jsx(K,{noPadding:!0,children:e.jsx(W,{columns:l.map(b=>({...b,render:b.key==="resultadoLiquido"?v=>({value:v.resultadoLiquido,className:v._resultadoLiquidoRaw>=0?"positiveBalance":"negativeBalance"}):void 0})),data:y,onRowClick:_,emptyMessage:s("business.dre.table.emptyMessage")})})]})}export{Se as default};
2//# sourceMappingURL=index.BRVqiLyC.js.map

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.