1import{f as N,y as M,r as C,I as S,z as w,u as F,D as p,$ as Y,fN as O,F as D,fO as R,j as s,m as z,aC as B,P as x,fP as E,aO as H,a5 as W}from"./index-DUoAJW6O.js";const _=()=>{const{t:a}=N(),[i,h]=M(),o=i.get("posId"),[y,f]=C.useState({}),{showToast:v}=S(),c=w(),u=Number(i.get("city"))||void 0,T=F(e=>e.permissions),{data:d}=p(c.organizationId?["get-pos",u,c.organizationId]:null,()=>Y({placementId:u,organizationId:c.organizationId}),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0,shouldRetryOnError:!1}),b=(d==null?void 0:d.map(e=>({name:e.name,value:e.id})))||[],{data:l,isLoading:g,mutate:j}=p(o!=="*"&&o?["get-timestamp",o]:null,()=>O(Number(o)),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),{trigger:I}=D(["post-timestamp"],async(e,{arg:t})=>R(t.body,t.id)),k=async e=>{try{const n=await I({body:{dateTimeStamp:new Date},id:e});n&&f(r=>({...r,[e]:!0})),j(r=>r&&r.map(m=>m.deviceId===e?{...m,tookMoneyTime:n.tookMoneyTime}:m),!1)}catch(t){console.error("Error in postTimestamp:",t),v(a("errors.other.errorInPostTimestamp"),"error")}},P=[{title:a("equipment.device"),dataIndex:"deviceName",key:"deviceName"},{title:a("routes.collection"),key:"begin",render:(e,t)=>s.jsx(z,{requiredPermissions:[{action:"create",subject:"CashCollection"},{action:"manage",subject:"CashCollection"}],userPermissions:T,children:n=>n&&s.jsx("div",{className:"flex justify-start",children:s.jsx(B,{title:"ÐÑоинкаÑÑиÑовал",classname:"border border-successFill rounded px-2 py-2 text-successFill hover:border-successFill/80 hover:text-successFill/80",type:"outline",handleClick:()=>k(t.deviceId),disabled:y[t.deviceId]})})})},{title:a("table.headers.datePrevious"),dataIndex:"oldTookMoneyTime",key:"oldTookMoneyTime",render:e=>e?x(e).format("DD.MM.YYYY HH:mm:ss"):"-"},{title:a("table.headers.dateCurrent"),dataIndex:"tookMoneyTime",key:"tookMoneyTime",render:e=>e?x(e).format("DD.MM.YYYY HH:mm:ss"):"-"}];return s.jsxs("div",{children:[s.jsx("div",{className:"ml-12 md:ml-0 mb-5",children:s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx("span",{className:"text-xl sm:text-3xl font-normal text-text01",children:a("routes.timestamp")})})}),s.jsxs("div",{className:"mt-5",children:[s.jsx(E,{title:a("finance.carWash"),options:b,classname:"w-64",value:Number(o),onChange:e=>H(i,h,{posId:e}),allowClear:!0}),s.jsx("div",{className:"mt-8",children:s.jsx(W,{dataSource:l==null?void 0:l.sort((e,t)=>e.deviceId-t.deviceId),columns:P,rowKey:"id",pagination:!1,scroll:{x:"max-content"},loading:g})})]})]})};export{_ 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.