PageSourceSearch

https://digdis.app/assets/index-DuYf-knm.js

js digdis.app collected 2026-10-06 04:52:58 UTC 14,703 bytes, 2 lines download raw bytes

1import{r as d,j as t}from"./react-Ph8KmUpc.js";import{c as yt}from"./react-redux-frK-3DTg.js";import{b as R}from"./redux-CEHQTSDm.js";import{L as Nt}from"./react-router-dom-4Xacavkg.js";import{c as l}from"./classnames-BexLmjtK.js";import{_ as wt}from"./lodash-BD6zDV1Z.js";import{d as h}from"./dayjs-B1fPiYSR.js";import{R as At}from"./react-country-flag-BJ73qb_B.js";import{L as I,ae as Rt,c as K,dj as It,B as D,ad as Q,z as _,J as Dt,dk as Mt,cI as kt,di as Lt}from"./index-BQP9Fsax.js";import{B as j}from"./index-Dgg3Vw6B.js";import"./react-infinite-scroller-DHECxD1N.js";import{I as X}from"./index-xkckgNYI.js";import{u as Wt}from"./react-router-dom-v5-compat-CtyklhH_.js";import{d as Ot}from"./react-router-DFdoayiM.js";import{e as f,f as c,I as Et,L as Y,q as Bt,d as Z,i as Ft,M as Ht}from"./antd-60O3bWIW.js";import"./@babel-Dv-xQaqJ.js";import"./react-dom-Bv_et8d-.js";import"./scheduler-CzFDRTuY.js";import"./hoist-non-react-statics-BSI0cVgy.js";import"./react-is-8JwjhRSi.js";import"./use-sync-external-store-Dy5tW4V4.js";import"./history-Dj_sFSuk.js";import"./resolve-pathname-D6XOvX2q.js";import"./value-equal-epUc6GCk.js";import"./tiny-invariant-BaFNuDhB.js";import"./jspdf-DJ5JdgJM.js";import"./fflate-Cf-_J6lE.js";import"./@redux-saga-DofAfZN4.js";import"./@loadable-D-cJeKcY.js";import"./country-list-8JtTH2WR.js";import"./mixpanel-browser-BICdPCGo.js";import"./react-ga-DGmEChOC.js";import"./prop-types-COOZHFUr.js";import"./file-saver-D0BwbMUa.js";import"./i18n-iso-countries-cqLO8yen.js";import"./diacritics-OEF76RwT.js";import"./sanitize-html-DrRXZjxj.js";import"./entities-CKVXowTg.js";import"./domelementtype-AVFTcEpP.js";import"./escape-string-regexp-BdPwSnSr.js";import"./deepmerge-MrQlWjp6.js";import"./parse-srcset-BJhEFT5l.js";import"./postcss-B8633UFr.js";import"./picocolors-CBpy9uNM.js";import"./nanoid-oL8Tb-R4.js";import"./title-BFmZ_Iud.js";import"./path-to-regexp-DqLwlp2K.js";import"./uuid-CQkTLCs1.js";import"./@ant-design-DKksAqrL.js";import"./rc-util-CJpcnuU4.js";import"./@emotion-BBuvJ6NL.js";import"./stylis-DKO5tF0i.js";import"./resize-observer-polyfill-B1PUzC5B.js";import"./@ctrl-DOFZgDuz.js";import"./react-custom-scrollbars-2-kgjb46fP.js";import"./raf-Dq-sNnLN.js";import"./performance-now-CBZyMFG9.js";import"./dom-css-B4pbzv-1.js";import"./prefix-style-BamWPxcA.js";import"./to-camel-case-BpxV1GzG.js";import"./to-space-case-V3KmtM9Z.js";import"./to-no-case-Dd7xp2sK.js";import"./add-px-to-style-Y8Vp6shL.js";import"./react-responsive-Fco_aIei.js";import"./chartjs-adapter-dayjs-4-8obW1Y9W.js";import"./chart.js-CeS8xRSw.js";import"./@kurkle-BZxJdD1U.js";import"./@remix-run-CE9fA62X.js";import"./rc-resize-observer-BdQ-qCQL.js";import"./rc-motion-DhBSNTJX.js";import"./rc-picker-CN97HBMS.js";import"./@rc-component-CxcFbznJ.js";import"./rc-tabs-7wIxrTW8.js";import"./rc-dropdown-D3NoWE6X.js";import"./rc-menu-Cs56wxo8.js";import"./rc-overflow-BU2hobRn.js";import"./rc-select-DMFs1Ga8.js";import"./rc-virtual-list-DCFHM7qA.js";import"./rc-collapse-Tq3AGtZp.js";import"./rc-input-number-DzPeLdwY.js";import"./rc-input-CuyV-7Kl.js";import"./rc-drawer-DDe2Y2yl.js";import"./rc-field-form-XbhqmKOH.js";import"./async-validator-DKvM95Vc.js";import"./scroll-into-view-if-needed-BZeNfFF0.js";import"./compute-scroll-into-view-DWa9QgjM.js";import"./rc-dialog-DCRVNfDd.js";import"./rc-notification-frdkeFpn.js";import"./rc-tooltip-Cwc3QpCo.js";import"./rc-rate-D3021DsI.js";import"./rc-slider-BhLoUAYh.js";import"./rc-steps-CE9f1muJ.js";import"./rc-switch-DEwR8TyH.js";import"./rc-table-CYxJIk4h.js";import"./rc-tree-CTLZRWS2.js";import"./rc-checkbox-DiOY8bhH.js";import"./rc-pagination-BvDmzJeC.js";import"./throttle-debounce-CUWDS_la.js";import"./copy-to-clipboard-BHXIcV7g.js";import"./toggle-selection-BHUZwh74.js";import"./rc-textarea-Dy8qJcu2.js";import"./rc-progress-B-NZ42G9.js";import"./react-phone-input-2-DcTLHI2n.js";const Vt="_modal_1s873_1",Pt="_modalTitle_1s873_5",Ut="_modalText_1s873_11",zt="_withholdingTaxWrapper_1s873_21",Gt="_buttonsRow_1s873_25",qt="_wrapper_1s873_30",Jt="_amount_1s873_33",$t="_container_1s873_38",Kt="_col_1s873_50",Qt="_country_1s873_57",Xt="_titleRow_1s873_62",Yt="_royaltiesTitle_1s873_70",Zt="_filters_1s873_81",te="_calendar_1s873_87",ee="_titleWrapper_1s873_95",ae="_selectedTitle_1s873_100",ne="_statements_1s873_105",se="_statementsCol_1s873_112",oe="_tableTitleRow_1s873_117",ce="_tableData_1s873_127",ie="_tableRow_1s873_131",le="_negative_1s873_145",re="_totalRow_1s873_150",me="_totalCol_1s873_163",de="_totalInfo_1s873_167",he="_label_1s873_170",ue="_button_1s873_25",pe="_textAreaWrapper_1s873_183",xe="_textArea_1s873_183",Se="_saveCommentButton_1s873_194",_e="_statementTypeSelect_1s873_200",je="_countryCodeSpan_1s873_205",fe="_contractLink_1s873_210",ge="_contractTitle_1s873_215",a={modal:Vt,modalTitle:Pt,modalText:Ut,withholdingTaxWrapper:zt,buttonsRow:Gt,wrapper:qt,amount:Jt,container:$t,col:Kt,country:Qt,titleRow:Xt,royaltiesTitle:Yt,filters:Zt,calendar:te,titleWrapper:ee,selectedTitle:ae,statements:ne,statementsCol:se,tableTitleRow:oe,tableData:ce,tableRow:ie,negative:le,totalRow:re,totalCol:me,totalInfo:de,label:he,button:ue,textAreaWrapper:pe,textArea:xe,saveCommentButton:Se,statementTypeSelect:_e,countryCodeSpan:je,contractLink:fe,contractTitle:ge},ve=yt(n=>({contractSearch:n.accounting.contractSearch,companyState:n.admin.company,contractStatements:n.accounting.contractStatements}),n=>({actions:R(Mt,n),companyActions:R(kt,n),searchActions:R(Lt,n)})),Te=n=>{var P,U,z,G,q,J,$;
1const[v,g]=d.useState(""),[tt,M]=d.useState(!1),[k,L]=d.useState(null),et=Wt(),{id:u}=Ot();d.useEffect(()=>(n.searchActions.get(),()=>{n.actions.reset(),n.searchActions.reset(),n.companyActions.reset()}),[]),d.useEffect(()=>{n.actions.setStatements({entries:[]}),n.actions.resetContractTotal(),n.actions.resetSelectedStatements(),g(""),n.actions.getContractData(u),n.actions.getContractWithholdingTaxInfo(u),n.actions.getContractComment(u)},[u]),d.useEffect(()=>{var s,o;const e=n.contractStatements.contractComment||((o=(s=n.contractStatements.contract)==null?void 0:s.accounting)==null?void 0:o.internalComment);e!=null&&g(e)},[n.contractStatements.contractComment,(U=(P=n.contractStatements.contract)==null?void 0:P.accounting)==null?void 0:U.internalComment]),d.useEffect(()=>{var e;(e=n.contractStatements.contract)!=null&&e.company&&n.companyActions.get({id:n.contractStatements.contract.company})},[(z=n.contractStatements.contract)==null?void 0:z._id]);const at=e=>{n.actions.updateStatementsFilters({type:e}),n.actions.getContractData(u)},nt=e=>{n.searchActions.updateSearch(e)},st=e=>{const s=n.contractSearch.items.find(i=>i.name===e),o=s==null?void 0:s._id;g(""),n.searchActions.updateSearch(e,o),o&&o!==n.contractSearch.selected&&et(K("accountingContractStatements",{id:o}))},W=e=>{const{statements:s}=n.contractStatements;return!!(s.pagination.hasMore&&s.entries.length-e<20)},O=e=>{W(e)&&n.actions.getMoreStatements()},ot=(e,s)=>()=>{const{selectedStatements:o}=n.contractStatements,i=[...o,e];n.actions.getTax(i.map(r=>r._id),s),n.actions.setSelectedStatements(i),O(i.length)},E=()=>{const{statements:e}=n.contractStatements;return e.entries.filter(o=>o.paid===!1)},ct=()=>{const s=E().map(r=>r._id),{selectedStatementsIds:o}=n.contractStatements;return s.filter(r=>o.includes(r)===!1)},it=e=>()=>{const s=E();n.actions.getTax(s.map(o=>o._id),e),n.actions.setSelectedStatements(s),O(s.length)},lt=e=>{if(!e)return!1;const s=h().endOf("day");return e>s},rt=(e,s)=>()=>{const{selectedStatements:o}=n.contractStatements,i=wt.filter(o,r=>r._id!==e);n.actions.getTax(i.map(r=>r._id),s),n.actions.setSelectedStatements(i)},T=()=>{M(!1),L(null)},B=()=>{k&&(n.actions.revertStatement(k),T())},mt=e=>{const{selectedStatements:s}=n.contractStatements;n.actions.updateStatementsFilters({unpaidOnly:e}),s.length&&n.actions.resetSelectedStatements()},dt=e=>{const s=h.utc(e).format(Dt);n.actions.setSelectedDate(s)},ht=e=>()=>{M(!0),L(e)},ut=e=>{v===""&&e.target.value===`
2`||g(e.target.value)},pt=()=>{n.actions.createComment({text:v||""})},{contractSearch:xt,contractStatements:C,actions:F}=n,{items:St,search:_t}=xt,{contract:p,contractTotal:b,statements:m,selectedStatements:y,selectedStatementsIds:jt,selectedDate:N,isLoading:ft,tax:gt,withholdingTaxInfo:x}=C;if(!p)return t.jsx(I,{loading:!0});const vt=m.entries.filter(e=>!jt.includes(e._id)),S=Rt(y.map(e=>e.amount),2),H=m.filters.unpaidOnly?b.totalSum-b.paidSum-S:b.totalSum-S,w=ct().length,Tt=W(w),Ct=w===0;let V=`Select ${w}`;Tt===!1&&(V="Select All");const A=S-gt,bt=e=>{var o,i;if(!e.paid)return"Unpaid";const s=e.invoiceId?(o=e.invoice)==null?void 0:o.submittedAt:(i=e.legacyAccounting)==null?void 0:i.dateOnInvoice;return s?h.utc(s).format(D):"-"};return t.jsxs(I,{loading:C.isLoading,className:a.wrapper,children:[t.jsx(f,{children:t.jsx(c,{span:24,children:t.jsxs("div",{className:a.container,children:[t.jsxs("div",{className:a.titleRow,children:[t.jsxs("div",{children:[t.jsxs("h2",{className:a.contractTitle,children:[t.jsx("span",{children:p.name}),t.jsx("span",{children:t.jsx(Nt,{to:K("adminContractDetails",{id:u}),className:a.contractLink,children:t.jsx("i",{className:"icon-link-ext"})})})]}),x&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:a.country,children:t.jsxs("div",{children:[t.jsx(At,{countryCode:(G=x.withholdingTax)==null?void 0:G.isoCode}),t.jsx("span",{className:a.countryCodeSpan,children:(q=x.withholdingTax)==null?void 0:q.countryEn})]})}),t.jsxs("div",{className:a.withholdingTaxWrapper,children:[t.jsxs("div",{children:[t.jsx("span",{children:"Withholding Tax Rate: "}),t.jsxs("span",{children:[(((J=x.withholdingTax)==null?void 0:J.realPercentage)??0)*100,"%"]})]}),t.jsxs("div",{children:[t.jsx("span",{children:"Withholding Tax Exemption: "}),t.jsx("span",{children:($=x.withholdingTaxExemptionInfo)!=null&&$.isExcempted?"Active":"Inactive"})]})]})]})]}),t.jsx("div",{className:a.textAreaWrapper,children:t.jsxs(I,{loading:n.companyState.isLoading,children:[t.jsx(Et.TextArea,{className:a.textArea,placeholder:"Add comment...",rows:3,value:v||void 0,onChange:ut}),t.jsx(j,{text:"Save",autoWidth:!0,disabled:C.isLoading,className:a.saveCommentButton,onClick:pt})]})}),t.jsx(Y,{style:{width:"220px"},value:_t,allowClear:!0,placeholder:"Search contracts",onSearch:nt,onSelect:st,children:St.map((e,s)=>t.jsx(Y.Option,{value:e.name,children:e.name},s))})]}),t.jsxs("div",{className:a.titleWrapper,children:[t.jsxs("div",{className:a.royaltiesTitle,children:[t.jsx("h4",{children:"Royalties"}),t.jsxs("span",{children:["Unpaid only",t.jsx(Bt,{size:"small",checked:m.filters.unpaidOnly,onChange:mt})]})]}),t.jsx("div",{className:a.selectedTitle,children:t.jsx("h4",{children:"Selected for Payment"})})]}),t.jsxs("div",{className:a.filters,children:[t.jsx(Z,{className:a.statementTypeSelect,placeholder:"Select Type Filter",value:n.contractStatements.statements.filters.type,mode:"multiple",onChange:at,allowClear:!0,children:It.map((e,s)=>t.jsx(Z.Option,{className:a.option,value:e,children:e},s))}),t.jsx(Ft,{className:a.calendar,placeholder:"Select date",showToday:!1,format:D,allowClear:!1,value:N?h.utc(N):void 0,onChange:dt,disabledDate:lt})]}),t.jsxs("div",{className:a.statements,children:[t.jsxs("div",{className:l(a.col,a.statementsCol),children:[t.jsxs(f,{className:l(a.tableTitleRow),children:[t.jsx(c,{span:4,children:"Date"}),t.jsx(c,{span:5,children:t.jsx("div",{className:a.amount,children:"Sum"})}),t.jsx(c,{span:7,children:"Description"}),t.jsx(c,{span:8,children:"Invoice date"})]}),t.jsx(X,{className:a.tableData,hasMore:m.pagination.hasMore,onLoadMore:F.getMoreStatements,isLoading:m.isLoading,autoHide:!1,autoHeight:!0,autoHeightMax:"calc(100vh - 455px)",children:vt.map(e=>{const s=e.paid;return t.jsxs(f,{className:a.tableRow,children:[t.jsx(c,{span:4,children:h.utc(e.date).format(Q)}),t.jsx(c,{span:5,className:l(a.amount,{[a.negative]:e.amount<0}),children:_(e.amount)}),t.jsx(c,{span:7,children:e.description}),t.jsxs(c,{span:8,children:[bt(e),s?t.jsx("button",{type:"button","aria-label":"Revert to Unpaid",onClick:ht(e._id),children:t.jsx("i",{className:"icon-undo"})}):t.jsx("button",{type:"button","aria-label":"Select Statement",onClick:ot
2(e,p._id),children:t.jsx("i",{className:"icon-plus-circle"})})]})]},e._id)})})]}),t.jsxs("div",{className:l(a.col,a.statementsCol),children:[t.jsxs(f,{className:l(a.tableTitleRow),children:[t.jsx(c,{span:4,children:"Date"}),t.jsx(c,{span:5,children:t.jsx("div",{className:a.amount,children:"Sum"})}),t.jsx(c,{span:7,children:"Type"}),t.jsx(c,{span:8})]}),t.jsx(X,{className:a.tableData,hasMore:!1,isLoading:!1,autoHide:!1,autoHeight:!0,autoHeightMax:"calc(100vh - 455px)",children:y.map(e=>{var o;const s=(o=e.legacyAccounting)==null?void 0:o.dateOnInvoice;return t.jsxs(f,{className:a.tableRow,children:[t.jsx(c,{span:4,children:h.utc(e.date).format(Q)}),t.jsx(c,{span:5,className:l(a.amount,{[a.negative]:e.amount<0}),children:_(e.amount)}),t.jsx(c,{span:7,children:e.description}),t.jsxs(c,{span:8,children:[s?h.utc(s).format(D):"",t.jsx("button",{type:"button",onClick:rt(e._id,p._id),children:t.jsx("i",{className:"icon-minus-circle"})})]})]},e._id)})})]})]}),t.jsxs("div",{className:a.totalRow,children:[t.jsxs("div",{className:l(a.col,a.totalCol),children:[t.jsxs("div",{className:a.totalInfo,children:[t.jsx("span",{className:a.label,children:"Total:"}),t.jsx("span",{className:l(a.amount,{[a.negative]:H<0}),children:_(H)})]}),!ft&&m.filters.unpaidOnly&&!!m.entries.length&&t.jsx(j,{autoWidth:!0,icon:"icon-plus-circle",className:a.button,text:V,disabled:Ct,onClick:it(p._id)})]}),t.jsxs("div",{className:l(a.col,a.totalCol),children:[t.jsxs("div",{className:a.totalInfo,children:[t.jsx("span",{className:a.label,children:"Total:"}),t.jsx("span",{className:l(a.amount,{[a.negative]:S<0}),children:_(S)}),t.jsx("span",{className:a.label,children:"Total after tax:"}),t.jsx("span",{className:l(a.amount,{[a.negative]:A<0}),children:_(A)})]}),!!y.length&&N&&t.jsx(j,{text:"Save",autoWidth:!0,theme:"cta",className:a.button,disabled:A<0,icon:"icon-check",onClick:F.submit})]})]})]})})}),t.jsxs(Ht,{centered:!0,title:!1,footer:null,open:tt,wrapClassName:a.modal,onOk:B,onCancel:T,destroyOnClose:!0,children:[t.jsx("h3",{className:a.modalTitle,children:"Are you sure to revert this revenue back to unpaid?"}),t.jsxs("p",{className:a.modalText,children:["After reverting, the date will be reset and it is free to be edited again with the"," ",t.jsx("i",{className:"icon-plus-circle"})," ","button"]}),t.jsxs("div",{className:a.buttonsRow,children:[t.jsx(j,{text:"Cancel",autoWidth:!0,icon:"icon-close",onClick:T}),t.jsx(j,{text:"Revert",autoWidth:!0,theme:"cta",icon:"icon-undo",onClick:B})]})]})]})},gn=ve(Te);export{gn as default};

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.