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,1700 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* form/postings — экранная форма счёта ($account) на учётном ядре (sources/data/api.js).
|
|
3
|
-
* Объединяет три режима работы со счётом по модели ODANT и сборную карточку проводки:
|
|
4
|
-
* - `mode: 'card'` (по умолчанию) — проводки счёта (`db_card`) с сальдо после каждой записи;
|
|
5
|
-
* - `mode: 'analysis'` (Экран 2 ODANT) — Анализ счёта в разрезе аналитик (`db_sheet`),
|
|
6
|
-
* слева панель аналитик (порядок иерархии ↑↓, фильтр по значениям и субаналитикам)
|
|
7
|
-
* и переключатель ЗНАЧЕНИЯ (Сумма / Количество), справа таблица с двухслойным заголовком, быстрым фильтром и прижатым футером Итого;
|
|
8
|
-
* - `mode: 'turnovers'` (Экран 3 ODANT) — двухпанельные Обороты счёта (`db_turnovers`):
|
|
9
|
-
* слева радиокнопки ГРУППИРОВАТЬ (Нет / Дни / Недели / Месяцы / Кварталы / Годы / Операции / Счета / Все)
|
|
10
|
-
* и сводная таблица периодов с сальдо и оборотом, справа — документы выбранного периода с переходом к проводке и документу;
|
|
11
|
-
* - `entryCard` (Экран 4 ODANT) — сборная карточка проводки (`db_entry`) из записей счёта Дебета и счёта Кредита.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const PERIOD_STORAGE_KEY = 'work.accounting.period';
|
|
15
|
-
|
|
16
|
-
function _day(d) {
|
|
17
|
-
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
18
|
-
}
|
|
19
|
-
const _today = () => _day(new Date());
|
|
20
|
-
const _yearStart = () => `${new Date().getFullYear()}-01-01`;
|
|
21
|
-
const _yearEnd = () => _today();
|
|
22
|
-
|
|
23
|
-
function _readSavedPeriod() {
|
|
24
|
-
try {
|
|
25
|
-
const raw = typeof sessionStorage !== 'undefined' ? sessionStorage.getItem(PERIOD_STORAGE_KEY) : null;
|
|
26
|
-
if (!raw)
|
|
27
|
-
return null;
|
|
28
|
-
const parsed = JSON.parse(raw);
|
|
29
|
-
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _writeSavedPeriod(packetsKey, from, to) {
|
|
37
|
-
try {
|
|
38
|
-
if (typeof sessionStorage !== 'undefined')
|
|
39
|
-
sessionStorage.setItem(PERIOD_STORAGE_KEY, JSON.stringify({ packetsKey: packetsKey || '*', from: from || '', to: to || '' }));
|
|
40
|
-
}
|
|
41
|
-
catch { /* ignore */ }
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _derivePacketsKey(from, to, fallback = '*') {
|
|
45
|
-
if (!from && !to)
|
|
46
|
-
return '*';
|
|
47
|
-
if (fallback && fallback !== '*')
|
|
48
|
-
return fallback;
|
|
49
|
-
if (from && to) {
|
|
50
|
-
const ym1 = /^(\d{4})-01-01$/.exec(from);
|
|
51
|
-
const ym2 = /^(\d{4})-12-31$/.exec(to);
|
|
52
|
-
if (ym1 && ym2 && ym1[1] === ym2[1])
|
|
53
|
-
return `${ym1[1]}*`;
|
|
54
|
-
return `period:${from}:${to}`;
|
|
55
|
-
}
|
|
56
|
-
return fallback || '*';
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function _daysInMonth(y, m) {
|
|
60
|
-
return new Date(y, m, 0).getDate();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function _weekBounds(dt) {
|
|
64
|
-
const dow = dt.getDay();
|
|
65
|
-
const diffToMon = dow === 0 ? -6 : 1 - dow;
|
|
66
|
-
const mon = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate() + diffToMon);
|
|
67
|
-
const sun = new Date(mon.getFullYear(), mon.getMonth(), mon.getDate() + 6);
|
|
68
|
-
return { from: _day(mon), to: _day(sun) };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function _boundsFromPacketsKey(key, defaultMode = 'month') {
|
|
72
|
-
const k = String(key || '').trim();
|
|
73
|
-
if (!k || k === '*')
|
|
74
|
-
return { from: '', to: '' };
|
|
75
|
-
if (k.startsWith('period:')) {
|
|
76
|
-
const [, s = '', e = ''] = k.split(':');
|
|
77
|
-
return { from: s, to: e };
|
|
78
|
-
}
|
|
79
|
-
if (k === 'now' || k.startsWith('now:')) {
|
|
80
|
-
const gran = k.startsWith('now:') ? k.slice(4) : defaultMode;
|
|
81
|
-
const now = new Date();
|
|
82
|
-
const y = now.getFullYear(), m = now.getMonth() + 1;
|
|
83
|
-
if (gran === 'day') {
|
|
84
|
-
const d = _day(now);
|
|
85
|
-
return { from: d, to: d };
|
|
86
|
-
}
|
|
87
|
-
if (gran === 'week')
|
|
88
|
-
return _weekBounds(now);
|
|
89
|
-
if (gran === 'quarter') {
|
|
90
|
-
const q = Math.floor((m - 1) / 3) + 1;
|
|
91
|
-
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
92
|
-
const m2 = (q - 1) * 3 + 3;
|
|
93
|
-
return { from: `${y}-${m1}-01`, to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}` };
|
|
94
|
-
}
|
|
95
|
-
if (gran === 'year')
|
|
96
|
-
return { from: `${y}-01-01`, to: `${y}-12-31` };
|
|
97
|
-
const ms = String(m).padStart(2, '0');
|
|
98
|
-
return { from: `${y}-${ms}-01`, to: `${y}-${ms}-${String(_daysInMonth(y, m)).padStart(2, '0')}` };
|
|
99
|
-
}
|
|
100
|
-
const clean = k.replace(/\*+$/, '');
|
|
101
|
-
if (/^\d{4}$/.test(clean))
|
|
102
|
-
return { from: `${clean}-01-01`, to: `${clean}-12-31` };
|
|
103
|
-
const qm = /^(\d{4})-q([1-4])$/i.exec(clean);
|
|
104
|
-
if (qm) {
|
|
105
|
-
const y = +qm[1], q = +qm[2];
|
|
106
|
-
const m1 = String((q - 1) * 3 + 1).padStart(2, '0');
|
|
107
|
-
const m2 = (q - 1) * 3 + 3;
|
|
108
|
-
return { from: `${y}-${m1}-01`, to: `${y}-${String(m2).padStart(2, '0')}-${String(_daysInMonth(y, m2)).padStart(2, '0')}` };
|
|
109
|
-
}
|
|
110
|
-
const mm = /^(\d{4})-(0[1-9]|1[0-2])$/.exec(clean);
|
|
111
|
-
if (mm) {
|
|
112
|
-
const y = +mm[1], m = +mm[2];
|
|
113
|
-
return { from: `${clean}-01`, to: `${clean}-${String(_daysInMonth(y, m)).padStart(2, '0')}` };
|
|
114
|
-
}
|
|
115
|
-
if (clean.startsWith('week:')) {
|
|
116
|
-
const monIso = clean.slice(5);
|
|
117
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(monIso)) {
|
|
118
|
-
const [y, m, d] = monIso.split('-').map(Number);
|
|
119
|
-
return _weekBounds(new Date(y, m - 1, d));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (/^\d{4}-\d{2}-\d{2}$/.test(clean))
|
|
123
|
-
return { from: clean, to: clean };
|
|
124
|
-
return { from: '', to: '' };
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const money = v => (Number(v) ? Number(v).toLocaleString('ru-RU', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) : '');
|
|
128
|
-
const qtyFmt = v => (Number(v) ? Number(v).toLocaleString('ru-RU', { maximumFractionDigits: 4 }) : '');
|
|
129
|
-
/** Сальдо со знаком (Дт − Кт) текстом: «1 200,00 Дт», «300,00 Кт». */
|
|
130
|
-
const saldo = v => (Number(v) > 0 ? money(v) + ' Дт' : Number(v) < 0 ? money(-v) + ' Кт' : '0');
|
|
131
|
-
|
|
132
|
-
export const TURNOVER_GROUPS = [
|
|
133
|
-
{ id: 'none', label: 'Нет' },
|
|
134
|
-
{ id: 'day', label: 'Дни' },
|
|
135
|
-
{ id: 'week', label: 'Недели' },
|
|
136
|
-
{ id: 'month', label: 'Месяцы' },
|
|
137
|
-
{ id: 'quarter', label: 'Кварталы' },
|
|
138
|
-
{ id: 'year', label: 'Годы' },
|
|
139
|
-
{ id: 'operation', label: 'Операции' },
|
|
140
|
-
{ id: 'account', label: 'Счета' },
|
|
141
|
-
{ id: 'all', label: 'Все' },
|
|
142
|
-
];
|
|
143
|
-
|
|
144
|
-
/** Парсинг строки фильтра субаналитики: «поле:значение» или просто текст поиска по name. */
|
|
145
|
-
function parseSubFilterInput(raw) {
|
|
146
|
-
const s = String(raw || '').trim();
|
|
147
|
-
if (!s)
|
|
148
|
-
return null;
|
|
149
|
-
const colon = s.indexOf(':');
|
|
150
|
-
const eq = s.indexOf('=');
|
|
151
|
-
const sep = colon > 0 && (eq < 0 || colon < eq) ? colon : eq;
|
|
152
|
-
if (sep > 0) {
|
|
153
|
-
const field = s.slice(0, sep).trim();
|
|
154
|
-
const val = s.slice(sep + 1).trim();
|
|
155
|
-
return field && val ? { [field]: { contains: val } } : null;
|
|
156
|
-
}
|
|
157
|
-
return { name: { contains: s } };
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export default {
|
|
161
|
-
imports: 'oda//button, oda//packets, ~/lib//editor-form',
|
|
162
|
-
template: /*html*/`
|
|
163
|
-
<style>
|
|
164
|
-
:host {
|
|
165
|
-
@apply --vertical;
|
|
166
|
-
@apply --flex;
|
|
167
|
-
gap: 0;
|
|
168
|
-
padding: 0;
|
|
169
|
-
overflow: hidden;
|
|
170
|
-
background: var(--content-background, #fff);
|
|
171
|
-
color: var(--content-color, #222);
|
|
172
|
-
font-size: 13px;
|
|
173
|
-
}
|
|
174
|
-
.error {
|
|
175
|
-
padding: 6px 10px;
|
|
176
|
-
color: var(--error-color, #c53030);
|
|
177
|
-
background: light-dark(#fff5f5, rgba(229, 62, 62, 0.15));
|
|
178
|
-
border-bottom: 1px solid var(--error-color, #feb2b2);
|
|
179
|
-
white-space: break-spaces;
|
|
180
|
-
}
|
|
181
|
-
/* Компактная полоса отбора аналитик над Оборотами и Проводками */
|
|
182
|
-
.filter-strip {
|
|
183
|
-
@apply --horizontal;
|
|
184
|
-
@apply --light;
|
|
185
|
-
color: var(--content-color);
|
|
186
|
-
flex-shrink: 0;
|
|
187
|
-
gap: 8px;
|
|
188
|
-
align-items: center;
|
|
189
|
-
flex-wrap: wrap;
|
|
190
|
-
padding: 3px 8px;
|
|
191
|
-
min-height: 28px;
|
|
192
|
-
border-bottom: 1px solid var(--border-color);
|
|
193
|
-
font-size: 12px;
|
|
194
|
-
}
|
|
195
|
-
.filter-strip-label {
|
|
196
|
-
font-weight: 600;
|
|
197
|
-
color: var(--muted-color);
|
|
198
|
-
}
|
|
199
|
-
.filter-slot-item {
|
|
200
|
-
@apply --horizontal;
|
|
201
|
-
align-items: center;
|
|
202
|
-
gap: 4px;
|
|
203
|
-
width: 185px;
|
|
204
|
-
}
|
|
205
|
-
.filter-strip select {
|
|
206
|
-
padding: 2px 6px;
|
|
207
|
-
font-size: 12px;
|
|
208
|
-
border: 1px solid var(--border-color);
|
|
209
|
-
border-radius: var(--radius-xs, 3px);
|
|
210
|
-
background: var(--content-background);
|
|
211
|
-
color: var(--content-color);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/* Общие табличные стили (единые с Ведомостью sheet.js и oda-table) */
|
|
215
|
-
.head-wrap {
|
|
216
|
-
@apply --vertical;
|
|
217
|
-
flex-shrink: 0;
|
|
218
|
-
background: var(--header-background);
|
|
219
|
-
color: var(--header-color);
|
|
220
|
-
border-bottom: 1px solid var(--border-color);
|
|
221
|
-
user-select: none;
|
|
222
|
-
scrollbar-gutter: stable;
|
|
223
|
-
overflow-y: hidden;
|
|
224
|
-
}
|
|
225
|
-
.head-top {
|
|
226
|
-
border-bottom: 1px solid var(--border-color);
|
|
227
|
-
font-weight: 600;
|
|
228
|
-
font-size: 12px;
|
|
229
|
-
}
|
|
230
|
-
.head {
|
|
231
|
-
font-weight: 600;
|
|
232
|
-
font-size: 12px;
|
|
233
|
-
}
|
|
234
|
-
.grid-body {
|
|
235
|
-
@apply --vertical;
|
|
236
|
-
flex: 1;
|
|
237
|
-
min-height: 0;
|
|
238
|
-
overflow-y: auto;
|
|
239
|
-
overflow-x: hidden;
|
|
240
|
-
scrollbar-gutter: stable;
|
|
241
|
-
background: var(--content-background);
|
|
242
|
-
}
|
|
243
|
-
div.row {
|
|
244
|
-
flex-shrink: 0;
|
|
245
|
-
min-height: 25px;
|
|
246
|
-
border-bottom: 1px solid var(--subtle-border);
|
|
247
|
-
}
|
|
248
|
-
div.row:hover:not(.selected):not(.total):not(.opening-row) {
|
|
249
|
-
background: var(--accent-soft);
|
|
250
|
-
}
|
|
251
|
-
div.row.selected {
|
|
252
|
-
background: var(--selected-background) !important;
|
|
253
|
-
color: var(--selected-color) !important;
|
|
254
|
-
}
|
|
255
|
-
div.row.selected .cell {
|
|
256
|
-
background: transparent !important;
|
|
257
|
-
color: var(--selected-color) !important;
|
|
258
|
-
border-right-color: rgba(255, 255, 255, 0.3) !important;
|
|
259
|
-
}
|
|
260
|
-
.cell {
|
|
261
|
-
min-width: 0;
|
|
262
|
-
padding: 4px 7px;
|
|
263
|
-
overflow: hidden;
|
|
264
|
-
text-overflow: ellipsis;
|
|
265
|
-
white-space: nowrap;
|
|
266
|
-
box-sizing: border-box;
|
|
267
|
-
display: flex;
|
|
268
|
-
align-items: center;
|
|
269
|
-
border-right: 1px solid var(--subtle-border);
|
|
270
|
-
}
|
|
271
|
-
.cell:last-child {
|
|
272
|
-
border-right: none;
|
|
273
|
-
}
|
|
274
|
-
.head-wrap .cell {
|
|
275
|
-
border-right: 1px solid var(--border-color);
|
|
276
|
-
padding: 3px 7px;
|
|
277
|
-
}
|
|
278
|
-
.head-wrap .cell:last-child {
|
|
279
|
-
border-right: none;
|
|
280
|
-
}
|
|
281
|
-
.cell.span2 {
|
|
282
|
-
grid-column: span 2;
|
|
283
|
-
justify-content: center;
|
|
284
|
-
text-align: center;
|
|
285
|
-
border-right: 1px solid var(--border-color);
|
|
286
|
-
}
|
|
287
|
-
.cell.span2:last-child {
|
|
288
|
-
border-right: none;
|
|
289
|
-
}
|
|
290
|
-
.cell.acc {
|
|
291
|
-
border-right: 2px solid var(--border-color) !important;
|
|
292
|
-
}
|
|
293
|
-
.cell.group-sep {
|
|
294
|
-
border-right: 1px solid var(--border-color);
|
|
295
|
-
}
|
|
296
|
-
.cell.num {
|
|
297
|
-
justify-content: flex-end;
|
|
298
|
-
text-align: right;
|
|
299
|
-
font-variant-numeric: tabular-nums;
|
|
300
|
-
}
|
|
301
|
-
.head .cell.num {
|
|
302
|
-
justify-content: center;
|
|
303
|
-
text-align: center;
|
|
304
|
-
}
|
|
305
|
-
.cell.link {
|
|
306
|
-
cursor: pointer;
|
|
307
|
-
text-decoration: underline;
|
|
308
|
-
}
|
|
309
|
-
.grid-body div.row .cell.debit-col {
|
|
310
|
-
background: light-dark(rgba(224, 245, 248, 0.32), rgba(56, 189, 248, 0.03));
|
|
311
|
-
}
|
|
312
|
-
.grid-body div.row .cell.credit-col {
|
|
313
|
-
background: light-dark(rgba(253, 230, 238, 0.32), rgba(244, 114, 182, 0.03));
|
|
314
|
-
}
|
|
315
|
-
.storno {
|
|
316
|
-
color: var(--error-color);
|
|
317
|
-
}
|
|
318
|
-
div.row.opening-row, div.bar.opening {
|
|
319
|
-
flex-shrink: 0;
|
|
320
|
-
font-weight: 600;
|
|
321
|
-
min-height: 24px;
|
|
322
|
-
background: var(--light-background);
|
|
323
|
-
color: var(--content-color);
|
|
324
|
-
border-bottom: 1px solid var(--border-color);
|
|
325
|
-
scrollbar-gutter: stable;
|
|
326
|
-
overflow-y: hidden;
|
|
327
|
-
}
|
|
328
|
-
div.row.total {
|
|
329
|
-
flex-shrink: 0;
|
|
330
|
-
font-weight: 700;
|
|
331
|
-
min-height: 27px;
|
|
332
|
-
background: var(--header-background);
|
|
333
|
-
color: var(--header-color);
|
|
334
|
-
border-top: 2px solid var(--border-color);
|
|
335
|
-
border-bottom: none;
|
|
336
|
-
scrollbar-gutter: stable;
|
|
337
|
-
overflow-y: hidden;
|
|
338
|
-
cursor: default;
|
|
339
|
-
}
|
|
340
|
-
.row.total .cell {
|
|
341
|
-
border-right: 1px solid var(--border-color);
|
|
342
|
-
}
|
|
343
|
-
.row.total .cell:last-child {
|
|
344
|
-
border-right: none;
|
|
345
|
-
}
|
|
346
|
-
.row-count {
|
|
347
|
-
font-weight: 600;
|
|
348
|
-
opacity: 0.85;
|
|
349
|
-
margin-left: 8px;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
/* Режим 1: Карточка проводок счёта (mode === 'card') */
|
|
353
|
-
.card-grid {
|
|
354
|
-
@apply --vertical;
|
|
355
|
-
flex: 1;
|
|
356
|
-
min-height: 0;
|
|
357
|
-
overflow: hidden;
|
|
358
|
-
border-top: 1px solid light-dark(#b5b4ac, #3e4049);
|
|
359
|
-
}
|
|
360
|
-
.card-grid div.head, .card-grid div.row, .card-grid div.bar.opening {
|
|
361
|
-
display: grid !important;
|
|
362
|
-
align-items: stretch;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/* Экран 2: Анализ счёта (mode === 'analysis') */
|
|
366
|
-
.analysis-layout, .turnovers-layout {
|
|
367
|
-
@apply --horizontal;
|
|
368
|
-
flex: 1;
|
|
369
|
-
min-height: 0;
|
|
370
|
-
gap: 0;
|
|
371
|
-
overflow: hidden;
|
|
372
|
-
border-top: 1px solid light-dark(#b5b4ac, #3e4049);
|
|
373
|
-
}
|
|
374
|
-
.analysis-side {
|
|
375
|
-
@apply --vertical;
|
|
376
|
-
width: 245px;
|
|
377
|
-
flex-shrink: 0;
|
|
378
|
-
gap: 0;
|
|
379
|
-
padding: 0;
|
|
380
|
-
background: light-dark(#f3f2ea, #22232a);
|
|
381
|
-
border-right: 1px solid light-dark(#9a9990, #4a4c56);
|
|
382
|
-
overflow: hidden;
|
|
383
|
-
font-size: 12px;
|
|
384
|
-
}
|
|
385
|
-
.analysis-side-top {
|
|
386
|
-
@apply --horizontal;
|
|
387
|
-
align-items: center;
|
|
388
|
-
gap: 4px;
|
|
389
|
-
padding: 4px 6px;
|
|
390
|
-
border-bottom: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
391
|
-
background: light-dark(#e8e7dc, #26272f);
|
|
392
|
-
flex-shrink: 0;
|
|
393
|
-
}
|
|
394
|
-
.slot-move-btn {
|
|
395
|
-
padding: 2px 7px;
|
|
396
|
-
font-size: 12px;
|
|
397
|
-
line-height: 1.2;
|
|
398
|
-
border: 1px solid light-dark(#b8b7ae, #4a4c56);
|
|
399
|
-
border-radius: 2px;
|
|
400
|
-
background: light-dark(#fff, #32343e);
|
|
401
|
-
color: inherit;
|
|
402
|
-
cursor: pointer;
|
|
403
|
-
}
|
|
404
|
-
.slot-move-btn:hover {
|
|
405
|
-
background: light-dark(#eef2fa, #3d404c);
|
|
406
|
-
}
|
|
407
|
-
.features-grid {
|
|
408
|
-
@apply --vertical;
|
|
409
|
-
flex: 1;
|
|
410
|
-
min-height: 0;
|
|
411
|
-
overflow-y: auto;
|
|
412
|
-
background: light-dark(#ffffff, #1b1c20);
|
|
413
|
-
border-bottom: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
414
|
-
}
|
|
415
|
-
.feat-head, .feat-row {
|
|
416
|
-
display: grid !important;
|
|
417
|
-
grid-template-columns: minmax(105px, 1.05fr) minmax(95px, 1fr);
|
|
418
|
-
align-items: stretch;
|
|
419
|
-
}
|
|
420
|
-
.feat-head {
|
|
421
|
-
background: light-dark(#e3e1d3, #2a2b32);
|
|
422
|
-
color: light-dark(#1f1f1f, #e2e8f0);
|
|
423
|
-
border-bottom: 1px solid light-dark(#9a9990, #4a4c56);
|
|
424
|
-
font-weight: 600;
|
|
425
|
-
font-size: 11.5px;
|
|
426
|
-
flex-shrink: 0;
|
|
427
|
-
}
|
|
428
|
-
.feat-row {
|
|
429
|
-
min-height: 24px;
|
|
430
|
-
border-bottom: 1px solid light-dark(#ecece8, #2c2d34);
|
|
431
|
-
cursor: pointer;
|
|
432
|
-
flex-shrink: 0;
|
|
433
|
-
}
|
|
434
|
-
.feat-row.selected {
|
|
435
|
-
background: light-dark(#dbe4f8, rgba(104, 130, 214, 0.28));
|
|
436
|
-
}
|
|
437
|
-
.feat-cell {
|
|
438
|
-
min-width: 0;
|
|
439
|
-
padding: 2px 5px;
|
|
440
|
-
display: flex;
|
|
441
|
-
align-items: center;
|
|
442
|
-
gap: 4px;
|
|
443
|
-
overflow: hidden;
|
|
444
|
-
text-overflow: ellipsis;
|
|
445
|
-
white-space: nowrap;
|
|
446
|
-
border-right: 1px solid light-dark(#e2e2dc, #2f3038);
|
|
447
|
-
box-sizing: border-box;
|
|
448
|
-
}
|
|
449
|
-
.feat-cell:last-child {
|
|
450
|
-
border-right: none;
|
|
451
|
-
}
|
|
452
|
-
.feat-select {
|
|
453
|
-
width: 100%;
|
|
454
|
-
min-width: 0;
|
|
455
|
-
padding: 1px 3px;
|
|
456
|
-
font-size: 11.5px;
|
|
457
|
-
border: 1px solid transparent;
|
|
458
|
-
border-radius: 2px;
|
|
459
|
-
background: transparent;
|
|
460
|
-
color: light-dark(#1d4ed8, #93c5fd);
|
|
461
|
-
cursor: pointer;
|
|
462
|
-
outline: none;
|
|
463
|
-
}
|
|
464
|
-
.feat-select:focus, .feat-select:hover {
|
|
465
|
-
border-color: light-dark(#b8b7ae, #4a4c56);
|
|
466
|
-
background: light-dark(#fff, #24252c);
|
|
467
|
-
}
|
|
468
|
-
.analysis-side-bottom {
|
|
469
|
-
@apply --vertical;
|
|
470
|
-
gap: 3px;
|
|
471
|
-
padding: 6px 8px;
|
|
472
|
-
flex-shrink: 0;
|
|
473
|
-
background: light-dark(#f3f2ea, #22232a);
|
|
474
|
-
}
|
|
475
|
-
.analysis-side-bottom label {
|
|
476
|
-
display: flex;
|
|
477
|
-
align-items: center;
|
|
478
|
-
gap: 5px;
|
|
479
|
-
cursor: pointer;
|
|
480
|
-
user-select: none;
|
|
481
|
-
}
|
|
482
|
-
.analysis-main {
|
|
483
|
-
@apply --vertical;
|
|
484
|
-
flex: 1;
|
|
485
|
-
min-width: 0;
|
|
486
|
-
min-height: 0;
|
|
487
|
-
overflow: hidden;
|
|
488
|
-
}
|
|
489
|
-
.analysis-table {
|
|
490
|
-
@apply --vertical;
|
|
491
|
-
flex: 1;
|
|
492
|
-
min-height: 0;
|
|
493
|
-
overflow: hidden;
|
|
494
|
-
}
|
|
495
|
-
.analysis-table div.head-top, .analysis-table div.head, .analysis-table div.filter-row, .analysis-table div.row {
|
|
496
|
-
display: grid !important;
|
|
497
|
-
grid-template-columns: minmax(210px, 2.5fr) repeat(6, minmax(90px, 1fr));
|
|
498
|
-
align-items: stretch;
|
|
499
|
-
}
|
|
500
|
-
.filter-row {
|
|
501
|
-
background: light-dark(#ffffff, #1f2026);
|
|
502
|
-
border-top: 1px solid light-dark(#b8b7ae, #3e4049);
|
|
503
|
-
min-height: 23px;
|
|
504
|
-
}
|
|
505
|
-
.filter-row .cell {
|
|
506
|
-
padding: 1px 5px;
|
|
507
|
-
gap: 4px;
|
|
508
|
-
}
|
|
509
|
-
.filter-mark {
|
|
510
|
-
font-size: 10.5px;
|
|
511
|
-
font-weight: 700;
|
|
512
|
-
color: light-dark(#555, #94a3b8);
|
|
513
|
-
flex-shrink: 0;
|
|
514
|
-
user-select: none;
|
|
515
|
-
}
|
|
516
|
-
.inline-filter-input {
|
|
517
|
-
flex: 1;
|
|
518
|
-
min-width: 0;
|
|
519
|
-
border: none;
|
|
520
|
-
outline: none;
|
|
521
|
-
background: transparent;
|
|
522
|
-
color: inherit;
|
|
523
|
-
font-size: 12px;
|
|
524
|
-
padding: 1px 2px;
|
|
525
|
-
}
|
|
526
|
-
.analysis-table .grid-body div.row .cell.acc {
|
|
527
|
-
background: light-dark(#f6f6f4, #222328);
|
|
528
|
-
}
|
|
529
|
-
.analysis-table div.row.group {
|
|
530
|
-
font-weight: 700;
|
|
531
|
-
}
|
|
532
|
-
.analysis-table .row.total .cell.acc {
|
|
533
|
-
justify-content: space-between;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
/* Экран 3: Обороты счёта (mode === 'turnovers') */
|
|
537
|
-
.group-title {
|
|
538
|
-
font-weight: 700;
|
|
539
|
-
font-size: 11.5px;
|
|
540
|
-
letter-spacing: 0.02em;
|
|
541
|
-
color: light-dark(#555, #cbd5e1);
|
|
542
|
-
margin-bottom: 2px;
|
|
543
|
-
}
|
|
544
|
-
.periods-panel {
|
|
545
|
-
@apply --vertical;
|
|
546
|
-
flex: 1.12;
|
|
547
|
-
min-width: 0;
|
|
548
|
-
min-height: 0;
|
|
549
|
-
overflow: hidden;
|
|
550
|
-
border-right: 2px solid light-dark(#8c8b82, #52545f);
|
|
551
|
-
}
|
|
552
|
-
.periods-panel div.head, .periods-panel div.row {
|
|
553
|
-
display: grid !important;
|
|
554
|
-
grid-template-columns: minmax(110px, 1.3fr) repeat(4, minmax(82px, 1fr));
|
|
555
|
-
align-items: stretch;
|
|
556
|
-
}
|
|
557
|
-
.periods-panel .grid-body div.row {
|
|
558
|
-
cursor: pointer;
|
|
559
|
-
}
|
|
560
|
-
.docs-panel {
|
|
561
|
-
@apply --vertical;
|
|
562
|
-
flex: 1.38;
|
|
563
|
-
min-width: 0;
|
|
564
|
-
min-height: 0;
|
|
565
|
-
overflow: hidden;
|
|
566
|
-
}
|
|
567
|
-
.docs-panel div.head, .docs-panel div.row {
|
|
568
|
-
display: grid !important;
|
|
569
|
-
grid-template-columns: 82px minmax(115px, 1.45fr) minmax(115px, 1.35fr) minmax(86px, 1fr) minmax(86px, 1fr) 30px;
|
|
570
|
-
align-items: stretch;
|
|
571
|
-
}
|
|
572
|
-
.cell.entry-col {
|
|
573
|
-
justify-content: center;
|
|
574
|
-
padding: 0 2px;
|
|
575
|
-
}
|
|
576
|
-
.entry-icon-btn {
|
|
577
|
-
display: inline-flex;
|
|
578
|
-
align-items: center;
|
|
579
|
-
justify-content: center;
|
|
580
|
-
width: 22px;
|
|
581
|
-
height: 20px;
|
|
582
|
-
padding: 0;
|
|
583
|
-
border: 1px solid transparent;
|
|
584
|
-
border-radius: 3px;
|
|
585
|
-
background: transparent;
|
|
586
|
-
color: light-dark(#444, #cbd5e1);
|
|
587
|
-
cursor: pointer;
|
|
588
|
-
}
|
|
589
|
-
.entry-icon-btn:hover {
|
|
590
|
-
border-color: light-dark(#b8b7ae, #4a4c56);
|
|
591
|
-
background: light-dark(#eef2fa, #2d3039);
|
|
592
|
-
color: light-dark(#1d4ed8, #93c5fd);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/* Экран 4: Сборная карточка проводки */
|
|
596
|
-
.entry-card {
|
|
597
|
-
@apply --vertical;
|
|
598
|
-
flex-shrink: 0;
|
|
599
|
-
gap: 8px;
|
|
600
|
-
margin: 8px;
|
|
601
|
-
padding: 10px 12px;
|
|
602
|
-
border: 2px solid #4f6bed;
|
|
603
|
-
border-radius: 6px;
|
|
604
|
-
background: light-dark(#ffffff, #22232a);
|
|
605
|
-
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
|
|
606
|
-
}
|
|
607
|
-
.entry-bar {
|
|
608
|
-
@apply --horizontal;
|
|
609
|
-
gap: 10px;
|
|
610
|
-
align-items: center;
|
|
611
|
-
flex-wrap: wrap;
|
|
612
|
-
}
|
|
613
|
-
.entry-sides {
|
|
614
|
-
@apply --horizontal;
|
|
615
|
-
gap: 12px;
|
|
616
|
-
}
|
|
617
|
-
.entry-side {
|
|
618
|
-
@apply --vertical;
|
|
619
|
-
flex: 1;
|
|
620
|
-
gap: 4px;
|
|
621
|
-
padding: 8px;
|
|
622
|
-
border: 1px solid light-dark(#d2d1c8, #3e4049);
|
|
623
|
-
border-radius: 4px;
|
|
624
|
-
background: light-dark(#fafaf7, #1b1c20);
|
|
625
|
-
}
|
|
626
|
-
.entry-side-title {
|
|
627
|
-
font-weight: 700;
|
|
628
|
-
border-bottom: 1px solid light-dark(#e2e2dc, #2f3038);
|
|
629
|
-
padding-bottom: 4px;
|
|
630
|
-
}
|
|
631
|
-
.btn-action {
|
|
632
|
-
@apply --content;
|
|
633
|
-
@apply --border;
|
|
634
|
-
padding: 3px 8px;
|
|
635
|
-
font-size: small;
|
|
636
|
-
font-family: inherit;
|
|
637
|
-
font-weight: 500;
|
|
638
|
-
border-radius: 0;
|
|
639
|
-
cursor: pointer;
|
|
640
|
-
}
|
|
641
|
-
.btn-action:hover:not(:disabled) {
|
|
642
|
-
@apply --hover;
|
|
643
|
-
}
|
|
644
|
-
</style>
|
|
645
|
-
|
|
646
|
-
<oda-packets no-flex mode="month" ~if="packetsStart"
|
|
647
|
-
:start="packetsStart" :end="packetsEnd" :days="packetDays"
|
|
648
|
-
::value="packetsKey" @selection-changed="onPackets($event)"></oda-packets>
|
|
649
|
-
|
|
650
|
-
<div class="error" ~if="error">{{error}}</div>
|
|
651
|
-
|
|
652
|
-
<!-- Компактная полоса группировки, отбора по аналитикам и подразделению в Оборотах и Проводках -->
|
|
653
|
-
<div class="filter-strip" ~if="mode !== 'analysis' && (mode === 'turnovers' || slots?.length || units.length > 1)">
|
|
654
|
-
<span class="filter-strip-label" ~if="mode === 'turnovers'">Группировать:</span>
|
|
655
|
-
<select ~if="mode === 'turnovers'" title="Группировать" @change="setGroupBy($this.value)">
|
|
656
|
-
<option ~for="turnoverGroupOptions" :value="$for.item.id" :selected="$for.item.id === groupBy">{{$for.item.label}}</option>
|
|
657
|
-
</select>
|
|
658
|
-
<span class="filter-strip-label" ~if="slots?.length">Аналитики:</span>
|
|
659
|
-
<div class="filter-slot-item" ~for="slots">
|
|
660
|
-
<oda-link-input dense :meta="$for.item" ::value="filters[$for.item.id]" @value-changed="onFilterChanged()"></oda-link-input>
|
|
661
|
-
</div>
|
|
662
|
-
<select ~if="units.length > 1" title="Подразделение" @change="setUnit($this.value)">
|
|
663
|
-
<option value="" :selected="!unit">Все подразделения</option>
|
|
664
|
-
<option ~for="units" :value="$for.item.cid" :selected="$for.item.cid === unit">{{$for.item.label}}</option>
|
|
665
|
-
</select>
|
|
666
|
-
</div>
|
|
667
|
-
|
|
668
|
-
<!-- Режим 1: Карточка проводок счёта (Проводки) -->
|
|
669
|
-
<div class="grid card-grid" ~if="mode === 'card'">
|
|
670
|
-
<div class="head-wrap">
|
|
671
|
-
<div class="head" ~style="{gridTemplateColumns: cardGridCols}">
|
|
672
|
-
<div class="cell">Дата</div>
|
|
673
|
-
<div class="cell">Операция</div>
|
|
674
|
-
<div class="cell num">Дебет</div>
|
|
675
|
-
<div class="cell num">Кредит</div>
|
|
676
|
-
<div class="cell num">Кол-во</div>
|
|
677
|
-
<div class="cell" ~for="slots">{{$for.item.label}}</div>
|
|
678
|
-
<div class="cell">Корр. счёт</div>
|
|
679
|
-
<div class="cell num">Сальдо</div>
|
|
680
|
-
</div>
|
|
681
|
-
<div class="bar opening" ~style="{gridTemplateColumns: cardGridCols}">
|
|
682
|
-
<div class="cell">На начало</div>
|
|
683
|
-
<div class="cell"></div>
|
|
684
|
-
<div class="cell num">{{money(opening.debit)}}</div>
|
|
685
|
-
<div class="cell num">{{money(opening.credit)}}</div>
|
|
686
|
-
<div class="cell num"></div>
|
|
687
|
-
<div class="cell" ~for="slots"></div>
|
|
688
|
-
<div class="cell"></div>
|
|
689
|
-
<div class="cell num">{{openingText}}</div>
|
|
690
|
-
</div>
|
|
691
|
-
</div>
|
|
692
|
-
<div class="grid-body">
|
|
693
|
-
<div class="row" ~for="displayRows" ~class="{storno: $for.item.storno}" ~style="{gridTemplateColumns: cardGridCols}" @dblclick="openEntry($for.item.entry)">
|
|
694
|
-
<div class="cell link" title="Открыть карточку проводки" @tap="openEntry($for.item.entry)">{{$for.item.date}}</div>
|
|
695
|
-
<div class="cell link" title="Открыть документ операции" @tap="openOperation($for.item)">{{$for.item.op}}</div>
|
|
696
|
-
<div class="cell num debit-col">{{$for.item.debit}}</div>
|
|
697
|
-
<div class="cell num credit-col">{{$for.item.credit}}</div>
|
|
698
|
-
<div class="cell num">{{$for.item.qty}}</div>
|
|
699
|
-
<div class="cell" ~for="$for.item.slots">{{$for.$for.item}}</div>
|
|
700
|
-
<div class="cell link" @tap="openCorr($for.item)">{{$for.item.corr}}</div>
|
|
701
|
-
<div class="cell num">{{$for.item.bal}}</div>
|
|
702
|
-
</div>
|
|
703
|
-
</div>
|
|
704
|
-
<div class="row total" ~style="{gridTemplateColumns: cardGridCols}">
|
|
705
|
-
<div class="cell"><span>Обороты</span><span class="row-count">{{displayRows.length}}</span></div>
|
|
706
|
-
<div class="cell">{{countText}}</div>
|
|
707
|
-
<div class="cell num">{{money(turnover.debit)}}</div>
|
|
708
|
-
<div class="cell num">{{money(turnover.credit)}}</div>
|
|
709
|
-
<div class="cell num"></div>
|
|
710
|
-
<div class="cell" ~for="slots"></div>
|
|
711
|
-
<div class="cell">Сальдо на конец</div>
|
|
712
|
-
<div class="cell num">{{closingText}}</div>
|
|
713
|
-
</div>
|
|
714
|
-
</div>
|
|
715
|
-
|
|
716
|
-
<!-- Экран 2 ODANT: Анализ счёта в разрезе аналитик (колонки по числу привязанных аналитических справочников, без левой панели) -->
|
|
717
|
-
<div class="analysis-layout" ~if="mode === 'analysis'">
|
|
718
|
-
<div class="analysis-main">
|
|
719
|
-
<div class="analysis-table">
|
|
720
|
-
<div class="head-wrap">
|
|
721
|
-
<div class="head-top" ~style="{gridTemplateColumns: analysisGridCols}">
|
|
722
|
-
<div class="cell acc" ~style="{gridColumn: 'span ' + analysisSlots.length, justifyContent: 'space-between'}">
|
|
723
|
-
<span>Аналитика</span>
|
|
724
|
-
<span style="display:inline-flex; align-items:center; gap:10px; font-weight:500; font-size:11.5px;">
|
|
725
|
-
<label style="display:inline-flex; align-items:center; gap:3px; cursor:pointer;"><input type="radio" name="valMode" value="amount" :checked="valueMode === 'amount'" @change="setValueMode('amount')"> Сумма</label>
|
|
726
|
-
<label style="display:inline-flex; align-items:center; gap:3px; cursor:pointer;"><input type="radio" name="valMode" value="qty" :checked="valueMode === 'qty'" @change="setValueMode('qty')"> Кол-во</label>
|
|
727
|
-
</span>
|
|
728
|
-
</div>
|
|
729
|
-
<div class="cell span2">На начало</div>
|
|
730
|
-
<div class="cell span2">За период</div>
|
|
731
|
-
<div class="cell span2">На конец</div>
|
|
732
|
-
</div>
|
|
733
|
-
<div class="head" ~style="{gridTemplateColumns: analysisGridCols}">
|
|
734
|
-
<div class="cell" ~for="analysisSlots" ~class="{acc: $for.index === analysisSlots.length - 1}">{{$for.item.label}}</div>
|
|
735
|
-
<div class="cell num">Дебет</div>
|
|
736
|
-
<div class="cell num group-sep">Кредит</div>
|
|
737
|
-
<div class="cell num">Дебет</div>
|
|
738
|
-
<div class="cell num group-sep">Кредит</div>
|
|
739
|
-
<div class="cell num">Дебет</div>
|
|
740
|
-
<div class="cell num">Кредит</div>
|
|
741
|
-
</div>
|
|
742
|
-
<div class="filter-row" ~style="{gridTemplateColumns: analysisGridCols}">
|
|
743
|
-
<div class="cell" ~for="analysisSlots" ~class="{acc: $for.index === analysisSlots.length - 1}">
|
|
744
|
-
<span class="filter-mark">a%c</span>
|
|
745
|
-
<input class="inline-filter-input" :value="slotQueryOf($for.item.id)" :placeholder="$for.item.label + '…'" @input="setSlotQuery($for.item.id, $this.value)">
|
|
746
|
-
</div>
|
|
747
|
-
<div class="cell"><span class="filter-mark">=</span></div>
|
|
748
|
-
<div class="cell group-sep"><span class="filter-mark">=</span></div>
|
|
749
|
-
<div class="cell"><span class="filter-mark">=</span></div>
|
|
750
|
-
<div class="cell group-sep"><span class="filter-mark">=</span></div>
|
|
751
|
-
<div class="cell"><span class="filter-mark">=</span></div>
|
|
752
|
-
<div class="cell"><span class="filter-mark">=</span></div>
|
|
753
|
-
</div>
|
|
754
|
-
</div>
|
|
755
|
-
<div class="grid-body">
|
|
756
|
-
<div class="row" ~for="analysisRows"
|
|
757
|
-
~style="{gridTemplateColumns: analysisGridCols}"
|
|
758
|
-
~class="{group: !$for.item.detail, selected: selectedAnalysisRow?.label === $for.item.label}"
|
|
759
|
-
@tap="selectedAnalysisRow = $for.item"
|
|
760
|
-
@dblclick="openTurnoversFromAnalysis($for.item)">
|
|
761
|
-
<div class="cell link" ~for="$for.item.slotCells" ~class="{acc: $for.$for.index === $for.item.slotCells.length - 1}">{{$for.$for.item}}</div>
|
|
762
|
-
<div class="cell num debit-col">{{$for.item.open_debit}}</div>
|
|
763
|
-
<div class="cell num credit-col group-sep">{{$for.item.open_credit}}</div>
|
|
764
|
-
<div class="cell num debit-col">{{$for.item.debit}}</div>
|
|
765
|
-
<div class="cell num credit-col group-sep">{{$for.item.credit}}</div>
|
|
766
|
-
<div class="cell num debit-col">{{$for.item.close_debit}}</div>
|
|
767
|
-
<div class="cell num credit-col">{{$for.item.close_credit}}</div>
|
|
768
|
-
</div>
|
|
769
|
-
</div>
|
|
770
|
-
<div class="row total" ~style="{gridTemplateColumns: analysisGridCols}">
|
|
771
|
-
<div class="cell acc" ~style="{gridColumn: 'span ' + analysisSlots.length}"><span>Итого</span><span class="row-count">{{analysisRows.length}}</span></div>
|
|
772
|
-
<div class="cell num">{{analysisTotals.open_debit}}</div>
|
|
773
|
-
<div class="cell num group-sep">{{analysisTotals.open_credit}}</div>
|
|
774
|
-
<div class="cell num">{{analysisTotals.debit}}</div>
|
|
775
|
-
<div class="cell num group-sep">{{analysisTotals.credit}}</div>
|
|
776
|
-
<div class="cell num">{{analysisTotals.close_debit}}</div>
|
|
777
|
-
<div class="cell num">{{analysisTotals.close_credit}}</div>
|
|
778
|
-
</div>
|
|
779
|
-
</div>
|
|
780
|
-
</div>
|
|
781
|
-
</div>
|
|
782
|
-
|
|
783
|
-
<!-- Экран 3 ODANT: Двухпанельные Обороты счёта -->
|
|
784
|
-
<div class="turnovers-layout" ~if="mode === 'turnovers'">
|
|
785
|
-
<div class="periods-panel">
|
|
786
|
-
<div class="head-wrap">
|
|
787
|
-
<div class="head">
|
|
788
|
-
<div class="cell">Период / Группа</div>
|
|
789
|
-
<div class="cell num">Дебет</div>
|
|
790
|
-
<div class="cell num">Кредит</div>
|
|
791
|
-
<div class="cell num">Сальдо</div>
|
|
792
|
-
<div class="cell num">Оборот</div>
|
|
793
|
-
</div>
|
|
794
|
-
<div class="row opening-row">
|
|
795
|
-
<div class="cell">На начало</div>
|
|
796
|
-
<div class="cell num">{{money(opening.debit)}}</div>
|
|
797
|
-
<div class="cell num">{{money(opening.credit)}}</div>
|
|
798
|
-
<div class="cell num">{{openingText}}</div>
|
|
799
|
-
<div class="cell num"></div>
|
|
800
|
-
</div>
|
|
801
|
-
</div>
|
|
802
|
-
<div class="grid-body">
|
|
803
|
-
<div class="row" ~for="turnoverGroups"
|
|
804
|
-
~class="{selected: selectedGroupKey === $for.item.key}"
|
|
805
|
-
@tap="selectGroup($for.item.key)">
|
|
806
|
-
<div class="cell link">{{$for.item.label}}</div>
|
|
807
|
-
<div class="cell num debit-col">{{$for.item.debit}}</div>
|
|
808
|
-
<div class="cell num credit-col">{{$for.item.credit}}</div>
|
|
809
|
-
<div class="cell num">{{$for.item.balance}}</div>
|
|
810
|
-
<div class="cell num">{{$for.item.turnover}}</div>
|
|
811
|
-
</div>
|
|
812
|
-
</div>
|
|
813
|
-
<div class="row total">
|
|
814
|
-
<div class="cell"><span>На конец</span><span class="row-count">{{turnoverGroups.length}}</span></div>
|
|
815
|
-
<div class="cell num">{{money(turnover.debit)}}</div>
|
|
816
|
-
<div class="cell num">{{money(turnover.credit)}}</div>
|
|
817
|
-
<div class="cell num">{{closingText}}</div>
|
|
818
|
-
<div class="cell num">{{netTurnoverText}}</div>
|
|
819
|
-
</div>
|
|
820
|
-
</div>
|
|
821
|
-
<div class="docs-panel">
|
|
822
|
-
<div class="head-wrap">
|
|
823
|
-
<div class="head">
|
|
824
|
-
<div class="cell">Дата</div>
|
|
825
|
-
<div class="cell">Операция</div>
|
|
826
|
-
<div class="cell">Корр. счёт</div>
|
|
827
|
-
<div class="cell num">Дебет</div>
|
|
828
|
-
<div class="cell num">Кредит</div>
|
|
829
|
-
<div class="cell entry-col" title="Проводка"></div>
|
|
830
|
-
</div>
|
|
831
|
-
</div>
|
|
832
|
-
<div class="grid-body">
|
|
833
|
-
<div class="row" ~for="turnoverDocs" ~class="{storno: $for.item.storno}" @dblclick="openEntry($for.item.entry)">
|
|
834
|
-
<div class="cell link" title="Открыть карточку проводки" @tap="openEntry($for.item.entry)">{{$for.item.date}}</div>
|
|
835
|
-
<div class="cell link" title="Открыть документ операции" @tap="openOperation($for.item)">{{$for.item.op}}</div>
|
|
836
|
-
<div class="cell link" title="Открыть корреспондирующий счёт" @tap="openCorr($for.item)">{{$for.item.corrDir}}</div>
|
|
837
|
-
<div class="cell num debit-col">{{$for.item.debit}}</div>
|
|
838
|
-
<div class="cell num credit-col">{{$for.item.credit}}</div>
|
|
839
|
-
<div class="cell entry-col">
|
|
840
|
-
<button type="button" class="entry-icon-btn" title="Открыть проводку" @tap.stop="openEntry($for.item.entry)">
|
|
841
|
-
<oda-icon icon="icons:list" icon-size="16"></oda-icon>
|
|
842
|
-
</button>
|
|
843
|
-
</div>
|
|
844
|
-
</div>
|
|
845
|
-
</div>
|
|
846
|
-
<div class="row total">
|
|
847
|
-
<div class="cell"><span>Итого</span><span class="row-count">{{turnoverDocs.length}}</span></div>
|
|
848
|
-
<div class="cell"></div>
|
|
849
|
-
<div class="cell"></div>
|
|
850
|
-
<div class="cell num">{{turnoverDocsTotals.debit}}</div>
|
|
851
|
-
<div class="cell num">{{turnoverDocsTotals.credit}}</div>
|
|
852
|
-
<div class="cell entry-col"></div>
|
|
853
|
-
</div>
|
|
854
|
-
</div>
|
|
855
|
-
</div>
|
|
856
|
-
|
|
857
|
-
<!-- Экран 4 ODANT: Сборная карточка проводки (из записей счёта Дебета и счёта Кредита) -->
|
|
858
|
-
<div class="entry-card" ~if="entryCard">
|
|
859
|
-
<div class="entry-bar">
|
|
860
|
-
<strong>Проводка #{{entryCard.entry}}</strong>
|
|
861
|
-
<span>от {{entryCardDate}}</span>
|
|
862
|
-
<span>Сумма: <strong>{{money(entryCard.amount)}}</strong></span>
|
|
863
|
-
<span ~if="entryCard.qty">Кол-во: {{entryCard.qty}}</span>
|
|
864
|
-
<span class="storno" ~if="entryCard.storno">[СТОРНО]</span>
|
|
865
|
-
<span style="margin-left:auto;">Операция: <span class="cell link" style="display:inline;border:none;padding:0;" @tap="openEntryOperation()">{{entryCard.opTitle}}</span></span>
|
|
866
|
-
<button type="button" class="btn-action" @tap="openEntryOperation()">Открыть документ</button>
|
|
867
|
-
<button type="button" class="btn-action" @tap="closeEntry()">Закрыть</button>
|
|
868
|
-
</div>
|
|
869
|
-
<div class="entry-sides">
|
|
870
|
-
<div class="entry-side">
|
|
871
|
-
<div class="entry-side-title">ДЕБЕТ: <span class="cell link" style="display:inline;border:none;padding:0;" @tap="openEntrySideAccount('debit')">{{entryCard.debitLabel}}</span></div>
|
|
872
|
-
<div>Сумма Дт: <strong>{{money(entryCard.debitAmount)}}</strong> <span ~if="entryCard.debitQty">({{entryCard.debitQty}})</span></div>
|
|
873
|
-
<div ~for="entryCard.debitAnalytics">
|
|
874
|
-
<span>{{$for.item.label}}:</span> <strong>{{$for.item.title || '—'}}</strong>
|
|
875
|
-
</div>
|
|
876
|
-
</div>
|
|
877
|
-
<div class="entry-side">
|
|
878
|
-
<div class="entry-side-title">КРЕДИТ: <span class="cell link" style="display:inline;border:none;padding:0;" @tap="openEntrySideAccount('credit')">{{entryCard.creditLabel}}</span></div>
|
|
879
|
-
<div>Сумма Кт: <strong>{{money(entryCard.creditAmount)}}</strong> <span ~if="entryCard.creditQty">({{entryCard.creditQty}})</span></div>
|
|
880
|
-
<div ~for="entryCard.creditAnalytics">
|
|
881
|
-
<span>{{$for.item.label}}:</span> <strong>{{$for.item.title || '—'}}</strong>
|
|
882
|
-
</div>
|
|
883
|
-
</div>
|
|
884
|
-
</div>
|
|
885
|
-
</div>
|
|
886
|
-
`,
|
|
887
|
-
packetsKey: { $def: '*', $type: String, $save: true },
|
|
888
|
-
packetsStart: '',
|
|
889
|
-
packetsEnd: '',
|
|
890
|
-
packetDays: null,
|
|
891
|
-
_packetFiltered: false,
|
|
892
|
-
_initializingPackets: false,
|
|
893
|
-
_attachedDone: false,
|
|
894
|
-
_initialNav: null,
|
|
895
|
-
/** Режим экрана счёта: 'card' (Проводки) | 'analysis' (Экран 2: Анализ) | 'turnovers' (Экран 3: Обороты) */
|
|
896
|
-
mode: 'card',
|
|
897
|
-
/** Режим значений в Анализе счёта: 'amount' (Сумма) | 'qty' (Количество) */
|
|
898
|
-
valueMode: 'amount',
|
|
899
|
-
/** Группировка в Оборотах счёта (Экран 3) */
|
|
900
|
-
groupBy: 'quarter',
|
|
901
|
-
turnoverGroupOptions: TURNOVER_GROUPS,
|
|
902
|
-
selectedGroupKey: '',
|
|
903
|
-
groups: [],
|
|
904
|
-
/** Выбранные слоты/признаки для разворота в Анализе счёта */
|
|
905
|
-
activeSlots: [],
|
|
906
|
-
/** Аналитические признаки по полям прилинкованных справочников */
|
|
907
|
-
analyticFeatures: [],
|
|
908
|
-
selectedFeatureId: '',
|
|
909
|
-
/** Значения фильтра по полям прилинкованных справочников: { 'slotId.fieldId': val } */
|
|
910
|
-
featureValues: {},
|
|
911
|
-
/** Текстовые фильтры субаналитик: { слот: 'поле:значение' } */
|
|
912
|
-
subFilters: {},
|
|
913
|
-
analysisQuery: '',
|
|
914
|
-
slotQueries: {},
|
|
915
|
-
sheetRows: [],
|
|
916
|
-
sheetTotal: null,
|
|
917
|
-
selectedAnalysisRow: null,
|
|
918
|
-
/** Открытая сборная карточка проводки (Экран 4) */
|
|
919
|
-
entryCard: null,
|
|
920
|
-
from: '',
|
|
921
|
-
to: '',
|
|
922
|
-
/** отбор по аналитикам стороны счёта: { слот: id } */
|
|
923
|
-
filters: {},
|
|
924
|
-
/** слоты аналитик счёта: { id, label, catalog } — для фильтров и колонок */
|
|
925
|
-
slots: [],
|
|
926
|
-
/** видимые подразделения (db_scope): больше одного — фильтр */
|
|
927
|
-
units: [],
|
|
928
|
-
/** выбранное подразделение (с вложенными), пусто — все видимые */
|
|
929
|
-
unit: '',
|
|
930
|
-
items: [],
|
|
931
|
-
count: 0,
|
|
932
|
-
opening: { debit: 0, credit: 0 },
|
|
933
|
-
turnover: { debit: 0, credit: 0 },
|
|
934
|
-
closing: { debit: 0, credit: 0 },
|
|
935
|
-
names: { objects: {}, classes: {}, paths: {} },
|
|
936
|
-
error: '',
|
|
937
|
-
money,
|
|
938
|
-
get analysisSlots() {
|
|
939
|
-
return this.slots?.length ? this.slots : [{ id: '_default', label: 'Объект / Субсчёт' }];
|
|
940
|
-
},
|
|
941
|
-
get analysisGridCols() {
|
|
942
|
-
const n = this.analysisSlots.length;
|
|
943
|
-
const firstCols = Array(n).fill(n === 1 ? 'minmax(210px, 2.5fr)' : 'minmax(150px, 1.45fr)').join(' ');
|
|
944
|
-
return `${firstCols} repeat(6, minmax(90px, 1fr))`;
|
|
945
|
-
},
|
|
946
|
-
slotQueryOf(slotId) {
|
|
947
|
-
if (this.slotQueries && slotId in this.slotQueries)
|
|
948
|
-
return this.slotQueries[slotId] || '';
|
|
949
|
-
if (this.analysisSlots.length === 1)
|
|
950
|
-
return this.analysisQuery || '';
|
|
951
|
-
return '';
|
|
952
|
-
},
|
|
953
|
-
setSlotQuery(slotId, val) {
|
|
954
|
-
const v = String(val || '');
|
|
955
|
-
this.slotQueries = { ...(this.slotQueries || {}), [slotId]: v };
|
|
956
|
-
if (this.analysisSlots.length === 1)
|
|
957
|
-
this.analysisQuery = v;
|
|
958
|
-
},
|
|
959
|
-
get cardGridCols() {
|
|
960
|
-
const slotCols = (this.slots || []).map(() => 'minmax(105px, 1.15fr)').join(' ');
|
|
961
|
-
return `84px minmax(125px, 1.4fr) minmax(94px, 1fr) minmax(94px, 1fr) minmax(64px, 0.65fr) ${slotCols ? slotCols + ' ' : ''}minmax(125px, 1.3fr) minmax(105px, 1.1fr)`;
|
|
962
|
-
},
|
|
963
|
-
get openingText() {
|
|
964
|
-
return saldo((Number(this.opening?.debit) || 0) - (Number(this.opening?.credit) || 0));
|
|
965
|
-
},
|
|
966
|
-
get closingText() {
|
|
967
|
-
return saldo((Number(this.closing?.debit) || 0) - (Number(this.closing?.credit) || 0));
|
|
968
|
-
},
|
|
969
|
-
get netTurnoverText() {
|
|
970
|
-
return saldo((Number(this.turnover?.debit) || 0) - (Number(this.turnover?.credit) || 0));
|
|
971
|
-
},
|
|
972
|
-
get countText() {
|
|
973
|
-
const n = (this.items || []).length;
|
|
974
|
-
return n < this.count ? `${n} из ${this.count}` : '';
|
|
975
|
-
},
|
|
976
|
-
get entryCardDate() {
|
|
977
|
-
return this.entryCard?.time ? new Date(this.entryCard.time).toLocaleDateString('ru-RU') : '';
|
|
978
|
-
},
|
|
979
|
-
get entryCardOpTitle() {
|
|
980
|
-
return this.entryCard?.operation?.title || this.entryCard?.operation?.classLabel || '';
|
|
981
|
-
},
|
|
982
|
-
get entryCardDebitLabel() {
|
|
983
|
-
return this.entryCard?.debit?.label || this.entryCard?.debit?.account || '';
|
|
984
|
-
},
|
|
985
|
-
get entryCardCreditLabel() {
|
|
986
|
-
return this.entryCard?.credit?.label || this.entryCard?.credit?.account || '';
|
|
987
|
-
},
|
|
988
|
-
accountText(cid) {
|
|
989
|
-
const code = String(cid || '').split('/').pop().replace(/^acc\./, '');
|
|
990
|
-
const label = String(this.names?.classes?.[cid] || '').trim();
|
|
991
|
-
if (!label || label === code)
|
|
992
|
-
return code;
|
|
993
|
-
if (label.startsWith(code + ' ') || label.startsWith(code + '.') || /^\d+(?:\.\d+)?\s/.test(label))
|
|
994
|
-
return label;
|
|
995
|
-
return `${code} ${label}`;
|
|
996
|
-
},
|
|
997
|
-
/** Операция: её название, без названия (ядро отдаёт id) — класс операции. */
|
|
998
|
-
opText(i) {
|
|
999
|
-
const title = this.names?.objects?.[i.op_id];
|
|
1000
|
-
return (title && title !== i.op_id ? title : '') || this.names?.classes?.[i.op_cid] || i.op_id || '';
|
|
1001
|
-
},
|
|
1002
|
-
get displayRows() {
|
|
1003
|
-
return (this.items || []).map(i => ({
|
|
1004
|
-
entry: i.entry || i.id || null,
|
|
1005
|
-
date: i.time ? new Date(i.time).toLocaleDateString() : '',
|
|
1006
|
-
op: this.opText(i),
|
|
1007
|
-
op_id: i.op_id || '',
|
|
1008
|
-
op_cid: i.op_cid || '',
|
|
1009
|
-
debit: money(i.debit),
|
|
1010
|
-
credit: money(i.credit),
|
|
1011
|
-
qty: i.qty ? String(i.qty) : '',
|
|
1012
|
-
slots: (this.slots || []).map(s => {
|
|
1013
|
-
const id = i.analytics?.[s.id];
|
|
1014
|
-
return id ? this.names?.objects?.[id] || id : '';
|
|
1015
|
-
}),
|
|
1016
|
-
corr: this.accountText(i.corr),
|
|
1017
|
-
corr_cid: i.corr || '',
|
|
1018
|
-
bal: saldo(i.balance),
|
|
1019
|
-
storno: !!i.storno,
|
|
1020
|
-
}));
|
|
1021
|
-
},
|
|
1022
|
-
/** Сводные строки групп для левой таблицы Экрана 3 (Обороты счёта). */
|
|
1023
|
-
get turnoverGroups() {
|
|
1024
|
-
return (this.groups || []).map(g => ({
|
|
1025
|
-
key: g.key,
|
|
1026
|
-
label: g.label,
|
|
1027
|
-
debit: money(g.debit),
|
|
1028
|
-
credit: money(g.credit),
|
|
1029
|
-
balance: saldo(g.balance),
|
|
1030
|
-
turnover: saldo(g.turnover),
|
|
1031
|
-
count: g.count || 0,
|
|
1032
|
-
}));
|
|
1033
|
-
},
|
|
1034
|
-
/** Первичные документы выбранного периода для правой таблицы Экрана 3 (Обороты счёта). */
|
|
1035
|
-
get turnoverDocs() {
|
|
1036
|
-
const sel = this.selectedGroupKey;
|
|
1037
|
-
const list = (this.items || []).filter(i => !sel || !i.groupKey || i.groupKey === sel);
|
|
1038
|
-
return list.map(i => {
|
|
1039
|
-
const corrName = this.accountText(i.corr);
|
|
1040
|
-
const prefix = Number(i.debit) > 0 ? 'со сч. ' : 'на сч. ';
|
|
1041
|
-
return {
|
|
1042
|
-
entry: i.entry || i.id || null,
|
|
1043
|
-
date: i.time ? new Date(i.time).toLocaleDateString() : '',
|
|
1044
|
-
op: this.opText(i),
|
|
1045
|
-
op_id: i.op_id || '',
|
|
1046
|
-
op_cid: i.op_cid || '',
|
|
1047
|
-
corr: corrName,
|
|
1048
|
-
corrDir: corrName ? prefix + corrName : '',
|
|
1049
|
-
corr_cid: i.corr || '',
|
|
1050
|
-
debit: money(i.debit),
|
|
1051
|
-
credit: money(i.credit),
|
|
1052
|
-
rawDebit: Number(i.debit) || 0,
|
|
1053
|
-
rawCredit: Number(i.credit) || 0,
|
|
1054
|
-
storno: !!i.storno,
|
|
1055
|
-
};
|
|
1056
|
-
});
|
|
1057
|
-
},
|
|
1058
|
-
get turnoverDocsTotals() {
|
|
1059
|
-
let d = 0, c = 0;
|
|
1060
|
-
for (const doc of this.turnoverDocs || []) {
|
|
1061
|
-
d += doc.rawDebit || 0;
|
|
1062
|
-
c += doc.rawCredit || 0;
|
|
1063
|
-
}
|
|
1064
|
-
return { debit: money(d), credit: money(c) };
|
|
1065
|
-
},
|
|
1066
|
-
/** Форматирование ячеек Анализа счёта (Сумма или Количество). */
|
|
1067
|
-
analysisCells(r) {
|
|
1068
|
-
if (this.valueMode === 'qty') {
|
|
1069
|
-
const q = r?.qty || {};
|
|
1070
|
-
const openNet = Number(q.opening) || 0;
|
|
1071
|
-
const closeNet = Number(q.closing) || 0;
|
|
1072
|
-
return {
|
|
1073
|
-
open_debit: openNet > 0 ? qtyFmt(openNet) : '',
|
|
1074
|
-
open_credit: openNet < 0 ? qtyFmt(-openNet) : '',
|
|
1075
|
-
debit: qtyFmt(q.debit),
|
|
1076
|
-
credit: qtyFmt(q.credit),
|
|
1077
|
-
close_debit: closeNet > 0 ? qtyFmt(closeNet) : '',
|
|
1078
|
-
close_credit: closeNet < 0 ? qtyFmt(-closeNet) : '',
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
return {
|
|
1082
|
-
open_debit: money(r?.opening?.debit), open_credit: money(r?.opening?.credit),
|
|
1083
|
-
debit: money(r?.turnover?.debit), credit: money(r?.turnover?.credit),
|
|
1084
|
-
close_debit: money(r?.closing?.debit), close_credit: money(r?.closing?.credit),
|
|
1085
|
-
};
|
|
1086
|
-
},
|
|
1087
|
-
/** Строки таблицы Экрана 2 (Анализ счёта) с колонками по каждому аналитическому справочнику. */
|
|
1088
|
-
get analysisRows() {
|
|
1089
|
-
const q = String(this.analysisQuery || '').trim().toLowerCase();
|
|
1090
|
-
const sq = this.slotQueries || {};
|
|
1091
|
-
const aSlots = this.analysisSlots;
|
|
1092
|
-
const rawList = this.sheetRows || [];
|
|
1093
|
-
const hasDetailRows = rawList.some(r => r?.key);
|
|
1094
|
-
const filteredRaw = hasDetailRows ? rawList.filter(r => r?.key) : rawList;
|
|
1095
|
-
const rows = filteredRaw.map(r => {
|
|
1096
|
-
const slotCells = aSlots.map(s => {
|
|
1097
|
-
if (r.key && typeof r.key === 'object') {
|
|
1098
|
-
const id = s.id in r.key ? r.key[s.id] : Object.values(r.key)[0];
|
|
1099
|
-
return id === null || id === undefined ? '—' : (this.names?.objects?.[id] || String(id));
|
|
1100
|
-
}
|
|
1101
|
-
return this.accountText(r.account);
|
|
1102
|
-
});
|
|
1103
|
-
const label = r.key
|
|
1104
|
-
? slotCells.join(' / ')
|
|
1105
|
-
: this.accountText(r.account);
|
|
1106
|
-
return {
|
|
1107
|
-
account: r.account,
|
|
1108
|
-
key: r.key || null,
|
|
1109
|
-
detail: !!r.key,
|
|
1110
|
-
slotCells,
|
|
1111
|
-
label,
|
|
1112
|
-
indent: (Number(r.level) || 0) * 16,
|
|
1113
|
-
...this.analysisCells(r),
|
|
1114
|
-
};
|
|
1115
|
-
});
|
|
1116
|
-
return rows.filter(r => {
|
|
1117
|
-
if (q && !r.label.toLowerCase().includes(q))
|
|
1118
|
-
return false;
|
|
1119
|
-
for (let i = 0; i < aSlots.length; i++) {
|
|
1120
|
-
const slotQ = String(sq[aSlots[i].id] || '').trim().toLowerCase();
|
|
1121
|
-
if (slotQ && !String(r.slotCells[i] || '').toLowerCase().includes(slotQ))
|
|
1122
|
-
return false;
|
|
1123
|
-
}
|
|
1124
|
-
return true;
|
|
1125
|
-
});
|
|
1126
|
-
},
|
|
1127
|
-
get analysisTotals() {
|
|
1128
|
-
return this.analysisCells(this.sheetTotal);
|
|
1129
|
-
},
|
|
1130
|
-
featureLabel(feat) {
|
|
1131
|
-
if (!feat)
|
|
1132
|
-
return '';
|
|
1133
|
-
if ((this.slots || []).length > 1 && feat.slotLabel)
|
|
1134
|
-
return `${feat.slotLabel}: ${feat.label || feat.id}`;
|
|
1135
|
-
return feat.label || feat.id;
|
|
1136
|
-
},
|
|
1137
|
-
featureValueOf(feat) {
|
|
1138
|
-
if (!feat)
|
|
1139
|
-
return '';
|
|
1140
|
-
if (feat.isObject)
|
|
1141
|
-
return String(this.filters?.[feat.slotId] || '');
|
|
1142
|
-
return String(this.featureValues?.[feat.id] || '');
|
|
1143
|
-
},
|
|
1144
|
-
featureValueLabel(feat) {
|
|
1145
|
-
const val = this.featureValueOf(feat);
|
|
1146
|
-
if (!val)
|
|
1147
|
-
return 'Все';
|
|
1148
|
-
const opt = (feat?.options || []).find(o => o.value === val);
|
|
1149
|
-
return opt?.label || val;
|
|
1150
|
-
},
|
|
1151
|
-
async setFeatureValue(feat, value) {
|
|
1152
|
-
if (!feat)
|
|
1153
|
-
return;
|
|
1154
|
-
const val = String(value || '');
|
|
1155
|
-
if (feat.isObject) {
|
|
1156
|
-
this.filters = { ...(this.filters || {}), [feat.slotId]: val };
|
|
1157
|
-
await this.onFilterChanged();
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1160
|
-
this.featureValues = { ...(this.featureValues || {}), [feat.id]: val };
|
|
1161
|
-
if (val && !(this.activeSlots || []).includes(feat.spec) && !(this.activeSlots || []).includes(feat.slotId)) {
|
|
1162
|
-
this.activeSlots = [...(this.activeSlots || []), feat.spec];
|
|
1163
|
-
}
|
|
1164
|
-
await this.reload();
|
|
1165
|
-
},
|
|
1166
|
-
async moveFeature(delta) {
|
|
1167
|
-
const list = [...(this.analyticFeatures || [])];
|
|
1168
|
-
const idx = list.findIndex(f => f.id === this.selectedFeatureId);
|
|
1169
|
-
if (idx < 0)
|
|
1170
|
-
return;
|
|
1171
|
-
const target = idx + delta;
|
|
1172
|
-
if (target < 0 || target >= list.length)
|
|
1173
|
-
return;
|
|
1174
|
-
const [moved] = list.splice(idx, 1);
|
|
1175
|
-
list.splice(target, 0, moved);
|
|
1176
|
-
this.analyticFeatures = list;
|
|
1177
|
-
const order = list.map(f => f.spec);
|
|
1178
|
-
this.activeSlots = (this.activeSlots || []).slice().sort((a, b) => {
|
|
1179
|
-
const ia = order.indexOf(a), ib = order.indexOf(b);
|
|
1180
|
-
return (ia < 0 ? 999 : ia) - (ib < 0 ? 999 : ib);
|
|
1181
|
-
});
|
|
1182
|
-
if (this.mode === 'analysis')
|
|
1183
|
-
await this.reload();
|
|
1184
|
-
},
|
|
1185
|
-
isSlotActive(slotId) {
|
|
1186
|
-
return (this.activeSlots || []).includes(slotId);
|
|
1187
|
-
},
|
|
1188
|
-
async toggleSlot(slotId, checked) {
|
|
1189
|
-
const cur = new Set(this.activeSlots || []);
|
|
1190
|
-
if (checked)
|
|
1191
|
-
cur.add(slotId);
|
|
1192
|
-
else
|
|
1193
|
-
cur.delete(slotId);
|
|
1194
|
-
const order = (this.analyticFeatures || []).map(f => f.spec);
|
|
1195
|
-
this.activeSlots = [...cur].sort((a, b) => {
|
|
1196
|
-
const ia = order.indexOf(a), ib = order.indexOf(b);
|
|
1197
|
-
if (ia < 0 && ib < 0)
|
|
1198
|
-
return 0;
|
|
1199
|
-
return (ia < 0 ? 999 : ia) - (ib < 0 ? 999 : ib);
|
|
1200
|
-
});
|
|
1201
|
-
if (this.mode === 'analysis')
|
|
1202
|
-
await this.reload();
|
|
1203
|
-
},
|
|
1204
|
-
async moveSlot(index, delta) {
|
|
1205
|
-
const list = [...(this.slots || [])];
|
|
1206
|
-
const target = index + delta;
|
|
1207
|
-
if (index < 0 || index >= list.length || target < 0 || target >= list.length)
|
|
1208
|
-
return;
|
|
1209
|
-
const [moved] = list.splice(index, 1);
|
|
1210
|
-
list.splice(target, 0, moved);
|
|
1211
|
-
this.slots = list;
|
|
1212
|
-
const order = list.map(s => s.id);
|
|
1213
|
-
this.activeSlots = (this.activeSlots || []).slice().sort((a, b) => order.indexOf(a) - order.indexOf(b));
|
|
1214
|
-
if (this.analyticFeatures?.length) {
|
|
1215
|
-
this.analyticFeatures = [...this.analyticFeatures].sort((a, b) => order.indexOf(a.slotId) - order.indexOf(b.slotId));
|
|
1216
|
-
}
|
|
1217
|
-
if (this.mode === 'analysis')
|
|
1218
|
-
await this.reload();
|
|
1219
|
-
},
|
|
1220
|
-
async setUnit(val) {
|
|
1221
|
-
this.unit = String(val || '');
|
|
1222
|
-
await this.reload();
|
|
1223
|
-
},
|
|
1224
|
-
async onFilterChanged() {
|
|
1225
|
-
const sig = JSON.stringify(this.analytics());
|
|
1226
|
-
if (this._lastFilterSig === sig)
|
|
1227
|
-
return;
|
|
1228
|
-
this._lastFilterSig = sig;
|
|
1229
|
-
await this.reload();
|
|
1230
|
-
},
|
|
1231
|
-
async setSubFilter(slotId, value) {
|
|
1232
|
-
this.subFilters = { ...(this.subFilters || {}), [slotId]: String(value || '') };
|
|
1233
|
-
await this.reload();
|
|
1234
|
-
},
|
|
1235
|
-
setValueMode(vm) {
|
|
1236
|
-
this.valueMode = vm === 'qty' ? 'qty' : 'amount';
|
|
1237
|
-
},
|
|
1238
|
-
async setMode(m) {
|
|
1239
|
-
const next = ['card', 'analysis', 'turnovers'].includes(m) ? m : 'card';
|
|
1240
|
-
if (this.mode === next)
|
|
1241
|
-
return;
|
|
1242
|
-
this.mode = next;
|
|
1243
|
-
await this.reload();
|
|
1244
|
-
this.async?.(() => this.render?.());
|
|
1245
|
-
},
|
|
1246
|
-
async setGroupBy(g) {
|
|
1247
|
-
this.groupBy = g || 'quarter';
|
|
1248
|
-
this.selectedGroupKey = '';
|
|
1249
|
-
await this.reload();
|
|
1250
|
-
},
|
|
1251
|
-
_notifyConsultantContext() {
|
|
1252
|
-
try {
|
|
1253
|
-
const wf = this._findFormHost?.() || this.domHost;
|
|
1254
|
-
if (!wf || typeof wf.buildConsultantContext !== 'function')
|
|
1255
|
-
return;
|
|
1256
|
-
const exp = window.top?.explorer || window.parent?.explorer;
|
|
1257
|
-
const cons = exp?.$?.('#consultant') || exp?.$?.('item-consultant');
|
|
1258
|
-
if (cons) {
|
|
1259
|
-
const ctx = wf.buildConsultantContext();
|
|
1260
|
-
cons.activeFormContext = ctx;
|
|
1261
|
-
cons.activeFormSummary = ctx;
|
|
1262
|
-
}
|
|
1263
|
-
}
|
|
1264
|
-
catch { /* ignore */ }
|
|
1265
|
-
},
|
|
1266
|
-
selectGroup(key) {
|
|
1267
|
-
this.selectedGroupKey = this.selectedGroupKey === key ? '' : key;
|
|
1268
|
-
this._notifyConsultantContext();
|
|
1269
|
-
},
|
|
1270
|
-
async openTurnoversFromAnalysis(row) {
|
|
1271
|
-
const r = row || this.selectedAnalysisRow;
|
|
1272
|
-
if (r?.key && typeof r.key === 'object') {
|
|
1273
|
-
const next = { ...(this.filters || {}) };
|
|
1274
|
-
for (const [k, v] of Object.entries(r.key)) {
|
|
1275
|
-
if (v)
|
|
1276
|
-
next[k] = v;
|
|
1277
|
-
}
|
|
1278
|
-
this.filters = next;
|
|
1279
|
-
}
|
|
1280
|
-
const host = this.domHost || this.parentElement;
|
|
1281
|
-
if (host && typeof host.applyNav === 'function' && host.view?.id && host.view.id !== 'turnovers') {
|
|
1282
|
-
await host.applyNav({
|
|
1283
|
-
view: 'turnovers',
|
|
1284
|
-
mode: 'turnovers',
|
|
1285
|
-
from: this.from,
|
|
1286
|
-
to: this.to,
|
|
1287
|
-
packetsKey: this.packetsKey,
|
|
1288
|
-
unit: this.unit,
|
|
1289
|
-
filters: this.filters,
|
|
1290
|
-
});
|
|
1291
|
-
return;
|
|
1292
|
-
}
|
|
1293
|
-
this.mode = 'turnovers';
|
|
1294
|
-
await this.reload();
|
|
1295
|
-
},
|
|
1296
|
-
/** Открыть сборную карточку проводки (Экран 4 ODANT) по номеру entry. */
|
|
1297
|
-
async openEntry(entryId) {
|
|
1298
|
-
if (!entryId || !this.$item)
|
|
1299
|
-
return null;
|
|
1300
|
-
this.error = '';
|
|
1301
|
-
try {
|
|
1302
|
-
const card = await this.$item.fetch('db_entry', { entry: entryId });
|
|
1303
|
-
if (card && typeof card === 'object') {
|
|
1304
|
-
const t = card.operation?.title;
|
|
1305
|
-
card.opTitle = (t && t !== card.operation?.id ? t : '') || card.operation?.label || card.operation?.classLabel || t || '';
|
|
1306
|
-
card.debitLabel = card.debit?.label || card.debit?.account || '';
|
|
1307
|
-
card.debitAmount = card.debit?.amount ?? card.amount ?? 0;
|
|
1308
|
-
card.debitQty = card.debit?.qty ?? card.qty ?? 0;
|
|
1309
|
-
card.debitAnalytics = card.debit?.analytics || [];
|
|
1310
|
-
card.creditLabel = card.credit?.label || card.credit?.account || '';
|
|
1311
|
-
card.creditAmount = card.credit?.amount ?? card.amount ?? 0;
|
|
1312
|
-
card.creditQty = card.credit?.qty ?? card.qty ?? 0;
|
|
1313
|
-
card.creditAnalytics = card.credit?.analytics || [];
|
|
1314
|
-
}
|
|
1315
|
-
this.entryCard = card;
|
|
1316
|
-
return this.entryCard;
|
|
1317
|
-
}
|
|
1318
|
-
catch (e) {
|
|
1319
|
-
this.error = String(e?.message || e);
|
|
1320
|
-
return null;
|
|
1321
|
-
}
|
|
1322
|
-
},
|
|
1323
|
-
closeEntry() {
|
|
1324
|
-
this.entryCard = null;
|
|
1325
|
-
},
|
|
1326
|
-
openEntryOperation() {
|
|
1327
|
-
if (!this.entryCard?.operation)
|
|
1328
|
-
return;
|
|
1329
|
-
return this.openOperation({
|
|
1330
|
-
op_cid: this.entryCard.operation.path || this.entryCard.operation.cid,
|
|
1331
|
-
op_id: this.entryCard.operation.id,
|
|
1332
|
-
});
|
|
1333
|
-
},
|
|
1334
|
-
openEntrySideAccount(side) {
|
|
1335
|
-
const s = side === 'credit' ? this.entryCard?.credit : this.entryCard?.debit;
|
|
1336
|
-
if (!s?.path && !s?.account)
|
|
1337
|
-
return;
|
|
1338
|
-
return this.openCorr({ corr_cid: s.path || s.account });
|
|
1339
|
-
},
|
|
1340
|
-
_findFormHost() {
|
|
1341
|
-
if (this.$form && ('focusedItem' in this.$form || typeof this.$form.syncFromView === 'function' || typeof this.$form.setFormPeriod === 'function'))
|
|
1342
|
-
return this.$form;
|
|
1343
|
-
for (let p = this.parentElement || this.domHost; p; p = p.parentElement || p.domHost) {
|
|
1344
|
-
if (p.localName === 'work-form' || typeof p.syncFromView === 'function' || typeof p.setFormPeriod === 'function' || 'focusedItem' in p)
|
|
1345
|
-
return p;
|
|
1346
|
-
}
|
|
1347
|
-
return null;
|
|
1348
|
-
},
|
|
1349
|
-
async onPackets(e) {
|
|
1350
|
-
const d = e?.detail?.value ?? e?.detail ?? {};
|
|
1351
|
-
if (Array.isArray(d))
|
|
1352
|
-
return;
|
|
1353
|
-
if (this._initializingPackets)
|
|
1354
|
-
return;
|
|
1355
|
-
const nextKey = d.value || (d.selected?.name === '*' ? '*' : (d.selected?.mask || this.packetsKey || '*'));
|
|
1356
|
-
if (d.selected?.name === '*') {
|
|
1357
|
-
this.packetsKey = '*';
|
|
1358
|
-
_writeSavedPeriod('*', '', '');
|
|
1359
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: '*', from: '', to: '' });
|
|
1360
|
-
if (this._packetFiltered || this.from || this.to) {
|
|
1361
|
-
this._packetFiltered = false;
|
|
1362
|
-
this.from = '';
|
|
1363
|
-
this.to = '';
|
|
1364
|
-
await this.reload();
|
|
1365
|
-
}
|
|
1366
|
-
return;
|
|
1367
|
-
}
|
|
1368
|
-
if (d.period?.start && d.period?.end) {
|
|
1369
|
-
const changed = this.from !== d.period.start || this.to !== d.period.end || !this._packetFiltered;
|
|
1370
|
-
this._packetFiltered = true;
|
|
1371
|
-
this.from = d.period.start;
|
|
1372
|
-
this.to = d.period.end;
|
|
1373
|
-
this.packetsKey = _derivePacketsKey(this.from, this.to, nextKey);
|
|
1374
|
-
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
1375
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
1376
|
-
if (changed)
|
|
1377
|
-
await this.reload();
|
|
1378
|
-
}
|
|
1379
|
-
},
|
|
1380
|
-
_restorePeriodState(nav = null) {
|
|
1381
|
-
const hasNavPeriod = nav && (nav.from !== undefined || nav.to !== undefined || nav.packetsKey);
|
|
1382
|
-
if (!hasNavPeriod && (this.from || this.to))
|
|
1383
|
-
return;
|
|
1384
|
-
const formPeriod = this._findFormHost()?.formPeriod || null;
|
|
1385
|
-
const saved = _readSavedPeriod();
|
|
1386
|
-
const localSavedKey = typeof this.loadFromLocalStorage === 'function' ? this.loadFromLocalStorage('packetsKey') : undefined;
|
|
1387
|
-
if (!hasNavPeriod && !formPeriod && !saved && typeof localSavedKey === 'string' && localSavedKey && (typeof this.packetsKey !== 'string' || this.packetsKey === '*'))
|
|
1388
|
-
this.packetsKey = localSavedKey;
|
|
1389
|
-
const pk = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
1390
|
-
const src = hasNavPeriod ? nav : (formPeriod || saved || (pk && pk !== '*' ? { packetsKey: pk } : null));
|
|
1391
|
-
if (!src)
|
|
1392
|
-
return;
|
|
1393
|
-
this._initializingPackets = true;
|
|
1394
|
-
try {
|
|
1395
|
-
const rawKey = typeof src.packetsKey === 'string' && src.packetsKey ? src.packetsKey : (pk || '*');
|
|
1396
|
-
let from = String(src.from || '');
|
|
1397
|
-
let to = String(src.to || '');
|
|
1398
|
-
if (!from && !to && rawKey !== '*') {
|
|
1399
|
-
const derived = _boundsFromPacketsKey(rawKey, 'month');
|
|
1400
|
-
if (derived.from && derived.to) {
|
|
1401
|
-
from = derived.from;
|
|
1402
|
-
to = derived.to;
|
|
1403
|
-
}
|
|
1404
|
-
}
|
|
1405
|
-
const key = _derivePacketsKey(from, to, rawKey);
|
|
1406
|
-
this.from = from;
|
|
1407
|
-
this.to = to;
|
|
1408
|
-
this._packetFiltered = !!(from || to);
|
|
1409
|
-
this.packetsKey = key;
|
|
1410
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
1411
|
-
}
|
|
1412
|
-
finally {
|
|
1413
|
-
this._initializingPackets = false;
|
|
1414
|
-
}
|
|
1415
|
-
},
|
|
1416
|
-
async syncFormPeriod(fp) {
|
|
1417
|
-
if (!fp || typeof fp !== 'object')
|
|
1418
|
-
return;
|
|
1419
|
-
const nextFrom = String(fp.from || '');
|
|
1420
|
-
const nextTo = String(fp.to || '');
|
|
1421
|
-
const nextKey = String(fp.packetsKey || '*');
|
|
1422
|
-
if (this.from === nextFrom && this.to === nextTo && this.packetsKey === nextKey)
|
|
1423
|
-
return;
|
|
1424
|
-
this._restorePeriodState(fp);
|
|
1425
|
-
await this.reload();
|
|
1426
|
-
},
|
|
1427
|
-
_applyNavFields(nav) {
|
|
1428
|
-
if (!nav || typeof nav !== 'object')
|
|
1429
|
-
return;
|
|
1430
|
-
if (nav.mode && ['card', 'analysis', 'turnovers'].includes(nav.mode))
|
|
1431
|
-
this.mode = nav.mode;
|
|
1432
|
-
else if (nav.view === 'turnovers' || nav.view === 'analysis')
|
|
1433
|
-
this.mode = nav.view;
|
|
1434
|
-
else if (nav.view === 'postings')
|
|
1435
|
-
this.mode = 'card';
|
|
1436
|
-
if (nav.groupBy)
|
|
1437
|
-
this.groupBy = String(nav.groupBy);
|
|
1438
|
-
this._restorePeriodState(nav);
|
|
1439
|
-
if (nav.unit !== undefined)
|
|
1440
|
-
this.unit = String(nav.unit || '');
|
|
1441
|
-
if (nav.filters && typeof nav.filters === 'object')
|
|
1442
|
-
this.filters = { ...nav.filters };
|
|
1443
|
-
_writeSavedPeriod(this.packetsKey, this.from, this.to);
|
|
1444
|
-
this._findFormHost()?.setFormPeriod?.({ packetsKey: this.packetsKey, from: this.from, to: this.to });
|
|
1445
|
-
},
|
|
1446
|
-
async attached() {
|
|
1447
|
-
if (this._attachedDone && !this._initialNav)
|
|
1448
|
-
return;
|
|
1449
|
-
const initNav = this._initialNav;
|
|
1450
|
-
this._initialNav = null;
|
|
1451
|
-
if (initNav)
|
|
1452
|
-
this._applyNavFields(initNav);
|
|
1453
|
-
else
|
|
1454
|
-
this._restorePeriodState();
|
|
1455
|
-
await Promise.all([this.loadSlots(), this.loadScope()]);
|
|
1456
|
-
await this.reload();
|
|
1457
|
-
if (initNav?.entry)
|
|
1458
|
-
await this.openEntry(initNav.entry);
|
|
1459
|
-
this._attachedDone = true;
|
|
1460
|
-
},
|
|
1461
|
-
async applyNav(nav) {
|
|
1462
|
-
if (!nav || typeof nav !== 'object')
|
|
1463
|
-
return;
|
|
1464
|
-
this._applyNavFields(nav);
|
|
1465
|
-
await this.reload();
|
|
1466
|
-
if (nav.entry)
|
|
1467
|
-
await this.openEntry(nav.entry);
|
|
1468
|
-
},
|
|
1469
|
-
async openOperation(row) {
|
|
1470
|
-
const path = this.names?.paths?.[row?.op_cid] || row?.op_cid;
|
|
1471
|
-
if (!path)
|
|
1472
|
-
return;
|
|
1473
|
-
try {
|
|
1474
|
-
const t = await WORK.get_item(path);
|
|
1475
|
-
if (t && window.execute)
|
|
1476
|
-
window.execute(t, { view: 'objects', id: row.op_id });
|
|
1477
|
-
}
|
|
1478
|
-
catch (e) {
|
|
1479
|
-
this.error = String(e?.message || e);
|
|
1480
|
-
}
|
|
1481
|
-
},
|
|
1482
|
-
async openCorr(row) {
|
|
1483
|
-
const path = this.names?.paths?.[row?.corr_cid] || row?.corr_cid;
|
|
1484
|
-
if (!path)
|
|
1485
|
-
return;
|
|
1486
|
-
try {
|
|
1487
|
-
const t = await WORK.get_item(path);
|
|
1488
|
-
if (t && window.execute)
|
|
1489
|
-
window.execute(t, { view: 'postings', from: this.from, to: this.to, unit: this.unit });
|
|
1490
|
-
}
|
|
1491
|
-
catch (e) {
|
|
1492
|
-
this.error = String(e?.message || e);
|
|
1493
|
-
}
|
|
1494
|
-
},
|
|
1495
|
-
/** Видимые подразделения для фильтра; без ответа — без фильтра. */
|
|
1496
|
-
async loadScope() {
|
|
1497
|
-
try {
|
|
1498
|
-
const s = await this.$item?.fetch('db_scope');
|
|
1499
|
-
this.units = Array.isArray(s?.units) && !s.all ? s.units : [];
|
|
1500
|
-
}
|
|
1501
|
-
catch {
|
|
1502
|
-
this.units = [];
|
|
1503
|
-
}
|
|
1504
|
-
},
|
|
1505
|
-
/** Слоты аналитик счёта из схемы ядра (с учётом наследования) и поля прилинкованных справочников. */
|
|
1506
|
-
loadSlots() {
|
|
1507
|
-
const p = (async () => {
|
|
1508
|
-
try {
|
|
1509
|
-
const res = await this.$item?.fetch('db_schema');
|
|
1510
|
-
const s = res?.schema;
|
|
1511
|
-
const fields = Array.isArray(s?.fields) ? s.fields : [];
|
|
1512
|
-
this.slots = fields.filter(f => f?.analytic && f.type === 'link')
|
|
1513
|
-
.map(f => ({ id: f.id, label: f.label || f.id, type: 'Link', catalog: f.targetPath || f.target, placeholder: f.label || f.id }));
|
|
1514
|
-
this.activeSlots = this.slots.map(f => f.id);
|
|
1515
|
-
const serverSlots = Array.isArray(res?.slots) ? res.slots : [];
|
|
1516
|
-
const features = [];
|
|
1517
|
-
for (const slot of this.slots) {
|
|
1518
|
-
const srv = serverSlots.find(x => x.id === slot.id);
|
|
1519
|
-
if (Array.isArray(srv?.fields) && srv.fields.length) {
|
|
1520
|
-
features.push(...srv.fields);
|
|
1521
|
-
}
|
|
1522
|
-
else {
|
|
1523
|
-
features.push({
|
|
1524
|
-
id: slot.id,
|
|
1525
|
-
spec: slot.id,
|
|
1526
|
-
slotId: slot.id,
|
|
1527
|
-
fieldId: 'name',
|
|
1528
|
-
label: 'Наименование',
|
|
1529
|
-
slotLabel: slot.label,
|
|
1530
|
-
isObject: true,
|
|
1531
|
-
type: 'link',
|
|
1532
|
-
catalog: slot.catalog,
|
|
1533
|
-
options: [],
|
|
1534
|
-
});
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
this.analyticFeatures = features;
|
|
1538
|
-
this.selectedFeatureId = features[0]?.id || '';
|
|
1539
|
-
}
|
|
1540
|
-
catch (e) {
|
|
1541
|
-
this.slots = [];
|
|
1542
|
-
this.activeSlots = [];
|
|
1543
|
-
this.analyticFeatures = [];
|
|
1544
|
-
this.selectedFeatureId = '';
|
|
1545
|
-
this.error = String(e?.message || e);
|
|
1546
|
-
}
|
|
1547
|
-
finally {
|
|
1548
|
-
if (this._slotsPromise === p)
|
|
1549
|
-
this._slotsPromise = null;
|
|
1550
|
-
}
|
|
1551
|
-
})();
|
|
1552
|
-
this._slotsPromise = p;
|
|
1553
|
-
return p;
|
|
1554
|
-
},
|
|
1555
|
-
/** Заданные фильтры аналитик. */
|
|
1556
|
-
analytics() {
|
|
1557
|
-
const out = {};
|
|
1558
|
-
for (const [k, v] of Object.entries(this.filters || {})) {
|
|
1559
|
-
if (v)
|
|
1560
|
-
out[k] = v;
|
|
1561
|
-
}
|
|
1562
|
-
return out;
|
|
1563
|
-
},
|
|
1564
|
-
/** Заданные фильтры субаналитик. */
|
|
1565
|
-
subanalytics() {
|
|
1566
|
-
const out = {};
|
|
1567
|
-
for (const [slotId, raw] of Object.entries(this.subFilters || {})) {
|
|
1568
|
-
const parsed = parseSubFilterInput(raw);
|
|
1569
|
-
if (parsed)
|
|
1570
|
-
out[slotId] = { ...(out[slotId] || {}), ...parsed };
|
|
1571
|
-
}
|
|
1572
|
-
for (const feat of this.analyticFeatures || []) {
|
|
1573
|
-
if (feat.isObject)
|
|
1574
|
-
continue;
|
|
1575
|
-
const val = this.featureValues?.[feat.id];
|
|
1576
|
-
if (val !== undefined && val !== null && val !== '') {
|
|
1577
|
-
if (!out[feat.slotId])
|
|
1578
|
-
out[feat.slotId] = {};
|
|
1579
|
-
out[feat.slotId][feat.fieldId] = feat.type === 'boolean' ? (val === '1' || val === 'true' ? 1 : 0) : val;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
return out;
|
|
1583
|
-
},
|
|
1584
|
-
params() {
|
|
1585
|
-
const p = { limit: 500 };
|
|
1586
|
-
for (const key of ['from', 'to', 'unit']) {
|
|
1587
|
-
const s = String(this[key] ?? '').trim();
|
|
1588
|
-
if (s)
|
|
1589
|
-
p[key] = s;
|
|
1590
|
-
}
|
|
1591
|
-
const a = this.analytics();
|
|
1592
|
-
if (Object.keys(a).length)
|
|
1593
|
-
p.analytics = JSON.stringify(a);
|
|
1594
|
-
const sub = this.subanalytics();
|
|
1595
|
-
if (Object.keys(sub).length)
|
|
1596
|
-
p.subanalytics = JSON.stringify(sub);
|
|
1597
|
-
return p;
|
|
1598
|
-
},
|
|
1599
|
-
_syncPacketRange(res) {
|
|
1600
|
-
if (!res)
|
|
1601
|
-
return false;
|
|
1602
|
-
if (!('range' in res)) {
|
|
1603
|
-
if (!this.packetsStart) {
|
|
1604
|
-
this.packetsStart = _yearStart();
|
|
1605
|
-
this.packetsEnd = _yearEnd();
|
|
1606
|
-
}
|
|
1607
|
-
return false;
|
|
1608
|
-
}
|
|
1609
|
-
const r = res.range;
|
|
1610
|
-
if (!r || !r.start || !r.end) {
|
|
1611
|
-
this.packetsStart = '';
|
|
1612
|
-
this.packetsEnd = '';
|
|
1613
|
-
this.packetDays = null;
|
|
1614
|
-
return false;
|
|
1615
|
-
}
|
|
1616
|
-
this.packetsStart = r.start;
|
|
1617
|
-
this.packetsEnd = r.end;
|
|
1618
|
-
this.packetDays = Array.isArray(r.days) && r.days.length ? r.days : null;
|
|
1619
|
-
const keyStr = typeof this.packetsKey === 'string' ? this.packetsKey : '';
|
|
1620
|
-
const isNowKey = keyStr === 'now' || keyStr.startsWith('now:');
|
|
1621
|
-
if (this._packetFiltered && !isNowKey && this.to && this.to < r.start) {
|
|
1622
|
-
this._initializingPackets = true;
|
|
1623
|
-
try {
|
|
1624
|
-
this._packetFiltered = false;
|
|
1625
|
-
this.from = '';
|
|
1626
|
-
this.to = '';
|
|
1627
|
-
this.packetsKey = '*';
|
|
1628
|
-
_writeSavedPeriod('*', '', '');
|
|
1629
|
-
}
|
|
1630
|
-
finally {
|
|
1631
|
-
this._initializingPackets = false;
|
|
1632
|
-
}
|
|
1633
|
-
return true;
|
|
1634
|
-
}
|
|
1635
|
-
return false;
|
|
1636
|
-
},
|
|
1637
|
-
async reload() {
|
|
1638
|
-
this.error = '';
|
|
1639
|
-
if (!this.$item) {
|
|
1640
|
-
this.items = [];
|
|
1641
|
-
this.groups = [];
|
|
1642
|
-
this.sheetRows = [];
|
|
1643
|
-
this.sheetTotal = null;
|
|
1644
|
-
this.count = 0;
|
|
1645
|
-
this.opening = this.turnover = this.closing = { debit: 0, credit: 0 };
|
|
1646
|
-
return;
|
|
1647
|
-
}
|
|
1648
|
-
this._lastFilterSig = JSON.stringify(this.analytics());
|
|
1649
|
-
try {
|
|
1650
|
-
if (this._slotsPromise)
|
|
1651
|
-
await this._slotsPromise;
|
|
1652
|
-
if (this.mode === 'analysis') {
|
|
1653
|
-
const p = this.params();
|
|
1654
|
-
delete p.limit;
|
|
1655
|
-
const by = (this.activeSlots?.length ? this.activeSlots : (this.slots || []).map(s => s.id)).filter(Boolean);
|
|
1656
|
-
if (by.length)
|
|
1657
|
-
p.by = JSON.stringify(by);
|
|
1658
|
-
const res = await this.$item.fetch('db_sheet', p);
|
|
1659
|
-
if (this._syncPacketRange(res))
|
|
1660
|
-
return await this.reload();
|
|
1661
|
-
this.names = { objects: {}, classes: {}, paths: {}, ...(res?.names || {}) };
|
|
1662
|
-
this.sheetRows = Array.isArray(res?.rows) ? res.rows : [];
|
|
1663
|
-
this.sheetTotal = res?.total || null;
|
|
1664
|
-
this.selectedAnalysisRow = this.analysisRows.find(r => r.detail) || this.analysisRows[0] || null;
|
|
1665
|
-
return;
|
|
1666
|
-
}
|
|
1667
|
-
if (this.mode === 'turnovers') {
|
|
1668
|
-
const p = { ...this.params(), groupBy: this.groupBy || 'quarter' };
|
|
1669
|
-
const res = await this.$item.fetch('db_turnovers', p);
|
|
1670
|
-
if (this._syncPacketRange(res))
|
|
1671
|
-
return await this.reload();
|
|
1672
|
-
this.names = { objects: {}, classes: {}, paths: {}, ...(res?.names || {}) };
|
|
1673
|
-
this.groups = Array.isArray(res?.groups) ? res.groups : [];
|
|
1674
|
-
this.items = Array.isArray(res?.items) ? res.items : [];
|
|
1675
|
-
this.count = Number(res?.total) || this.items.length;
|
|
1676
|
-
this.opening = res?.opening || { debit: 0, credit: 0 };
|
|
1677
|
-
this.closing = res?.closing || { debit: 0, credit: 0 };
|
|
1678
|
-
this.turnover = { debit: res?.closing?.debit ?? 0, credit: res?.closing?.credit ?? 0 };
|
|
1679
|
-
if (!this.selectedGroupKey && this.groups.length)
|
|
1680
|
-
this.selectedGroupKey = this.groups[0].key;
|
|
1681
|
-
return;
|
|
1682
|
-
}
|
|
1683
|
-
const res = await this.$item.fetch('db_card', this.params());
|
|
1684
|
-
if (this._syncPacketRange(res))
|
|
1685
|
-
return await this.reload();
|
|
1686
|
-
this.names = { objects: {}, classes: {}, paths: {}, ...(res?.names || {}) };
|
|
1687
|
-
this.items = Array.isArray(res?.items) ? res.items : [];
|
|
1688
|
-
this.count = Number(res?.total) || this.items.length;
|
|
1689
|
-
this.opening = res?.opening || { debit: 0, credit: 0 };
|
|
1690
|
-
this.turnover = res?.turnover || { debit: 0, credit: 0 };
|
|
1691
|
-
this.closing = res?.closing || { debit: 0, credit: 0 };
|
|
1692
|
-
}
|
|
1693
|
-
catch (e) {
|
|
1694
|
-
this.error = String(e?.message || e);
|
|
1695
|
-
}
|
|
1696
|
-
finally {
|
|
1697
|
-
this._notifyConsultantContext();
|
|
1698
|
-
}
|
|
1699
|
-
},
|
|
1700
|
-
};
|