shutro-erp 0.3.5 → 0.3.7
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/dist/account_asset/.kosh/bindings.js +15 -0
- package/dist/{mrp_account → account_asset}/.kosh/schema.d.ts +785 -614
- package/dist/account_asset/board.d.ts +61 -0
- package/dist/account_asset/board.js +86 -0
- package/dist/account_asset/books.d.ts +42 -0
- package/dist/account_asset/books.js +398 -0
- package/dist/account_asset/demo.d.ts +7 -0
- package/dist/account_asset/demo.js +72 -0
- package/dist/account_asset/i18n/bn.d.ts +2 -0
- package/dist/account_asset/i18n/bn.js +97 -0
- package/dist/account_asset/index.d.ts +9 -0
- package/dist/account_asset/index.js +337 -0
- package/dist/account_asset/module.d.ts +11076 -0
- package/dist/account_asset/module.js +230 -0
- package/dist/account_budget/.kosh/bindings.js +15 -0
- package/dist/account_budget/.kosh/schema.d.ts +2841 -0
- package/dist/account_budget/budget.d.ts +5 -0
- package/dist/account_budget/budget.js +142 -0
- package/dist/account_budget/demo.d.ts +6 -0
- package/dist/account_budget/demo.js +30 -0
- package/dist/account_budget/i18n/bn.d.ts +2 -0
- package/dist/account_budget/i18n/bn.js +63 -0
- package/dist/account_budget/index.d.ts +4 -0
- package/dist/account_budget/index.js +237 -0
- package/dist/account_budget/module.d.ts +27289 -0
- package/dist/account_budget/module.js +182 -0
- package/dist/account_portal/.kosh/bindings.js +1 -1
- package/dist/account_portal/.kosh/schema.d.ts +651 -10
- package/dist/account_portal/i18n/bn.d.ts +2 -0
- package/dist/account_portal/i18n/bn.js +6 -0
- package/dist/account_portal/index.js +2 -0
- package/dist/account_portal/module.d.ts +5212 -1592
- package/dist/accounting/.kosh/bindings.js +1 -1
- package/dist/accounting/.kosh/schema.d.ts +651 -10
- package/dist/accounting/closing.js +1 -0
- package/dist/accounting/fiscal.d.ts +578 -0
- package/dist/accounting/fiscal.js +401 -0
- package/dist/accounting/followups.d.ts +618 -0
- package/dist/accounting/followups.js +420 -0
- package/dist/accounting/i18n/bn.d.ts +2 -0
- package/dist/accounting/i18n/bn.js +425 -0
- package/dist/accounting/index.d.ts +3 -1
- package/dist/accounting/index.js +780 -5
- package/dist/accounting/module.d.ts +5386 -1543
- package/dist/accounting/module.js +155 -18
- package/dist/accounting/statements.d.ts +878 -0
- package/dist/accounting/statements.js +728 -0
- package/dist/accounting/web/BankReconcilePage.d.ts +9 -0
- package/dist/accounting/web/BankReconcilePage.js +138 -0
- package/dist/accounting/web/FollowupsPage.d.ts +8 -0
- package/dist/accounting/web/FollowupsPage.js +54 -0
- package/dist/accounting/web/PostingPreview.d.ts +8 -0
- package/dist/accounting/web/PostingPreview.js +26 -0
- package/dist/accounting/web/index.d.ts +3 -0
- package/dist/accounting/web/index.js +9 -0
- package/dist/accounting/web/messages.js +140 -0
- package/dist/approvals/.kosh/bindings.d.ts +22 -0
- package/dist/approvals/.kosh/bindings.js +15 -0
- package/dist/approvals/.kosh/schema.d.ts +879 -0
- package/dist/approvals/demo.d.ts +7 -0
- package/dist/approvals/demo.js +41 -0
- package/dist/approvals/i18n/bn.d.ts +2 -0
- package/dist/approvals/i18n/bn.js +133 -0
- package/dist/approvals/index.d.ts +36 -0
- package/dist/approvals/index.js +772 -0
- package/dist/approvals/mails.d.ts +30 -0
- package/dist/approvals/mails.js +87 -0
- package/dist/approvals/module.d.ts +2930 -0
- package/dist/approvals/module.js +473 -0
- package/dist/approvals/web/Config.d.ts +12 -0
- package/dist/approvals/web/Config.js +60 -0
- package/dist/approvals/web/History.d.ts +4 -0
- package/dist/approvals/web/History.js +13 -0
- package/dist/approvals/web/Inbox.d.ts +9 -0
- package/dist/approvals/web/Inbox.js +114 -0
- package/dist/approvals/web/Matrix.d.ts +9 -0
- package/dist/approvals/web/Matrix.js +26 -0
- package/dist/approvals/web/Mine.d.ts +7 -0
- package/dist/approvals/web/Mine.js +27 -0
- package/dist/approvals/web/index.d.ts +15 -0
- package/dist/approvals/web/index.js +29 -0
- package/dist/approvals/web/messages.d.ts +2 -0
- package/dist/approvals/web/messages.js +211 -0
- package/dist/approvals/web/shared.d.ts +59 -0
- package/dist/approvals/web/shared.js +46 -0
- package/dist/approvals_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/approvals_purchase/.kosh/bindings.js +15 -0
- package/dist/approvals_purchase/.kosh/schema.d.ts +1997 -0
- package/dist/approvals_purchase/i18n/bn.d.ts +2 -0
- package/dist/approvals_purchase/i18n/bn.js +5 -0
- package/dist/approvals_purchase/index.d.ts +3 -0
- package/dist/approvals_purchase/index.js +47 -0
- package/dist/approvals_purchase/module.d.ts +12670 -0
- package/dist/approvals_purchase/module.js +84 -0
- package/dist/attendance/.kosh/bindings.d.ts +22 -0
- package/dist/attendance/.kosh/bindings.js +15 -0
- package/dist/attendance/.kosh/schema.d.ts +1106 -0
- package/dist/attendance/days.d.ts +96 -0
- package/dist/attendance/days.js +430 -0
- package/dist/attendance/demo.d.ts +7 -0
- package/dist/attendance/demo.js +58 -0
- package/dist/attendance/i18n/bn.d.ts +2 -0
- package/dist/attendance/i18n/bn.js +147 -0
- package/dist/attendance/index.d.ts +4 -0
- package/dist/attendance/index.js +515 -0
- package/dist/attendance/module.d.ts +4413 -0
- package/dist/attendance/module.js +412 -0
- package/dist/attendance/routes.d.ts +16 -0
- package/dist/attendance/routes.js +266 -0
- package/dist/attendance/web/Check.d.ts +8 -0
- package/dist/attendance/web/Check.js +40 -0
- package/dist/attendance/web/Kiosk.d.ts +8 -0
- package/dist/attendance/web/Kiosk.js +62 -0
- package/dist/attendance/web/PinButton.d.ts +7 -0
- package/dist/attendance/web/PinButton.js +29 -0
- package/dist/attendance/web/index.d.ts +13 -0
- package/dist/attendance/web/index.js +22 -0
- package/dist/attendance/web/messages.d.ts +2 -0
- package/dist/attendance/web/messages.js +61 -0
- package/dist/automation/engine.js +1 -1
- package/dist/calendar/.kosh/bindings.js +1 -1
- package/dist/calendar/.kosh/schema.d.ts +2 -1
- package/dist/calendar/i18n/bn.d.ts +2 -0
- package/dist/calendar/i18n/bn.js +80 -0
- package/dist/calendar/index.js +77 -0
- package/dist/calendar/module.d.ts +26 -0
- package/dist/calendar/module.js +14 -4
- package/dist/cli/apps.js +25 -5
- package/dist/cli/init.js +46 -4
- package/dist/cli/templates.d.ts +1 -1
- package/dist/cli/templates.js +123 -5
- package/dist/contacts/.kosh/bindings.js +1 -1
- package/dist/contacts/.kosh/schema.d.ts +2 -1
- package/dist/contacts/i18n/bn.d.ts +2 -0
- package/dist/contacts/i18n/bn.js +67 -0
- package/dist/contacts/index.js +3 -0
- package/dist/contacts/module.d.ts +42 -0
- package/dist/contacts/module.js +19 -3
- package/dist/crm/.kosh/bindings.js +1 -1
- package/dist/crm/.kosh/schema.d.ts +3 -1
- package/dist/crm/i18n/bn.d.ts +2 -0
- package/dist/crm/i18n/bn.js +80 -0
- package/dist/crm/index.js +22 -0
- package/dist/crm/module.d.ts +22 -0
- package/dist/crm/module.js +6 -3
- package/dist/documents/.kosh/bindings.d.ts +22 -0
- package/dist/documents/.kosh/bindings.js +15 -0
- package/dist/documents/.kosh/schema.d.ts +863 -0
- package/dist/documents/demo.d.ts +6 -0
- package/dist/documents/demo.js +22 -0
- package/dist/documents/documents.d.ts +98 -0
- package/dist/documents/documents.js +318 -0
- package/dist/documents/i18n/bn.d.ts +2 -0
- package/dist/documents/i18n/bn.js +83 -0
- package/dist/documents/index.d.ts +30 -0
- package/dist/documents/index.js +569 -0
- package/dist/documents/module.d.ts +2801 -0
- package/dist/documents/module.js +215 -0
- package/dist/documents/web/Versions.d.ts +7 -0
- package/dist/documents/web/Versions.js +45 -0
- package/dist/documents/web/index.d.ts +11 -0
- package/dist/documents/web/index.js +16 -0
- package/dist/documents/web/messages.d.ts +2 -0
- package/dist/documents/web/messages.js +21 -0
- package/dist/event/.kosh/bindings.js +1 -1
- package/dist/event/.kosh/schema.d.ts +2 -1
- package/dist/event/i18n/bn.d.ts +2 -0
- package/dist/event/i18n/bn.js +101 -0
- package/dist/event/index.js +66 -0
- package/dist/event/module.d.ts +20 -0
- package/dist/event/module.js +8 -1
- package/dist/event_account/.kosh/bindings.js +1 -1
- package/dist/event_account/.kosh/schema.d.ts +651 -10
- package/dist/event_account/i18n/bn.d.ts +2 -0
- package/dist/event_account/i18n/bn.js +5 -0
- package/dist/event_account/index.js +2 -0
- package/dist/event_account/module.d.ts +5133 -1513
- package/dist/expense/.kosh/bindings.d.ts +22 -0
- package/dist/expense/.kosh/bindings.js +15 -0
- package/dist/expense/.kosh/schema.d.ts +1620 -0
- package/dist/expense/demo.d.ts +7 -0
- package/dist/expense/demo.js +69 -0
- package/dist/expense/i18n/bn.d.ts +2 -0
- package/dist/expense/i18n/bn.js +155 -0
- package/dist/expense/index.d.ts +3 -0
- package/dist/expense/index.js +502 -0
- package/dist/expense/module.d.ts +6768 -0
- package/dist/expense/module.js +649 -0
- package/dist/expense_account/.kosh/bindings.d.ts +22 -0
- package/dist/expense_account/.kosh/bindings.js +15 -0
- package/dist/expense_account/.kosh/schema.d.ts +2515 -0
- package/dist/expense_account/i18n/bn.d.ts +2 -0
- package/dist/expense_account/i18n/bn.js +15 -0
- package/dist/expense_account/index.d.ts +3 -0
- package/dist/expense_account/index.js +76 -0
- package/dist/expense_account/module.d.ts +14628 -0
- package/dist/expense_account/module.js +318 -0
- package/dist/helpdesk/.kosh/bindings.d.ts +22 -0
- package/dist/helpdesk/.kosh/bindings.js +15 -0
- package/dist/helpdesk/.kosh/schema.d.ts +886 -0
- package/dist/helpdesk/demo.d.ts +7 -0
- package/dist/helpdesk/demo.js +65 -0
- package/dist/helpdesk/hours.d.ts +17 -0
- package/dist/helpdesk/hours.js +94 -0
- package/dist/helpdesk/i18n/bn.d.ts +2 -0
- package/dist/helpdesk/i18n/bn.js +127 -0
- package/dist/helpdesk/index.d.ts +10 -0
- package/dist/helpdesk/index.js +463 -0
- package/dist/helpdesk/module.d.ts +2960 -0
- package/dist/helpdesk/module.js +326 -0
- package/dist/helpdesk/routes.d.ts +12 -0
- package/dist/helpdesk/routes.js +132 -0
- package/dist/helpdesk/sla.d.ts +37 -0
- package/dist/helpdesk/sla.js +226 -0
- package/dist/hr/.kosh/bindings.js +1 -1
- package/dist/hr/.kosh/schema.d.ts +59 -1
- package/dist/hr/demo.js +11 -1
- package/dist/hr/i18n/bn.d.ts +2 -0
- package/dist/hr/i18n/bn.js +126 -0
- package/dist/hr/index.d.ts +1 -1
- package/dist/hr/index.js +158 -12
- package/dist/hr/module.d.ts +932 -59
- package/dist/hr/module.js +114 -17
- package/dist/indent/.kosh/bindings.d.ts +22 -0
- package/dist/indent/.kosh/bindings.js +15 -0
- package/dist/indent/.kosh/schema.d.ts +2084 -0
- package/dist/indent/demo.d.ts +7 -0
- package/dist/indent/demo.js +48 -0
- package/dist/indent/i18n/bn.d.ts +2 -0
- package/dist/indent/i18n/bn.js +143 -0
- package/dist/indent/index.d.ts +3 -0
- package/dist/indent/index.js +450 -0
- package/dist/indent/module.d.ts +13424 -0
- package/dist/indent/module.js +792 -0
- package/dist/indent_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/indent_purchase/.kosh/bindings.js +15 -0
- package/dist/indent_purchase/.kosh/schema.d.ts +2710 -0
- package/dist/indent_purchase/i18n/bn.d.ts +2 -0
- package/dist/indent_purchase/i18n/bn.js +13 -0
- package/dist/indent_purchase/index.d.ts +3 -0
- package/dist/indent_purchase/index.js +61 -0
- package/dist/indent_purchase/module.d.ts +27950 -0
- package/dist/indent_purchase/module.js +163 -0
- package/dist/l10n_bd/.kosh/bindings.js +1 -1
- package/dist/l10n_bd/.kosh/schema.d.ts +651 -10
- package/dist/l10n_bd/i18n/bn.d.ts +2 -0
- package/dist/l10n_bd/i18n/bn.js +69 -0
- package/dist/l10n_bd/index.js +2 -0
- package/dist/l10n_bd/module.d.ts +5212 -1592
- package/dist/l10n_bd_payroll/.kosh/bindings.d.ts +22 -0
- package/dist/l10n_bd_payroll/.kosh/bindings.js +15 -0
- package/dist/l10n_bd_payroll/.kosh/schema.d.ts +2891 -0
- package/dist/l10n_bd_payroll/data.d.ts +47 -0
- package/dist/l10n_bd_payroll/data.js +347 -0
- package/dist/l10n_bd_payroll/i18n/bn.d.ts +2 -0
- package/dist/l10n_bd_payroll/i18n/bn.js +4 -0
- package/dist/l10n_bd_payroll/index.d.ts +4 -0
- package/dist/l10n_bd_payroll/index.js +26 -0
- package/dist/l10n_bd_payroll/module.d.ts +17294 -0
- package/dist/l10n_bd_payroll/module.js +86 -0
- package/dist/l10n_bd_pos/.kosh/bindings.d.ts +22 -0
- package/dist/{mrp_account → l10n_bd_pos}/.kosh/bindings.js +2 -2
- package/dist/l10n_bd_pos/.kosh/schema.d.ts +2341 -0
- package/dist/l10n_bd_pos/i18n/bn.d.ts +2 -0
- package/dist/l10n_bd_pos/i18n/bn.js +32 -0
- package/dist/l10n_bd_pos/index.d.ts +3 -0
- package/dist/l10n_bd_pos/index.js +111 -0
- package/dist/{mrp_account → l10n_bd_pos}/module.d.ts +9047 -6981
- package/dist/l10n_bd_pos/module.js +43 -0
- package/dist/l10n_in/.kosh/bindings.js +1 -1
- package/dist/l10n_in/.kosh/schema.d.ts +651 -10
- package/dist/l10n_in/i18n/bn.d.ts +2 -0
- package/dist/l10n_in/i18n/bn.js +95 -0
- package/dist/l10n_in/index.js +2 -0
- package/dist/l10n_in/module.d.ts +6778 -1580
- package/dist/l10n_in/module.js +25 -5
- package/dist/l10n_in/web/GstSettings.js +2 -2
- package/dist/mail/inbound/handle.js +8 -5
- package/dist/mail/inbound/models.js +5 -3
- package/dist/mail/index.d.ts +12 -1
- package/dist/mail/index.js +139 -2
- package/dist/mail/send.d.ts +56 -0
- package/dist/mail/send.js +394 -0
- package/dist/mail/web/SendButton.d.ts +9 -0
- package/dist/mail/web/SendButton.js +71 -0
- package/dist/mail/web/SendSelected.d.ts +8 -0
- package/dist/mail/web/SendSelected.js +33 -0
- package/dist/mail/web/index.d.ts +2 -0
- package/dist/mail/web/index.js +6 -0
- package/dist/mail/web/messages.js +36 -0
- package/dist/maintenance/.kosh/bindings.js +1 -1
- package/dist/maintenance/.kosh/schema.d.ts +2 -1
- package/dist/maintenance/i18n/bn.d.ts +2 -0
- package/dist/maintenance/i18n/bn.js +132 -0
- package/dist/maintenance/index.js +85 -0
- package/dist/maintenance/module.d.ts +25 -0
- package/dist/maintenance/module.js +27 -9
- package/dist/maintenance_stock/.kosh/bindings.js +1 -1
- package/dist/maintenance_stock/.kosh/schema.d.ts +374 -3
- package/dist/maintenance_stock/i18n/bn.d.ts +2 -0
- package/dist/maintenance_stock/i18n/bn.js +21 -0
- package/dist/maintenance_stock/index.js +2 -0
- package/dist/maintenance_stock/module.d.ts +6095 -1327
- package/dist/maintenance_stock/module.js +1 -0
- package/dist/modules-sdk/apps.d.ts +10 -0
- package/dist/modules-sdk/apps.js +32 -0
- package/dist/modules-sdk/index.d.ts +1 -1
- package/dist/modules-sdk/manifest.d.ts +105 -2
- package/dist/payment/.kosh/bindings.js +1 -1
- package/dist/payment/.kosh/schema.d.ts +653 -11
- package/dist/payment/i18n/bn.d.ts +2 -0
- package/dist/payment/i18n/bn.js +59 -0
- package/dist/payment/index.d.ts +41 -0
- package/dist/payment/index.js +216 -74
- package/dist/payment/module.d.ts +5353 -1675
- package/dist/payment/module.js +36 -6
- package/dist/payment/settle.js +11 -1
- package/dist/payroll/.kosh/bindings.d.ts +22 -0
- package/dist/payroll/.kosh/bindings.js +15 -0
- package/dist/payroll/.kosh/schema.d.ts +1448 -0
- package/dist/payroll/compute.d.ts +35 -0
- package/dist/payroll/compute.js +398 -0
- package/dist/payroll/demo.d.ts +55 -0
- package/dist/payroll/demo.js +121 -0
- package/dist/payroll/formula.d.ts +62 -0
- package/dist/payroll/formula.js +320 -0
- package/dist/payroll/i18n/bn.d.ts +2 -0
- package/dist/payroll/i18n/bn.js +206 -0
- package/dist/payroll/index.d.ts +230 -0
- package/dist/payroll/index.js +715 -0
- package/dist/{mrp → payroll}/module.d.ts +4294 -2624
- package/dist/payroll/module.js +606 -0
- package/dist/payroll/routes.d.ts +10 -0
- package/dist/payroll/routes.js +112 -0
- package/dist/payroll_account/.kosh/bindings.d.ts +22 -0
- package/dist/payroll_account/.kosh/bindings.js +15 -0
- package/dist/payroll_account/.kosh/schema.d.ts +2887 -0
- package/dist/payroll_account/i18n/bn.d.ts +2 -0
- package/dist/payroll_account/i18n/bn.js +10 -0
- package/dist/payroll_account/index.d.ts +3 -0
- package/dist/payroll_account/index.js +42 -0
- package/dist/payroll_account/module.d.ts +16738 -0
- package/dist/payroll_account/module.js +256 -0
- package/dist/permissions/approvals.d.ts +227 -12
- package/dist/permissions/approvals.js +1421 -67
- package/dist/permissions/index.d.ts +1 -1
- package/dist/permissions/index.js +2 -2
- package/dist/permissions/models.js +364 -13
- package/dist/permissions/routes.d.ts +9 -1
- package/dist/permissions/routes.js +72 -5
- package/dist/permissions/web/ApprovalPanel.d.ts +5 -4
- package/dist/permissions/web/ApprovalPanel.js +75 -11
- package/dist/permissions/web/index.d.ts +6 -4
- package/dist/permissions/web/index.js +13 -4
- package/dist/permissions/web/messages.d.ts +2 -0
- package/dist/permissions/web/messages.js +95 -0
- package/dist/portal/.kosh/bindings.js +1 -1
- package/dist/portal/.kosh/schema.d.ts +2 -1
- package/dist/portal/documents.d.ts +3 -0
- package/dist/portal/documents.js +21 -1
- package/dist/portal/i18n/bn.d.ts +2 -0
- package/dist/portal/i18n/bn.js +33 -0
- package/dist/portal/index.js +3 -1
- package/dist/portal/module.d.ts +20 -0
- package/dist/portal/routes-documents.js +76 -0
- package/dist/pos/.kosh/bindings.js +1 -1
- package/dist/pos/.kosh/schema.d.ts +652 -10
- package/dist/pos/i18n/bn.d.ts +2 -0
- package/dist/pos/i18n/bn.js +133 -0
- package/dist/pos/index.js +87 -1
- package/dist/pos/module.d.ts +6967 -1709
- package/dist/pos/module.js +49 -5
- package/dist/pos/routes.js +80 -7
- package/dist/pos/web/Register.js +2 -5
- package/dist/pos_stock/.kosh/bindings.js +1 -1
- package/dist/pos_stock/.kosh/schema.d.ts +822 -12
- package/dist/pos_stock/i18n/bn.d.ts +2 -0
- package/dist/pos_stock/i18n/bn.js +6 -0
- package/dist/pos_stock/index.js +2 -0
- package/dist/pos_stock/module.d.ts +11241 -2851
- package/dist/product/.kosh/bindings.js +1 -1
- package/dist/product/.kosh/schema.d.ts +203 -1
- package/dist/product/i18n/bn.d.ts +2 -0
- package/dist/product/i18n/bn.js +175 -0
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.js +301 -1
- package/dist/product/module.d.ts +1727 -0
- package/dist/product/module.js +67 -6
- package/dist/product/pricelist.d.ts +575 -0
- package/dist/product/pricelist.js +257 -0
- package/dist/product/variants.d.ts +908 -0
- package/dist/product/variants.js +251 -0
- package/dist/production/.kosh/bindings.d.ts +22 -0
- package/dist/production/.kosh/bindings.js +15 -0
- package/dist/production/.kosh/schema.d.ts +2345 -0
- package/dist/{mrp → production}/demo.d.ts +1 -1
- package/dist/{mrp → production}/demo.js +5 -5
- package/dist/production/depth.d.ts +790 -0
- package/dist/production/depth.js +262 -0
- package/dist/production/i18n/bn.d.ts +2 -0
- package/dist/production/i18n/bn.js +350 -0
- package/dist/production/index.d.ts +6 -0
- package/dist/production/index.js +1256 -0
- package/dist/production/module.d.ts +17327 -0
- package/dist/production/module.js +1333 -0
- package/dist/production/plan.d.ts +921 -0
- package/dist/production/plan.js +511 -0
- package/dist/production/schedule.d.ts +656 -0
- package/dist/production/schedule.js +309 -0
- package/dist/production_account/.kosh/bindings.d.ts +22 -0
- package/dist/production_account/.kosh/bindings.js +15 -0
- package/dist/production_account/.kosh/schema.d.ts +3496 -0
- package/dist/production_account/i18n/bn.d.ts +2 -0
- package/dist/production_account/i18n/bn.js +93 -0
- package/dist/production_account/index.d.ts +4 -0
- package/dist/production_account/index.js +246 -0
- package/dist/production_account/module.d.ts +1192 -0
- package/dist/{mrp_account → production_account}/module.js +72 -18
- package/dist/production_account/overhead.d.ts +1195 -0
- package/dist/production_account/overhead.js +554 -0
- package/dist/project/.kosh/bindings.js +1 -1
- package/dist/project/.kosh/schema.d.ts +735 -1
- package/dist/project/i18n/bn.d.ts +2 -0
- package/dist/project/i18n/bn.js +383 -0
- package/dist/project/index.d.ts +3 -1
- package/dist/project/index.js +1024 -14
- package/dist/project/module.d.ts +9912 -390
- package/dist/project/module.js +1590 -14
- package/dist/project/routes.d.ts +44 -0
- package/dist/project/routes.js +314 -0
- package/dist/project/schedule.d.ts +72 -0
- package/dist/project/schedule.js +192 -0
- package/dist/project/web/Refresh.d.ts +8 -0
- package/dist/project/web/Refresh.js +29 -0
- package/dist/project/web/Schedule.d.ts +9 -0
- package/dist/project/web/Schedule.js +93 -0
- package/dist/project/web/Structure.d.ts +8 -0
- package/dist/project/web/Structure.js +86 -0
- package/dist/project/web/Workload.d.ts +8 -0
- package/dist/project/web/Workload.js +43 -0
- package/dist/project/web/index.d.ts +14 -0
- package/dist/project/web/index.js +25 -0
- package/dist/project/web/messages.d.ts +2 -0
- package/dist/project/web/messages.js +85 -0
- package/dist/project_account/.kosh/bindings.d.ts +22 -0
- package/dist/project_account/.kosh/bindings.js +15 -0
- package/dist/project_account/.kosh/schema.d.ts +2763 -0
- package/dist/project_account/i18n/bn.d.ts +2 -0
- package/dist/project_account/i18n/bn.js +6 -0
- package/dist/project_account/index.d.ts +3 -0
- package/dist/project_account/index.js +29 -0
- package/dist/project_account/module.d.ts +15013 -0
- package/dist/project_account/module.js +76 -0
- package/dist/project_portal/.kosh/bindings.js +1 -1
- package/dist/project_portal/.kosh/schema.d.ts +735 -1
- package/dist/project_portal/i18n/bn.d.ts +2 -0
- package/dist/project_portal/i18n/bn.js +6 -0
- package/dist/project_portal/index.js +2 -0
- package/dist/project_portal/module.d.ts +4796 -87
- package/dist/project_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/project_purchase/.kosh/bindings.js +15 -0
- package/dist/project_purchase/.kosh/schema.d.ts +3393 -0
- package/dist/project_purchase/i18n/bn.d.ts +2 -0
- package/dist/project_purchase/i18n/bn.js +4 -0
- package/dist/project_purchase/index.d.ts +9 -0
- package/dist/project_purchase/index.js +24 -0
- package/dist/project_purchase/module.d.ts +38613 -0
- package/dist/project_purchase/module.js +56 -0
- package/dist/purchase/.kosh/bindings.js +1 -1
- package/dist/purchase/.kosh/schema.d.ts +908 -5
- package/dist/purchase/comparison.d.ts +993 -0
- package/dist/purchase/comparison.js +415 -0
- package/dist/purchase/extras.d.ts +1509 -0
- package/dist/purchase/extras.js +445 -0
- package/dist/purchase/i18n/bn.d.ts +2 -0
- package/dist/purchase/i18n/bn.js +413 -0
- package/dist/purchase/index.d.ts +5 -0
- package/dist/purchase/index.js +1280 -4
- package/dist/purchase/module.d.ts +7147 -395
- package/dist/purchase/module.js +303 -10
- package/dist/purchase/request.d.ts +696 -0
- package/dist/purchase/request.js +446 -0
- package/dist/purchase/tender.d.ts +1208 -0
- package/dist/purchase/tender.js +507 -0
- package/dist/purchase/vendorprice.d.ts +340 -0
- package/dist/purchase/vendorprice.js +153 -0
- package/dist/purchase_account/.kosh/bindings.js +1 -1
- package/dist/purchase_account/.kosh/schema.d.ts +1209 -16
- package/dist/purchase_account/i18n/bn.d.ts +2 -0
- package/dist/purchase_account/i18n/bn.js +22 -0
- package/dist/purchase_account/index.js +20 -0
- package/dist/purchase_account/module.d.ts +12232 -2028
- package/dist/purchase_account/module.js +252 -9
- package/dist/purchase_portal/.kosh/bindings.js +1 -1
- package/dist/purchase_portal/.kosh/schema.d.ts +908 -5
- package/dist/purchase_portal/i18n/bn.d.ts +2 -0
- package/dist/purchase_portal/i18n/bn.js +5 -0
- package/dist/purchase_portal/index.js +2 -0
- package/dist/purchase_portal/module.d.ts +6853 -352
- package/dist/purchase_stock/.kosh/bindings.js +1 -1
- package/dist/purchase_stock/.kosh/schema.d.ts +1096 -21
- package/dist/purchase_stock/i18n/bn.d.ts +2 -0
- package/dist/purchase_stock/i18n/bn.js +19 -0
- package/dist/purchase_stock/index.d.ts +2 -2
- package/dist/purchase_stock/index.js +38 -2
- package/dist/purchase_stock/module.d.ts +12930 -1612
- package/dist/purchase_stock/module.js +317 -9
- package/dist/purchase_stock/scorecard.d.ts +22 -0
- package/dist/purchase_stock/scorecard.js +77 -0
- package/dist/purchase_stock/web/Scorecard.d.ts +7 -0
- package/dist/purchase_stock/web/Scorecard.js +22 -0
- package/dist/purchase_stock/web/index.d.ts +11 -0
- package/dist/purchase_stock/web/index.js +16 -0
- package/dist/purchase_stock/web/messages.d.ts +2 -0
- package/dist/purchase_stock/web/messages.js +27 -0
- package/dist/purchase_stock_account/.kosh/bindings.js +1 -1
- package/dist/purchase_stock_account/.kosh/schema.d.ts +1444 -20
- package/dist/purchase_stock_account/i18n/bn.d.ts +2 -0
- package/dist/purchase_stock_account/i18n/bn.js +8 -0
- package/dist/purchase_stock_account/index.js +18 -0
- package/dist/purchase_stock_account/module.d.ts +7 -35346
- package/dist/purchase_stock_account/module.js +35 -8
- package/dist/recruitment/.kosh/bindings.js +1 -1
- package/dist/recruitment/.kosh/schema.d.ts +60 -1
- package/dist/recruitment/i18n/bn.d.ts +2 -0
- package/dist/recruitment/i18n/bn.js +93 -0
- package/dist/recruitment/index.js +64 -0
- package/dist/recruitment/module.d.ts +460 -8
- package/dist/recruitment/module.js +13 -4
- package/dist/reporting/documents.d.ts +5 -0
- package/dist/reporting/documents.js +11 -1
- package/dist/reporting/index.d.ts +1 -1
- package/dist/reporting/index.js +1 -1
- package/dist/reporting/web/CalendarView.d.ts +18 -5
- package/dist/reporting/web/CalendarView.js +163 -29
- package/dist/reporting/web/messages.js +18 -0
- package/dist/sale_account/.kosh/bindings.js +1 -1
- package/dist/sale_account/.kosh/schema.d.ts +763 -18
- package/dist/sale_account/i18n/bn.d.ts +2 -0
- package/dist/sale_account/i18n/bn.js +48 -0
- package/dist/sale_account/index.d.ts +1 -1
- package/dist/sale_account/index.js +102 -4
- package/dist/sale_account/module.d.ts +8241 -2052
- package/dist/sale_account/module.js +535 -46
- package/dist/sale_crm/.kosh/bindings.d.ts +22 -0
- package/dist/sale_crm/.kosh/bindings.js +15 -0
- package/dist/{mrp → sale_crm}/.kosh/schema.d.ts +391 -494
- package/dist/sale_crm/i18n/bn.d.ts +2 -0
- package/dist/sale_crm/i18n/bn.js +9 -0
- package/dist/sale_crm/index.d.ts +7 -0
- package/dist/sale_crm/index.js +104 -0
- package/dist/sale_crm/module.d.ts +5609 -0
- package/dist/sale_crm/module.js +73 -0
- package/dist/sale_portal/.kosh/bindings.js +1 -1
- package/dist/sale_portal/.kosh/schema.d.ts +292 -4
- package/dist/sale_portal/i18n/bn.d.ts +2 -0
- package/dist/sale_portal/i18n/bn.js +7 -0
- package/dist/sale_portal/index.js +10 -0
- package/dist/sale_portal/module.d.ts +2563 -292
- package/dist/sale_project/.kosh/bindings.js +1 -1
- package/dist/sale_project/.kosh/schema.d.ts +1025 -4
- package/dist/sale_project/i18n/bn.d.ts +2 -0
- package/dist/sale_project/i18n/bn.js +12 -0
- package/dist/sale_project/index.js +2 -0
- package/dist/sale_project/module.d.ts +9280 -762
- package/dist/sale_project/module.js +17 -1
- package/dist/sale_stock/.kosh/bindings.js +1 -1
- package/dist/sale_stock/.kosh/schema.d.ts +463 -6
- package/dist/sale_stock/i18n/bn.d.ts +2 -0
- package/dist/sale_stock/i18n/bn.js +15 -0
- package/dist/sale_stock/index.js +2 -0
- package/dist/sale_stock/module.d.ts +8355 -1334
- package/dist/sale_stock/module.js +20 -3
- package/dist/sales/.kosh/bindings.js +1 -1
- package/dist/sales/.kosh/schema.d.ts +292 -4
- package/dist/sales/i18n/bn.d.ts +2 -0
- package/dist/sales/i18n/bn.js +128 -0
- package/dist/sales/index.js +124 -5
- package/dist/sales/module.d.ts +3568 -633
- package/dist/sales/module.js +306 -11
- package/dist/server/api/duplicate.d.ts +14 -0
- package/dist/server/api/duplicate.js +75 -0
- package/dist/server/api/explain.d.ts +70 -0
- package/dist/server/api/explain.js +111 -0
- package/dist/server/api/metadata.d.ts +2 -0
- package/dist/server/api/metadata.js +9 -0
- package/dist/server/api/openapi.js +15 -0
- package/dist/server/api/rest.d.ts +1 -0
- package/dist/server/api/rest.js +76 -12
- package/dist/server/api/views.js +1 -1
- package/dist/server/apps.d.ts +16 -1
- package/dist/server/apps.js +164 -2
- package/dist/server/auth/base.js +2 -0
- package/dist/server/auth/service.d.ts +8 -0
- package/dist/server/auth/service.js +19 -0
- package/dist/server/events.d.ts +13 -0
- package/dist/server/events.js +22 -0
- package/dist/server/i18n.d.ts +27 -0
- package/dist/server/i18n.js +143 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +2 -0
- package/dist/server/server.js +6 -0
- package/dist/settings/company.d.ts +3 -1
- package/dist/settings/company.js +26 -5
- package/dist/settings/routes.d.ts +10 -0
- package/dist/settings/routes.js +19 -3
- package/dist/settings/web/AppsPage.d.ts +3 -2
- package/dist/settings/web/AppsPage.js +26 -8
- package/dist/settings/web/CompaniesPage.js +91 -6
- package/dist/settings/web/messages.js +64 -0
- package/dist/sign/.kosh/bindings.d.ts +22 -0
- package/dist/{mrp → sign}/.kosh/bindings.js +2 -2
- package/dist/sign/.kosh/schema.d.ts +991 -0
- package/dist/sign/i18n/bn.d.ts +2 -0
- package/dist/sign/i18n/bn.js +97 -0
- package/dist/sign/index.d.ts +29 -0
- package/dist/sign/index.js +478 -0
- package/dist/sign/module.d.ts +4518 -0
- package/dist/sign/module.js +167 -0
- package/dist/sign/sign.d.ts +82 -0
- package/dist/sign/sign.js +474 -0
- package/dist/stock/.kosh/bindings.js +1 -1
- package/dist/stock/.kosh/schema.d.ts +374 -3
- package/dist/stock/demo.d.ts +2 -1
- package/dist/stock/demo.js +28 -1
- package/dist/stock/i18n/bn.d.ts +2 -0
- package/dist/stock/i18n/bn.js +311 -0
- package/dist/stock/index.d.ts +4 -1
- package/dist/stock/index.js +674 -6
- package/dist/stock/ledger.d.ts +78 -0
- package/dist/stock/ledger.js +582 -0
- package/dist/stock/module.d.ts +6142 -1380
- package/dist/stock/module.js +780 -26
- package/dist/stock/replenish.d.ts +38 -0
- package/dist/stock/replenish.js +191 -0
- package/dist/stock/returns.d.ts +157 -0
- package/dist/stock/returns.js +163 -0
- package/dist/stock/web/Ledger.d.ts +9 -0
- package/dist/stock/web/Ledger.js +108 -0
- package/dist/stock/web/Operations.d.ts +8 -0
- package/dist/stock/web/Operations.js +33 -0
- package/dist/stock/web/Replenishment.d.ts +8 -0
- package/dist/stock/web/Replenishment.js +84 -0
- package/dist/stock/web/ReturnButton.d.ts +7 -0
- package/dist/stock/web/ReturnButton.js +62 -0
- package/dist/stock/web/index.d.ts +7 -2
- package/dist/stock/web/index.js +15 -2
- package/dist/stock/web/messages.js +206 -0
- package/dist/stock_account/.kosh/bindings.js +1 -1
- package/dist/stock_account/.kosh/schema.d.ts +878 -12
- package/dist/stock_account/i18n/bn.d.ts +2 -0
- package/dist/stock_account/i18n/bn.js +73 -0
- package/dist/stock_account/index.d.ts +1 -0
- package/dist/stock_account/index.js +141 -3
- package/dist/stock_account/landed.d.ts +429 -0
- package/dist/stock_account/landed.js +335 -0
- package/dist/stock_account/module.d.ts +12143 -3391
- package/dist/stock_account/module.js +135 -6
- package/dist/stock_account/web/LandedPreview.d.ts +7 -0
- package/dist/stock_account/web/LandedPreview.js +23 -0
- package/dist/stock_account/web/index.d.ts +11 -0
- package/dist/stock_account/web/index.js +16 -0
- package/dist/stock_account/web/messages.d.ts +2 -0
- package/dist/stock_account/web/messages.js +27 -0
- package/dist/todo/i18n/bn.d.ts +2 -0
- package/dist/todo/i18n/bn.js +66 -0
- package/dist/todo/index.js +59 -0
- package/dist/todo/module.d.ts +5 -0
- package/dist/todo/module.js +5 -3
- package/dist/trade_finance/.kosh/bindings.js +1 -1
- package/dist/trade_finance/.kosh/schema.d.ts +2 -1
- package/dist/trade_finance/i18n/bn.d.ts +2 -0
- package/dist/trade_finance/i18n/bn.js +162 -0
- package/dist/trade_finance/index.js +95 -0
- package/dist/trade_finance/module.d.ts +26 -0
- package/dist/trade_finance/module.js +29 -8
- package/dist/trade_finance_account/.kosh/bindings.js +1 -1
- package/dist/trade_finance_account/.kosh/schema.d.ts +651 -10
- package/dist/trade_finance_account/i18n/bn.d.ts +2 -0
- package/dist/trade_finance_account/i18n/bn.js +27 -0
- package/dist/trade_finance_account/index.js +3 -0
- package/dist/trade_finance_account/module.d.ts +5129 -1509
- package/dist/trade_finance_account/module.js +2 -0
- package/dist/trade_finance_purchase/.kosh/bindings.js +1 -1
- package/dist/trade_finance_purchase/.kosh/schema.d.ts +908 -5
- package/dist/trade_finance_purchase/i18n/bn.d.ts +2 -0
- package/dist/trade_finance_purchase/i18n/bn.js +6 -0
- package/dist/trade_finance_purchase/index.js +2 -0
- package/dist/trade_finance_purchase/module.d.ts +6909 -408
- package/dist/trade_finance_sale/.kosh/bindings.js +1 -1
- package/dist/trade_finance_sale/.kosh/schema.d.ts +292 -4
- package/dist/trade_finance_sale/i18n/bn.d.ts +2 -0
- package/dist/trade_finance_sale/i18n/bn.js +6 -0
- package/dist/trade_finance_sale/index.js +2 -0
- package/dist/trade_finance_sale/module.d.ts +2602 -331
- package/dist/ui/api.d.ts +2 -0
- package/dist/ui/app.d.ts +9 -0
- package/dist/ui/app.js +47 -15
- package/dist/ui/components/AppIcon.js +9 -2
- package/dist/ui/components/Explain.d.ts +69 -0
- package/dist/ui/components/Explain.js +62 -0
- package/dist/ui/context.d.ts +8 -1
- package/dist/ui/context.js +34 -1
- package/dist/ui/i18n/messages.d.ts +40 -0
- package/dist/ui/i18n/messages.js +80 -0
- package/dist/ui/index.d.ts +2 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/registry.d.ts +14 -0
- package/dist/ui/registry.js +10 -0
- package/dist/ui/views/FormView.d.ts +6 -0
- package/dist/ui/views/FormView.js +51 -12
- package/dist/ui/views/KanbanView.js +9 -1
- package/dist/ui/views/ListView.d.ts +8 -0
- package/dist/ui/views/ListView.js +14 -5
- package/dist/ui/views/StatsRow.js +2 -1
- package/dist/ui/views/widgets.js +7 -1
- package/dist/views/extend.js +12 -0
- package/dist/views/types.d.ts +13 -2
- package/dist/views/validate.js +8 -1
- package/dist/website/.kosh/bindings.js +1 -1
- package/dist/website/.kosh/schema.d.ts +2 -1
- package/dist/website/i18n/bn.d.ts +2 -0
- package/dist/website/i18n/bn.js +113 -0
- package/dist/website/index.js +37 -0
- package/dist/website/module.d.ts +20 -0
- package/dist/website/module.js +30 -5
- package/dist/website_crm/.kosh/bindings.js +1 -1
- package/dist/website_crm/.kosh/schema.d.ts +3 -1
- package/dist/website_crm/i18n/bn.d.ts +2 -0
- package/dist/website_crm/i18n/bn.js +5 -0
- package/dist/website_crm/index.js +2 -0
- package/dist/website_crm/module.d.ts +41 -0
- package/dist/website_sale/.kosh/bindings.d.ts +22 -0
- package/dist/website_sale/.kosh/bindings.js +15 -0
- package/dist/website_sale/.kosh/schema.d.ts +2909 -0
- package/dist/website_sale/couriers.d.ts +50 -0
- package/dist/website_sale/couriers.js +59 -0
- package/dist/website_sale/demo.d.ts +7 -0
- package/dist/website_sale/demo.js +90 -0
- package/dist/website_sale/growth.d.ts +31 -0
- package/dist/website_sale/growth.js +163 -0
- package/dist/website_sale/i18n/bn.d.ts +2 -0
- package/dist/website_sale/i18n/bn.js +132 -0
- package/dist/website_sale/index.d.ts +49 -0
- package/dist/website_sale/index.js +620 -0
- package/dist/website_sale/module.d.ts +35182 -0
- package/dist/website_sale/module.js +419 -0
- package/dist/website_sale/shipments.d.ts +16 -0
- package/dist/website_sale/shipments.js +113 -0
- package/dist/website_sale/shop.d.ts +81 -0
- package/dist/website_sale/shop.js +662 -0
- package/dist/website_sale_stock/.kosh/bindings.d.ts +22 -0
- package/dist/website_sale_stock/.kosh/bindings.js +15 -0
- package/dist/website_sale_stock/.kosh/schema.d.ts +3400 -0
- package/dist/website_sale_stock/i18n/bn.d.ts +2 -0
- package/dist/website_sale_stock/i18n/bn.js +4 -0
- package/dist/website_sale_stock/index.d.ts +9 -0
- package/dist/website_sale_stock/index.js +22 -0
- package/dist/website_sale_stock/module.d.ts +11 -0
- package/dist/website_sale_stock/module.js +32 -0
- package/package.json +117 -8
- package/dist/mrp/index.d.ts +0 -3
- package/dist/mrp/index.js +0 -392
- package/dist/mrp/module.js +0 -695
- package/dist/mrp_account/index.d.ts +0 -3
- package/dist/mrp_account/index.js +0 -22
- /package/dist/{mrp → account_asset}/.kosh/bindings.d.ts +0 -0
- /package/dist/{mrp_account → account_budget}/.kosh/bindings.d.ts +0 -0
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
|
-
* The approval panel (RFC 0004 §6, RFC 0007): the web contribution of `shutro-erp/permissions`, registered as
|
|
4
|
-
* component `approvals.Panel` and placed in a form by a view extension.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* The approval panel (RFC 0004 §6, RFC 0007, RFC 0025 §3.1): the web contribution of `shutro-erp/permissions`, registered as
|
|
4
|
+
* the node component `approvals.Panel` and placed in a form by a view extension. The record's current round as steps —
|
|
5
|
+
* each level with its state and votes, who decided and what they said —, earlier rounds behind a disclosure; the
|
|
6
|
+
* user's decision when it is theirs (approve; reject or send back for changes with a reason) and, for the requester,
|
|
7
|
+
* withdrawing. The server checks order, approvers, company and separation of duties.
|
|
7
8
|
*/
|
|
8
9
|
import { ApiError, Badge, Button, Textarea } from '../../ui/index.js';
|
|
9
10
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
10
11
|
import { useId, useState } from 'react';
|
|
12
|
+
import { useTranslation } from 'react-i18next';
|
|
13
|
+
/** Whole hours between two instants (to now when `to` is null). */
|
|
14
|
+
const hoursBetween = (from, to) => Math.max(0, Math.round(((to === null ? Date.now() : Date.parse(to)) - Date.parse(from)) / 3_600_000));
|
|
11
15
|
const TONE = {
|
|
12
16
|
pending: 'warning',
|
|
13
17
|
approved: 'success',
|
|
14
18
|
rejected: 'danger',
|
|
19
|
+
sent_back: 'danger',
|
|
15
20
|
cancelled: 'neutral',
|
|
16
21
|
};
|
|
22
|
+
const DOT = {
|
|
23
|
+
pending: 'border-warning bg-warning/20',
|
|
24
|
+
approved: 'border-success bg-success',
|
|
25
|
+
rejected: 'border-danger bg-danger',
|
|
26
|
+
sent_back: 'border-danger bg-danger/40',
|
|
27
|
+
cancelled: 'border-muted-foreground bg-muted',
|
|
28
|
+
};
|
|
29
|
+
function Round({ requests, events = [], }) {
|
|
30
|
+
const { t, i18n } = useTranslation('approvalPanel');
|
|
31
|
+
return (_jsx("ol", { className: "grid gap-3", children: requests.map((r) => (_jsxs("li", { className: "flex gap-3 text-sm", children: [_jsx("span", { "aria-hidden": "true", className: `mt-1 size-3 shrink-0 rounded-full border-2 ${DOT[r.state]}` }), _jsxs("span", { className: "grid flex-1 gap-0.5", children: [_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-medium", children: r.levelName }), _jsx(Badge, { tone: TONE[r.state], children: t(`state.${r.state}`) }), r.required > 1 ? (_jsx("span", { className: "text-xs text-muted-foreground", children: t('votes', { n: r.approvals, of: r.required }) })) : null] }), r.approverRole === '' ? null : (_jsx("span", { className: "text-xs text-muted-foreground", children: r.approverRole })), r.comment === null ? null : _jsxs("span", { className: "text-xs", children: ["\u201C", r.comment, "\u201D"] }), r.state === 'pending' && r.startedAt !== null ? (_jsx("span", { className: "text-xs text-muted-foreground", children: t('since', { hours: hoursBetween(r.startedAt, null) }) })) : null, r.explanation === null && !events.some((e) => e.request === r.id) ? null : (_jsxs("details", { className: "text-xs text-muted-foreground", children: [_jsx("summary", { className: "cursor-pointer", children: t('how') }), r.explanation === null ? null : _jsx("p", { className: "mt-1", children: r.explanation }), _jsx("ul", { className: "mt-1 grid gap-0.5", "aria-label": t('log'), children: events
|
|
32
|
+
.filter((e) => e.request === r.id)
|
|
33
|
+
.map((e) => (_jsxs("li", { children: [_jsx("time", { dateTime: e.at, children: new Date(e.at).toLocaleString(i18n.language) }), ' ', "\u00B7 ", t(`event.${e.kind}`), e.note === null || e.kind === 'created' ? '' : ` — ${e.note}`] }, e.id))) })] }))] })] }, r.id))) }));
|
|
34
|
+
}
|
|
17
35
|
export function ApprovalPanel({ record, model, api, version, reload, }) {
|
|
36
|
+
const { t } = useTranslation('approvalPanel');
|
|
18
37
|
const queryClient = useQueryClient();
|
|
19
38
|
const id = useId();
|
|
20
39
|
const [comment, setComment] = useState('');
|
|
@@ -29,20 +48,65 @@ export function ApprovalPanel({ record, model, api, version, reload, }) {
|
|
|
29
48
|
queryFn: () => api.call('GET', '/api/v1/approvals/inbox'),
|
|
30
49
|
enabled: recordId !== undefined,
|
|
31
50
|
});
|
|
51
|
+
const me = useQuery({ queryKey: ['me'], queryFn: () => api.me() });
|
|
52
|
+
const done = async () => {
|
|
53
|
+
setComment('');
|
|
54
|
+
await queryClient.invalidateQueries({ queryKey: ['approvals'] });
|
|
55
|
+
reload();
|
|
56
|
+
};
|
|
32
57
|
const decide = useMutation({
|
|
33
|
-
mutationFn: ({ request, decision }) => api.call('POST', `/api/v1/approvals/requests/${request}/${decision}`, comment.trim() === '' ? {} : { comment: comment.trim() }),
|
|
58
|
+
mutationFn: ({ request, decision, }) => api.call('POST', `/api/v1/approvals/requests/${request}/${decision}`, comment.trim() === '' ? {} : { comment: comment.trim() }),
|
|
59
|
+
onSuccess: done,
|
|
60
|
+
});
|
|
61
|
+
const [reassigning, setReassigning] = useState(false);
|
|
62
|
+
const [chosen, setChosen] = useState([]);
|
|
63
|
+
const [mode, setMode] = useState('replace');
|
|
64
|
+
const [reason, setReason] = useState('');
|
|
65
|
+
const people = useQuery({
|
|
66
|
+
queryKey: ['approvals', 'people'],
|
|
67
|
+
queryFn: () => api.call('GET', '/api/v1/models/res.users?fields=id,name&limit=200&order=name'),
|
|
68
|
+
enabled: reassigning,
|
|
69
|
+
});
|
|
70
|
+
const reassign = useMutation({
|
|
71
|
+
mutationFn: (request) => api.call('POST', `/api/v1/approvals/requests/${request}/reassign`, {
|
|
72
|
+
users: chosen,
|
|
73
|
+
mode,
|
|
74
|
+
reason: reason.trim(),
|
|
75
|
+
}),
|
|
34
76
|
onSuccess: async () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
77
|
+
setReassigning(false);
|
|
78
|
+
setChosen([]);
|
|
79
|
+
setReason('');
|
|
80
|
+
await done();
|
|
38
81
|
},
|
|
39
82
|
});
|
|
83
|
+
const tell = useMutation({
|
|
84
|
+
mutationFn: (request) => api.call('POST', `/api/v1/approvals/requests/${request}/notify-backups`, {}),
|
|
85
|
+
onSuccess: done,
|
|
86
|
+
});
|
|
87
|
+
const withdraw = useMutation({
|
|
88
|
+
mutationFn: () => api.call('POST', `/api/v1/approvals/${model}/${recordId}/withdraw`),
|
|
89
|
+
onSuccess: done,
|
|
90
|
+
});
|
|
40
91
|
if (recordId === undefined)
|
|
41
92
|
return null;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
93
|
+
const all = requests.data?.requests ?? [];
|
|
94
|
+
if (all.length === 0)
|
|
44
95
|
return null;
|
|
96
|
+
const last = Math.max(...all.map((r) => r.round));
|
|
97
|
+
const current = all.filter((r) => r.round === last && r.state !== 'cancelled');
|
|
98
|
+
const earlier = all.filter((r) => r.round < last && r.state !== 'cancelled');
|
|
45
99
|
const mine = new Set((inbox.data?.requests ?? []).map((r) => r.id));
|
|
46
100
|
const actionable = current.find((r) => mine.has(r.id));
|
|
47
|
-
|
|
101
|
+
const asked = current.some((r) => r.state === 'pending' && r.requestedBy === me.data?.id);
|
|
102
|
+
const error = decide.error ?? withdraw.error ?? reassign.error ?? tell.error;
|
|
103
|
+
const manage = requests.data?.manage === true;
|
|
104
|
+
// The waiting request whose turn it is (the first, when levels decide side by side).
|
|
105
|
+
const waiting = current.find((r) => r.state === 'pending' && r.startedAt !== null);
|
|
106
|
+
const mayTell = waiting !== undefined &&
|
|
107
|
+
waiting.backups.length > 0 &&
|
|
108
|
+
(manage || waiting.approvers.includes(me.data?.id ?? -1));
|
|
109
|
+
return (_jsxs("section", { "aria-labelledby": `${id}-title`, className: "rounded-lg border bg-surface p-4", children: [_jsxs("h2", { id: `${id}-title`, className: "mb-3 flex items-center gap-2 text-sm font-semibold", children: [t('title'), last > 1 ? _jsx(Badge, { tone: "neutral", children: t('round', { n: last }) }) : null] }), current.length === 0 ? (_jsx("p", { className: "text-sm text-muted-foreground", children: t('withdrawn') })) : (_jsx(Round, { requests: current, events: requests.data?.events ?? [] })), earlier.length === 0 ? null : (_jsxs("details", { className: "mt-3 text-sm", children: [_jsx("summary", { className: "cursor-pointer text-muted-foreground", children: t('earlier', { count: earlier.length }) }), _jsx("div", { className: "mt-2", children: _jsx(Round, { requests: earlier }) })] })), actionable === undefined ? null : (_jsxs("div", { className: "mt-4 grid gap-2", children: [_jsx("label", { htmlFor: `${id}-comment`, className: "text-sm font-medium", children: t('yourDecision', { level: actionable.levelName }) }), _jsx(Textarea, { id: `${id}-comment`, placeholder: t('commentHint'), value: comment, onChange: (e) => setComment(e.target.value) }), _jsxs("div", { className: "flex flex-wrap gap-2", children: [_jsx(Button, { variant: "primary", disabled: decide.isPending, onClick: () => decide.mutate({ request: actionable.id, decision: 'approve' }), children: t('approve') }), _jsx(Button, { disabled: decide.isPending || comment.trim() === '', onClick: () => decide.mutate({ request: actionable.id, decision: 'send-back' }), children: t('sendBack') }), _jsx(Button, { variant: "danger", disabled: decide.isPending || comment.trim() === '', onClick: () => decide.mutate({ request: actionable.id, decision: 'reject' }), children: t('reject') })] })] })), waiting !== undefined && (manage || mayTell) ? (_jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [manage ? (_jsx(Button, { variant: "ghost", onClick: () => setReassigning((v) => !v), children: t('reassign') })) : null, mayTell ? (_jsx(Button, { variant: "ghost", disabled: tell.isPending, onClick: () => tell.mutate(waiting.id), children: t('tellBackups') })) : null] })) : null, reassigning && waiting !== undefined ? (_jsxs("fieldset", { className: "mt-3 grid gap-2 rounded-md border p-3", children: [_jsx("legend", { className: "px-1 text-sm font-medium", children: t('reassignLevel', { level: waiting.levelName }) }), _jsx("label", { htmlFor: `${id}-people`, className: "text-sm", children: t('newApprovers') }), _jsx("select", { id: `${id}-people`, multiple: true, className: "min-h-24 rounded-md border bg-surface p-1 text-sm", value: chosen.map(String), onChange: (e) => setChosen([...e.target.selectedOptions].map((o) => Number(o.value))), children: (people.data?.items ?? [])
|
|
110
|
+
.filter((u) => u.id !== waiting.requestedBy)
|
|
111
|
+
.map((u) => (_jsx("option", { value: u.id, children: u.name }, u.id))) }), _jsx("div", { className: "flex flex-wrap gap-3 text-sm", children: ['replace', 'add'].map((m) => (_jsxs("label", { className: "flex items-center gap-1", children: [_jsx("input", { type: "radio", name: `${id}-mode`, checked: mode === m, onChange: () => setMode(m) }), t(`mode.${m}`)] }, m))) }), _jsx("label", { htmlFor: `${id}-reason`, className: "text-sm", children: t('reason') }), _jsx(Textarea, { id: `${id}-reason`, value: reason, onChange: (e) => setReason(e.target.value) }), _jsx("div", { children: _jsx(Button, { variant: "primary", disabled: reassign.isPending || chosen.length === 0 || reason.trim() === '', onClick: () => reassign.mutate(waiting.id), children: t('reassignConfirm') }) })] })) : null, asked ? (_jsx("div", { className: "mt-3", children: _jsx(Button, { variant: "ghost", disabled: withdraw.isPending, onClick: () => withdraw.mutate(), children: t('withdraw') }) })) : null, error === null ? null : (_jsx("p", { role: "alert", className: "mt-2 text-sm text-danger", children: error instanceof ApiError ? error.message : String(error) }))] }));
|
|
48
112
|
}
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
* The web contribution of `shutro-erp/permissions` (RFC 0007 §5): register it in the app's registry.
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
5
|
+
import { type Registry } from '../../ui/index.js';
|
|
6
|
+
import type { i18n } from 'i18next';
|
|
6
7
|
import { ApprovalPanel } from './ApprovalPanel.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { messages } from './messages.js';
|
|
9
|
+
export { ApprovalPanel, messages as approvalPanelMessages };
|
|
10
|
+
/** Registers `approvals.Panel` (and its messages in `i18n`, when given). */
|
|
11
|
+
export declare function registerPermissionsWeb(registry: Registry, i18n?: i18n): Registry;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* The web contribution of `shutro-erp/permissions` (RFC 0007 §5): register it in the app's registry.
|
|
4
|
+
*/
|
|
5
|
+
import { addMessages } from '../../ui/index.js';
|
|
1
6
|
import { ApprovalPanel } from './ApprovalPanel.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
import { messages } from './messages.js';
|
|
8
|
+
export { ApprovalPanel, messages as approvalPanelMessages };
|
|
9
|
+
/** Registers `approvals.Panel` (and its messages in `i18n`, when given). */
|
|
10
|
+
export function registerPermissionsWeb(registry, i18n) {
|
|
11
|
+
registry.registerComponent('approvals.Panel', ApprovalPanel);
|
|
12
|
+
if (i18n !== undefined)
|
|
13
|
+
addMessages(i18n, 'approvalPanel', messages);
|
|
14
|
+
return registry;
|
|
6
15
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** Messages of the approval panel on records (namespace `approvalPanel`), in English and Bangla. */
|
|
2
|
+
export const messages = {
|
|
3
|
+
en: {
|
|
4
|
+
title: 'Approvals',
|
|
5
|
+
round: 'Round {{n}}',
|
|
6
|
+
earlier: 'Earlier rounds ({{count}})',
|
|
7
|
+
withdrawn: 'The approvals were withdrawn.',
|
|
8
|
+
votes: '{{n}} of {{of}} approvals',
|
|
9
|
+
yourDecision: 'Your decision: {{level}}',
|
|
10
|
+
commentHint: 'A comment (needed to reject or send back)',
|
|
11
|
+
approve: 'Approve',
|
|
12
|
+
sendBack: 'Send back for changes',
|
|
13
|
+
reject: 'Reject',
|
|
14
|
+
withdraw: 'Withdraw my request',
|
|
15
|
+
how: 'How the approvers were found',
|
|
16
|
+
reassign: 'Reassign',
|
|
17
|
+
reassignLevel: 'Reassign {{level}}',
|
|
18
|
+
newApprovers: 'Who decides instead',
|
|
19
|
+
mode: { replace: 'Replace the approvers', add: 'Add to them' },
|
|
20
|
+
reason: 'Why (required)',
|
|
21
|
+
reassignConfirm: 'Reassign',
|
|
22
|
+
tellBackups: 'Tell the backups',
|
|
23
|
+
log: 'Log',
|
|
24
|
+
since: 'Its turn for {{hours}} h',
|
|
25
|
+
event: {
|
|
26
|
+
created: 'Created',
|
|
27
|
+
started: 'Its turn',
|
|
28
|
+
voted: 'Voted',
|
|
29
|
+
approved: 'Approved',
|
|
30
|
+
rejected: 'Rejected',
|
|
31
|
+
sent_back: 'Sent back',
|
|
32
|
+
cancelled: 'Cancelled',
|
|
33
|
+
skipped: 'Skipped',
|
|
34
|
+
reminded: 'Reminded',
|
|
35
|
+
escalated: 'Escalated',
|
|
36
|
+
auto: 'Approved already',
|
|
37
|
+
reassigned: 'Reassigned',
|
|
38
|
+
synced: 'Synced',
|
|
39
|
+
notified: 'Backups told',
|
|
40
|
+
},
|
|
41
|
+
state: {
|
|
42
|
+
pending: 'Waiting',
|
|
43
|
+
approved: 'Approved',
|
|
44
|
+
rejected: 'Rejected',
|
|
45
|
+
sent_back: 'Sent back',
|
|
46
|
+
cancelled: 'Cancelled',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
bn: {
|
|
50
|
+
title: 'অনুমোদন',
|
|
51
|
+
round: 'পর্ব {{n}}',
|
|
52
|
+
earlier: 'আগের পর্ব ({{count}})',
|
|
53
|
+
withdrawn: 'অনুমোদনের অনুরোধ প্রত্যাহার করা হয়েছে।',
|
|
54
|
+
votes: '{{of}}টির মধ্যে {{n}}টি অনুমোদন',
|
|
55
|
+
yourDecision: 'আপনার সিদ্ধান্ত: {{level}}',
|
|
56
|
+
commentHint: 'একটি মন্তব্য (প্রত্যাখ্যান বা ফেরত পাঠাতে প্রয়োজন)',
|
|
57
|
+
approve: 'অনুমোদন',
|
|
58
|
+
sendBack: 'সংশোধনের জন্য ফেরত',
|
|
59
|
+
reject: 'প্রত্যাখ্যান',
|
|
60
|
+
withdraw: 'আমার অনুরোধ প্রত্যাহার',
|
|
61
|
+
how: 'অনুমোদনকারী কীভাবে নির্ধারিত হলেন',
|
|
62
|
+
reassign: 'অন্যকে দিন',
|
|
63
|
+
reassignLevel: '{{level}} অন্যকে দিন',
|
|
64
|
+
newApprovers: 'এর বদলে কে সিদ্ধান্ত নেবেন',
|
|
65
|
+
mode: { replace: 'অনুমোদনকারী বদলে দিন', add: 'তাঁদের সঙ্গে যোগ করুন' },
|
|
66
|
+
reason: 'কারণ (আবশ্যক)',
|
|
67
|
+
reassignConfirm: 'অন্যকে দিন',
|
|
68
|
+
tellBackups: 'বিকল্পদের জানান',
|
|
69
|
+
log: 'লগ',
|
|
70
|
+
since: '{{hours}} ঘণ্টা ধরে এর পালা',
|
|
71
|
+
event: {
|
|
72
|
+
created: 'তৈরি',
|
|
73
|
+
started: 'এর পালা',
|
|
74
|
+
voted: 'ভোট',
|
|
75
|
+
approved: 'অনুমোদিত',
|
|
76
|
+
rejected: 'প্রত্যাখ্যাত',
|
|
77
|
+
sent_back: 'ফেরত পাঠানো',
|
|
78
|
+
cancelled: 'বাতিল',
|
|
79
|
+
skipped: 'বাদ দেওয়া',
|
|
80
|
+
reminded: 'মনে করানো',
|
|
81
|
+
escalated: 'ঊর্ধ্বতনে পাঠানো',
|
|
82
|
+
auto: 'আগেই অনুমোদিত',
|
|
83
|
+
reassigned: 'অন্যকে দেওয়া',
|
|
84
|
+
synced: 'মিলিয়ে নেওয়া',
|
|
85
|
+
notified: 'বিকল্পদের জানানো',
|
|
86
|
+
},
|
|
87
|
+
state: {
|
|
88
|
+
pending: 'অপেক্ষায়',
|
|
89
|
+
approved: 'অনুমোদিত',
|
|
90
|
+
rejected: 'প্রত্যাখ্যাত',
|
|
91
|
+
sent_back: 'ফেরত পাঠানো',
|
|
92
|
+
cancelled: 'বাতিল',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash:
|
|
1
|
+
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: ebc3fbac95760b14
|
|
2
2
|
// Bindings of module `portal`: import the definition API from here to get types scoped to what it can see.
|
|
3
3
|
export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
|
|
4
4
|
import { definitions } from '../../server/orm.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash:
|
|
1
|
+
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: ebc3fbac95760b14
|
|
2
2
|
// Schema view of module `portal` (RFC 0002 §7.7): the models it owns or depends on, with the extensions it can see.
|
|
3
3
|
import type { F } from '../../server/orm.js';
|
|
4
4
|
|
|
@@ -508,6 +508,7 @@ export interface ResPartner {
|
|
|
508
508
|
readonly parent: F.Many2one<'res.partner'>;
|
|
509
509
|
readonly contacts: F.One2many<'res.partner', { readonly required: true }>;
|
|
510
510
|
readonly email: F.Char;
|
|
511
|
+
readonly lang: F.Selection<'en' | 'bn'>;
|
|
511
512
|
readonly phone: F.Char;
|
|
512
513
|
readonly mobile: F.Char;
|
|
513
514
|
readonly website: F.Char;
|
|
@@ -12,6 +12,9 @@ export interface PortalDocument {
|
|
|
12
12
|
readonly model: ApiModel;
|
|
13
13
|
/** The lines' model, when the document has lines. */
|
|
14
14
|
readonly lineModel: ApiModel | null;
|
|
15
|
+
/** The optional items' model and the field that points back at the document, when it has options. */
|
|
16
|
+
readonly optionModel: ApiModel | null;
|
|
17
|
+
readonly optionParent: string | null;
|
|
15
18
|
}
|
|
16
19
|
/** The documents of the loaded modules, by key. @throws {ServerConfigError} for a declaration that cannot work */
|
|
17
20
|
export declare function portalDocuments(registry: KoshRegistry): ReadonlyMap<string, PortalDocument>;
|
package/dist/portal/documents.js
CHANGED
|
@@ -50,12 +50,32 @@ export function portalDocuments(registry) {
|
|
|
50
50
|
if (!lineModel.byKey.has(field))
|
|
51
51
|
fail(key, `${lines?.target} has no field '${field}'.`, 'Declare existing line fields.');
|
|
52
52
|
}
|
|
53
|
+
let optionModel = null;
|
|
54
|
+
let optionParent = null;
|
|
55
|
+
if (spec.options !== undefined) {
|
|
56
|
+
const options = m.byKey.get(spec.options.field);
|
|
57
|
+
if (options?.kind !== 'one2many' || options.target === null)
|
|
58
|
+
fail(key, `'${spec.options.field}' is not a one2many.`, 'Name the options field.');
|
|
59
|
+
optionModel = models.get(options?.target ?? '') ?? null;
|
|
60
|
+
if (optionModel === null)
|
|
61
|
+
fail(key, `the options' model ${options?.target} is not served.`, 'Use a served model.');
|
|
62
|
+
const om = optionModel;
|
|
63
|
+
for (const field of spec.options.fields)
|
|
64
|
+
if (!om.byKey.has(field))
|
|
65
|
+
fail(key, `${om.name} has no field '${field}'.`, 'Declare existing option fields.');
|
|
66
|
+
if (!om.transitions.includes(spec.options.add))
|
|
67
|
+
fail(key, `${om.name} has no transition '${spec.options.add}'.`, 'Name the transition that adds an option.');
|
|
68
|
+
optionParent =
|
|
69
|
+
om.fields.find((f) => f.kind === 'many2one' && f.target === spec.model)?.key ?? null;
|
|
70
|
+
if (optionParent === null)
|
|
71
|
+
fail(key, `${om.name} has no many2one to ${spec.model}.`, 'Options point at their document.');
|
|
72
|
+
}
|
|
53
73
|
for (const action of spec.actions ?? [])
|
|
54
74
|
if (!m.transitions.includes(action.transition))
|
|
55
75
|
fail(key, `${spec.model} has no transition '${action.transition}' (action '${action.key}').`, `Transitions: ${m.transitions.join(', ') || 'none'}.`);
|
|
56
76
|
if (spec.pdf !== undefined && !templates.has(spec.pdf))
|
|
57
77
|
fail(key, `no document template '${spec.pdf}'.`, 'Name a template a module ships (module.key).');
|
|
58
|
-
out.set(key, { spec, model: m, lineModel });
|
|
78
|
+
out.set(key, { spec, model: m, lineModel, optionModel, optionParent });
|
|
59
79
|
}
|
|
60
80
|
return out;
|
|
61
81
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Bangla for the module's labels, keyed by their English text (RFC 0023 §3.1; `pnpm i18n:extract`). */
|
|
2
|
+
export const bn = {
|
|
3
|
+
'A document is announced once.': 'একটি নথির ঘোষণা একবারই দেওয়া হয়।',
|
|
4
|
+
Action: 'কার্যক্রম',
|
|
5
|
+
Company: 'প্রতিষ্ঠান',
|
|
6
|
+
'Created At': 'তৈরির সময়',
|
|
7
|
+
'Created By': 'তৈরি করেছেন',
|
|
8
|
+
'Display Name': 'প্রদর্শিত নাম',
|
|
9
|
+
Document: 'নথি',
|
|
10
|
+
'Document Hash': 'নথির হ্যাশ',
|
|
11
|
+
'Expires At': 'মেয়াদ শেষের সময়',
|
|
12
|
+
ID: 'আইডি',
|
|
13
|
+
'Invited By': 'আমন্ত্রণ জানিয়েছেন',
|
|
14
|
+
Ip: 'আইপি',
|
|
15
|
+
Model: 'মডেল',
|
|
16
|
+
Name: 'নাম',
|
|
17
|
+
'Portal access': 'পোর্টাল প্রবেশাধিকার',
|
|
18
|
+
'Portal access manager': 'পোর্টাল প্রবেশাধিকার ব্যবস্থাপক',
|
|
19
|
+
'Portal announcement': 'পোর্টাল ঘোষণা',
|
|
20
|
+
'Portal contact': 'পোর্টাল যোগাযোগ',
|
|
21
|
+
'Portal invitation': 'পোর্টাল আমন্ত্রণ',
|
|
22
|
+
'Portal signature': 'পোর্টাল স্বাক্ষর',
|
|
23
|
+
'Portal user': 'পোর্টাল ব্যবহারকারী',
|
|
24
|
+
'Portal users': 'পোর্টাল ব্যবহারকারী',
|
|
25
|
+
Recipients: 'প্রাপক',
|
|
26
|
+
Record: 'রেকর্ড',
|
|
27
|
+
Signature: 'স্বাক্ষর',
|
|
28
|
+
'Token Hash': 'টোকেন হ্যাশ',
|
|
29
|
+
'Updated At': 'হালনাগাদের সময়',
|
|
30
|
+
'Updated By': 'হালনাগাদ করেছেন',
|
|
31
|
+
'Used At': 'ব্যবহারের সময়',
|
|
32
|
+
User: 'ব্যবহারকারী',
|
|
33
|
+
};
|
package/dist/portal/index.js
CHANGED
|
@@ -31,9 +31,11 @@ export function createPortal(options = {}) {
|
|
|
31
31
|
shutro: portalShutro,
|
|
32
32
|
kosh: '^0.1.0',
|
|
33
33
|
depends: [base, contacts, messaging, reporting],
|
|
34
|
+
// Bangla for the labels it serves (RFC 0023 §3.1; `pnpm i18n:extract`).
|
|
35
|
+
i18n: { bn: () => import('./i18n/bn.js') },
|
|
34
36
|
accessLevels: { manager: { label: 'Portal access', groups: ['portal.manager'] } },
|
|
35
37
|
externalGroups: ['portal.user'],
|
|
36
|
-
privateModels: ['portal.invitation', 'portal.signature'],
|
|
38
|
+
privateModels: ['portal.invitation', 'portal.signature', 'portal.announcement'],
|
|
37
39
|
// "Portal access" on the contact form, under the ways to reach them.
|
|
38
40
|
viewExtensions: [
|
|
39
41
|
{
|
package/dist/portal/module.d.ts
CHANGED
|
@@ -1172,6 +1172,16 @@ export declare const portalShutro: import("../server/orm.js").Module<readonly [i
|
|
|
1172
1172
|
readonly hasDefault: false;
|
|
1173
1173
|
readonly readonly: false;
|
|
1174
1174
|
}, string>;
|
|
1175
|
+
readonly lang: import("../server/orm.js").SelectionField<"bn" | "en", {
|
|
1176
|
+
readonly required: false;
|
|
1177
|
+
readonly computed: false;
|
|
1178
|
+
readonly inverse: false;
|
|
1179
|
+
readonly sequence: false;
|
|
1180
|
+
readonly computeName: undefined;
|
|
1181
|
+
readonly store: true;
|
|
1182
|
+
readonly hasDefault: false;
|
|
1183
|
+
readonly readonly: false;
|
|
1184
|
+
}>;
|
|
1175
1185
|
readonly phone: import("../server/orm.js").CharField<{
|
|
1176
1186
|
readonly required: false;
|
|
1177
1187
|
readonly computed: false;
|
|
@@ -1393,6 +1403,16 @@ export declare const portalShutro: import("../server/orm.js").Module<readonly [i
|
|
|
1393
1403
|
readonly hasDefault: false;
|
|
1394
1404
|
readonly readonly: false;
|
|
1395
1405
|
}, string>;
|
|
1406
|
+
readonly lang: import("../server/orm.js").SelectionField<"bn" | "en", {
|
|
1407
|
+
readonly required: false;
|
|
1408
|
+
readonly computed: false;
|
|
1409
|
+
readonly inverse: false;
|
|
1410
|
+
readonly sequence: false;
|
|
1411
|
+
readonly computeName: undefined;
|
|
1412
|
+
readonly store: true;
|
|
1413
|
+
readonly hasDefault: false;
|
|
1414
|
+
readonly readonly: false;
|
|
1415
|
+
}>;
|
|
1396
1416
|
readonly phone: import("../server/orm.js").CharField<{
|
|
1397
1417
|
readonly required: false;
|
|
1398
1418
|
readonly computed: false;
|
|
@@ -112,6 +112,22 @@ export function registerPortalDocumentRoutes(context) {
|
|
|
112
112
|
});
|
|
113
113
|
return out;
|
|
114
114
|
};
|
|
115
|
+
/** The optional items on offer and whether the document takes them now (RFC 0028 §3.5). */
|
|
116
|
+
const optionsOf = async (su, d, id) => {
|
|
117
|
+
const spec = d.spec.options;
|
|
118
|
+
if (spec === undefined || d.optionModel === null || d.optionParent === null)
|
|
119
|
+
return {};
|
|
120
|
+
const offered = await ref(su, d.optionModel.name).search({
|
|
121
|
+
where: { and: [{ [d.optionParent]: id }, spec.offered] },
|
|
122
|
+
});
|
|
123
|
+
const open = (await ref(su, d.model.name).search({ where: { and: [{ id }, spec.when] }, limit: 1 }))
|
|
124
|
+
.length > 0;
|
|
125
|
+
return {
|
|
126
|
+
optionFields: meta(d.optionModel, spec.fields),
|
|
127
|
+
options: await values(su, d.optionModel, offered.ids, spec.fields),
|
|
128
|
+
optionsOpen: open,
|
|
129
|
+
};
|
|
130
|
+
};
|
|
115
131
|
/** The document as the user sees it: what a signature's hash covers. */
|
|
116
132
|
const documentOfRecord = async (su, d, id) => {
|
|
117
133
|
const [record] = await values(su, d.model, [id], d.spec.fields);
|
|
@@ -207,6 +223,7 @@ export function registerPortalDocumentRoutes(context) {
|
|
|
207
223
|
? {}
|
|
208
224
|
: { lineFields: meta(d.lineModel, d.spec.lines.fields), lines }),
|
|
209
225
|
actions: await available(su, d, id),
|
|
226
|
+
...(await optionsOf(su, d, id)),
|
|
210
227
|
payable: d.spec.payment !== undefined &&
|
|
211
228
|
(await ref(su, d.model.name).search({
|
|
212
229
|
where: { and: [{ id }, d.spec.payment.when] },
|
|
@@ -328,6 +345,65 @@ export function registerPortalDocumentRoutes(context) {
|
|
|
328
345
|
}), { write: true });
|
|
329
346
|
return reply.status(outcome.status).send(outcome.body);
|
|
330
347
|
});
|
|
348
|
+
// `POST /api/portal/v1/documents/:key/:id/options/:option/add`: the user adds an optional item to their document
|
|
349
|
+
// while it takes them (RFC 0028 §3.5) — checked as the user, added as the system, on the thread and audited.
|
|
350
|
+
app.post('/api/portal/v1/documents/:key/:id/options/:option/add', async (request, reply) => {
|
|
351
|
+
const d = documentOf(request.params);
|
|
352
|
+
const id = idOf(request.params);
|
|
353
|
+
const option = Number(request.params['option']);
|
|
354
|
+
const spec = d.spec.options;
|
|
355
|
+
if (spec === undefined || d.optionModel === null || d.optionParent === null)
|
|
356
|
+
throw new HttpProblem(404, 'not-found', 'No options', `${d.spec.label} have no options.`);
|
|
357
|
+
if (!Number.isSafeInteger(option) || option <= 0)
|
|
358
|
+
throw new HttpProblem(404, 'not-found', 'No such option', 'No such option.');
|
|
359
|
+
const optionModel = d.optionModel.name;
|
|
360
|
+
const parent = d.optionParent;
|
|
361
|
+
const outcome = await request.env((env) => idempotent(request, env, driver, async () => {
|
|
362
|
+
portalOnly(env);
|
|
363
|
+
await mine(env, d, id);
|
|
364
|
+
const who = await env.asSuperuser({ reason: 'portal option' }, async (su) => {
|
|
365
|
+
const open = (await ref(su, d.model.name).search({
|
|
366
|
+
where: { and: [{ id }, spec.when] },
|
|
367
|
+
limit: 1,
|
|
368
|
+
})).length > 0;
|
|
369
|
+
const onOffer = (await ref(su, optionModel).search({
|
|
370
|
+
where: { and: [{ id: option, [parent]: id }, spec.offered] },
|
|
371
|
+
limit: 1,
|
|
372
|
+
})).length > 0;
|
|
373
|
+
if (!open || !onOffer)
|
|
374
|
+
throw new HttpProblem(409, 'not-available', 'Not possible any more', 'This option cannot be added to this document now.');
|
|
375
|
+
const [user] = (await ref(su, 'res.users').browse([env.uid]).load(['login', 'name'])).read(['login', 'name']);
|
|
376
|
+
const [item] = (await ref(su, optionModel).browse([option]).load(['displayName'])).read(['displayName']);
|
|
377
|
+
return {
|
|
378
|
+
login: String(user?.['login'] ?? ''),
|
|
379
|
+
name: String(user?.['name'] ?? ''),
|
|
380
|
+
item: String(item?.['displayName'] ?? `#${option}`),
|
|
381
|
+
};
|
|
382
|
+
});
|
|
383
|
+
await context.shutro.bootstrap({ reason: `portal ${d.spec.key} option by ${who.login}`, company: env.companyId }, async (su) => {
|
|
384
|
+
const target = ref(su, optionModel).browse([option]);
|
|
385
|
+
await target[spec.add].call(target);
|
|
386
|
+
await postExternalMessage(su, chatter, d.model.name, id, {
|
|
387
|
+
text: `${who.name} added “${who.item}” in the portal.`,
|
|
388
|
+
authorEmail: who.login,
|
|
389
|
+
authorName: who.name,
|
|
390
|
+
});
|
|
391
|
+
await audit(su, {
|
|
392
|
+
kind: 'portal.option',
|
|
393
|
+
summary: `${who.name} (${who.login}) added ${who.item} to ${d.model.name} #${id} in the portal.`,
|
|
394
|
+
actor: env.uid,
|
|
395
|
+
company: env.companyId,
|
|
396
|
+
targetModel: d.model.name,
|
|
397
|
+
targetId: id,
|
|
398
|
+
details: { option },
|
|
399
|
+
ip: request.ip,
|
|
400
|
+
});
|
|
401
|
+
await su.flush();
|
|
402
|
+
});
|
|
403
|
+
return { status: 200, body: { added: option } };
|
|
404
|
+
}), { write: true });
|
|
405
|
+
return reply.status(outcome.status).send(outcome.body);
|
|
406
|
+
});
|
|
331
407
|
app.get('/api/portal/v1/documents/:key/:id/thread', async (request) => {
|
|
332
408
|
const d = documentOf(request.params);
|
|
333
409
|
const id = idOf(request.params);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash:
|
|
1
|
+
// GENERATED by `pnpm generate:models` (Shutro’s generator). Do not edit. definitions-hash: fff35eedcd283a0e
|
|
2
2
|
// Bindings of module `pos`: import the definition API from here to get types scoped to what it can see.
|
|
3
3
|
export { defineModel, defineModule, extendModel, f, replace } from '../../server/orm.js';
|
|
4
4
|
import { definitions } from '../../server/orm.js';
|