- Реструктуризация: src/ разбит на middleware/, utils/, repositories/ (удалены), routes/ (удалены) - Добавлен src/original-html.ts — полный HTML с reportModal - Добавлен src/index.tsx.backup — React-компонент с reportModal - Миграции переименованы (0001_initial_schema.sql) - Добавлена миграция 0018 (удалена позже) - Docker: multi-stage build, wrangler.toml - Frontend: public/static/app.js + style.css - seed.sql добавлен - Документация: CHANGELOG, CHANGES_v4.1.0-4.1.9, PROJECT_STRUCTURE
1231 lines
87 KiB
HTML
1231 lines
87 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html lang="et"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>AKNAPROFF Tootmine</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
|
<style>
|
|
.checkbox-cell { cursor: pointer; transition: all 0.2s; }
|
|
.checkbox-cell:hover { opacity: 0.8; transform: scale(1.05); }
|
|
.checkbox-checked { background-color: #10b981 !important; color: white; }
|
|
.checkbox-unchecked { background-color: white; border: 2px solid #d1d5db; }
|
|
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
|
|
.modal.active { display: flex; align-items: center; justify-content: center; }
|
|
.modal-content { background-color: white; padding: 2rem; border-radius: 0.5rem; max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; overflow-x: hidden; }
|
|
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
|
|
.admin-only { display: none; }
|
|
.admin-only-block { display: none; }
|
|
.admin-only-inline-block { display: none; }
|
|
body.role-admin .admin-only { display: table-cell; }
|
|
body.role-admin .admin-only-block { display: block; }
|
|
body.role-admin .admin-only-inline-block { display: inline-block; }
|
|
/* Fixed padding for container on all screen sizes */
|
|
.app-container { max-width: 100%; margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem; }
|
|
/* Report modal steps */
|
|
.report-step.hidden { display: none; }
|
|
/* Print styles */
|
|
@media print {
|
|
body * { visibility: hidden; }
|
|
#printArea, #printArea * { visibility: visible; }
|
|
#printArea { position: absolute; left: 0; top: 0; width: 100%; }
|
|
@page { margin: 1cm; }
|
|
}
|
|
/* Remove body scroll */
|
|
body { overflow: hidden; height: 100vh; }
|
|
/* Sticky footer with shadow */
|
|
tfoot.sticky { box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15); }
|
|
</style>
|
|
<style>*, ::before, ::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/* ! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com */*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}::after,::before{--tw-content:''}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sticky{position:sticky}.bottom-0{bottom:0px}.top-0{top:0px}.z-10{z-index:10}.col-span-3{grid-column:span 3 / span 3}.mx-2{margin-left:0.5rem;margin-right:0.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:0.25rem}.mb-2{margin-bottom:0.5rem}.mb-3{margin-bottom:0.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:0.25rem}.ml-2{margin-left:0.5rem}.mr-1{margin-right:0.25rem}.mr-2{margin-right:0.5rem}.mr-3{margin-right:0.75rem}.mt-2{margin-top:0.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1{height:0.25rem}.h-10{height:2.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.max-h-96{max-height:24rem}.w-10{width:2.5rem}.w-16{width:4rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-full{width:100%}.min-w-\[150px\]{min-width:150px}.min-w-\[200px\]{min-width:200px}.max-w-2xl{max-width:42rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2, minmax(0, 1fr))}.grid-cols-3{grid-template-columns:repeat(3, minmax(0, 1fr))}.grid-cols-4{grid-template-columns:repeat(4, minmax(0, 1fr))}.grid-cols-5{grid-template-columns:repeat(5, minmax(0, 1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-3{gap:0.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.75rem * var(--tw-space-x-reverse));margin-left:calc(0.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-4 > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y > :not([hidden]) ~ :not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200 > :not([hidden]) ~ :not([hidden]){--tw-divide-opacity:1;border-color:rgb(229 231 235 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:0.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:0.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-l-4{border-left-width:4px}.border-t{border-top-width:1px}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-red-600{--tw-border-opacity:1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity:1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-600{--tw-bg-opacity:1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.bg-green-700{--tw-bg-opacity:1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(79 70 229 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.p-3{padding:0.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:0.25rem;padding-right:0.25rem}.px-2{padding-left:0.5rem;padding-right:0.5rem}.px-3{padding-left:0.75rem;padding-right:0.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:0.25rem;padding-bottom:0.25rem}.py-2{padding-top:0.5rem;padding-bottom:0.5rem}.py-3{padding-top:0.75rem;padding-bottom:0.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:0.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.text-gray-200{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity:1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity:1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.shadow-md{--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.transition{transition-property:color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.hover\:border-green-600:hover{--tw-border-opacity:1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.hover\:border-indigo-600:hover{--tw-border-opacity:1;border-color:rgb(79 70 229 / var(--tw-border-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-400:hover{--tw-bg-opacity:1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-green-50:hover{--tw-bg-opacity:1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\:bg-green-700:hover{--tw-bg-opacity:1;background-color:rgb(21 128 61 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-50:hover{--tw-bg-opacity:1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-700:hover{--tw-bg-opacity:1;background-color:rgb(67 56 202 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-indigo-600:hover{--tw-text-opacity:1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.hover\:text-indigo-700:hover{--tw-text-opacity:1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.hover\:text-indigo-800:hover{--tw-text-opacity:1;color:rgb(55 48 163 / var(--tw-text-opacity, 1))}.hover\:text-red-800:hover{--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.hover\:opacity-80:hover{opacity:0.8}.focus\:border-transparent:focus{border-color:transparent}.focus\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.focus\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241 / var(--tw-ring-opacity, 1))}.focus\:ring-red-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(239 68 68 / var(--tw-ring-opacity, 1))}.group:hover .group-hover\:scale-110{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}</style><script type="text/javascript" data-name="TokenSigning" data-by="Web-eID extension" src="chrome-extension://ncibgoaomkmdpilpocfeponihegamlic/token-signing-page-script.js"></script></head>
|
|
<body class="bg-gray-100">
|
|
<!-- Login Modal (for admin) -->
|
|
<div id="loginModal" class="modal">
|
|
<div class="modal-content max-w-md">
|
|
<div class="text-center mb-6">
|
|
<i class="fas fa-lock text-4xl text-indigo-600 mb-3"></i>
|
|
<h2 class="text-2xl font-bold text-gray-800">Login</h2>
|
|
<p class="text-gray-600 mt-2">Sisesta kasutajaandmed</p>
|
|
</div>
|
|
<form id="loginForm" class="space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Kasutajanimi</label>
|
|
<input type="text" id="username" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent" required="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Parool</label>
|
|
<input type="password" id="password" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent" required="">
|
|
</div>
|
|
<div class="flex space-x-3">
|
|
<button type="button" onclick="continueAsGuest()" class="flex-1 bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
<i class="fas fa-eye mr-2"></i>Vaata ainult
|
|
</button>
|
|
<button type="submit" class="flex-1 bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-sign-in-alt mr-2"></i>Logi sisse
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<div id="loginError" class="mt-4 p-3 bg-red-100 text-red-700 rounded-lg hidden"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Main App (visible by default as public user view) -->
|
|
<div id="mainApp">
|
|
<!-- Header -->
|
|
<div class="bg-white shadow-md mb-6">
|
|
<div class="app-container py-4">
|
|
<div class="flex justify-between items-center">
|
|
<!-- Left: Title -->
|
|
<h1 class="text-2xl font-bold text-gray-800">
|
|
<i class="fas fa-industry mr-2 text-indigo-600"></i>
|
|
AKNAPROFF Tootmine
|
|
</h1>
|
|
|
|
<!-- Right: User info, admin buttons, and logout/login -->
|
|
<div class="flex items-center space-x-4">
|
|
<!-- Show user info and admin buttons for logged in users -->
|
|
<span id="userInfo" class="text-gray-600 hidden">
|
|
<i class="fas fa-user mr-2"></i>
|
|
<span id="userName"></span>
|
|
</span>
|
|
|
|
<!-- Session timer (shown only in last minute) -->
|
|
<span id="sessionTimer" class="hidden text-red-600 font-semibold animate-pulse">
|
|
<i class="fas fa-clock mr-1"></i>
|
|
<span id="sessionTimeLeft"></span>
|
|
</span>
|
|
|
|
<!-- Admin buttons (Report & Settings) -->
|
|
<button id="reportBtn" onclick="openReportModal()" class="admin-only-inline-block text-indigo-600 hover:text-indigo-700 transition mx-2" title="Aruanne">
|
|
<i class="fas fa-chart-bar text-xl"></i>
|
|
</button>
|
|
<button id="settingsBtn" onclick="openSettingsModal()" class="admin-only-inline-block text-gray-600 hover:text-indigo-600 transition mx-2 hidden" title="Seaded">
|
|
<i class="fas fa-cog text-xl"></i>
|
|
</button>
|
|
|
|
<button id="logoutBtn" onclick="logout()" class="hidden bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition">
|
|
<i class="fas fa-sign-out-alt mr-2"></i>Välja
|
|
</button>
|
|
<!-- Show login button for public users -->
|
|
<button id="loginBtn" onclick="openLoginModal()" class="bg-indigo-600 text-white px-4 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-sign-in-alt mr-2"></i>Admin Login
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="app-container">
|
|
<!-- Filters -->
|
|
<div class="bg-white rounded shadow-sm p-3 mb-3">
|
|
<div class="flex flex-wrap gap-3 items-end">
|
|
<div class="flex-1 min-w-[150px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-calendar mr-1 text-xs"></i>Kuu
|
|
</label>
|
|
<select id="monthFilter" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500">
|
|
<option value="1">Jaanuar</option>
|
|
<option value="2">Veebruar</option>
|
|
<option value="3">Märts</option>
|
|
<option value="4">Aprill</option>
|
|
<option value="5">Mai</option>
|
|
<option value="6">Juuni</option>
|
|
<option value="7">Juuli</option>
|
|
<option value="8">August</option>
|
|
<option value="9">September</option>
|
|
<option value="10">Oktoober</option>
|
|
<option value="11">November</option>
|
|
<option value="12">Detsember</option>
|
|
</select>
|
|
</div>
|
|
<div class="flex-1 min-w-[150px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-calendar-alt mr-1 text-xs"></i>Aasta
|
|
</label>
|
|
<select id="yearFilter" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500"><option value="2025">2025</option><option value="2026">2026</option></select>
|
|
</div>
|
|
<div id="addNewRowBtn">
|
|
<button onclick="openModal()" class="bg-indigo-600 text-white px-4 py-1 text-sm rounded hover:bg-indigo-700 transition">
|
|
<i class="fas fa-plus mr-1 text-xs"></i>Lisa uus rida
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quick Search -->
|
|
<div class="bg-white rounded shadow-sm p-3 mb-3">
|
|
<h3 class="text-sm font-semibold text-gray-800 mb-2">
|
|
<i class="fas fa-search mr-1 text-indigo-600 text-xs"></i>Kiir otsing
|
|
</h3>
|
|
<div class="flex flex-wrap gap-3 items-end">
|
|
<!-- Sort by ID button -->
|
|
<div class="flex items-end">
|
|
<button id="sortByIdBtn" onclick="toggleSortById()" class="px-3 py-1 text-sm border border-gray-300 rounded hover:bg-gray-50 transition flex items-center justify-between min-w-[100px]">
|
|
<span>ID</span>
|
|
<i id="sortByIdIcon" class="fas fa-sort text-gray-400"></i>
|
|
</button>
|
|
</div>
|
|
<div class="flex-1 min-w-[200px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-user mr-1 text-xs"></i>Klient
|
|
</label>
|
|
<input type="text" id="searchClient" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500" placeholder="Otsi kliendi järgi...">
|
|
</div>
|
|
<div class="flex-1 min-w-[150px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-tag mr-1 text-xs"></i>Tüüp
|
|
</label>
|
|
<input type="text" id="searchType" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500" placeholder="Otsi tüübi järgi...">
|
|
</div>
|
|
<div class="flex-1 min-w-[150px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-file-invoice mr-1 text-xs"></i>Pakkum. Nr
|
|
</label>
|
|
<input type="text" id="searchOffer" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500" placeholder="Otsi pakkumise nr järgi...">
|
|
</div>
|
|
<div class="flex-1 min-w-[150px]">
|
|
<label class="block text-xs font-medium text-gray-700 mb-1">
|
|
<i class="fas fa-briefcase mr-1 text-xs"></i>Töö Nr
|
|
</label>
|
|
<input type="text" id="searchWork" class="w-full px-2 py-1 text-sm border border-gray-300 rounded focus:ring-1 focus:ring-indigo-500" placeholder="Otsi töö nr järgi...">
|
|
</div>
|
|
<div>
|
|
<label class="flex items-center space-x-2 cursor-pointer pb-1">
|
|
<input type="checkbox" id="searchByYear" class="w-4 h-4 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500">
|
|
<span class="text-xs font-medium text-gray-700 whitespace-nowrap">
|
|
<i class="fas fa-calendar-alt mr-1 text-xs"></i>Aasta järgi
|
|
</span>
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<button onclick="clearAllFilters()" class="px-3 py-1 text-xs bg-gray-200 text-gray-700 rounded hover:bg-gray-300 transition whitespace-nowrap" title="Tühjenda kõik filtrid">
|
|
<i class="fas fa-times-circle mr-1 text-xs"></i>Tühjenda filtrid
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Table -->
|
|
<div class="bg-white rounded shadow-sm overflow-hidden">
|
|
<div class="overflow-x-auto overflow-y-auto" style="max-height: calc(100vh - 320px);">
|
|
<table class="w-full text-xs">
|
|
<thead class="bg-gray-700 sticky top-0 z-10">
|
|
<tr>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('client')">
|
|
<div class="flex items-center justify-between">
|
|
<span>Klient</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-client"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('type')">
|
|
<div class="flex items-center justify-center">
|
|
<span>Tüüp</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-type"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('offer')">
|
|
<div class="flex items-center justify-between">
|
|
<span>Pakkum. Nr</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-offer"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('work')">
|
|
<div class="flex items-center justify-between">
|
|
<span>Töö Nr</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-work"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Kogus</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Värv</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('material')">
|
|
<div class="flex items-center justify-center">
|
|
<span>MAT-1</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-material"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">MAT-2</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase cursor-pointer hover:bg-gray-600 transition" onclick="sortRecords('package')">
|
|
<div class="flex items-center justify-center">
|
|
<span>PAKETT</span>
|
|
<i class="fas fa-sort text-gray-300 ml-1 text-xs" id="sort-icon-package"></i>
|
|
</div>
|
|
</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Töölehti</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">LÕIKUS</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">KLAAS</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">VALMIS</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">VÄLJAS</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Märkused</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Probleemid</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Paigaldaja</th>
|
|
<th class="admin-only px-2 py-2 text-right text-xs font-medium text-gray-200 uppercase">Hind (€)</th>
|
|
<th class="admin-only px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Tegevused</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="recordsTable" class="divide-y divide-gray-200">
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-2 py-1 text-xs text-gray-900">AS Okna Service</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-600">-</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">P-2025-001</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">T-2025-001</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-900 font-medium">12</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600" title="">-</td>
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
08.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
11.11.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
09.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 border border-green-600 text-white text-xs font-semibold cursor-pointer hover:opacity-80 transition" onclick="toggleWorksheetsStep(1)" title="Klõps 3: Tühjenda">
|
|
26.11.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(1, 'cutting', '2025-01-10')">
|
|
10.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(1, 'glazing', '2025-01-12')">
|
|
12.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(1, 'ready', '2025-01-14')">
|
|
14.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(1, 'issued', '2025-01-15')">
|
|
15.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openNotesModal(1, "")">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openProblemsModal(1, "", {"worksheets_error":0,"cutting_error":0,"glazing_error":0,"ready_error":0,"issued_error":0})">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-2 py-1 text-xs text-gray-600">Jüri Tamm</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-sm text-right">
|
|
<div class="inline-block px-2 py-1 rounded text-gray-900 font-medium" title="Arve puudub">
|
|
2500.00
|
|
</div>
|
|
</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-center">
|
|
<button onclick="editRecord(1)" class="text-indigo-600 hover:text-indigo-800 transition mr-2">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button onclick="confirmDelete(1)" class="delete-btn text-red-600 hover:text-red-800 transition" style="display: inline-block;">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-2 py-1 text-xs text-gray-900">OÜ Aken ja Uks</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-600">-</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">P-2025-002</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">T-2025-002</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-900 font-medium">8</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600" title="">-</td>
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
07.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
07.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-red-100 border border-red-300 text-red-800 text-xs cursor-pointer hover:opacity-80 transition" onclick="toggleWorksheetsStep(2)" title="qqqq">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(2, 'cutting', '2025-01-08')">
|
|
08.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-red-100 border border-red-300 text-red-800 text-xs font-semibold cursor-pointer hover:bg-red-50 transition" title="qqqq" onclick="toggleDate(2, 'glazing', '2025-01-10')">
|
|
10.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-300 text-gray-600 border border-gray-400 cursor-pointer hover:bg-gray-400 text-xs" title="qqqq" onclick="openBlockedFieldModal("qqqq")">
|
|
<i class="fas fa-lock"></i>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-300 text-gray-600 border border-gray-400 cursor-pointer hover:bg-gray-400 text-xs" title="qqqq" onclick="openBlockedFieldModal("qqqq")">
|
|
<i class="fas fa-lock"></i>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openNotesModal(2, "Срочный заказ до 20.01")">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-red-500 text-white border-2 border-red-600 text-xs font-semibold cursor-pointer hover:bg-red-600 transition" title="qqqq" onclick="openProblemsModal(2, "qqqq", {"worksheets_error":1,"cutting_error":0,"glazing_error":1,"ready_error":0,"issued_error":0})">
|
|
27.11.2025
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-2 py-1 text-xs text-gray-600">Mari Kask</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-sm text-right">
|
|
<div class="inline-block px-2 py-1 rounded text-gray-900 font-medium" title="Arve puudub">
|
|
1800.00
|
|
</div>
|
|
</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-center">
|
|
<button onclick="editRecord(2)" class="text-indigo-600 hover:text-indigo-800 transition mr-2">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button onclick="confirmDelete(2)" class="delete-btn text-red-600 hover:text-red-800 transition" style="display: inline-block;">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-2 py-1 text-xs text-gray-900">Koduleht OÜ</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-600">-</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">P-2025-003</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">T-2025-003</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-900 font-medium">15</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600" title="">-</td>
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
10.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-red-100 border border-red-300 text-red-800 text-xs cursor-pointer hover:opacity-80 transition" onclick="toggleWorksheetsStep(3)" title="Klõps 1: Lisa kuupäev">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-green-500 text-white text-xs font-semibold cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(3, 'cutting', '2025-01-11')">
|
|
11.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(3, 'glazing', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-300 text-gray-600 border border-gray-400 cursor-pointer hover:bg-gray-400 text-xs" title="Klõpsake probleemi vaatamiseks" onclick="openBlockedFieldModal("")">
|
|
<i class="fas fa-lock"></i>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-300 text-gray-600 border border-gray-400 cursor-pointer hover:bg-gray-400 text-xs" title="Klõpsake probleemi vaatamiseks" onclick="openBlockedFieldModal("")">
|
|
<i class="fas fa-lock"></i>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openNotesModal(3, "")">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-red-500 text-white border-2 border-red-600 text-xs font-semibold cursor-pointer hover:bg-red-600 transition" title="" onclick="openProblemsModal(3, "", {"worksheets_error":1,"cutting_error":0,"glazing_error":0,"ready_error":0,"issued_error":0})">
|
|
26.11.2025
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-2 py-1 text-xs text-gray-600">Peeter Sepp</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-sm text-right">
|
|
<div class="inline-block px-2 py-1 rounded text-gray-900 font-medium" title="Arve puudub">
|
|
3200.00
|
|
</div>
|
|
</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-center">
|
|
<button onclick="editRecord(3)" class="text-indigo-600 hover:text-indigo-800 transition mr-2">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button onclick="confirmDelete(3)" class="delete-btn text-red-600 hover:text-red-800 transition" style="display: inline-block;">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-2 py-1 text-xs text-gray-900">Test Client AS</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-600">-</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">P-2025-004</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">T-2025-004</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-900 font-medium">5</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600" title="">-</td>
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs font-semibold">
|
|
05.01.2025
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-400 text-xs cursor-pointer hover:opacity-80 transition" onclick="toggleWorksheetsStep(4)" title="Klõps 1: Lisa kuupäev">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(4, 'cutting', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(4, 'glazing', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(4, 'ready', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(4, 'issued', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openNotesModal(4, "Ждём подтверждения")">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openProblemsModal(4, "", {"worksheets_error":0,"cutting_error":0,"glazing_error":0,"ready_error":0,"issued_error":0})">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-2 py-1 text-xs text-gray-600">Peeter Sepp</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-sm text-right">
|
|
<div class="inline-block px-2 py-1 rounded text-gray-900 font-medium" title="Arve puudub">
|
|
1000.00
|
|
</div>
|
|
</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-center">
|
|
<button onclick="editRecord(4)" class="text-indigo-600 hover:text-indigo-800 transition mr-2">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button onclick="confirmDelete(4)" class="delete-btn text-red-600 hover:text-red-800 transition" style="display: inline-block;">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="hover:bg-gray-50 transition">
|
|
<td class="px-2 py-1 text-xs text-gray-900">Demo Company</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-600">-</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">P-2025-005</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600">T-2025-005</td>
|
|
<td class="px-2 py-1 text-xs text-center text-gray-900 font-medium">20</td>
|
|
<td class="px-2 py-1 text-xs text-gray-600" title="">-</td>
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-400 text-xs cursor-pointer hover:opacity-80 transition" onclick="toggleWorksheetsStep(5)" title="Klõps 1: Lisa kuupäev">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(5, 'cutting', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(5, 'glazing', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(5, 'ready', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-white border border-gray-300 text-gray-900 text-xs cursor-pointer hover:bg-red-50 transition" onclick="toggleDate(5, 'issued', null)">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openNotesModal(5, "")">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td class="px-2 py-1 text-center">
|
|
<div class="inline-block px-2 py-1 rounded bg-gray-100 border border-gray-300 text-gray-400 text-xs cursor-pointer hover:bg-gray-200 transition" onclick="openProblemsModal(5, "", {"worksheets_error":0,"cutting_error":0,"glazing_error":0,"ready_error":0,"issued_error":0})">
|
|
-
|
|
</div>
|
|
</td>
|
|
|
|
<td class="px-2 py-1 text-xs text-gray-600">Jüri Tamm</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-sm text-right">
|
|
<div class="inline-block px-2 py-1 rounded text-gray-900 font-medium" title="Arve puudub">
|
|
4500.00
|
|
</div>
|
|
</td>
|
|
|
|
<td class="admin-only px-2 py-1 text-center">
|
|
<button onclick="editRecord(5)" class="text-indigo-600 hover:text-indigo-800 transition mr-2">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button onclick="confirmDelete(5)" class="delete-btn text-red-600 hover:text-red-800 transition" style="display: inline-block;">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
<tfoot id="recordsTableFooter" class="bg-gray-700 border-t border-gray-600 sticky bottom-0 z-10">
|
|
<tr class="font-semibold">
|
|
<td class="px-2 py-1 text-xs text-gray-200" colspan="4">
|
|
<i class="fas fa-calculator mr-1 text-xs"></i>Summa:
|
|
</td>
|
|
<td class="px-2 py-1 text-xs text-center text-white bg-indigo-600 font-bold">
|
|
60
|
|
</td>
|
|
<td colspan="12"></td>
|
|
<td class="admin-only px-2 py-1 text-xs text-right text-white bg-indigo-600 font-bold">
|
|
13000.00
|
|
</td>
|
|
<td class="admin-only"></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal -->
|
|
<div id="recordModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800" id="modalTitle">Lisa uus kirje</h2>
|
|
<button onclick="closeModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
<form id="recordForm">
|
|
<input type="hidden" id="recordId">
|
|
<div class="space-y-4">
|
|
<div class="grid grid-cols-4 gap-4">
|
|
<div class="col-span-3">
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Klient *</label>
|
|
<input type="text" id="clientName" class="w-full px-4 py-2 border border-gray-300 rounded-lg" required="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Tüüp</label>
|
|
<input type="text" id="type" class="w-full px-4 py-2 border border-gray-300 rounded-lg" maxlength="3">
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Pakkum. Nr *</label>
|
|
<input type="text" id="offerNumber" class="w-full px-4 py-2 border border-gray-300 rounded-lg" required="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Töö Nr *</label>
|
|
<input type="text" id="workNumber" class="w-full px-4 py-2 border border-gray-300 rounded-lg" required="">
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Kogus</label>
|
|
<input type="number" id="quantity" class="w-full px-4 py-2 border border-gray-300 rounded-lg" min="0">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Värv</label>
|
|
<input type="text" id="color" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Märkused</label>
|
|
<textarea id="notes" class="w-full px-4 py-2 border border-gray-300 rounded-lg" rows="3"></textarea>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Paigaldaja</label>
|
|
<input type="text" id="installer" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
<div class="grid grid-cols-3 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Hind (€)</label>
|
|
<input type="number" id="price" class="w-full px-4 py-2 border border-gray-300 rounded-lg" step="0.01" min="0">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Arve Nr</label>
|
|
<input type="text" id="arveMakstud" class="w-full px-4 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
<div class="flex items-center justify-center" style="padding-top: 28px;">
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="arveChecked" class="w-5 h-5 text-indigo-600 border-gray-300 rounded focus:ring-indigo-500 cursor-pointer">
|
|
<span class="text-sm font-medium text-gray-700">Arve makstud</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<!-- Date fields (MAT-1, MAT-2 and PAK only) -->
|
|
<div class="grid grid-cols-3 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">MATERJAL-1</label>
|
|
<input type="date" id="materialDate" class="w-full px-3 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">MATERJAL-2</label>
|
|
<input type="date" id="material2Date" class="w-full px-3 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">PAKETT</label>
|
|
<input type="date" id="packageDate" class="w-full px-3 py-2 border border-gray-300 rounded-lg">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end space-x-3 mt-6">
|
|
<button type="button" onclick="closeModal()" class="bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
Tühista
|
|
</button>
|
|
<button type="submit" class="bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-save mr-2"></i>Salvesta
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Notes Modal -->
|
|
<div id="notesModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800">Märkused</h2>
|
|
<button onclick="closeNotesModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
<form id="notesForm" onsubmit="saveNotes(event)">
|
|
<input type="hidden" id="notesRecordId">
|
|
<div class="space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Märkused</label>
|
|
<textarea id="notesText" class="w-full px-4 py-2 border border-gray-300 rounded-lg" rows="8" placeholder="Sisesta märkused..."></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end space-x-3 mt-6">
|
|
<button type="button" onclick="closeNotesModal()" class="bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
Tühista
|
|
</button>
|
|
<button type="submit" class="bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-save mr-2"></i>Salvesta
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Problems Modal -->
|
|
<div id="problemsModal" class="modal">
|
|
<div class="modal-content">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800">Probleemid</h2>
|
|
<button onclick="closeProblemsModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
<form id="problemsForm" onsubmit="saveProblems(event)">
|
|
<input type="hidden" id="problemsRecordId" value="">
|
|
<div class="space-y-4">
|
|
<div>
|
|
<textarea id="problemsText" class="w-full px-4 py-2 border border-gray-300 rounded-lg" rows="8" placeholder="Sisesta probleemid..."></textarea>
|
|
<p class="mt-2 text-sm text-gray-600">
|
|
<i class="fas fa-info-circle mr-1"></i>
|
|
Kui see väli on täidetud või vigade märked on seatud, siis VALMIS ja VÄLJAS väljad on blokeeritud
|
|
</p>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-3">Märgi vead (esiletoodud punasega tabelis):</label>
|
|
<div class="grid grid-cols-5 gap-4">
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="errorWorksheets" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500">
|
|
<span class="text-sm text-gray-700">Töölehti</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="errorCutting" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500">
|
|
<span class="text-sm text-gray-700">Lõikus</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="errorGlazing" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500">
|
|
<span class="text-sm text-gray-700">Klaas</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="errorReady" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500">
|
|
<span class="text-sm text-gray-700">Valmis</span>
|
|
</label>
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="errorIssued" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500">
|
|
<span class="text-sm text-gray-700">Väljas</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end space-x-3 mt-6">
|
|
<button type="button" onclick="closeProblemsModal()" class="bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
Tühista
|
|
</button>
|
|
<button type="submit" class="bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-save mr-2"></i>Salvesta
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Blocked Field Alert Modal -->
|
|
<div id="blockedFieldModal" class="modal">
|
|
<div class="modal-content max-w-md">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-red-600">
|
|
<i class="fas fa-exclamation-triangle mr-2"></i>
|
|
Väli blokeeritud
|
|
</h2>
|
|
<button onclick="closeBlockedFieldModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
<div class="space-y-4">
|
|
<div class="bg-red-50 border-l-4 border-red-500 p-4 rounded">
|
|
<p class="text-sm text-gray-700 mb-2 font-semibold">
|
|
<i class="fas fa-lock mr-2"></i>
|
|
See väli on blokeeritud probleemi tõttu:
|
|
</p>
|
|
<p id="blockedFieldMessage" class="text-sm text-gray-800 whitespace-pre-wrap"></p>
|
|
</div>
|
|
<p class="text-xs text-gray-600">
|
|
<i class="fas fa-info-circle mr-1"></i>
|
|
Lahendage probleem Probleemid veerus, et väljad vabastada
|
|
</p>
|
|
</div>
|
|
<div class="flex justify-end mt-6">
|
|
<button onclick="closeBlockedFieldModal()" class="bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
Sulge
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Settings Modal (for admin) -->
|
|
<div id="settingsModal" class="modal">
|
|
<div class="modal-content max-w-md">
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800">
|
|
<i class="fas fa-cog mr-2 text-indigo-600"></i>
|
|
Seaded
|
|
</h2>
|
|
<button onclick="closeSettingsModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
<form id="settingsForm" class="space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Kasutajanimi</label>
|
|
<input type="text" id="settingsUsername" class="w-full px-4 py-2 border border-gray-300 rounded-lg bg-gray-100 text-gray-600" readonly="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Nimi (Allkiri)</label>
|
|
<input type="text" id="settingsFullName" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent" required="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Praegune parool</label>
|
|
<input type="password" id="settingsCurrentPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent" required="">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Uus parool (jäta tühjaks, kui ei muuda)</label>
|
|
<input type="password" id="settingsNewPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent">
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Kinnita uus parool</label>
|
|
<input type="password" id="settingsConfirmPassword" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent">
|
|
</div>
|
|
<div class="pt-4 border-t">
|
|
<label class="flex items-center space-x-2 cursor-pointer">
|
|
<input type="checkbox" id="allowDeleteCheckbox" class="w-4 h-4 text-red-600 border-gray-300 rounded focus:ring-red-500 cursor-pointer">
|
|
<span class="text-sm font-medium text-gray-700">Luba kustutamine (kuva prügikasti nupp)</span>
|
|
</label>
|
|
</div>
|
|
<div class="flex space-x-3 pt-4">
|
|
<button type="button" onclick="closeSettingsModal()" class="flex-1 bg-gray-300 text-gray-700 px-6 py-2 rounded-lg hover:bg-gray-400 transition">
|
|
Tühista
|
|
</button>
|
|
<button type="submit" class="flex-1 bg-indigo-600 text-white px-6 py-2 rounded-lg hover:bg-indigo-700 transition">
|
|
<i class="fas fa-save mr-2"></i>Salvesta
|
|
</button>
|
|
</div>
|
|
</form>
|
|
<div id="settingsError" class="mt-4 p-3 bg-red-100 text-red-700 rounded-lg hidden"></div>
|
|
<div id="settingsSuccess" class="mt-4 p-3 bg-green-100 text-green-700 rounded-lg hidden"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Report Modal (3 steps) -->
|
|
<div id="reportModal" class="modal">
|
|
<div class="modal-content" style="max-width: 700px; width: 95%;">
|
|
|
|
<div class="flex justify-between items-center mb-6">
|
|
<h2 class="text-2xl font-bold text-gray-800">
|
|
<i class="fas fa-chart-bar mr-2 text-indigo-600"></i>
|
|
Aruanne
|
|
</h2>
|
|
<button onclick="closeReportModal()" class="text-gray-500 hover:text-gray-700">
|
|
<i class="fas fa-times text-2xl"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Step indicator -->
|
|
<div class="flex items-center justify-center mb-8">
|
|
<div class="flex items-center">
|
|
<div id="step0-indicator" class="flex items-center">
|
|
<div class="w-10 h-10 rounded-full bg-indigo-600 text-white flex items-center justify-center font-bold">1</div>
|
|
<span class="ml-2 text-sm font-medium text-indigo-600">Vali tüüp</span>
|
|
</div>
|
|
<div class="w-16 h-1 bg-gray-300 mx-4"></div>
|
|
<div id="step1-indicator" class="flex items-center">
|
|
<div class="w-10 h-10 rounded-full bg-gray-300 text-gray-600 flex items-center justify-center font-bold">2</div>
|
|
<span class="ml-2 text-sm font-medium text-gray-600">Periood</span>
|
|
</div>
|
|
<div class="w-16 h-1 bg-gray-300 mx-4"></div>
|
|
<div id="step2-indicator" class="flex items-center">
|
|
<div class="w-10 h-10 rounded-full bg-gray-300 text-gray-600 flex items-center justify-center font-bold">3</div>
|
|
<span class="ml-2 text-sm font-medium text-gray-600">Statistika</span>
|
|
</div>
|
|
<div class="w-16 h-1 bg-gray-300 mx-4"></div>
|
|
<div id="step3-indicator" class="flex items-center">
|
|
<div class="w-10 h-10 rounded-full bg-gray-300 text-gray-600 flex items-center justify-center font-bold">4</div>
|
|
<span class="ml-2 text-sm font-medium text-gray-600">Lae alla</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Step 0: Report Type Selection -->
|
|
<div id="reportStep0" class="report-step">
|
|
<div class="text-center py-8">
|
|
<h3 class="text-xl font-semibold text-gray-800 mb-8">Vali aruande tüüp</h3>
|
|
<div class="grid grid-cols-2 gap-6 max-w-2xl mx-auto">
|
|
<!-- Master Report Button -->
|
|
<button onclick="selectReportType('master')" class="flex flex-col items-center justify-center p-8 border-2 border-gray-300 rounded-lg hover:border-indigo-600 hover:bg-indigo-50 transition group" title="Meistri aruanne: aasta statistika akende kohta">
|
|
<i class="fas fa-tools text-5xl text-indigo-600 mb-4 group-hover:scale-110 transition"></i>
|
|
<h4 class="text-lg font-semibold text-gray-800 mb-2">Meistri aruanne</h4>
|
|
<p class="text-xs text-gray-600 text-center">Aasta statistika<br>koguste ja summade kohta</p>
|
|
</button>
|
|
|
|
<!-- Accountant Report Button -->
|
|
<button onclick="selectReportType('accountant')" class="flex flex-col items-center justify-center p-8 border-2 border-gray-300 rounded-lg hover:border-green-600 hover:bg-green-50 transition group" title="Raamatupidaja aruanne: detailne klientide ja arvete loetelu">
|
|
<i class="fas fa-file-invoice-dollar text-5xl text-green-600 mb-4 group-hover:scale-110 transition"></i>
|
|
<h4 class="text-lg font-semibold text-gray-800 mb-2">Raamatupidaja aruanne</h4>
|
|
<p class="text-xs text-gray-600 text-center">Detailne loetelu<br>klientide ja arvete kohta</p>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Step 1: Period Selection (Year for Master, Month+Year for Accountant) -->
|
|
<div id="reportStep1" class="report-step hidden">
|
|
<div class="text-center py-8">
|
|
<i class="fas fa-calendar-alt text-6xl text-indigo-600 mb-6"></i>
|
|
<h3 id="reportStep1Title" class="text-xl font-semibold text-gray-800 mb-6">Vali periood</h3>
|
|
|
|
<!-- Month selector (only for accountant) -->
|
|
<div id="reportMonthSelector" class="mb-4 hidden">
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Kuu</label>
|
|
<select id="reportMonth" class="w-64 px-4 py-3 text-lg border-2 border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent mx-auto">
|
|
<option value="1">Jaanuar</option>
|
|
<option value="2">Veebruar</option>
|
|
<option value="3">Märts</option>
|
|
<option value="4">Aprill</option>
|
|
<option value="5">Mai</option>
|
|
<option value="6">Juuni</option>
|
|
<option value="7">Juuli</option>
|
|
<option value="8">August</option>
|
|
<option value="9">September</option>
|
|
<option value="10">Oktoober</option>
|
|
<option value="11">November</option>
|
|
<option value="12">Detsember</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Year selector (for both) -->
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">Aasta</label>
|
|
<select id="reportYear" class="w-64 px-4 py-3 text-lg border-2 border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent mx-auto"><option value="2025">2025</option><option value="2026">2026</option></select>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mt-8">
|
|
<button onclick="goBackToReportStep0()" class="bg-gray-300 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-400 transition">
|
|
<i class="fas fa-arrow-left mr-2"></i>Tagasi
|
|
</button>
|
|
<button onclick="goToReportStep2()" class="bg-indigo-600 text-white px-8 py-3 rounded-lg hover:bg-indigo-700 transition text-lg font-semibold">
|
|
Järgmine <i class="fas fa-arrow-right ml-2"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Step 2: Statistics Table (Master or Accountant) -->
|
|
<div id="reportStep2" class="report-step hidden">
|
|
<!-- Master Report Table -->
|
|
<div id="masterReportTable">
|
|
<table class="w-full text-xs">
|
|
<thead class="bg-gray-700">
|
|
<tr>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Kuu</th>
|
|
<th class="px-1 py-2 text-center text-xs font-medium text-gray-200 uppercase">Tööp.</th>
|
|
<th class="px-1 py-2 text-center text-xs font-medium text-gray-200 uppercase">Kogus</th>
|
|
<th class="px-1 py-2 text-right text-xs font-medium text-gray-200 uppercase">Summa</th>
|
|
<th class="px-1 py-2 text-center text-xs font-medium text-gray-200 uppercase">Kesk/p</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="reportTableBody" class="bg-white divide-y divide-gray-200">
|
|
<!-- Will be populated by JavaScript -->
|
|
</tbody>
|
|
<tfoot class="bg-gray-700">
|
|
<tr class="font-bold">
|
|
<td class="px-2 py-1 text-xs text-gray-200">KOKKU:</td>
|
|
<td class="px-1 py-1 text-center text-xs text-white bg-indigo-600" id="totalWorkDays">-</td>
|
|
<td class="px-1 py-1 text-center text-xs text-white bg-indigo-600" id="totalWindows">0</td>
|
|
<td class="px-1 py-1 text-right text-xs text-white bg-indigo-600" id="totalPrice">0.00</td>
|
|
<td class="px-1 py-1 text-center text-xs text-white bg-indigo-600" id="avgPerDay">-</td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Accountant Report Table -->
|
|
<div id="accountantReportTable" class="hidden">
|
|
<div class="overflow-x-auto max-h-96 overflow-y-auto">
|
|
<table class="w-full text-xs">
|
|
<thead class="bg-green-700 sticky top-0">
|
|
<tr>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Klient</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Pakkum. Nr</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Töö Nr</th>
|
|
<th class="px-2 py-2 text-center text-xs font-medium text-gray-200 uppercase">Kogus</th>
|
|
<th class="px-2 py-2 text-right text-xs font-medium text-gray-200 uppercase">Hind (€)</th>
|
|
<th class="px-2 py-2 text-left text-xs font-medium text-gray-200 uppercase">Arve Nr</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="accountantReportTableBody" class="bg-white divide-y divide-gray-200">
|
|
<!-- Will be populated by JavaScript -->
|
|
</tbody>
|
|
<tfoot class="bg-green-700 sticky bottom-0">
|
|
<tr class="font-bold">
|
|
<td class="px-2 py-1 text-xs text-gray-200" colspan="3">KOKKU:</td>
|
|
<td class="px-2 py-1 text-center text-xs text-white bg-green-600" id="accTotalQuantity">0</td>
|
|
<td class="px-2 py-1 text-right text-xs text-white bg-green-600" id="accTotalPrice">0.00</td>
|
|
<td class="px-2 py-1 text-xs text-gray-200"></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-between mt-8">
|
|
<button onclick="goToReportStep1()" class="bg-gray-300 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-400 transition">
|
|
<i class="fas fa-arrow-left mr-2"></i>Tagasi
|
|
</button>
|
|
<button onclick="goToReportStep3()" class="bg-indigo-600 text-white px-8 py-3 rounded-lg hover:bg-indigo-700 transition text-lg font-semibold">
|
|
Genereeri aruanne <i class="fas fa-arrow-right ml-2"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Step 3: Generate CSV -->
|
|
<div id="reportStep3" class="report-step hidden">
|
|
<div class="text-center py-8">
|
|
<i class="fas fa-file-csv text-6xl text-green-600 mb-6"></i>
|
|
<h3 class="text-xl font-semibold text-gray-800 mb-4">Aruanne on valmis!</h3>
|
|
<p class="text-gray-600 mb-8">CSV fail on genereeritud ja valmis allalaadimiseks või printimiseks</p>
|
|
<div class="flex justify-center gap-4">
|
|
<button onclick="downloadCSV()" class="bg-green-600 text-white px-8 py-4 rounded-lg hover:bg-green-700 transition text-lg font-semibold inline-flex items-center">
|
|
<i class="fas fa-download mr-3"></i>
|
|
Lae alla CSV
|
|
</button>
|
|
<button onclick="printReport()" class="bg-blue-600 text-white px-8 py-4 rounded-lg hover:bg-blue-700 transition text-lg font-semibold inline-flex items-center">
|
|
<i class="fas fa-print mr-3"></i>
|
|
Prindi nüüd
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-between mt-8">
|
|
<button onclick="goToReportStep2()" class="bg-gray-300 text-gray-700 px-6 py-3 rounded-lg hover:bg-gray-400 transition">
|
|
<i class="fas fa-arrow-left mr-2"></i>Tagasi
|
|
</button>
|
|
<button onclick="closeReportModal()" class="bg-indigo-600 text-white px-6 py-3 rounded-lg hover:bg-indigo-700 transition">
|
|
Sulge
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/axios@1.6.0/dist/axios.min.js"></script>
|
|
<script src="/static/app.js?v=4.1.21"></script>
|
|
|
|
|
|
</body></html> |