1var je=Object.defineProperty;var ve=(e,a,o)=>a in e?je(e,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[a]=o;var g=(e,a,o)=>ve(e,typeof a!="symbol"?a+"":a,o);import{j as t}from"./modules.Ch66jYJ6.js";import{ai as re,u as y,T as b,E as r,dy as Re,bA as le,e as Ne,dm as we,bX as Y,J as pe,m as Ae,Q as me,au as Ee,aw as Pe,bF as h,l as Me,o as We,F as ke,b9 as ee,K as He,b3 as Le,L as Ge,U as u,as as S,cx as z,bI as Oe,a$ as te,b5 as $e,aq as J,r as Be,s as ce,c as w,Z as Ue,bM as T,dv as j,du as L,bL as p,cJ as de,bC as qe,aL as ze,aK as k,aJ as Je,d as Ke,bD as ae,dn as Qe,H as _e,bE as Xe,aP as oe,aQ as G,P as Ze,aM as Ye}from"./index.DRpWbXsJ.js";import{c as $,b as O,a1 as et}from"./kendo.lG5BT02J.js";import{u as tt}from"./useFilterStorage.D2d2jh7A.js";import{u as at}from"./usePageStorage.BSDALu5k.js";import{D as ot}from"./DocumentIndex.BDrcAh76.js";import{u as nt}from"./UseGridSort.DiR670po.js";import{u as st}from"./FilterTab.K3EuUtzn.js";import{E as it}from"./EmptyGrid.CAOyRaoU.js";import{E as rt}from"./EmptyGridText.DuNLlceV.js";import{M as ne}from"./MoreActionsTooltip.DBXg-8R2.js";import{F as lt,u as mt,a as ue,b as se,P as ct,D as dt}from"./DocumentsWithVatFilter.K0Jp8OQw.js";import{S as ut}from"./Search.Do4W9z1i.js";import{u as he}from"./useActionCopy.CBwImHY7.js";import{T as ht,A as B}from"./ToolbarActions.B7RjsUcK.js";import{u as Ce,E as Ct}from"./EditRowAction.BjVo-6rz.js";import{E as ft,a as gt,b as U,c as C,u as xt}from"./ExportedColumn.D_q5y71u.js";import{u as fe}from"./useActionExportToPdf.C71GR3vN.js";import{u as bt}from"./useActionRedirect.BxzSiKrj.js";import{u as Dt}from"./useActionOpenVariantManager.bAPhxT7U.js";import{u as ge}from"./useActionRelatedDocuments.B1PWr-Kc.js";import{u as yt}from"./useActionSettings.CLf5RJ-E.js";import{u as xe}from"./useActionUpdateExported.BG9fllPg.js";import{u as It}from"./useToolbarItems.rDpYI5AG.js";import{g as K}from"./getTooltipDefinition.TOUTwiGq.js";import{T as Q}from"./ToolbarAction.CKG-uwDV.js";import{R as _,b as Tt}from"./reportSettings._GSiDWBR.js";import{u as be}from"./useReportPrint.D2BtA9Cp.js";import{b as St,F as Ft,c as Vt,D as jt}from"./FilterDate.CBtDpXPt.js";import{c as vt,F as Rt}from"./FilterDropDownList.34TjFKn3.js";import{u as Nt}from"./useDeleteAction.C43ispHE.js";import{u as De,a as wt}from"./useCashVoucherPrintAction.DSw6miVs.js";import{u as pt}from"./useExportColumns.SHxVHwWv.js";import{a as At,G as Et}from"./constants.BCBZPfpS.js";import{M as Pt}from"./MoreActionsButton.Cv7C6-SO.js";import{E as Mt}from"./EetStatusGridCell.CqczNlkG.js";import{G as q}from"./GridCellLink.CwA2rXzA.js";import{G as ie}from"./GridCellText.cyqiL1B6.js";import{u as Wt}from"./useDefaultColumns.eKxx6aTn.js";import{G as kt,R as Ht}from"./RowActionsWrapper.zsG0UVNO.js";import{E as Lt}from"./ExportedStatus.CdnbSy2H.js";import{u as Gt}from"./useRenderColumns.C5rsiTMH.js";import{D as Ot}from"./DeleteRowAction.u9BjBeLH.js";import{S as $t}from"./ShowMoreRowAction.CSWaHm2X.js";import{P as Bt}from"./PrintRowAction.CUFb_CFI.js";import{a as X,F as Ut}from"./FilterSection.-3jAD3cb.js";import{F as qt}from"./FilterRangeNumber.fc2sGauI.js";import{F as zt}from"./FilterSegmentButtons.3SbBhkvK.js";import{F as ye}from"./FilterSplitter.Ctv34BLD.js";import{F as Jt}from"./FilterTags.CE7RU30D.js";import{u as Kt}from"./useDataOnDemand.D2B141u5.js";import{u as Qt}from"./useTags.BYJSvc_a.js";import{F as _t}from"./FilterCheckbox.WC1joVet.js";import{u as Xt}from"./useAgendaExtensions.DD7274dN.js";import{E as Zt}from"./ExportedDropDownList.UDm51ytJ.js";import"./useDateTypes.DXA-vGBO.js";import"./useSortStorage.D0wBpW_w.js";import"./useRenderEmptyGridColumns.B5N3TyYH.js";import"./usePairWithDocumentAction.CayoRC_B.js";import"./FilterPartnerComboBox.BiZBBGM9.js";import"./PartnerComboBox.BXNO5Kmt.js";import"./FilterDateRow.DR5MEGF_.js";import"./DialogGrid.30JTfVCP.js";import"./ReadonlyGrid.D6bI0H7I.js";import"./ToolbarSeparator.DvzlqZZx.js";import"./GridRowActionItem.D3znDmUr.js";import"./getReportSettings.BiZrR5bK.js";import"./useExportFile.Dtr61RsQ.js";import"./ActionButton.Cg4nilzP.js";import"./useRelatedDocumentAction.ntRUaiRK.js";import"./Currencies.D4WMO2T6.js";import"./usePaymentStatus.CyYC9LAI.js";import"./useUpdateExportedAction.DbFC_aFp.js";import"./ToolbarItem.CL0H8S8l.js";import"./DeleteResponseContentItem.q7JdYuyf.js";import"./DocumentDeleteResult.CS0tbF8P.js";import"./RelatedDocumentsToggable.KCxaJJZv.js";import"./useInformDialog.D1zf9nTU.js";import"./DeleteAction.B4Drz5fv.js";const Yt=()=>{const{agendaSettings:e}=re(),{t:a}=y([b.Common]),o=[{Disabled:!0,Rank:0,Name:r.nameof(s=>s.DocumentNumber),DisplayName:a("Common:DocumentNumber"),Show:!0},{Disabled:!1,Rank:1,Name:"Flag",DisplayName:a("Common:Label.Flag"),Show:!1},{Disabled:!1,Rank:2,Name:r.nameof(s=>s.MovementType),DisplayName:a("Common:Label.BankMovementType"),Show:!0},{Disabled:!1,Rank:3,Name:r.nameof(s=>s.Description),DisplayName:a("Common:Description"),Show:!0},{Disabled:!1,Rank:4,Name:r.nameof(s=>s.ContactName),DisplayName:a("Common:PartnerOrPerson"),Show:!0},{Disabled:!1,Rank:5,Name:r.nameof(s=>s.DateOfTransaction),DisplayName:a("Common:Date"),Show:!0},{Disabled:!1,Rank:6,Name:r.nameof(s=>s.TotalWithVat),DisplayName:a("Common:TotalAmount"),Show:!0},{Disabled:!1,Rank:7,Name:r.nameof(s=>s.PairedDocumentNumber),DisplayName:a("Common:Label.Paired"),Show:!0},{Disabled:!1,Rank:8,Name:r.nameof(s=>s.VariableSymbol),DisplayName:a("Common:VariableSymbolOrExternalNumber.Short"),Show:!1},{Disabled:!1,Rank:9,Name:r.nameof(s=>s.CashRegisterName),DisplayName:a("Common:CashRegister"),Show:!1}];return e.IsVatPayer&&o.push({Disabled:!1,Rank:10,Name:r.nameof(s=>s.TotalWithoutVat),DisplayName:a("Common:TotalAmountWithoutVat"),Show:!1},{Disabled:!1,Rank:11,Name:r.nameof(s=>s.TotalVat),DisplayName:a("Common:Vat"),Show:!1}),o.push({Disabled:!1,Rank:12,Name:r.nameof(s=>s.TotalWithVatHc),DisplayName:"".concat(a("Common:TotalAmount")," (").concat(e.CurrencySymbol,")"),Show:!1}),e.IsVatPayer&&o.push({Disabled:!1,Rank:13,Name:r.nameof(s=>s.TotalWithoutVatHc),DisplayName:"".concat(a("Common:TotalAmountWithoutVat")," (").concat(e.CurrencySymbol,")"),Show:!1},{Disabled:!1,Rank:14,Name:r.nameof(s=>s.TotalVatHc),DisplayName:"".concat(a("Common:Vat")," (").concat(e.CurrencySymbol,")"),Show:!1}),e.EetRegime!==Re.None&&o.push({Rank:15,Name:r.nameof(s=>s.EetStatus),DisplayName:a("Common:Eet.Title"),Show:!0,Disabled:!1}),{Id:0,EntityType:le.CashVoucher,IsActive:!0,Name:a("VariantManager.DefaultName"),Items:o,Version:1}};function ea(){return Ne().shape({CashRegisterId:pe().required(Ae.requiredText("Common:CashRegisterId")),DateFrom:Y("Common:DateFrom").nullable().notRequired(),DateTo:Y("Common:DateTo").nullable().notRequired(),IsIntervalCorrect:we()})}class ta extends ft{constructor(){super(...arguments);g(this,"CurrencySymbol",!1);g(this,"DateOfTransaction",!1);g(this,"DocumentNumber",!1);g(this,"InvoiceDocumentNumber",!1);g(this,"MovementType",!1);g(this,"Description",!1);g(this,"ContactName",!1);g(this,"TotalWithVat",!1);g(this,"TotalWithVatHc",!1);g(this,"TotalWithoutVat",!1);g(this,"TotalWithoutVatHc",!1);g(this,"TotalVat",!1);g(this,"TotalVatHc",!1);g(this,"VariableSymbol",!1);g(this,"CashRegisterName",!1);g(this,"EetStatus",!1)}}const aa=e=>{var v,R;const{t:a}=y([b.Common]),o=me(),s=Ee(),l=Pe(),c=St({propertyName:"DateOfTransaction",type:h.Date}),n=vt({propertyName:"CashRegisterId",type:h.CashRegister}),[i,d]=$.useState(e.init.stateModel),[x,m]=$.useState(!1),[D,H]=$.useState(e.init.cashRegister),E=ea(),F=Me({mode:"onBlur",reValidateMode:"onBlur",resolver:We(E),defaultValues:{CashRegisterId:e.init.cashRegister.Id,DateFrom:(v=e.init.date.dateFrom)!=null?v:null,DateTo:(R=e.init.date.dateTo)!=null?R:null,DateType:e.init.date.dateType,IsCustomSet:e.init.date.isCustomSet}}),P=()=>{const f=F.getValues(),I=c.create(new Ft({dateFrom:f.DateFrom,dateTo:f.DateTo,isCustomSet:f.DateType===z.Custom,dateType:f.DateType,isActive:f.DateType!==z.All})),V=n.create({Value:D.Id,Text:D.Name});return new Oe([I,V])},M=f=>{const I=e.cashRegisters.find(V=>V.Id===f.value);I!==void 0&&(H(I),F.handleSubmit(A)())},A=async f=>
1{F.formState.isValid&&(m(!0),await o.get(u.CashVoucher.Data.GetCashRegisterState(f.CashRegisterId,f.DateFrom,f.DateTo)).then(I=>{d(I)}).finally(()=>{m(!1)}))};return t.jsx(ke,{formProps:F,children:t.jsxs(lt,{isLoading:x,model:i,init:{date:e.init.date,filter:e.init.filter},getFilter:P,loadData:A,handleShowDocuments:e.handleShowDocuments,handlePrint:e.handlePrint,handleClose:e.handleClose,children:[t.jsx(ee,{labelLength:2,valueLength:6,label:a("Common:CashRegister"),children:t.jsx(He,{name:"CashRegisterId",textField:"Name",valueField:"Id",onChange:M,data:e.cashRegisters,uiId:"csw-cash-register"})}),t.jsxs(ee,{labelLength:2,valueLength:6,label:"",children:[t.jsx(Le,{children:i.InitailStateDate===null?t.jsx("div",{children:a("Common:InitialState.Message_IsNotSet")}):t.jsx("div",{children:a("Common:InitialState.State",{amount:l.Format({value:i.InitailStateAmount}),currency:i.CurrencySymbol,date:s.Format(i.InitailStateDate)})})}),t.jsxs(Ge,{...S("csw-change-initial-state"),to:u.Setting.CashRegister.CashRegisters,children:[a("Common:InitialState.Message_Change")," "]})]})]})})},oa=e=>{var n;const{t:a}=y([b.Common]),o={dateFrom:te().startOf("month").toDate(),dateTo:te().endOf("month").toDate(),isCustomSet:!1,dateType:z.ThisMonth},l=(()=>{var d;const i=(d=e.filter)==null?void 0:d.getFilter(h.Date);return i===void 0?o:{dateFrom:i.data.dateFrom===void 0?void 0:new Date(i.data.dateFrom),dateTo:i.data.dateTo===void 0?void 0:new Date(i.data.dateTo),isCustomSet:i.data.isCustomSet,dateType:i.data.dateType}})(),c=(n=e.filter)==null?void 0:n.getFilter(h.CashRegister);return t.jsx($e,{size:J.Medium,title:a("Common:CashRegisterState"),onClose:e.handleClose,children:t.jsx(Be,{url:u.CashVoucher.Data.GetCashRegisterStateIndex(l.dateFrom,l.dateTo,c==null?void 0:c.data.value),children:i=>t.jsx(aa,{cashRegisters:i.CashRegisters,init:{date:l,cashRegister:i.CashRegisters.find(d=>d.Id===i.CashRegisterState.CashRegisterId),stateModel:i.CashRegisterState,filter:e.filter},handleShowDocuments:e.handleShowDocuments,handlePrint:e.handlePrint,handleClose:e.handleClose})})})};function na(e){const{t:a}=y([b.Common]),o=ce(),{print:s}=be(),l=i=>{const d=i==null?void 0:i.getFilter(h.Date),x=i==null?void 0:i.getFilter(h.CashRegister);s(_.CashVoucher.CashRegisterBook({CashRegisterId:x==null?void 0:x.data.value,DateFrom:d==null?void 0:d.data.dateFrom,DateTo:d==null?void 0:d.data.dateTo}))},c=i=>{o.onClose(),e.onFilterChange&&e.onFilterChange(i)},n=t.jsx(t.Fragment,{children:o.isVisible===!0&&t.jsx(oa,{isVisible:o.isVisible,filter:e.filter,handlePrint:l,handleShowDocuments:c,handleClose:o.onClose})});return{title:a("Common:CashRegisterState"),type:w.Balance,onActionClick:o.onShow,components:n,uiId:"csw-grid-finance-state"}}const sa=e=>{var s;const a={toolbar:"csw-grid-finance-state"},o=na({filter:e.filter,onFilterChange:e.onFilterChange});return{isActive:(s=e.isActive)!=null?s:!0,toolbar:t.jsx(Q,{uiId:a.toolbar,action:o,disabled:e.disabled}),tooltipRow:K({action:o,disabled:e.disabled,uiId:a.toolbar}),renderActionComponents:()=>t.jsx(t.Fragment,{children:o.components})}},Ie=e=>{var s;const a=De({selectedIds:e.selectedIds,documentNumbersWithEet:e.documentNumbersWithEet,pairingStatus:e.pairingStatus,onCompleted:e.onCompleted}),o=Nt({url:u.CashVoucher.Data.Delete,ids:e.selectedIds,dialogSize:J.Medium,customConfirmContent:a.confirmDialogContent,hideConfirmButton:a.isDeleteButtonHidden,deleteResult:a.deleteResultContent,onActionClick:a.handleBeforeDelete,onDeleted:a.handleAfterDelete});return{isActive:(s=e.isActive)!=null?s:!0,toolbar:t.jsx(Q,{action:o,uiId:"csw-grid-delete",disabled:e.disabled}),tooltipRow:K({action:o,disabled:e.disabled,uiId:"csw-row-action-delete"}),renderActionComponents:()=>o.components}},ia=e=>{const{t:a}=y([b.Common,b.IssuedInvoice]);return t.jsxs(gt,{children:[t.jsxs(U,{title:"".concat(a("Common:InfoAboutDocument"),":"),children:[t.jsx(C,{name:r.nameof(o=>o.DocumentNumber),label:a("Common:DocumentNumber")}),t.jsx(C,{name:r.nameof(o=>o.DateOfTransaction),label:a("Common:Date")}),t.jsx(C,{name:r.nameof(o=>o.MovementType),label:a("Common:Label.MovementType")}),t.jsx(C,{name:r.nameof(o=>o.Description),label:a("Common:Description")}),t.jsx(C,{name:r.nameof(o=>o.ContactName),label:a("Common:PartnerOrPerson")}),t.jsx(C,{name:r.nameof(o=>o.VariableSymbol),label:a("Common:VariableSymbolOrExternalNumber.Short")}),t.jsx(C,{name:r.nameof(o=>o.CashRegisterName),label:a("Common:CashRegister")})]}),t.jsx(U,{title:"".concat(a("Common:InfoAboutPrice"),":"),children:e.agendaSettings.IsVatPayer?t.jsxs(t.Fragment,{children:[t.jsx(C,{name:r.nameof(o=>o.TotalWithVat),label:a("Common:TotalWithVat")}),t.jsx(C,{name:r.nameof(o=>o.TotalWithoutVat),label:a("Common:TotalWithoutVat")}
1),t.jsx(C,{name:r.nameof(o=>o.TotalVat),label:a("Common:Vat")}),t.jsx(C,{name:r.nameof(o=>o.CurrencySymbol),label:a("Common:Currency")}),t.jsx(C,{name:r.nameof(o=>o.TotalWithVatHc),label:a("Common:PriceTotalWithVatHc")}),t.jsx(C,{name:r.nameof(o=>o.TotalWithoutVatHc),label:a("Common:PriceTotalWithoutVatHc")}),t.jsx(C,{name:r.nameof(o=>o.TotalVatHc),label:a("Common:TotalVatHc")})]}):t.jsxs(t.Fragment,{children:[t.jsx(C,{name:r.nameof(o=>o.TotalWithVat),label:a("Common:Total")}),t.jsx(C,{name:r.nameof(o=>o.CurrencySymbol),label:a("Common:Currency")}),t.jsx(C,{name:r.nameof(o=>o.TotalWithVatHc),label:a("Common:TotalHc")})]})}),t.jsxs(U,{title:"".concat(a("Common:Other"),":"),children:[t.jsx(C,{name:r.nameof(o=>o.InvoiceDocumentNumber),label:a("Common:Label.Paired")}),t.jsx(C,{name:r.nameof(o=>o.Exported),label:a("Common:Exported")}),e.agendaSettings.HasEet&&e.agendaSettings.LegislationType===Ue.Cz&&t.jsx(C,{name:r.nameof(o=>o.EetStatus),label:a("Common:Eet.Title")})]})]})};function ra(){return{getSelectedColumns:(a,o,s)=>{const{isSelected:l,select:c,selectedColumns:n}=pt(a);return(l(i=>i.TotalWithVat)||l(i=>i.TotalWithoutVat)||l(i=>i.TotalVat))&&c(i=>i.CurrencySymbol),a.includes("Flag")&&c(i=>i.Exported),n}}}const Te=e=>{var o;const a=wt({selectedIds:e.selectedIds});return{isActive:(o=e.isActive)!=null?o:!0,toolbar:t.jsx(Q,{uiId:Et.Print,action:a,disabled:e.disabled}),tooltipRow:K({action:a,disabled:e.disabled,uiId:At.Print}),renderActionComponents:()=>t.jsx(t.Fragment,{children:a.components})}},la=e=>{var d;const{t:a}=y(b.Common),{print:o}=be(),s={type:w.Report,title:a("Common:Menu.Reports")},l={toolbar:"csw-grid-reports"},c=()=>{var m;const x=_.CashVoucher.List({ids:(m=e.selectedIds)!=null?m:[],dataState:e.dataState,filterModels:e.filterModel});o(x)},i={rows:[{icon:w.Report,text:a("Common:ListOfDocuments"),onClick:c,uiId:"csw-action-print-cash-voucher-list"}]};return{isActive:(d=e.isActive)!=null?d:!0,toolbar:t.jsx(Pt,{uiId:l.toolbar,title:s.title,headerTitle:s.title,sections:[i],type:s.type,disabled:e.disabled}),tooltipRow:{disabled:e.disabled,innerSection:{title:s.title,titleIcon:s.type,...i}},renderActionComponents:()=>null}},ma=e=>{var v,R,f,I,V,W;const{t:a}=y([b.Common]),o=It(e.selectedItems),s=mt({documentType:T.CashVoucher,getCreateUrl:u.CashVoucher.Create}),l=Ce({url:u.CashVoucher.Edit(o.selectedId),disabled:!o.selectedOne}),c=fe({documentType:T.CashVoucher,selectedIds:o.selectedIds,disabled:!o.selectedOne}),n=Te({selectedIds:o.selectedIds,disabled:!o.selectedAny}),i=Ie({selectedIds:o.selectedIds,documentNumbersWithEet:e.selectedItems.filter(N=>N.EetStatus===L.Registered).map(N=>N.DocumentNumber),pairingStatus:e.selectedItems.some(N=>N.Status===j.IsSummarySalesReceipt)?j.IsSummarySalesReceipt:j.Unpaired,disabled:!o.selectedAny,onCompleted:e.onDataFetch}),d=he({url:u.CashVoucher.Copy(o.selectedId),disabled:!o.selectedOne}),x=ue({movementType:(R=(v=e.selectedItems[0])==null?void 0:v.MovementType)!=null?R:p.Entry,documentType:T.CashVoucher,item:e.selectedItems[0],disabled:!o.selectedOne||((f=e.selectedItems[0])==null?void 0:f.PairedDocumentId)!=null||((I=e.selectedItems[0])==null?void 0:I.EetStatus)===L.Registered||((V=e.selectedItems[0])==null?void 0:V.Status)===j.IsSummarySalesReceipt,getPairUrl:u.CashVoucher.Data.Pair,onDataFetch:e.onDataFetch}),m=ge({id:o.selectedId,type:de.CashVoucher,documentNumber:(W=e.selectedItems[0])==null?void 0:W.DocumentNumber,disabled:!o.selectedOne}),D=la({disabled:e.isEmptyGrid,filterModel:e.filterModels,dataState:e.dataState,selectedIds:o.selectedIds}),H=xt({disabled:e.isEmptyGrid,model:new ta,columns:e.columns,dataState:e.dataState,filterModels:e.filterModels,columnsProvider:ra(),filterProvider:Tt(),selectedItems:e.selectedItems,exportEntityType:qe.CashVoucher,dialogTitle:a("IssuedInvoice:CashVoucherExportTitle"),dialogComponent:ia}),E=sa({filter:e.filterModels,onFilterChange:e.onFilterChange}),F=bt({actionType:w.Setting,redirectUrl:u.Setting.CashRegister.CashRegisters,title:a("Common:SideMenu.Settings")}),P=xe({url:u.CashVoucher.Data.SetToNotExported,selectedIds:o.selectedIds,disabled:!o.selectedAny,onExportedChange:e.onDataFetch,textResourceName:"Common:Text.CashVoucherUpdateExportedConfirmation"}),M=Dt({openVariantManager:e.openVariantManager}),A=yt({actions:[M,F]});return t.jsx(ht,{sections:[new B(s,l,c,n,i),new B(d,x,m,P),new B(E,D,H,A)]})},Se=e=>{var a;return t.jsxs(t.Fragment,{children:[t.jsx(ut,{onChange:e.onSearchTextChange,defaultText:e.defaultSearchText,columns:["DocumentNumber","PairedDocumentNumber","ContactName","Description"],filterModels:e.filterModels}),t.jsx(ma,{onFilterChange:e.onFilterChange,filterModels:e.filterModels,columns:e.columns,selectedItems:(a=e.selectedItems)!=null?a:[],onData
1Fetch:e.onDataFetch,dataState:e.dataState,isEmptyGrid:e.isEmptyGrid,openVariantManager:e.openVariantManager})]})},Fe=O.createContext({});function ca(){return O.useContext(Fe)}const da=e=>{const a=Ve(e),{gridRef:o,renderColumns:s}=Gt(a,e.columns);return t.jsx("div",{ref:o,children:t.jsxs(ze,{...e,children:[t.jsx(et,{children:t.jsx(Se,{...e,isEmptyGrid:e.total===0})}),s()]})})},ua=e=>t.jsx(Fe.Provider,{value:e,children:t.jsx(da,{...e})}),ha=e=>{var E,F,P,M,A,v,R,f,I,V,W,N,Z;const{t:a}=y([b.Common]),o=e.dataItem?e.dataItem.Id:0,s=Ce({url:u.CashVoucher.Edit(o)}),l=Te({selectedIds:[o]}),c=De({documentNumbersWithEet:((E=e.dataItem)==null?void 0:E.EetStatus)===L.Registered?[e.dataItem.DocumentNumber]:[],selectedIds:[o],pairingStatus:(P=(F=e.dataItem)==null?void 0:F.Status)!=null?P:j.Unpaired}),n=Ie({documentNumbersWithEet:((M=e.dataItem)==null?void 0:M.EetStatus)===L.Registered?[e.dataItem.DocumentNumber]:[],selectedIds:[o],pairingStatus:(v=(A=e.dataItem)==null?void 0:A.Status)!=null?v:j.Unpaired,onCompleted:e.onDataFetch}),i=fe({documentType:T.CashVoucher,selectedIds:[o]}),d=ue({movementType:(f=(R=e.dataItem)==null?void 0:R.MovementType)!=null?f:p.Entry,documentType:T.CashVoucher,item:e.dataItem,disabled:((I=e.dataItem)==null?void 0:I.PairedDocumentId)!==null||((V=e.dataItem)==null?void 0:V.EetStatus)===L.Registered||((W=e.dataItem)==null?void 0:W.Status)===j.IsSummarySalesReceipt,getPairUrl:u.CashVoucher.Data.Pair,onDataFetch:e.onDataFetch}),x=he({url:u.CashVoucher.Copy(o)}),m=ge({id:o,type:de.CashVoucher,documentNumber:(N=e.dataItem)==null?void 0:N.DocumentNumber}),D=xe({url:u.CashVoucher.Data.SetToNotExported,selectedIds:[o],onExportedChange:e.onDataFetch,textResourceName:"Common:Text.CashVoucherUpdateExportedConfirmation"}),H=[{rows:[s.tooltipRow,i.tooltipRow,l.tooltipRow,n.tooltipRow]},{rows:[x.tooltipRow,d.tooltipRow,m.tooltipRow,D.tooltipRow]}];return t.jsxs(t.Fragment,{children:[t.jsxs(kt,{children:[t.jsx(Ct,{url:u.CashVoucher.Edit(o),disabled:e.actionsDisabled}),t.jsx(Bt,{reportSetting:_.CashVoucher.Detail([o])}),t.jsx(Ot,{id:o,url:u.CashVoucher.Data.Delete,onActionClick:c.handleBeforeDelete,onCompleted:e.onDataFetch,customDeleteDialogContent:c.confirmDialogContent,deleteButtonHidden:c.isDeleteButtonHidden,dialogSize:J.Medium}),t.jsx($t,{headerTitle:a("Common:CashVoucher.Title",{documentNumber:(Z=e.dataItem)==null?void 0:Z.DocumentNumber}),rowItemId:o,sections:H})]}),d.renderActionComponents(),m.renderActionComponents(),n.renderActionComponents(),D.renderActionComponents()]})};function Ve(e){const{t:a}=y(b.Common),{defaultColumns:o}=Wt(),{agendaSettings:s}=re();function l(n,i){switch(n){case T.ProformaInvoice:return u.ProformaInvoice.Preview(i);case T.CreditNote:return u.CreditNote.Preview(i);case T.ReceivedInvoice:return u.ReceivedInvoice.Preview(i);case T.ReceivedReceipt:return u.ReceivedReceipt.Preview(i);case T.IssuedInvoice:default:return u.IssuedInvoice.Preview(i)}}return[o.Selected(e),{field:r.nameof(n=>n.DocumentNumber),title:a("Common:DocumentNumber"),cell:n=>t.jsx(q,{url:u.CashVoucher.Preview(n.dataItem.Id),name:n.dataItem.DocumentNumber,title:n.dataItem.DocumentNumber,uiId:"csw-cash-voucher-number"}),minWidth:95},{field:"Flag",title:a("Common:Label.Flag"),sortable:!1,cell:n=>t.jsx("td",{...S("csw-cash-voucher-flags"),children:t.jsx("div",{className:"status-wrapper left",children:t.jsx(Lt,{exportedStatus:n.dataItem.Exported})})}),minWidth:70},{field:r.nameof(n=>n.MovementType),title:a("Common:Label.BankMovementType"),minWidth:94,sortable:!0,cell:n=>t.jsx("td",{...S("csw-cash-voucher-movement-type"),children:n.dataItem.MovementDisplayName})},{field:r.nameof(n=>n.Description),title:a("Common:Description"),headerClassName:"text-left",minWidth:100,cell:n=>t.jsx(ie,{value:n.dataItem.Description,uiId:"csw-cash-voucher-description"})},{field:r.nameof(n=>n.VariableSymbol),title:a("Common:VariableSymbolOrExternalNumber.Short"),minWidth:100,headerClassName:"text-left",cell:n=>t.jsx("td",{...S("csw-cash-voucher-variable-symbol"),className:"text-left",children:n.dataItem.VariableSymbol})},{field:r.nameof(n=>n.ContactName),title:a("Common:PartnerOrPerson"),cell:n=>t.jsx(q,{uiId:"csw-cash-voucher-partner",title:n.dataItem.ContactName,url:u.Contact.Preview(n.dataItem.PartnerContactId),name:n.dataItem.ContactName}),minWidth:100},{field:r.nameof(n=>n.TotalWithVat),title:a("Common:TotalAmount"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-with-vat"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalWithVat,symbol:n.dataItem.CurrencySymbol})}),minWidth:130},{field:r.nameof(n=>n.CashRegisterName),title:a("Common:CashRegister"),headerClassName:"text-left",minWidth:100,cell:n=>t.jsx(ie,{value:n.dataItem.CashRegisterName,uiId:"csw-cash-register-name"})},{field:r.nameof(n=>n.DateOfTransaction),title:a("Common:Date"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-date-of-transaction"),className:"text-right",children:t.jsx(Je,{value:n.dataItem.DateOfTransaction})}),minWidth:86},{field:r.nameof(n=>n.PairedDocumentNumber),title:a("Common:Label.Paired"),cell:n=>t.jsx(q,{uiId:"csw-cash-voucher-paired-document",title:n.dataItem.PairedDocumentNumber,url:l(n.dataItem.PairedDocumentType,n.dataItem.PairedDocumentId),name:n.dataItem.PairedDocumentNumber}),minWidth:95},{minWidth:44,field:r.nameof(n=>n.EetStatus),title:a("Common:Eet.Title"),headerClassName:"text-left",sortable:!1,
1cell:n=>t.jsx("td",{children:t.jsx("div",{className:"status-wrapper left",children:t.jsx(Mt,{eetStatus:n.dataItem.EetStatus})})})},{...o.Actions(),cell:Ca},{field:r.nameof(n=>n.TotalWithVatHc),title:"".concat(a("Common:TotalAmount")," (").concat(s.CurrencySymbol,")"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-with-vat-hc"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalWithVatHc,symbol:s.CurrencySymbol})}),minWidth:130},{field:r.nameof(n=>n.TotalVat),title:a("Common:Vat"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-vat"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalVat,symbol:n.dataItem.CurrencySymbol})}),minWidth:130},{field:r.nameof(n=>n.TotalWithoutVat),title:"".concat(a("Common:TotalAmountWithoutVat")),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-without-vat"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalWithoutVat,symbol:n.dataItem.CurrencySymbol})}),minWidth:130},{field:r.nameof(n=>n.TotalWithoutVatHc),title:"".concat(a("Common:TotalAmountWithoutVat")," (").concat(s.CurrencySymbol,")"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-without-vat-hc"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalWithoutVatHc,symbol:s.CurrencySymbol})}),minWidth:130},{field:r.nameof(n=>n.TotalVatHc),title:"".concat(a("Common:Vat")," (").concat(s.CurrencySymbol,")"),headerClassName:"text-right",cell:n=>t.jsx("td",{...S("csw-cash-voucher-total-vat-hc"),className:"text-right",children:t.jsx(k,{value:n.dataItem.TotalVatHc,symbol:s.CurrencySymbol})}),minWidth:130}]}const Ca=e=>{const a=ca();return t.jsx(Ht,{...e,children:t.jsx(ha,{dataItem:e.dataItem,onDataFetch:a.onDataFetch})})},fa=e=>{const{t:a}=y(b.Common),o=Ve(),s=Ke(),l=se({movementType:p.Entry,documentType:T.CashVoucher,getCreateUrl:u.CashVoucher.Create}),c=se({movementType:p.Issue,documentType:T.CashVoucher,getCreateUrl:u.CashVoucher.Create}),n=[{rows:[{icon:w.CreateReceivedInvoice,onClick:()=>s.push(u.CashVoucher.Create(p.Entry)),text:a("Common:Button.NewEntryCash"),uiId:"csw-new-entry-empty-list"},{icon:w.CreateReceivedInvoice,onClick:l.onActionClick,text:a("Common:Button.NewEntryCashDocument"),uiId:"csw-new-entry-from-invoice-empty-list"}]}],i=[{rows:[{icon:w.CreateIssuedInvoice,onClick:()=>s.push(u.CashVoucher.Create(p.Issue)),text:a("Common:Button.NewIssueCash"),uiId:"csw-new-issue-empty-list"},{icon:w.CreateIssuedInvoice,onClick:c.onActionClick,text:a("Common:Button.NewIssueCashDocument"),uiId:"csw-new-issue-from-invoice-empty-list"}]}];return t.jsxs(t.Fragment,{children:[t.jsx(it,{toolbar:t.jsx(Se,{openVariantManager:e.openVariantManager,columns:e.columns,isEmptyGrid:!0}),columns:e.columns,columnProps:o}),t.jsxs("div",{className:"empty-info-wrapper",children:[t.jsx("img",{className:"empty-list-cash-voucher",alt:a("Common:CashRegister")}),t.jsxs("div",{children:[t.jsx("h2",{children:a("Common:SideMenu.CashRegisters")}),t.jsx(rt,{children:a("Common:CashVoucherEmptyList")}),t.jsx(ne,{sections:n,children:d=>t.jsx(ae,{uiId:"csw-create-entry-empty-list",onClick:d.onClick,ref:d.setTriggerRef,children:a("Common:Label.CreateFirstIncome")})}),t.jsx(ne,{sections:i,children:d=>t.jsx(ae,{uiId:"csw-create-issue-empty-list",onClick:d.onClick,className:"ml-16",ref:d.setTriggerRef,children:a("Common:Label.CreateFirstExpense")})})]}),l.components,c.components]})]})},ga=e=>{const{t:a}=y([b.Common]),o=[{type:h.Date,name:a("Common:Date"),propertyName:"DateOfTransaction",uiId:"csw-filter-date-of-issue"},{type:h.Price,name:a("Filter.Price"),propertyName:"TotalWithVatHc",uiId:"csw-filter-total-with-vat-hc"}],[s,l]=O.useState(h.Date),c=m=>{l(m)},n=m=>{e.onFilterChange&&e.onFilterChange(m)},i=m=>{var D;return(D=e.filters.getFilter(m))!=null?D:jt.GetDateDefault(m)},d=m=>{e.onFilterChange&&e.onFilterChange(m)},x=()=>{var m;return(m=e.filters.getFilter(h.Price))!=null?m:{key:"",filter:[],type:h.Price,isActive:!1,data:{}}};return t.jsxs(X,{children:[t.jsxs("div",{className:"default-label above",children:[a("Common:Type"),":"]}),t.jsx(zt,{activeTypes:e.filters.getActiveTypes(),buttonsDef:o,selectedType:s,onSelectedChange:c}),o.map((m,D)=>m.type===s&&m.type!==h.Price?t.jsx(Vt,{default:i(m.type),type:m.type,propertyName:m.propertyName,onFilter:n,labels:{dropDown:"".concat(m.name),from:"".concat(m.name," ").concat(a("Common:Filter.From")),to:"".concat(m.name," ").concat(a("Common:Filter.To"))},activeFilter:e.activeFilters.getFilter(m.type)},D):m.type===s&&m.type===h.Price?t.jsx(qt,{format:"n2",default:x(),propertyName:m.propertyName,type:m.type,onFiler:d,uiId:"csw-filter-price-total"},D):t.jsx(O.Fragment,{},D))]})},xa=e=>{var i;
1const a=me(),o=h.CashRegister,s=e.filters.getFilter(o),l=()=>a.get(u.CashVoucher.Data.GetCompanyCashRegisters).then(d=>d.map(x=>({Text:x.Name,Value:x.Id}))),c={initData:s==null?[]:[{Text:s.data.text,Value:s.data.value}],loadData:l},n=Kt(c);return t.jsx(Rt,{selected:(i=e.filters.getFilter(h.CashRegister))==null?void 0:i.data.value,onFilterChange:e.onFilterChange,label:Qe("Common:CashRegister"),propertyName:"CashRegisterId",type:h.CashRegister,onFocus:n.handleDataLoad,loading:n.isLoading,data:n.data,uiId:"csw-filter-cash-register"})},ba=e=>{var s,l;const{t:a}=y([b.Common]),o=Qt();return t.jsxs(t.Fragment,{children:[t.jsx(ye,{index:e.splitterIndex}),t.jsx(X,{children:t.jsxs(t.Fragment,{children:[t.jsx(xa,{...e}),t.jsx(ct,{filters:e.filters,pairedValue:j.PairedWithInvoice,pairedWithReceiptValue:j.PairedWithReceipt,onFilterChange:e.onFilterChange}),t.jsx(Jt,{label:a("Common:Tags"),type:h.Tag,useTags:o,selectedTags:(l=(s=e.filters.getFilter(h.Tag))==null?void 0:s.data.tags)!=null?l:[],onFilterChange:e.onFilterChange})]})})]})},Da=e=>{var l;const{t:a}=y([b.Common]),{agendaSettings:o,hasIncomeTax:s}=Xt();return t.jsx(t.Fragment,{children:(o.IsVatPayer||s())&&t.jsxs(t.Fragment,{children:[t.jsx(ye,{index:e.splitterIndex}),t.jsxs(X,{children:[t.jsxs("div",{className:"default-label above ml-0",children:[a("Common:Filter.Others"),":"]}),o.IsVatPayer&&t.jsx(dt,{...e}),s()&&t.jsx(_t,{checked:(l=e.filters.getFilter(h.IsIncomeTax))==null?void 0:l.data.value,label:a("Common:Filter.IsIncomeTax"),type:h.IsIncomeTax,propertyName:r.nameof(c=>c.IsIncomeTax),onFilterChange:e.onFilterChange,uiId:"csw-filter-is-income-tax"}),t.jsx(Zt,{filters:e.filters,onFilterChange:e.onFilterChange})]})]})})},ya=e=>t.jsxs(Ut,{...e.filterHolder,...e.filterHolder.methods,children:[t.jsx(ga,{activeFilters:e.filterHolder.activeFilters,filters:e.filterHolder.tempFilters,onFilterChange:e.filterHolder.methods.onTempFilterChange}),t.jsx(ba,{filters:e.filterHolder.tempFilters,onFilterChange:e.filterHolder.methods.onTempFilterChange,splitterIndex:0}),t.jsx(Da,{filters:e.filterHolder.tempFilters,onFilterChange:e.filterHolder.methods.onTempFilterChange,splitterIndex:1})]}),Ia=e=>{const{t:a}=y(b.Contact),{fetchData:o,...s}=e.events,l=e.filterHolder.activeFilters.getFilterTabValue(),{onSelected:c}=st(e.getTabFilter,e.filterHolder.methods.doFilter,l),n=ce(),i=t.jsx(ua,{...s,onSearchTextChange:e.filterHolder.methods.doFilter,defaultSearchText:e.filterHolder.activeFilters.getFullTextSearchValue(),onDataFetch:()=>o(e.state.dataState),columns:e.variantManager.columns,filterModels:e.filterHolder.activeFilters,onFilterChange:e.filterHolder.methods.setNewFilter,openVariantManager:n.onShow,...e.state});return t.jsxs(t.Fragment,{children:[t.jsxs(_e,{children:[t.jsx("h1",{children:a("Common:CashRegister")}),t.jsx(Xe,{defaultVariant:Yt(),entityType:le.CashVoucher,onChange:e.variantManager.onVariantChange,visibility:n})]}),t.jsx(ya,{filterHolder:e.filterHolder}),t.jsx("div",{className:"k-tabstrip-wrapper",children:e.hasData?t.jsxs(oe,{onSelected:c,selected:l,children:[t.jsx(G,{contentClassName:"tab-overflow-fix",title:a("Common:Tab.All"),children:i}),t.jsx(G,{title:a("Common:Label.Incomes"),children:i}),t.jsx(G,{title:a("Common:Label.Expenses"),children:i})]}):t.jsx(oe,{selected:0,children:t.jsx(G,{contentClassName:"tab-overflow-fix",title:a("Common:Tab.All"),children:t.jsx(fa,{openVariantManager:n.onShow,columns:e.variantManager.columns})})})})]})};function Ta(){const e=o=>{const s=[];
1switch(o){case 1:{s.push({logic:"or",filters:[{field:r.nameof(l=>l.MovementType),operator:"eq",value:p.Entry}]});break}case 2:{s.push({logic:"or",filters:[{field:r.nameof(l=>l.MovementType),operator:"eq",value:p.Issue}]});break}}return s},a={filter:e(0),isActive:e(0).length>0,label:"",type:h.Tab,key:h.Tab,data:{selected:0}};return{getFilter:e,defaultTabFilter:a}}const Sa=()=>{const{getFilter:e,defaultTabFilter:a}=Ta(),o=tt({keyStorageName:"CashVoucherFilter",defaultFilter:[a]}),s=nt("CashVoucherSort",[{field:"DocumentNumber",dir:"asc"}]),l=at("CashVoucherPage");return t.jsx(ot,{url:u.CashVoucher.Data.Index,children:c=>{const n=c.Total>0;return t.jsx(Ye,{url:u.CashVoucher.Data.GetList,doubleClick:{url:u.CashVoucher.Preview},canFetchData:n,hasData:n,gridFilter:o,gridPage:l,gridSort:s,children:i=>t.jsx(Ia,{...i,getTabFilter:e})})}})},Xo=Ze(Sa);export{Xo 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.