odant-work 1.0.91 → 1.0.92
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#system/certs/russian_trusted_root_ca.pem +32 -32
- package/#system/mail.json.example +9 -9
- package/#system/package-manifest.json +332 -373
- package/#system/settings.json.example +3 -3
- package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
- package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
- package/$server/$folder/$class/$domain/class.js +4 -4
- package/$server/$folder/$class/$handler/$trigger/class.js +3 -3
- package/$server/$folder/$class/$handler/class.js +9 -9
- package/$server/$folder/$class/$handler/handlers/pages/editor/$handler/class.js +5 -5
- package/$server/$folder/$class/$handler/readme.md +23 -23
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/mcp/$handler/mcp.js → mcp/$handler/class.js} +251 -210
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/modules → modules}/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/$organization/handlers/pages/site/$handler/{site.js → class.js} +351 -364
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/license/$handler/license.js → license/$handler/class.js} +104 -103
- package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
- package/$server/$folder/$class/$structure/$user/class.js +2 -2
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/{$handler/tabs/profile/$handler/profile.js → profile/$handler/class.js} +6 -2
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +308 -5
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +14 -3
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md +40 -40
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/agent/$handler/agent.js → agent/$handler/class.js} +329 -320
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/database/$handler/database.js → database/$handler/class.js} +510 -577
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/messengers/$handler/messengers.js → messengers/$handler/class.js} +142 -143
- package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
- package/$server/$folder/$class/ai/config.js +19 -19
- package/$server/$folder/$class/ai/prompt/$method/class.js +41 -41
- package/$server/$folder/$class/ai/skills/approval-flow.md +14 -14
- package/$server/$folder/$class/ai/skills/backup-check.md +13 -13
- package/$server/$folder/$class/ai/skills/computer.md +27 -27
- package/$server/$folder/$class/ai/skills/delegate-task.md +15 -15
- package/$server/$folder/$class/ai/skills/external-signup.md +14 -14
- package/$server/$folder/$class/ai/skills/onboarding.md +15 -15
- package/$server/$folder/$class/ai/skills/orchestration.md +41 -41
- package/$server/$folder/$class/ai/system.md +1 -1
- package/$server/$folder/$class/class.js +0 -3
- package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/files → files}/$handler/class.js +2 -0
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/requisites/$handler/requisites.js → requisites/$handler/class.js} +43 -36
- package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
- package/$server/$folder/$file/$audio/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$audio/handlers/preview/$handler/preview.js +88 -88
- package/$server/$folder/$file/$call/class.js +10 -10
- package/$server/$folder/$file/$call/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$call/triggers/on_save/$trigger/class.js +48 -48
- package/$server/$folder/$file/$data/class.js +16 -16
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +31 -4
- package/$server/$folder/$file/$devs/$js/class.js +2 -2
- package/$server/$folder/$file/$devs/$json/class.js +2 -2
- package/$server/$folder/$file/$devs/$ts/class.js +2 -2
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +30 -2
- package/$server/$folder/$file/$eml/class.js +17 -17
- package/$server/$folder/$file/$ics/class.js +44 -44
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +10 -2
- package/$server/$folder/$file/$ics/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$ics/handlers/preview/$handler/preview.js +67 -67
- package/$server/$folder/$file/$ics/readme.md +21 -21
- package/$server/$folder/$file/$image/$svg/class.js +11 -11
- package/$server/$folder/$file/$image/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +33 -33
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +82 -2
- package/$server/$folder/$file/$logs/class.js +39 -39
- package/$server/$folder/$file/$logs/handlers/methods/txt-test/$handler/class.js +4 -4
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +60 -2
- package/$server/$folder/$file/$office/$outlook/$ics/class.js +227 -227
- package/$server/$folder/$file/$office/$word/$rtf/template.rtf +159 -159
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +1 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +17 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +7 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/util.js +1 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/voice-policy.js +6 -2
- package/$server/$folder/$file/$task/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$task/readme.md +32 -32
- package/$server/$folder/$file/$txt/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +41 -41
- package/$server/$folder/$file/$video/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +13 -13
- package/$server/$folder/$file/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/download.js +4 -4
- package/$server/$folder/$file/handlers/pages/form/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +32 -2
- package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$file/readme.md +31 -31
- package/$server/$folder/class.js +11 -11
- package/$server/$folder/handlers/pages/form/$handler/class.js +2469 -5
- package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
- package/$server/$folder/lib/chat-item/chat-item.js +2 -2
- package/$server/$folder/lib/email/settings.js +82 -82
- package/$server/$folder/lib/file-viewer/file-viewer.js +8 -8
- package/$server/$folder/lib/icon/user/user.js +6 -6
- package/$server/$folder/lib/item-data-grid/item-data-grid.js +48 -48
- package/$server/$folder/lib/item-form/item-form.js +84 -84
- package/$server/$folder/lib/menu/menu.js +3 -2
- package/$server/$folder/lib/menu/readme.md +29 -29
- package/$server/$folder/lib/node/readme.md +29 -29
- package/$server/$folder/lib/pack/pack.js +4 -4
- package/$server/$folder/lib/site-loc/readme.md +16 -16
- package/.github/workflows/ci.yml +39 -39
- package/AGENTS.md +1 -1
- package/{models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +383 -430
- package/{models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$provider/handlers/pages/form/system/ai/$handler/class.js} +155 -166
- package/{models → MODELS}/$ai/$folder/$class/$provider/readme.md +16 -16
- package/{models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/handlers/pages/form/system/ai/$handler/class.js} +34 -33
- package/{models → MODELS}/GigaChat/$provider/readme.md +24 -24
- package/{models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/Local/$provider/handlers/pages/form/system/ai/$handler/class.js} +569 -626
- package/MODULES/$domain/handlers/pages/form/system/{$handler/tabs/mcp → mcp}/$handler/class.js +1 -0
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +648 -20
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +140 -6
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +305 -5
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +241 -5
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +515 -15
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js +3 -0
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js +422 -5
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +40 -40
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +56 -56
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js +1791 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js +776 -5
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +807 -5
- package/MODULES/Register/REGISTER/68/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/68/02/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/320/265/321/200/320/262/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js +1 -1
- package/MODULES/Register/STRUCTS/$struct/class.js +4 -4
- package/NODES/$node/$folder/$class/$node/class.js +35 -35
- package/NODES/$node/class.js +5 -5
- package/NODES/$node/handlers/pages/form/network/$handler/class.js +121 -4
- package/oda/benchmarks/dbmon/lib/ENV.js +213 -213
- package/oda/benchmarks/dbmon/lib/ga.js +11 -11
- package/oda/benchmarks/dbmon/lib/memory-stats.js +105 -105
- package/oda/benchmarks/dbmon/lib/monitor.js +69 -69
- package/oda/benchmarks/sierpinski/sierpinski.js +149 -149
- package/oda/components/editors/code-editor/code-editor.js +387 -387
- package/oda/components/editors/code-editor/src/ace.js +16 -16
- package/oda/components/editors/code-editor/src/beautify-css.js +1625 -1625
- package/oda/components/editors/code-editor/src/beautify-html.js +3122 -3122
- package/oda/components/editors/code-editor/src/beautify.js +4005 -4005
- package/oda/components/editors/code-editor/src/ext-beautify.js +7 -7
- package/oda/components/editors/code-editor/src/ext-code_lens.js +7 -7
- package/oda/components/editors/code-editor/src/ext-elastic_tabstops_lite.js +7 -7
- package/oda/components/editors/code-editor/src/ext-emmet.js +7 -7
- package/oda/components/editors/code-editor/src/ext-error_marker.js +7 -7
- package/oda/components/editors/code-editor/src/ext-hardwrap.js +7 -7
- package/oda/components/editors/code-editor/src/ext-keybinding_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-language_tools.js +7 -7
- package/oda/components/editors/code-editor/src/ext-linking.js +7 -7
- package/oda/components/editors/code-editor/src/ext-modelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-options.js +7 -7
- package/oda/components/editors/code-editor/src/ext-prompt.js +7 -7
- package/oda/components/editors/code-editor/src/ext-rtl.js +7 -7
- package/oda/components/editors/code-editor/src/ext-searchbox.js +7 -7
- package/oda/components/editors/code-editor/src/ext-settings_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-spellcheck.js +7 -7
- package/oda/components/editors/code-editor/src/ext-split.js +7 -7
- package/oda/components/editors/code-editor/src/ext-static_highlight.js +7 -7
- package/oda/components/editors/code-editor/src/ext-statusbar.js +7 -7
- package/oda/components/editors/code-editor/src/ext-textarea.js +7 -7
- package/oda/components/editors/code-editor/src/ext-themelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-whitespace.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-emacs.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-sublime.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vim.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vscode.js +7 -7
- package/oda/components/editors/code-editor/src/mode-css.js +7 -7
- package/oda/components/editors/code-editor/src/mode-html.js +7 -7
- package/oda/components/editors/code-editor/src/mode-javascript.js +7 -7
- package/oda/components/editors/code-editor/src/mode-json.js +7 -7
- package/oda/components/editors/code-editor/src/mode-markdown.js +7 -7
- package/oda/components/editors/code-editor/src/mode-svg.js +7 -7
- package/oda/components/editors/code-editor/src/mode-text.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xml.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xquery.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/css.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/html.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/javascript.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/json.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/markdown.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/svg.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/text.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xml.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xquery.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_dark.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_light.js +7 -7
- package/oda/components/editors/markdown/markdown-editor/lib/font-awesome.min.css +3 -3
- package/oda/components/editors/markdown/markdown-editor/lib/readme.md +332 -332
- package/oda/components/editors/markdown/markdown-editor/markdown-editor.js +78 -78
- package/oda/components/editors/markdown/markdown-viewer/test.md +239 -239
- package/oda/components/editors/markdown/markdown.js +76 -76
- package/oda/components/inputs/block/readme.md +39 -39
- package/oda/components/inputs/checkbox/checkbox.js +92 -92
- package/oda/components/inputs/color/color.js +83 -83
- package/oda/components/inputs/date/date.js +40 -40
- package/oda/components/inputs/input/input.js +219 -219
- package/oda/components/inputs/link/link.js +1 -1
- package/oda/components/inputs/link/readme.md +42 -42
- package/oda/components/inputs/markdown-input/markdown-input.js +77 -77
- package/oda/components/inputs/numeric/numeric.js +141 -141
- package/oda/components/inputs/table-input/readme.md +39 -39
- package/oda/components/inputs/text/text.js +88 -88
- package/oda/components/inputs/toggle/toggle.js +101 -101
- package/oda/components/layouts/hexagon-layout/hexagon-layout.js +218 -218
- package/oda/components/menus/menu/index_old.html +140 -140
- package/oda/components/structure/controls-map.js +56 -56
- package/oda/components/structure/controls.js +29 -29
- package/oda/components/structure/readme.md +31 -31
- package/oda/components/structure/structure.js +64 -64
- package/oda/components/table/index.html +210 -210
- package/oda/components/table/lib/coerce.js +68 -68
- package/oda/components/table/lib/column.js +568 -568
- package/oda/components/table/readme.md +120 -120
- package/oda/components/table/router.js +86 -86
- package/oda/components/table/settings.js +89 -89
- package/oda/index.html +159 -159
- package/oda/tools/icons/icons-set/icons-set.js +60 -60
- package/oda/tools/icons/lib/svg/_makeSVG.html +41 -41
- package/oda/tools/icons/lib/svg/aws.svg +2679 -2679
- package/oda/tools/icons/lib/svg/info.json +46 -46
- package/oda/tools/jupyter/demo.ipynb +160 -160
- package/oda/tools/jupyter/lib/print_elements.js +73 -73
- package/oda/tools/jupyter/test-2.ipynb +305 -305
- package/oda/tools/jupyter/test.ipynb +603 -603
- package/oda/tools/styles/adoptedStyleSheets.js +333 -333
- package/oda/tools/tester/device-preview/devices.json +9 -9
- package/package.json +1 -1
- package/rules/rules.md +445 -445
- package/scripts/SYNC-README.md +107 -107
- package/scripts/agent-eval.mjs +223 -223
- package/scripts/dump-svn-chat.mjs +9 -9
- package/scripts/extract-chat-day.mjs +21 -21
- package/scripts/rag-bench.mjs +166 -166
- package/scripts/restore-chat.mjs +166 -166
- package/scripts/sync-svn-git.bat +129 -129
- package/scripts/test-merge.mjs +75 -75
- package/scripts/work-desktop-bridge.mjs +101 -101
- package/sources/client/class.js +3 -0
- package/sources/client/field.js +168 -168
- package/sources/client/handler.js +68 -32
- package/sources/client/index.js +32 -32
- package/sources/client/readme.md +16 -16
- package/sources/client.js +12 -0
- package/sources/core.js +91 -91
- package/sources/data/choices.js +125 -125
- package/sources/host/babel-merge.js +398 -353
- package/sources/host/config.js +48 -48
- package/sources/host/index-db.js +94 -94
- package/sources/host/net-guard.js +228 -228
- package/sources/host/package-install.js +63 -63
- package/sources/host/push.js +86 -86
- package/sources/host/readme.md +41 -41
- package/sources/host/secret-box.js +93 -93
- package/sources/host/server-id.js +26 -26
- package/sources/host/stun.js +33 -33
- package/sources/host/tls-ca.js +60 -60
- package/sources/host/vapid.js +14 -14
- package/sources/index.html +1 -1
- package/sources/modules/a2a/server.js +608 -608
- package/sources/modules/agent/connections.js +442 -442
- package/sources/modules/agent/diff.js +69 -69
- package/sources/modules/agent/eval.js +222 -222
- package/sources/modules/agent/hooks.js +131 -131
- package/sources/modules/agent/index.js +6 -3
- package/sources/modules/agent/log.js +43 -43
- package/sources/modules/agent/loop.js +65 -0
- package/sources/modules/agent/mcp-pool.js +253 -253
- package/sources/modules/agent/recovery.js +89 -89
- package/sources/modules/agent/scope.js +387 -0
- package/sources/modules/agent/session.js +350 -15
- package/sources/modules/agent/taint.js +100 -100
- package/sources/modules/agent/tools/branch.js +311 -311
- package/sources/modules/agent/tools/browser.js +254 -254
- package/sources/modules/agent/tools/computer.js +120 -120
- package/sources/modules/agent/tools/connect.js +316 -316
- package/sources/modules/agent/tools/dev/lsp.js +334 -334
- package/sources/modules/agent/tools/dev/patch.js +564 -564
- package/sources/modules/agent/tools/memory.js +153 -153
- package/sources/modules/agent/tools/meta.js +60 -0
- package/sources/modules/agent/tools/os-files.js +358 -358
- package/sources/modules/agent/tools/plugins.js +80 -80
- package/sources/modules/agent/tools/sandbox.js +268 -268
- package/sources/modules/agent/types.d.ts +183 -183
- package/sources/modules/agent/undo.js +254 -254
- package/sources/modules/agent/util.js +179 -179
- package/sources/modules/contacts/contacts.js +200 -200
- package/sources/modules/contacts/index.html +546 -546
- package/sources/modules/lan/discovery.js +192 -192
- package/sources/modules/lan/store.js +62 -62
- package/sources/modules/mcp/readme.md +70 -70
- package/sources/modules/mcp/server.js +525 -525
- package/sources/modules/mcp/tokens.js +140 -140
- package/sources/modules/nodes/identity.js +123 -123
- package/sources/modules/nodes/outbound.js +105 -105
- package/sources/modules/nodes/signing.js +71 -71
- package/sources/modules/rag/embed-worker.js +36 -36
- package/sources/modules/rag/readme.md +70 -70
- package/sources/modules/readme.md +21 -21
- package/sources/modules/sandbox/config.js +74 -74
- package/sources/modules/sandbox/driver.js +100 -100
- package/sources/modules/sandbox/images/work-computer/Dockerfile +34 -34
- package/sources/modules/sandbox/images/work-computer/entrypoint.sh +24 -24
- package/sources/modules/sandbox/manager.js +1089 -1089
- package/sources/modules/sandbox/readme.md +63 -63
- package/sources/modules/sandbox/vnc-proxy.js +296 -296
- package/sources/server/access/audit.js +138 -138
- package/sources/server/access/refs.js +106 -106
- package/sources/server/assert-class-id.js +23 -23
- package/sources/server/chat-threads.js +16 -5
- package/sources/server/class.js +4 -1
- package/sources/server/external-source.js +90 -90
- package/sources/server/file.js +1 -1
- package/sources/server/folder.js +75 -33
- package/sources/server/handler.js +25 -12
- package/sources/server/index.js +12 -12
- package/sources/server/memory-mark.js +34 -34
- package/sources/server/readme.md +110 -110
- package/sources/server/safe-node-name.js +67 -67
- package/sources/server/server.js +6 -6
- package/sources/server/upload-mark.js +24 -24
- package/sources/server/zip-guard.js +81 -81
- package/whitepaper.md +568 -568
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -9
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -1
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/$handler/tabs/license/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/profile/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2095
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database/$handler/class.js +0 -9
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -281
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/staff.js +0 -2126
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
- package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
- package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -309
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/files/$handler/files.js +0 -17
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/requisites/$handler/class.js +0 -16
- package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -760
- package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
- package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
- package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -1
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +0 -623
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +0 -134
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" +0 -293
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" +0 -234
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" +0 -406
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/virtual.js +0 -399
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/analysis.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/postings.js +0 -1700
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/turnovers.js +0 -9
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/journal.js +0 -723
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
- package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
- package/models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- /package/$server/$folder/$class/$structure/$organization/handlers/pages/form/system/{$handler/tabs/requisites → requisites}/$handler/class.js +0 -0
- /package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/database → database}/$handler/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/methods/chat/$method/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$provider/class.js +0 -0
- /package/{models → MODELS}/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/readme.md +0 -0
- /package/{models → MODELS}/GigaChat/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/$provider/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Max/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Pro/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/handlers/methods/transfer/$handler/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Pro 2/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Vision/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Lite 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Pro 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/class.js +0 -0
- /package/{models → MODELS}/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexART/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT 5 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT Reasoning/$ai/class.js +0 -0
- /package/{users → USERS}/$users/class.js +0 -0
|
@@ -1,5 +1,776 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* form/journal — журнал проводок на учётном ядре (`db_journal`, sources/data/api.js):
|
|
3
|
+
* сверху полоса периодов `oda-packets`, компактная панель фильтров и таблица проводок на CSS Grid
|
|
4
|
+
* с прижатым к низу футером итогов.
|
|
5
|
+
* Клик по дате открывает сборную карточку проводки (`db_entry`, Экран 4 ODANT);
|
|
6
|
+
* клик по счёту или операции открывает форму счёта или документ операции.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const PERIOD_STORAGE_KEY = 'work.accounting.period';
|
|
10
|
+
function _day(d) {
|
|
11
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
12
|
+
}
|
|
13
|
+
const _today = () => _day(new Date());
|
|
14
|
+
const _yearStart = () => `${new Date().getFullYear()}-01-01`;
|
|
15
|
+
const _yearEnd = () => _today();
|
|
16
|
+
function _readSavedPeriod() {
|
|
17
|
+
try {
|
|
18
|
+
const raw = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem(PERIOD_STORAGE_KEY) : null;
|
|
19
|
+
if (!raw) return null;
|
|
20
|
+
const parsed = JSON.parse(raw);
|
|
21
|
+
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function _writeSavedPeriod(packetsKey, from, to) {
|
|
27
|
+
try {
|
|
28
|
+
if (typeof sessionStorage !== 'undefined') sessionStorage.setItem(PERIOD_STORAGE_KEY, JSON.stringify({
|
|
29
|
+
packetsKey: packetsKey || '*',
|
|
30
|
+
from: from || '',
|
|
31
|
+
to: to || ''
|
|
32
|
+
}));
|
|
33
|
+
} catch {/* ignore */}
|
|
34
|
+
}
|
|
35
|
+
function _derivePacketsKey(from, to, fallback = '*') {
|
|
36
|
+
if (!from && !to) return '*';
|
|
37
|
+
if (fallback && fallback !== '*') return fallback;
|
|
38
|
+
if (from && to) {
|
|
39
|
+
const ym1 = /^(\d{4})-01-01$/.exec(from);
|
|
40
|
+
const ym2 = /^(\d{4})-12-31$/.exec(to);
|
|
41
|
+
if (ym1 && ym2 && ym1[1] === ym2[1]) return `${ym1[1]}*`;
|
|
42
|
+
return `period:${from}:${to}`;
|
|
43
|
+
}
|
|
44
|
+
return fallback || '*';
|
|
45
|
+
}
|
|
46
|
+
function _daysInMonth(y, m) {
|
|
47
|
+
return new Date(y, m, 0).getDate();
|
|
48
|
+
}
|
|
49
|
+
function _weekBounds(dt) {
|
|
50
|
+
const dow = dt.getDay();
|
|
51
|
+
const diffToMon = dow === 0 ? -6 : 1 - dow;
|
|
52
|
+
const mon = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate() + diffToMon);
|
|
53
|
+
const sun = new Date(mon.getFullYear(), mon.getMonth(), mon.getDate() + 6);
|
|
54
|
+
return {
|
|
55
|
+
from: _day(mon),
|
|
56
|
+
to: _day(sun)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function _boundsFromPacketsKey(key, defaultMode = 'month') {
|
|
60
|
+
const k = String(key || '').trim();
|
|
61
|
+
if (!k || k === '*') return {
|
|
62
|
+
from: '',
|
|
63
|
+
to: ''
|
|
64
|
+
};
|
|
65
|
+
if (k.startsWith('period:')) {
|
|
66
|
+
const [, s = '', e = ''] = k.split(':');
|
|
67
|
+
return {
|
|
68
|
+
from: s,
|
|
69
|
+
to: e
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (k === 'now' || k.startsWith('now:')) {
|
|
73
|
+
const gran = k.startsWith('now:') ? k.slice(4) : defaultMode;
|
|
74
|
+
const now = new Date();
|
|
75
|
+
const y = now.getFullYear(),
|
|
76
|
+
m = now.getMonth() + 1;
|
|
77
|
+
if (gran === 'day') {
|
|
78
|
+
const d = _day(now);
|
|
79
|
+
return {
|
|
80
|
+
from: d,
|
|
81
|
+
to: d
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (gran === 'week') return _weekBounds(now);
|
|
85
|
+
if (gran === 'quarter') {
|
|
86
|
+
const q = Math.floor((m - 1) / 3) + 1;
|
|
87
|
+
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
88
|
+
const m2 = (q - 1) * 3 + 3;
|
|
89
|
+
return {
|
|
90
|
+
from: `${y}-${m1}-01`,
|
|
91
|
+
to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}`
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
if (gran === 'year') return {
|
|
95
|
+
from: `${y}-01-01`,
|
|
96
|
+
to: `${y}-12-31`
|
|
97
|
+
};
|
|
98
|
+
const ms = String(m).padStart(2, '0');
|
|
99
|
+
return {
|
|
100
|
+
from: `${y}-${ms}-01`,
|
|
101
|
+
to: `${y}-${ms}-${String(_daysInMonth(y, m)).padStart(2, '0')}`
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const clean = k.replace(/\*+$/, '');
|
|
105
|
+
if (/^\d{4}$/.test(clean)) return {
|
|
106
|
+
from: `${clean}-01-01`,
|
|
107
|
+
to: `${clean}-12-31`
|
|
108
|
+
};
|
|
109
|
+
const qm = /^(\d{4})-q([1-4])$/i.exec(clean);
|
|
110
|
+
if (qm) {
|
|
111
|
+
const y = +qm[1],
|
|
112
|
+
q = +qm[2];
|
|
113
|
+
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
114
|
+
const m2 = (q - 1) * 3 + 3;
|
|
115
|
+
return {
|
|
116
|
+
from: `${y}-${m1}-01`,
|
|
117
|
+
to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}`
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const mm = /^(\d{4})-(0[1-9]|1[0-2])$/.exec(clean);
|
|
121
|
+
if (mm) {
|
|
122
|
+
const y = +mm[1],
|
|
123
|
+
m = +mm[2];
|
|
124
|
+
return {
|
|
125
|
+
from: `${clean}-01`,
|
|
126
|
+
to: `${clean}-${String(_daysInMonth(y, m)).padStart(2, '0')}`
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
if (clean.startsWith('week:')) {
|
|
130
|
+
const monIso = clean.slice(5);
|
|
131
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(monIso)) {
|
|
132
|
+
const [y, m, d] = monIso.split('-').map(Number);
|
|
133
|
+
return _weekBounds(new Date(y, m - 1, d));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(clean)) return {
|
|
137
|
+
from: clean,
|
|
138
|
+
to: clean
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
from: '',
|
|
142
|
+
to: ''
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const money = v => Number(v) ? Number(v).toLocaleString('ru-RU', {
|
|
146
|
+
minimumFractionDigits: 2,
|
|
147
|
+
maximumFractionDigits: 2
|
|
148
|
+
}) : '';
|
|
149
|
+
export default {
|
|
150
|
+
icon: 'odant:calendar',
|
|
151
|
+
label: 'Журнал',
|
|
152
|
+
component: {
|
|
153
|
+
imports: 'oda//button, oda//packets',
|
|
154
|
+
template: /*html*/`
|
|
155
|
+
<style>
|
|
156
|
+
:host {
|
|
157
|
+
@apply --vertical;
|
|
158
|
+
@apply --flex;
|
|
159
|
+
gap: 0;
|
|
160
|
+
padding: 0;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
background: var(--content-background, #fff);
|
|
163
|
+
color: var(--content-color, #222);
|
|
164
|
+
font-size: 13px;
|
|
165
|
+
}
|
|
166
|
+
.filter-strip {
|
|
167
|
+
@apply --horizontal;
|
|
168
|
+
flex-shrink: 0;
|
|
169
|
+
gap: 8px;
|
|
170
|
+
align-items: center;
|
|
171
|
+
flex-wrap: wrap;
|
|
172
|
+
padding: 3px 8px;
|
|
173
|
+
min-height: 28px;
|
|
174
|
+
background: light-dark(#efeee4, #24252b);
|
|
175
|
+
border-bottom: 1px solid light-dark(#b5b4ac, #3e4049);
|
|
176
|
+
font-size: 12px;
|
|
177
|
+
}
|
|
178
|
+
.filter-strip input:not([type]),
|
|
179
|
+
.filter-strip select {
|
|
180
|
+
min-width: 0;
|
|
181
|
+
padding: 2px 6px;
|
|
182
|
+
font-size: 12px;
|
|
183
|
+
border: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
184
|
+
border-radius: 3px;
|
|
185
|
+
background: light-dark(#ffffff, #1b1c20);
|
|
186
|
+
color: inherit;
|
|
187
|
+
}
|
|
188
|
+
.filter-strip input:not([type]) {
|
|
189
|
+
width: 170px;
|
|
190
|
+
}
|
|
191
|
+
.filter-strip label {
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
gap: 4px;
|
|
195
|
+
cursor: pointer;
|
|
196
|
+
user-select: none;
|
|
197
|
+
}
|
|
198
|
+
.error {
|
|
199
|
+
padding: 6px 10px;
|
|
200
|
+
color: var(--error-color, #c53030);
|
|
201
|
+
background: light-dark(#fff5f5, rgba(229, 62, 62, 0.15));
|
|
202
|
+
border-bottom: 1px solid var(--error-color, #feb2b2);
|
|
203
|
+
white-space: break-spaces;
|
|
204
|
+
}
|
|
205
|
+
.grid {
|
|
206
|
+
@apply --vertical;
|
|
207
|
+
flex: 1;
|
|
208
|
+
min-height: 0;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
border-top: 1px solid light-dark(#b5b4ac, #3e4049);
|
|
211
|
+
}
|
|
212
|
+
div.head, div.row {
|
|
213
|
+
display: grid !important;
|
|
214
|
+
grid-template-columns: 84px minmax(125px, 1.3fr) minmax(115px, 1.2fr) minmax(115px, 1.2fr) minmax(115px, 1.2fr) minmax(115px, 1.2fr) minmax(94px, 0.95fr) minmax(72px, 0.7fr) 74px;
|
|
215
|
+
align-items: stretch;
|
|
216
|
+
}
|
|
217
|
+
.head-wrap {
|
|
218
|
+
@apply --vertical;
|
|
219
|
+
flex-shrink: 0;
|
|
220
|
+
background: light-dark(#e3e1d3, #2a2b32);
|
|
221
|
+
color: light-dark(#1f1f1f, #e2e8f0);
|
|
222
|
+
border-bottom: 1px solid light-dark(#9a9990, #4a4c56);
|
|
223
|
+
user-select: none;
|
|
224
|
+
scrollbar-gutter: stable;
|
|
225
|
+
overflow-y: hidden;
|
|
226
|
+
}
|
|
227
|
+
.head {
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
font-size: 12px;
|
|
230
|
+
}
|
|
231
|
+
.grid-body {
|
|
232
|
+
@apply --vertical;
|
|
233
|
+
flex: 1;
|
|
234
|
+
min-height: 0;
|
|
235
|
+
overflow-y: auto;
|
|
236
|
+
overflow-x: hidden;
|
|
237
|
+
scrollbar-gutter: stable;
|
|
238
|
+
background: light-dark(#ffffff, #1b1c20);
|
|
239
|
+
}
|
|
240
|
+
div.row {
|
|
241
|
+
flex-shrink: 0;
|
|
242
|
+
min-height: 25px;
|
|
243
|
+
border-bottom: 1px solid light-dark(#ecece8, #2c2d34);
|
|
244
|
+
}
|
|
245
|
+
div.row:hover:not(.total) {
|
|
246
|
+
background: light-dark(#f2f5fb, rgba(255, 255, 255, 0.05));
|
|
247
|
+
}
|
|
248
|
+
.cell {
|
|
249
|
+
min-width: 0;
|
|
250
|
+
padding: 4px 7px;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
text-overflow: ellipsis;
|
|
253
|
+
white-space: nowrap;
|
|
254
|
+
box-sizing: border-box;
|
|
255
|
+
display: flex;
|
|
256
|
+
align-items: center;
|
|
257
|
+
border-right: 1px solid light-dark(#e2e2dc, #2f3038);
|
|
258
|
+
}
|
|
259
|
+
.cell:last-child {
|
|
260
|
+
border-right: none;
|
|
261
|
+
}
|
|
262
|
+
.head-wrap .cell {
|
|
263
|
+
border-right: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
264
|
+
padding: 4px 7px;
|
|
265
|
+
}
|
|
266
|
+
.head-wrap .cell:last-child {
|
|
267
|
+
border-right: none;
|
|
268
|
+
}
|
|
269
|
+
.cell.num {
|
|
270
|
+
justify-content: flex-end;
|
|
271
|
+
text-align: right;
|
|
272
|
+
font-variant-numeric: tabular-nums;
|
|
273
|
+
}
|
|
274
|
+
.head .cell.num {
|
|
275
|
+
justify-content: center;
|
|
276
|
+
text-align: center;
|
|
277
|
+
}
|
|
278
|
+
.cell.link {
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
text-decoration: underline;
|
|
281
|
+
}
|
|
282
|
+
.storno {
|
|
283
|
+
color: var(--error-color, #c53030);
|
|
284
|
+
}
|
|
285
|
+
div.row.total {
|
|
286
|
+
flex-shrink: 0;
|
|
287
|
+
font-weight: 700;
|
|
288
|
+
min-height: 27px;
|
|
289
|
+
background: light-dark(#e3e1d3, #2a2b32);
|
|
290
|
+
color: light-dark(#111, #f1f5f9);
|
|
291
|
+
border-top: 2px solid light-dark(#8c8b82, #52545f);
|
|
292
|
+
border-bottom: none;
|
|
293
|
+
scrollbar-gutter: stable;
|
|
294
|
+
overflow-y: hidden;
|
|
295
|
+
cursor: default;
|
|
296
|
+
}
|
|
297
|
+
.row.total .cell {
|
|
298
|
+
border-right: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
299
|
+
}
|
|
300
|
+
.row.total .cell:last-child {
|
|
301
|
+
border-right: none;
|
|
302
|
+
}
|
|
303
|
+
.entry-card {
|
|
304
|
+
@apply --vertical;
|
|
305
|
+
flex-shrink: 0;
|
|
306
|
+
gap: 8px;
|
|
307
|
+
margin: 8px;
|
|
308
|
+
padding: 10px 12px;
|
|
309
|
+
border: 2px solid #4f6bed;
|
|
310
|
+
border-radius: 6px;
|
|
311
|
+
background: light-dark(#ffffff, #22232a);
|
|
312
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
|
|
313
|
+
}
|
|
314
|
+
.entry-bar {
|
|
315
|
+
@apply --horizontal;
|
|
316
|
+
gap: 10px;
|
|
317
|
+
align-items: center;
|
|
318
|
+
flex-wrap: wrap;
|
|
319
|
+
}
|
|
320
|
+
.entry-sides {
|
|
321
|
+
@apply --horizontal;
|
|
322
|
+
gap: 12px;
|
|
323
|
+
}
|
|
324
|
+
.entry-side {
|
|
325
|
+
@apply --vertical;
|
|
326
|
+
flex: 1;
|
|
327
|
+
gap: 4px;
|
|
328
|
+
padding: 8px;
|
|
329
|
+
border: 1px solid light-dark(#d2d1c8, #3e4049);
|
|
330
|
+
border-radius: 4px;
|
|
331
|
+
background: light-dark(#fafaf7, #1b1c20);
|
|
332
|
+
}
|
|
333
|
+
.entry-side-title {
|
|
334
|
+
font-weight: 700;
|
|
335
|
+
border-bottom: 1px solid light-dark(#e2e2dc, #2f3038);
|
|
336
|
+
padding-bottom: 4px;
|
|
337
|
+
}
|
|
338
|
+
.btn-action {
|
|
339
|
+
@apply --content;
|
|
340
|
+
@apply --border;
|
|
341
|
+
padding: 3px 8px;
|
|
342
|
+
font-size: small;
|
|
343
|
+
font-family: inherit;
|
|
344
|
+
font-weight: 500;
|
|
345
|
+
border-radius: 0;
|
|
346
|
+
cursor: pointer;
|
|
347
|
+
}
|
|
348
|
+
.btn-action:hover:not(:disabled) {
|
|
349
|
+
@apply --hover;
|
|
350
|
+
}
|
|
351
|
+
</style>
|
|
352
|
+
|
|
353
|
+
<oda-packets no-flex mode="month" ~if="packetsStart"
|
|
354
|
+
:start="packetsStart" :end="packetsEnd" :days="packetDays"
|
|
355
|
+
::value="packetsKey" @selection-changed="onPackets($event)"></oda-packets>
|
|
356
|
+
|
|
357
|
+
<div class="filter-strip">
|
|
358
|
+
<input :value="account" placeholder="Счёт (например 41, 62)…" @change="setAccount($this.value)">
|
|
359
|
+
<input :value="opClass" placeholder="Класс операций…" @change="setOpClass($this.value)">
|
|
360
|
+
<select ~if="units.length > 1" title="Подразделение" @change="setUnit($this.value)">
|
|
361
|
+
<option value="" :selected="!unit">Все подразделения</option>
|
|
362
|
+
<option ~for="units" :value="$for.item.cid" :selected="$for.item.cid === unit">{{$for.item.label}}</option>
|
|
363
|
+
</select>
|
|
364
|
+
<label><input type="checkbox" :checked="effective" @change="setEffective($this.checked)"> только действующие</label>
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div class="error" ~if="error">{{error}}</div>
|
|
368
|
+
|
|
369
|
+
<div class="grid">
|
|
370
|
+
<div class="head-wrap">
|
|
371
|
+
<div class="head">
|
|
372
|
+
<div class="cell">Дата</div>
|
|
373
|
+
<div class="cell">Операция</div>
|
|
374
|
+
<div class="cell">Дебет</div>
|
|
375
|
+
<div class="cell">Аналитика Дт</div>
|
|
376
|
+
<div class="cell">Кредит</div>
|
|
377
|
+
<div class="cell">Аналитика Кт</div>
|
|
378
|
+
<div class="cell num">Сумма</div>
|
|
379
|
+
<div class="cell num">Кол-во</div>
|
|
380
|
+
<div class="cell">Статус</div>
|
|
381
|
+
</div>
|
|
382
|
+
</div>
|
|
383
|
+
<div class="grid-body">
|
|
384
|
+
<div class="row" ~for="displayRows" ~class="{storno: $for.item.storno}" @dblclick="openEntry($for.item.entry)">
|
|
385
|
+
<div class="cell link" title="Открыть карточку проводки" @tap="openEntry($for.item.entry)">{{$for.item.date}}</div>
|
|
386
|
+
<div class="cell link" @tap="openOperation($for.item)">{{$for.item.op}}</div>
|
|
387
|
+
<div class="cell link" @tap="openAccount($for.item, 'debit')">{{$for.item.debit}}</div>
|
|
388
|
+
<div class="cell">{{$for.item.debitAnalytics}}</div>
|
|
389
|
+
<div class="cell link" @tap="openAccount($for.item, 'credit')">{{$for.item.credit}}</div>
|
|
390
|
+
<div class="cell">{{$for.item.creditAnalytics}}</div>
|
|
391
|
+
<div class="cell num">{{$for.item.amount}}</div>
|
|
392
|
+
<div class="cell num">{{$for.item.qty}}</div>
|
|
393
|
+
<div class="cell">{{$for.item.status}}</div>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
<div class="row total">
|
|
397
|
+
<div class="cell">{{countText}}</div>
|
|
398
|
+
<div class="cell"></div>
|
|
399
|
+
<div class="cell"></div>
|
|
400
|
+
<div class="cell"></div>
|
|
401
|
+
<div class="cell"></div>
|
|
402
|
+
<div class="cell"></div>
|
|
403
|
+
<div class="cell num">{{money(sum.amount)}}</div>
|
|
404
|
+
<div class="cell num"></div>
|
|
405
|
+
<div class="cell"></div>
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
<!-- Экран 4 ODANT: Сборная карточка проводки -->
|
|
410
|
+
<div class="entry-card" ~if="entryCard">
|
|
411
|
+
<div class="entry-bar">
|
|
412
|
+
<strong>Проводка #{{entryCard.entry}}</strong>
|
|
413
|
+
<span>Сумма: <strong>{{money(entryCard.amount)}}</strong></span>
|
|
414
|
+
<span ~if="entryCard.qty">Кол-во: {{entryCard.qty}}</span>
|
|
415
|
+
<span class="storno" ~if="entryCard.storno">[СТОРНО]</span>
|
|
416
|
+
<span style="margin-left:auto;">Операция: <strong>{{entryCard.operation?.title}}</strong></span>
|
|
417
|
+
<button type="button" class="btn-action" @tap="closeEntry()">Закрыть</button>
|
|
418
|
+
</div>
|
|
419
|
+
<div class="entry-sides">
|
|
420
|
+
<div class="entry-side">
|
|
421
|
+
<div class="entry-side-title">ДЕБЕТ: {{entryCard.debit?.label}}</div>
|
|
422
|
+
<div>Сумма Дт: <strong>{{money(entryCard.debit?.amount)}}</strong></div>
|
|
423
|
+
<div ~for="entryCard.debit?.analytics">
|
|
424
|
+
<span>{{$for.item.label}}:</span> <strong>{{$for.item.title || '—'}}</strong>
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
<div class="entry-side">
|
|
428
|
+
<div class="entry-side-title">КРЕДИТ: {{entryCard.credit?.label}}</div>
|
|
429
|
+
<div>Сумма Кт: <strong>{{money(entryCard.credit?.amount)}}</strong></div>
|
|
430
|
+
<div ~for="entryCard.credit?.analytics">
|
|
431
|
+
<span>{{$for.item.label}}:</span> <strong>{{$for.item.title || '—'}}</strong>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
</div>
|
|
436
|
+
`,
|
|
437
|
+
packetsKey: {
|
|
438
|
+
$def: '*',
|
|
439
|
+
$type: String,
|
|
440
|
+
$save: true
|
|
441
|
+
},
|
|
442
|
+
packetsStart: '',
|
|
443
|
+
packetsEnd: '',
|
|
444
|
+
packetDays: null,
|
|
445
|
+
_packetFiltered: false,
|
|
446
|
+
_initializingPackets: false,
|
|
447
|
+
_attachedDone: false,
|
|
448
|
+
_initialNav: null,
|
|
449
|
+
from: '',
|
|
450
|
+
to: '',
|
|
451
|
+
account: '',
|
|
452
|
+
/** класс операций (путь) — проводки только его операций и потомков */
|
|
453
|
+
opClass: '',
|
|
454
|
+
/** только действующие проводки: без сторно и прежних версий проведения */
|
|
455
|
+
effective: false,
|
|
456
|
+
/** видимые подразделения (db_scope): больше одного — фильтр */
|
|
457
|
+
units: [],
|
|
458
|
+
/** выбранное подразделение (с вложенными), пусто — все видимые */
|
|
459
|
+
unit: '',
|
|
460
|
+
items: [],
|
|
461
|
+
/** всего проводок по фильтру (строк может быть меньше — первая страница) */
|
|
462
|
+
count: 0,
|
|
463
|
+
sum: {
|
|
464
|
+
amount: 0,
|
|
465
|
+
qty: 0
|
|
466
|
+
},
|
|
467
|
+
names: {
|
|
468
|
+
objects: {},
|
|
469
|
+
classes: {},
|
|
470
|
+
paths: {}
|
|
471
|
+
},
|
|
472
|
+
entryCard: null,
|
|
473
|
+
error: '',
|
|
474
|
+
money,
|
|
475
|
+
get countText() {
|
|
476
|
+
const n = (this.items || []).length;
|
|
477
|
+
return n < this.count ? `Записей: ${n} из ${this.count}` : `Записей: ${n}`;
|
|
478
|
+
},
|
|
479
|
+
/** Счёт для показа: код (последний сегмент пути) и название (без дублирования кода). */
|
|
480
|
+
accountText(cid) {
|
|
481
|
+
const code = String(cid || '').split('/').pop().replace(/^acc\./, '');
|
|
482
|
+
const label = String(this.names?.classes?.[cid] || '').trim();
|
|
483
|
+
if (!label || label === code) return code;
|
|
484
|
+
if (label.startsWith(code + ' ') || label.startsWith(code + '.') || /^\d+(?:\.\d+)?\s/.test(label)) return label;
|
|
485
|
+
return `${code} ${label}`;
|
|
486
|
+
},
|
|
487
|
+
/** Аналитики стороны: названия объектов через « / ». */
|
|
488
|
+
analyticsText(side) {
|
|
489
|
+
return Object.values(side || {}).map(id => this.names?.objects?.[id] || id).join(' / ');
|
|
490
|
+
},
|
|
491
|
+
/** Операция: её название, без названия (ядро отдаёт id) — класс операции. */
|
|
492
|
+
opText(e) {
|
|
493
|
+
const title = this.names?.objects?.[e.op_id];
|
|
494
|
+
return (title && title !== e.op_id ? title : '') || this.names?.classes?.[e.op_cid] || e.op_id || '';
|
|
495
|
+
},
|
|
496
|
+
get displayRows() {
|
|
497
|
+
return (this.items || []).map(e => ({
|
|
498
|
+
entry: e.id || e.entry || null,
|
|
499
|
+
op_id: e.op_id || '',
|
|
500
|
+
date: e.time ? new Date(e.time).toLocaleDateString() : '',
|
|
501
|
+
op: this.opText(e),
|
|
502
|
+
debit: this.accountText(e.debit),
|
|
503
|
+
debitAnalytics: this.analyticsText(e.debit_analytics),
|
|
504
|
+
credit: this.accountText(e.credit),
|
|
505
|
+
creditAnalytics: this.analyticsText(e.credit_analytics),
|
|
506
|
+
amount: money(e.amount),
|
|
507
|
+
qty: e.qty ? `${e.doc_qty ?? e.qty}${e.doc_unit ? ' ' + e.doc_unit : ''}` : '',
|
|
508
|
+
status: e.storno ? 'сторно' : '',
|
|
509
|
+
storno: !!e.storno,
|
|
510
|
+
op_cid: e.op_cid || '',
|
|
511
|
+
debit_cid: e.debit || '',
|
|
512
|
+
credit_cid: e.credit || ''
|
|
513
|
+
}));
|
|
514
|
+
},
|
|
515
|
+
async setAccount(val) {
|
|
516
|
+
this.account = String(val || '');
|
|
517
|
+
await this.reload();
|
|
518
|
+
},
|
|
519
|
+
async setOpClass(val) {
|
|
520
|
+
this.opClass = String(val || '');
|
|
521
|
+
await this.reload();
|
|
522
|
+
},
|
|
523
|
+
async setUnit(val) {
|
|
524
|
+
this.unit = String(val || '');
|
|
525
|
+
await this.reload();
|
|
526
|
+
},
|
|
527
|
+
async setEffective(val) {
|
|
528
|
+
this.effective = !!val;
|
|
529
|
+
await this.reload();
|
|
530
|
+
},
|
|
531
|
+
_findFormHost() {
|
|
532
|
+
if (this.$form && ('focusedItem' in this.$form || typeof this.$form.syncFromView === 'function' || typeof this.$form.setFormPeriod === 'function')) return this.$form;
|
|
533
|
+
for (let p = this.parentElement || this.domHost; p; p = p.parentElement || p.domHost) {
|
|
534
|
+
if (p.localName === 'work-form' || typeof p.syncFromView === 'function' || typeof p.setFormPeriod === 'function' || 'focusedItem' in p) return p;
|
|
535
|
+
}
|
|
536
|
+
return null;
|
|
537
|
+
},
|
|
538
|
+
async onPackets(e) {
|
|
539
|
+
const d = e?.detail?.value ?? e?.detail ?? {};
|
|
540
|
+
if (Array.isArray(d)) return;
|
|
541
|
+
if (this._initializingPackets) return;
|
|
542
|
+
const nextKey = d.value || (d.selected?.name === '*' ? '*' : d.selected?.mask || this.packetsKey || '*');
|
|
543
|
+
if (d.selected?.name === '*') {
|
|
544
|
+
this.packetsKey = '*';
|
|
545
|
+
_writeSavedPeriod('*', '', '');
|
|
546
|
+
this._findFormHost()?.setFormPeriod?.({
|
|
547
|
+
packetsKey: '*',
|
|
548
|
+
from: '',
|
|
549
|
+
to: ''
|
|
550
|
+
});
|
|
551
|
+
if (this._packetFiltered || this.from || this.to) {
|
|
552
|
+
this._packetFiltered = false;
|
|
553
|
+
this.from = '';
|
|
554
|
+
this.to = '';
|
|
555
|
+
await this.reload();
|
|
556
|
+
}
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
if (d.period?.start && d.period?.end) {
|
|
560
|
+
const changed = this.from !== d.period.start || this.to !== d.period.end || !this._packetFiltered;
|
|
561
|
+
this._packetFiltered = true;
|
|
562
|
+
this.from = d.period.start;
|
|
563
|
+
this.to = d.period.end;
|
|
564
|
+
this.packetsKey = _derivePacketsKey(this.from, this.to, nextKey);
|
|
565
|
+
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
566
|
+
this._findFormHost()?.setFormPeriod?.({
|
|
567
|
+
packetsKey: this.packetsKey,
|
|
568
|
+
from: this.from,
|
|
569
|
+
to: this.to
|
|
570
|
+
});
|
|
571
|
+
if (changed) await this.reload();
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
_restorePeriodState(nav = null) {
|
|
575
|
+
const hasNavPeriod = nav && (nav.from !== undefined || nav.to !== undefined || nav.packetsKey);
|
|
576
|
+
if (!hasNavPeriod && (this.from || this.to)) return;
|
|
577
|
+
const formPeriod = this._findFormHost()?.formPeriod || null;
|
|
578
|
+
const saved = _readSavedPeriod();
|
|
579
|
+
const localSavedKey = typeof this.loadFromLocalStorage === 'function' ? this.loadFromLocalStorage('packetsKey') : undefined;
|
|
580
|
+
if (!hasNavPeriod && !formPeriod && !saved && typeof localSavedKey === 'string' && localSavedKey && (typeof this.packetsKey !== 'string' || this.packetsKey === '*')) this.packetsKey = localSavedKey;
|
|
581
|
+
const pk = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
582
|
+
const src = hasNavPeriod ? nav : formPeriod || saved || (pk && pk !== '*' ? {
|
|
583
|
+
packetsKey: pk
|
|
584
|
+
} : null);
|
|
585
|
+
if (!src) return;
|
|
586
|
+
this._initializingPackets = true;
|
|
587
|
+
try {
|
|
588
|
+
const rawKey = typeof src.packetsKey === 'string' && src.packetsKey ? src.packetsKey : pk || '*';
|
|
589
|
+
let from = String(src.from || '');
|
|
590
|
+
let to = String(src.to || '');
|
|
591
|
+
if (!from && !to && rawKey !== '*') {
|
|
592
|
+
const derived = _boundsFromPacketsKey(rawKey, 'month');
|
|
593
|
+
if (derived.from && derived.to) {
|
|
594
|
+
from = derived.from;
|
|
595
|
+
to = derived.to;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
const key = _derivePacketsKey(from, to, rawKey);
|
|
599
|
+
this.from = from;
|
|
600
|
+
this.to = to;
|
|
601
|
+
this._packetFiltered = !!(from || to);
|
|
602
|
+
this.packetsKey = key;
|
|
603
|
+
this._findFormHost()?.setFormPeriod?.({
|
|
604
|
+
packetsKey: this.packetsKey,
|
|
605
|
+
from: this.from,
|
|
606
|
+
to: this.to
|
|
607
|
+
});
|
|
608
|
+
} finally {
|
|
609
|
+
this._initializingPackets = false;
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
_applyNavFields(nav) {
|
|
613
|
+
if (!nav || typeof nav !== 'object') return;
|
|
614
|
+
this._restorePeriodState(nav);
|
|
615
|
+
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
616
|
+
this._findFormHost()?.setFormPeriod?.({
|
|
617
|
+
packetsKey: this.packetsKey,
|
|
618
|
+
from: this.from,
|
|
619
|
+
to: this.to
|
|
620
|
+
});
|
|
621
|
+
},
|
|
622
|
+
async syncFormPeriod(fp) {
|
|
623
|
+
if (!fp || typeof fp !== 'object') return;
|
|
624
|
+
const nextFrom = String(fp.from || '');
|
|
625
|
+
const nextTo = String(fp.to || '');
|
|
626
|
+
const nextKey = String(fp.packetsKey || '*');
|
|
627
|
+
if (this.from === nextFrom && this.to === nextTo && this.packetsKey === nextKey) return;
|
|
628
|
+
this._restorePeriodState(fp);
|
|
629
|
+
await this.reload();
|
|
630
|
+
},
|
|
631
|
+
async openEntry(entryId) {
|
|
632
|
+
if (!entryId || !this.$item) return null;
|
|
633
|
+
this.error = '';
|
|
634
|
+
try {
|
|
635
|
+
this.entryCard = await this.$item.fetch('db_entry', {
|
|
636
|
+
entry: entryId
|
|
637
|
+
});
|
|
638
|
+
return this.entryCard;
|
|
639
|
+
} catch (e) {
|
|
640
|
+
this.error = String(e?.message || e);
|
|
641
|
+
return null;
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
closeEntry() {
|
|
645
|
+
this.entryCard = null;
|
|
646
|
+
},
|
|
647
|
+
async attached() {
|
|
648
|
+
if (this._attachedDone && !this._initialNav) return;
|
|
649
|
+
const initNav = this._initialNav;
|
|
650
|
+
this._initialNav = null;
|
|
651
|
+
this._restorePeriodState(initNav);
|
|
652
|
+
await Promise.all([this.loadScope(), this.reload()]);
|
|
653
|
+
this._attachedDone = true;
|
|
654
|
+
},
|
|
655
|
+
/** Видимые подразделения для фильтра; без ответа — без фильтра. */
|
|
656
|
+
async loadScope() {
|
|
657
|
+
try {
|
|
658
|
+
const s = await this.$item?.fetch('db_scope');
|
|
659
|
+
this.units = Array.isArray(s?.units) && !s.all ? s.units : [];
|
|
660
|
+
} catch {
|
|
661
|
+
this.units = [];
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
params() {
|
|
665
|
+
const p = {
|
|
666
|
+
limit: 500,
|
|
667
|
+
desc: true
|
|
668
|
+
};
|
|
669
|
+
const put = (key, v) => {
|
|
670
|
+
const s = String(v ?? '').trim();
|
|
671
|
+
if (s) p[key] = s;
|
|
672
|
+
};
|
|
673
|
+
put('from', this.from);
|
|
674
|
+
put('to', this.to);
|
|
675
|
+
put('account', this.account);
|
|
676
|
+
put('op_cid', this.opClass);
|
|
677
|
+
put('unit', this.unit);
|
|
678
|
+
if (this.effective) p.effective = true;
|
|
679
|
+
return p;
|
|
680
|
+
},
|
|
681
|
+
_syncPacketRange(res) {
|
|
682
|
+
if (!res) return false;
|
|
683
|
+
if (!('range' in res)) {
|
|
684
|
+
if (!this.packetsStart) {
|
|
685
|
+
this.packetsStart = _yearStart();
|
|
686
|
+
this.packetsEnd = _yearEnd();
|
|
687
|
+
}
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
const r = res.range;
|
|
691
|
+
if (!r || !r.start || !r.end) {
|
|
692
|
+
this.packetsStart = '';
|
|
693
|
+
this.packetsEnd = '';
|
|
694
|
+
this.packetDays = null;
|
|
695
|
+
return false;
|
|
696
|
+
}
|
|
697
|
+
this.packetsStart = r.start;
|
|
698
|
+
this.packetsEnd = r.end;
|
|
699
|
+
this.packetDays = Array.isArray(r.days) && r.days.length ? r.days : null;
|
|
700
|
+
const keyStr = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
701
|
+
const isNowKey = keyStr === 'now' || keyStr.startsWith('now:');
|
|
702
|
+
if (this._packetFiltered && !isNowKey && this.to && this.to < r.start) {
|
|
703
|
+
this._initializingPackets = true;
|
|
704
|
+
try {
|
|
705
|
+
this._packetFiltered = false;
|
|
706
|
+
this.from = '';
|
|
707
|
+
this.to = '';
|
|
708
|
+
this.packetsKey = '*';
|
|
709
|
+
_writeSavedPeriod('*', '', '');
|
|
710
|
+
} finally {
|
|
711
|
+
this._initializingPackets = false;
|
|
712
|
+
}
|
|
713
|
+
return true;
|
|
714
|
+
}
|
|
715
|
+
return false;
|
|
716
|
+
},
|
|
717
|
+
async reload() {
|
|
718
|
+
this.error = '';
|
|
719
|
+
if (!this.$item) {
|
|
720
|
+
this.items = [];
|
|
721
|
+
this.count = 0;
|
|
722
|
+
this.sum = {
|
|
723
|
+
amount: 0,
|
|
724
|
+
qty: 0
|
|
725
|
+
};
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
try {
|
|
729
|
+
const res = await this.$item.fetch('db_journal', this.params());
|
|
730
|
+
if (this._syncPacketRange(res)) return await this.reload();
|
|
731
|
+
this.names = {
|
|
732
|
+
objects: {},
|
|
733
|
+
classes: {},
|
|
734
|
+
paths: {},
|
|
735
|
+
...(res?.names || {})
|
|
736
|
+
};
|
|
737
|
+
this.items = Array.isArray(res?.items) ? res.items : [];
|
|
738
|
+
this.count = Number(res?.total) || this.items.length;
|
|
739
|
+
this.sum = res?.sum || {
|
|
740
|
+
amount: 0,
|
|
741
|
+
qty: 0
|
|
742
|
+
};
|
|
743
|
+
} catch (e) {
|
|
744
|
+
this.items = [];
|
|
745
|
+
this.count = 0;
|
|
746
|
+
this.sum = {
|
|
747
|
+
amount: 0,
|
|
748
|
+
qty: 0
|
|
749
|
+
};
|
|
750
|
+
this.error = String(e?.message || e);
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
/** Открыть форму класса в новом окне. */
|
|
754
|
+
async openPath(path, nav) {
|
|
755
|
+
if (!path) return;
|
|
756
|
+
try {
|
|
757
|
+
const t = await WORK.get_item(path);
|
|
758
|
+
if (t && window.execute) window.execute(t, nav);
|
|
759
|
+
} catch (e) {
|
|
760
|
+
this.error = String(e?.message || e);
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
/** Класс операции (её форма — список операций с окном редактора). */
|
|
764
|
+
openOperation(row) {
|
|
765
|
+
const nav = row?.op_id ? {
|
|
766
|
+
view: 'objects',
|
|
767
|
+
id: row.op_id
|
|
768
|
+
} : undefined;
|
|
769
|
+
return this.openPath(this.names?.paths?.[row.op_cid] || row.op_cid, nav);
|
|
770
|
+
},
|
|
771
|
+
openAccount(row, side) {
|
|
772
|
+
const cid = side === 'debit' ? row.debit_cid : row.credit_cid;
|
|
773
|
+
return this.openPath(this.names?.paths?.[cid] || cid);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
};
|