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
|
@@ -0,0 +1,1256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* `shutro-erp/production` (RFC 0021): the **Production** app. Bills of materials with versions and effective dates, work
|
|
4
|
+
* centres, and production orders that show what is short and what they cost before they start, moving stock through
|
|
5
|
+
* Stockroom (components to Production, the product back into stock). Their work orders are scheduled at the work
|
|
6
|
+
* centres and shown on a Gantt.
|
|
7
|
+
*
|
|
8
|
+
* - `GET /api/v1/production/capacity?from=YYYY-MM-DD&to=YYYY-MM-DD` each centre's planned hours and load, by day
|
|
9
|
+
*/
|
|
10
|
+
import { contacts } from '../contacts/index.js';
|
|
11
|
+
import { messaging } from '../messaging/index.js';
|
|
12
|
+
import { defineModule } from '../modules-sdk/index.js';
|
|
13
|
+
import { permissions } from '../permissions/index.js';
|
|
14
|
+
import { product } from '../product/index.js';
|
|
15
|
+
import { reporting } from '../reporting/index.js';
|
|
16
|
+
import { HttpProblem } from '../server/index.js';
|
|
17
|
+
import { stock } from '../stock/index.js';
|
|
18
|
+
import { action, field, form, gantt, kanban, list, search } from '../views/index.js';
|
|
19
|
+
import { productionDemo } from './demo.js';
|
|
20
|
+
import { ProductionBomEligibility, ProductionProductSpec, ProductionShift, ProductionSpecParameter, } from './depth.js';
|
|
21
|
+
import { DAY_STARTS_AT, ProductionBom, ProductionBomLine, ProductionOrder, ProductionOrderComponent, ProductionWorkcenter, ProductionWorkorder, productionShutro, } from './module.js';
|
|
22
|
+
import { ProductionPlan, ProductionPlanLine } from './plan.js';
|
|
23
|
+
import { ProductionSchedule } from './schedule.js';
|
|
24
|
+
export { BOM_KINDS, bomsNeedApproval, CompanyProduction, ineligible, ProductionBomCost, ProductionBomEligibility, ProductionBomSpec, ProductionProductSpec, ProductionShift, ProductionSpecParameter, reachedValues, } from './depth.js';
|
|
25
|
+
export { ProductionBom, ProductionBomByproduct, ProductionBomLine, ProductionBomOperation, ProductionOrder, ProductionOrderComponent, ProductionWorkcenter, ProductionWorkorder, productionShutro, ReorderMake, reviseBom, ScrapProduction, schedule, validBom, } from './module.js';
|
|
26
|
+
export { generateForecast, generateSchedules, ProductionPlan, ProductionPlanLine, ProductionPlanMaterial, procureShortages, } from './plan.js';
|
|
27
|
+
export { followOrders, makeOrders, ProductionSchedule, ProductionScheduleComponent, preflight, } from './schedule.js';
|
|
28
|
+
/** Each work centre's planned hours by day (the overlap of its work orders with the day) against its hours. */
|
|
29
|
+
function registerCapacityRoutes({ app }) {
|
|
30
|
+
app.get('/api/v1/production/capacity', async (request) => {
|
|
31
|
+
const q = request.query;
|
|
32
|
+
const valid = (v) => typeof v === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(v);
|
|
33
|
+
if (!valid(q.from) || !valid(q.to) || String(q.from) > String(q.to))
|
|
34
|
+
throw new HttpProblem(400, 'invalid-period', 'Invalid period', 'from and to as YYYY-MM-DD, from first.');
|
|
35
|
+
const days = [];
|
|
36
|
+
for (let d = new Date(`${String(q.from)}T00:00:00`);; d = new Date(d.getTime() + 86_400_000)) {
|
|
37
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
38
|
+
const day = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
|
|
39
|
+
if (day > String(q.to) || days.length > 92)
|
|
40
|
+
break;
|
|
41
|
+
days.push(day);
|
|
42
|
+
}
|
|
43
|
+
return request.env(async (raw) => {
|
|
44
|
+
const env = raw;
|
|
45
|
+
const centres = await (await env.model('production.workcenter').search({})).load([
|
|
46
|
+
'name',
|
|
47
|
+
'hoursPerDay',
|
|
48
|
+
]);
|
|
49
|
+
const orders = await (await env
|
|
50
|
+
.model('production.workorder')
|
|
51
|
+
.search({ where: { state: { in: ['ready', 'progress'] } } })).load({ workcenter: true });
|
|
52
|
+
return {
|
|
53
|
+
days,
|
|
54
|
+
workcenters: [...centres].map((c) => ({
|
|
55
|
+
id: c.id,
|
|
56
|
+
name: c.name,
|
|
57
|
+
hoursPerDay: c.hoursPerDay.toString(),
|
|
58
|
+
days: days.map((day) => {
|
|
59
|
+
// The centre's working window that day: the work planned outside it (the night) does not count.
|
|
60
|
+
const from = new Date(`${day}T${String(DAY_STARTS_AT).padStart(2, '0')}:00:00`).getTime();
|
|
61
|
+
const to = from + Number(c.hoursPerDay) * 3_600_000;
|
|
62
|
+
let ms = 0;
|
|
63
|
+
for (const w of orders) {
|
|
64
|
+
if (w.workcenter.id !== c.id ||
|
|
65
|
+
!(w.plannedStart instanceof Date) ||
|
|
66
|
+
!(w.plannedStop instanceof Date))
|
|
67
|
+
continue;
|
|
68
|
+
ms += Math.max(0, Math.min(to, w.plannedStop.getTime()) - Math.max(from, w.plannedStart.getTime()));
|
|
69
|
+
}
|
|
70
|
+
const hours = ms / 3_600_000;
|
|
71
|
+
const capacity = Number(c.hoursPerDay);
|
|
72
|
+
return {
|
|
73
|
+
day,
|
|
74
|
+
plannedHours: hours.toFixed(2),
|
|
75
|
+
load: capacity > 0 ? Math.round((hours / capacity) * 100) : 0,
|
|
76
|
+
};
|
|
77
|
+
}),
|
|
78
|
+
})),
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export const production = defineModule({
|
|
84
|
+
shutro: productionShutro,
|
|
85
|
+
kosh: '^0.1.0',
|
|
86
|
+
hooks: { demo: productionDemo },
|
|
87
|
+
// Exceptions to the module standard (RFC 0023), each with its reason.
|
|
88
|
+
standard: {
|
|
89
|
+
waive: [
|
|
90
|
+
{
|
|
91
|
+
rule: 'I1',
|
|
92
|
+
model: 'production.bom.spec',
|
|
93
|
+
reason: 'Imports with its bill (the bills template).',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
rule: 'I1',
|
|
97
|
+
model: 'production.bom.cost',
|
|
98
|
+
reason: 'Written by the system when a bill is activated.',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
rule: 'I1',
|
|
102
|
+
model: 'production.plan.line',
|
|
103
|
+
reason: 'Lines import with their plan (the plans template).',
|
|
104
|
+
},
|
|
105
|
+
{ rule: 'I1', model: 'production.plan.material', reason: 'Written by the forecast.' },
|
|
106
|
+
{ rule: 'I1', model: 'production.schedule.component', reason: 'Written by the pre-flight.' },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
// Settings › App settings › Production (RFC 0020): per company.
|
|
110
|
+
settings: {
|
|
111
|
+
sections: [
|
|
112
|
+
{
|
|
113
|
+
key: 'bills',
|
|
114
|
+
label: 'Bills of materials',
|
|
115
|
+
description: 'Whether bills are approved before they make products.',
|
|
116
|
+
keywords: 'bill of materials bom approval formula',
|
|
117
|
+
scope: 'company',
|
|
118
|
+
editors: ['production.manager'],
|
|
119
|
+
fields: [
|
|
120
|
+
{
|
|
121
|
+
key: 'bomApproval',
|
|
122
|
+
help: 'On, a bill is submitted for review and approved before an order may use it; off, a draft bill is used at once.',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
approvals: [
|
|
129
|
+
{
|
|
130
|
+
name: 'Production plan approvals',
|
|
131
|
+
model: 'production.plan',
|
|
132
|
+
onApproved: 'approve',
|
|
133
|
+
onRejected: 'reject',
|
|
134
|
+
levels: [{ name: 'Production manager', condition: {}, approverRole: 'production.manager' }],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: 'Bill of materials approvals',
|
|
138
|
+
model: 'production.bom',
|
|
139
|
+
onApproved: 'approve',
|
|
140
|
+
onRejected: 'reject',
|
|
141
|
+
levels: [{ name: 'Production manager', condition: {}, approverRole: 'production.manager' }],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
depends: [product, stock, contacts, messaging, reporting, permissions],
|
|
145
|
+
app: {
|
|
146
|
+
code: 'production',
|
|
147
|
+
label: 'Production',
|
|
148
|
+
icon: 'production',
|
|
149
|
+
sequence: 13,
|
|
150
|
+
category: 'Operations',
|
|
151
|
+
summary: 'Bills of materials with versions, orders that show what is short and what they cost',
|
|
152
|
+
},
|
|
153
|
+
// The product's shelf life and retail price, with Stockroom's stock group.
|
|
154
|
+
viewExtensions: [
|
|
155
|
+
{
|
|
156
|
+
view: 'product.product.form',
|
|
157
|
+
operations: [
|
|
158
|
+
{
|
|
159
|
+
insertAfter: 'stock_quantities',
|
|
160
|
+
nodes: [
|
|
161
|
+
{
|
|
162
|
+
kind: 'group',
|
|
163
|
+
id: 'production_label',
|
|
164
|
+
label: 'Batches and labels',
|
|
165
|
+
children: [
|
|
166
|
+
field({ field: 'shelfLifeDays', id: 'production_shelf_life' }),
|
|
167
|
+
field({ field: 'retailPrice', id: 'production_retail_price' }),
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
routes: (context) => registerCapacityRoutes(context),
|
|
176
|
+
documents: [
|
|
177
|
+
{
|
|
178
|
+
key: 'production_schedule',
|
|
179
|
+
name: 'Production schedule',
|
|
180
|
+
model: 'production.schedule',
|
|
181
|
+
layout: {
|
|
182
|
+
paper: 'A4',
|
|
183
|
+
header: '{{company.name}}',
|
|
184
|
+
footer: 'Page {{page}} of {{pages}}',
|
|
185
|
+
blocks: [
|
|
186
|
+
{ kind: 'heading', id: 'title', text: 'Batch {{name}}', level: 1 },
|
|
187
|
+
{
|
|
188
|
+
kind: 'fields',
|
|
189
|
+
id: 'about',
|
|
190
|
+
items: [
|
|
191
|
+
{ label: 'Product', bind: 'product.name' },
|
|
192
|
+
{ label: 'Bill of materials', bind: 'bom.label' },
|
|
193
|
+
{ label: 'Packaging bill', bind: 'packagingBom.label' },
|
|
194
|
+
{ label: 'Target', bind: 'quantity' },
|
|
195
|
+
{ label: 'Produced', bind: 'produced' },
|
|
196
|
+
{ label: 'Work centre', bind: 'workcenter.name' },
|
|
197
|
+
{ label: 'Shift', bind: 'shift.name' },
|
|
198
|
+
{ label: 'Start', bind: 'start' },
|
|
199
|
+
{ label: 'End', bind: 'end' },
|
|
200
|
+
{ label: 'Status', bind: 'state' },
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
kind: 'table',
|
|
205
|
+
id: 'components',
|
|
206
|
+
bind: 'components',
|
|
207
|
+
columns: [
|
|
208
|
+
{ label: 'Component', bind: 'product.name' },
|
|
209
|
+
{ label: 'Required', bind: 'required' },
|
|
210
|
+
{ label: 'Available', bind: 'available' },
|
|
211
|
+
{ label: 'Deficit', bind: 'deficit' },
|
|
212
|
+
{ label: 'Surplus', bind: 'surplus' },
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
kind: 'table',
|
|
217
|
+
id: 'orders',
|
|
218
|
+
bind: 'orders',
|
|
219
|
+
columns: [
|
|
220
|
+
{ label: 'Order', bind: 'name' },
|
|
221
|
+
{ label: 'Stage', bind: 'stage' },
|
|
222
|
+
{ label: 'Status', bind: 'state' },
|
|
223
|
+
{ label: 'Produced', bind: 'producedQty' },
|
|
224
|
+
{ label: 'Yield', bind: 'yieldStatus' },
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{ kind: 'text', id: 'note', text: '{{note}}' },
|
|
228
|
+
{ kind: 'qr', id: 'qr', bind: 'name', size: 24, label: 'Batch number' },
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
key: 'production_label',
|
|
234
|
+
name: 'Batch label',
|
|
235
|
+
model: 'production.order',
|
|
236
|
+
layout: {
|
|
237
|
+
paper: 'A4',
|
|
238
|
+
header: '{{company.name}}',
|
|
239
|
+
footer: '',
|
|
240
|
+
blocks: [
|
|
241
|
+
{ kind: 'heading', id: 'title', text: '{{product.name}}', level: 1 },
|
|
242
|
+
{
|
|
243
|
+
kind: 'fields',
|
|
244
|
+
id: 'label',
|
|
245
|
+
items: [
|
|
246
|
+
{ label: 'Batch number', bind: 'batch' },
|
|
247
|
+
{ label: 'Quantity', bind: 'producedQty' },
|
|
248
|
+
{ label: 'Manufactured on', bind: 'manufacturingDate' },
|
|
249
|
+
{ label: 'Expires on', bind: 'expiryDate' },
|
|
250
|
+
{ label: 'Maximum retail price', bind: 'product.retailPrice' },
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
{ kind: 'qr', id: 'qr', bind: 'batch', size: 32, label: 'Batch number' },
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
key: 'production_plan',
|
|
259
|
+
name: 'Production plan',
|
|
260
|
+
model: 'production.plan',
|
|
261
|
+
layout: {
|
|
262
|
+
paper: 'A4',
|
|
263
|
+
orientation: 'landscape',
|
|
264
|
+
header: '{{company.name}}',
|
|
265
|
+
footer: 'Page {{page}} of {{pages}}',
|
|
266
|
+
blocks: [
|
|
267
|
+
{ kind: 'heading', id: 'title', text: 'Production plan {{name}}', level: 1 },
|
|
268
|
+
{
|
|
269
|
+
kind: 'fields',
|
|
270
|
+
id: 'about',
|
|
271
|
+
items: [
|
|
272
|
+
{ label: 'Plan', bind: 'title' },
|
|
273
|
+
{ label: 'From', bind: 'dateFrom' },
|
|
274
|
+
{ label: 'To', bind: 'dateTo' },
|
|
275
|
+
{ label: 'Warehouse', bind: 'warehouse.name' },
|
|
276
|
+
{ label: 'Status', bind: 'state' },
|
|
277
|
+
],
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
kind: 'table',
|
|
281
|
+
id: 'lines',
|
|
282
|
+
bind: 'lines',
|
|
283
|
+
columns: [
|
|
284
|
+
{ label: 'Product', bind: 'product.name' },
|
|
285
|
+
{ label: 'Bill of materials', bind: 'bom.label' },
|
|
286
|
+
{ label: 'Quantity', bind: 'quantity' },
|
|
287
|
+
{ label: 'Work centre', bind: 'workcenter.name' },
|
|
288
|
+
{ label: 'Start', bind: 'start' },
|
|
289
|
+
{ label: 'End', bind: 'end' },
|
|
290
|
+
{ label: 'Minutes needed', bind: 'minutes' },
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
kind: 'table',
|
|
295
|
+
id: 'materials',
|
|
296
|
+
bind: 'materials',
|
|
297
|
+
columns: [
|
|
298
|
+
{ label: 'Material', bind: 'product.name' },
|
|
299
|
+
{ label: 'Required', bind: 'required' },
|
|
300
|
+
{ label: 'On hand', bind: 'onHand' },
|
|
301
|
+
{ label: 'On order', bind: 'onOrder' },
|
|
302
|
+
{ label: 'Shortage', bind: 'shortage' },
|
|
303
|
+
{ label: 'Ordered by', bind: 'document' },
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
{ kind: 'text', id: 'note', text: '{{note}}' },
|
|
307
|
+
{ kind: 'qr', id: 'qr', bind: 'name', size: 24, label: 'Plan reference' },
|
|
308
|
+
],
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
key: 'production_bom',
|
|
313
|
+
name: 'Bill of materials',
|
|
314
|
+
model: 'production.bom',
|
|
315
|
+
layout: {
|
|
316
|
+
paper: 'A4',
|
|
317
|
+
header: '{{company.name}}',
|
|
318
|
+
footer: 'Page {{page}} of {{pages}}',
|
|
319
|
+
blocks: [
|
|
320
|
+
{ kind: 'heading', id: 'title', text: 'Bill of materials {{label}}', level: 1 },
|
|
321
|
+
{
|
|
322
|
+
kind: 'fields',
|
|
323
|
+
id: 'about',
|
|
324
|
+
items: [
|
|
325
|
+
{ label: 'Product', bind: 'product.name' },
|
|
326
|
+
{ label: 'Kind', bind: 'kind' },
|
|
327
|
+
{ label: 'Makes', bind: 'quantity' },
|
|
328
|
+
{ label: 'Version', bind: 'version' },
|
|
329
|
+
{ label: 'Unit cost', bind: 'unitCost' },
|
|
330
|
+
{ label: 'Status', bind: 'state' },
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
kind: 'table',
|
|
335
|
+
id: 'lines',
|
|
336
|
+
bind: 'lines',
|
|
337
|
+
columns: [
|
|
338
|
+
{ label: 'Component', bind: 'product.name' },
|
|
339
|
+
{ label: 'Quantity', bind: 'quantity' },
|
|
340
|
+
{ label: 'Unit', bind: 'uom.name' },
|
|
341
|
+
{ label: 'Ratio (%)', bind: 'ratio' },
|
|
342
|
+
{ label: 'Loss (%)', bind: 'loss' },
|
|
343
|
+
{ label: 'Gross quantity', bind: 'grossQuantity' },
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
kind: 'table',
|
|
348
|
+
id: 'operations',
|
|
349
|
+
bind: 'operations',
|
|
350
|
+
columns: [
|
|
351
|
+
{ label: 'Operation', bind: 'name' },
|
|
352
|
+
{ label: 'Work centre', bind: 'workcenter.name' },
|
|
353
|
+
{ label: 'Minutes', bind: 'minutes' },
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
{ kind: 'text', id: 'note', text: '{{note}}' },
|
|
357
|
+
{ kind: 'qr', id: 'qr', bind: 'label', size: 24, label: 'Bill reference' },
|
|
358
|
+
],
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
key: 'production_order',
|
|
363
|
+
name: 'Production order',
|
|
364
|
+
model: 'production.order',
|
|
365
|
+
layout: {
|
|
366
|
+
paper: 'A4',
|
|
367
|
+
header: '{{company.name}}',
|
|
368
|
+
footer: 'Page {{page}} of {{pages}}',
|
|
369
|
+
blocks: [
|
|
370
|
+
{ kind: 'heading', id: 'title', text: 'Production order {{name}}', level: 1 },
|
|
371
|
+
{
|
|
372
|
+
kind: 'fields',
|
|
373
|
+
id: 'order',
|
|
374
|
+
items: [
|
|
375
|
+
{ label: 'Product', bind: 'product.name' },
|
|
376
|
+
{ label: 'Quantity', bind: 'quantity' },
|
|
377
|
+
{ label: 'Bill of materials', bind: 'bom.displayName' },
|
|
378
|
+
{ label: 'Date', bind: 'date' },
|
|
379
|
+
{ label: 'Warehouse', bind: 'warehouse.name' },
|
|
380
|
+
{ label: 'Status', bind: 'state' },
|
|
381
|
+
],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
kind: 'fields',
|
|
385
|
+
id: 'cost',
|
|
386
|
+
items: [
|
|
387
|
+
{ label: 'Materials', bind: 'materialCost' },
|
|
388
|
+
{ label: 'Operations', bind: 'operationCost' },
|
|
389
|
+
{ label: 'Total', bind: 'totalCost' },
|
|
390
|
+
{ label: 'Per unit', bind: 'unitCost' },
|
|
391
|
+
],
|
|
392
|
+
},
|
|
393
|
+
{ kind: 'text', id: 'note', text: '{{note}}' },
|
|
394
|
+
{ kind: 'signature', id: 'sign', labels: ['Produced by', 'Checked by'] },
|
|
395
|
+
],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
importTemplates: [
|
|
400
|
+
{
|
|
401
|
+
key: 'production_schedules',
|
|
402
|
+
model: 'production.schedule',
|
|
403
|
+
label: 'Production schedules',
|
|
404
|
+
columns: [
|
|
405
|
+
{ header: 'Product', field: 'product' },
|
|
406
|
+
{ header: 'Bill of materials', field: 'bom' },
|
|
407
|
+
{ header: 'Packaging bill', field: 'packagingBom' },
|
|
408
|
+
{ header: 'Target', field: 'quantity' },
|
|
409
|
+
{ header: 'Work centre', field: 'workcenter' },
|
|
410
|
+
{ header: 'Shift', field: 'shift' },
|
|
411
|
+
{ header: 'Start', field: 'start' },
|
|
412
|
+
{ header: 'End', field: 'end' },
|
|
413
|
+
{ header: 'Warehouse', field: 'warehouse' },
|
|
414
|
+
],
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
key: 'production_plans',
|
|
418
|
+
model: 'production.plan',
|
|
419
|
+
label: 'Production plans',
|
|
420
|
+
columns: [
|
|
421
|
+
{ header: 'Plan', field: 'title' },
|
|
422
|
+
{ header: 'From', field: 'dateFrom' },
|
|
423
|
+
{ header: 'To', field: 'dateTo' },
|
|
424
|
+
{ header: 'Warehouse', field: 'warehouse' },
|
|
425
|
+
{ header: 'Lines › Product', field: 'lines.product' },
|
|
426
|
+
{ header: 'Lines › Quantity', field: 'lines.quantity' },
|
|
427
|
+
{ header: 'Lines › Work centre', field: 'lines.workcenter' },
|
|
428
|
+
{ header: 'Lines › Start', field: 'lines.start' },
|
|
429
|
+
{ header: 'Lines › End', field: 'lines.end' },
|
|
430
|
+
],
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
key: 'production_spec_parameters',
|
|
434
|
+
model: 'production.spec.parameter',
|
|
435
|
+
label: 'Specification parameters',
|
|
436
|
+
columns: [
|
|
437
|
+
{ header: 'Name', field: 'name' },
|
|
438
|
+
{ header: 'Unit', field: 'unit' },
|
|
439
|
+
],
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
key: 'production_product_specs',
|
|
443
|
+
model: 'production.product.spec',
|
|
444
|
+
label: 'Product specifications',
|
|
445
|
+
columns: [
|
|
446
|
+
{ header: 'Product', field: 'product' },
|
|
447
|
+
{ header: 'Parameter', field: 'parameter' },
|
|
448
|
+
{ header: 'Value', field: 'value' },
|
|
449
|
+
],
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
key: 'production_eligibility',
|
|
453
|
+
model: 'production.bom.eligibility',
|
|
454
|
+
label: 'Component eligibility',
|
|
455
|
+
columns: [
|
|
456
|
+
{ header: 'Kind of bill', field: 'kind' },
|
|
457
|
+
{ header: 'Allowed component categories', field: 'categories' },
|
|
458
|
+
],
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
key: 'production_shifts',
|
|
462
|
+
model: 'production.shift',
|
|
463
|
+
label: 'Shifts',
|
|
464
|
+
columns: [
|
|
465
|
+
{ header: 'Name', field: 'name' },
|
|
466
|
+
{ header: 'Start', field: 'start' },
|
|
467
|
+
{ header: 'End', field: 'end' },
|
|
468
|
+
],
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: 'production_workcenter',
|
|
472
|
+
model: 'production.workcenter',
|
|
473
|
+
label: 'Work centre',
|
|
474
|
+
columns: [
|
|
475
|
+
{ header: 'Name', field: 'name' },
|
|
476
|
+
{ header: 'Code', field: 'code' },
|
|
477
|
+
{ header: 'Hours a day', field: 'hoursPerDay' },
|
|
478
|
+
{ header: 'Cost per hour', field: 'costPerHour' },
|
|
479
|
+
{ header: 'Note', field: 'note' },
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
key: 'production_bom',
|
|
484
|
+
model: 'production.bom',
|
|
485
|
+
label: 'Bill of materials',
|
|
486
|
+
columns: [
|
|
487
|
+
{ header: 'Product', field: 'product' },
|
|
488
|
+
{ header: 'Makes', field: 'quantity' },
|
|
489
|
+
{ header: 'Version', field: 'version' },
|
|
490
|
+
{ header: 'Valid from', field: 'validFrom' },
|
|
491
|
+
{ header: 'Valid until', field: 'validTo' },
|
|
492
|
+
{ header: 'Note', field: 'note' },
|
|
493
|
+
{ header: 'Components › Product', field: 'lines.product' },
|
|
494
|
+
{ header: 'Components › Quantity', field: 'lines.quantity' },
|
|
495
|
+
{ header: 'Components › Unit', field: 'lines.uom' },
|
|
496
|
+
],
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
key: 'production_order',
|
|
500
|
+
model: 'production.order',
|
|
501
|
+
label: 'Production order',
|
|
502
|
+
columns: [
|
|
503
|
+
{ header: 'Product', field: 'product' },
|
|
504
|
+
{ header: 'Quantity', field: 'quantity' },
|
|
505
|
+
{ header: 'Bill of materials', field: 'bom' },
|
|
506
|
+
{ header: 'Planned for', field: 'date' },
|
|
507
|
+
{ header: 'Warehouse', field: 'warehouse' },
|
|
508
|
+
{ header: 'Note', field: 'note' },
|
|
509
|
+
],
|
|
510
|
+
},
|
|
511
|
+
],
|
|
512
|
+
events: [
|
|
513
|
+
{
|
|
514
|
+
topic: 'production.order.confirmed',
|
|
515
|
+
model: 'production.order',
|
|
516
|
+
label: 'Production order confirmed',
|
|
517
|
+
},
|
|
518
|
+
{ topic: 'production.order.done', model: 'production.order', label: 'Production order done' },
|
|
519
|
+
{
|
|
520
|
+
topic: 'production.bom.submitted',
|
|
521
|
+
model: 'production.bom',
|
|
522
|
+
label: 'Bill of materials submitted for review',
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
topic: 'production.bom.activated',
|
|
526
|
+
model: 'production.bom',
|
|
527
|
+
label: 'Bill of materials activated',
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
topic: 'production.bom.revised',
|
|
531
|
+
model: 'production.bom',
|
|
532
|
+
label: 'Bill of materials revised',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
topic: 'production.plan.submitted',
|
|
536
|
+
model: 'production.plan',
|
|
537
|
+
label: 'Production plan submitted',
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
topic: 'production.plan.approved',
|
|
541
|
+
model: 'production.plan',
|
|
542
|
+
label: 'Production plan approved',
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
topic: 'production.plan.scheduled',
|
|
546
|
+
model: 'production.plan',
|
|
547
|
+
label: 'Production plan scheduled into batches',
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
topic: 'production.schedule.confirmed',
|
|
551
|
+
model: 'production.schedule',
|
|
552
|
+
label: 'Batch confirmed',
|
|
553
|
+
},
|
|
554
|
+
{ topic: 'production.schedule.done', model: 'production.schedule', label: 'Batch done' },
|
|
555
|
+
],
|
|
556
|
+
// Bangla for the labels it serves (RFC 0023 §3.1; `pnpm i18n:extract`).
|
|
557
|
+
i18n: { bn: () => import('./i18n/bn.js') },
|
|
558
|
+
accessLevels: {
|
|
559
|
+
user: { label: 'User (production orders)', groups: ['production.user'] },
|
|
560
|
+
manager: {
|
|
561
|
+
label: 'Manager (bills of materials, work centres, everything)',
|
|
562
|
+
groups: ['production.manager'],
|
|
563
|
+
implies: ['user'],
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
// The Overview (RFC 0022 step 2).
|
|
567
|
+
overview: {
|
|
568
|
+
cards: [
|
|
569
|
+
{
|
|
570
|
+
id: 'confirmed',
|
|
571
|
+
title: 'Orders confirmed',
|
|
572
|
+
kind: 'kpi',
|
|
573
|
+
model: 'production.order',
|
|
574
|
+
measure: 'count',
|
|
575
|
+
filter: { state: 'confirmed' },
|
|
576
|
+
w: 3,
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
id: 'done_month',
|
|
580
|
+
title: 'Made this month',
|
|
581
|
+
kind: 'kpi',
|
|
582
|
+
model: 'production.order',
|
|
583
|
+
measure: 'count',
|
|
584
|
+
filter: { state: 'done' },
|
|
585
|
+
comparison: { field: 'createdAt', mode: 'previous' },
|
|
586
|
+
w: 3,
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
id: 'work_in_progress',
|
|
590
|
+
title: 'Work orders in progress',
|
|
591
|
+
kind: 'kpi',
|
|
592
|
+
model: 'production.workorder',
|
|
593
|
+
measure: 'count',
|
|
594
|
+
filter: { state: 'progress' },
|
|
595
|
+
w: 3,
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
id: 'workcenters',
|
|
599
|
+
title: 'Work centres',
|
|
600
|
+
kind: 'kpi',
|
|
601
|
+
model: 'production.workcenter',
|
|
602
|
+
measure: 'count',
|
|
603
|
+
w: 3,
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
id: 'by_state',
|
|
607
|
+
title: 'Orders by state',
|
|
608
|
+
kind: 'chart',
|
|
609
|
+
model: 'production.order',
|
|
610
|
+
measure: 'count',
|
|
611
|
+
groupBy: 'state',
|
|
612
|
+
chart: 'bar',
|
|
613
|
+
w: 6,
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
id: 'made_by_product',
|
|
617
|
+
title: 'Made, by product',
|
|
618
|
+
kind: 'pivot',
|
|
619
|
+
model: 'production.order',
|
|
620
|
+
measure: 'sum:quantity',
|
|
621
|
+
groupBy: 'product',
|
|
622
|
+
filter: { state: 'done' },
|
|
623
|
+
w: 6,
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
id: 'load_by_workcenter',
|
|
627
|
+
title: 'Work waiting by work centre',
|
|
628
|
+
kind: 'pivot',
|
|
629
|
+
model: 'production.workorder',
|
|
630
|
+
measure: 'count',
|
|
631
|
+
groupBy: 'workcenter',
|
|
632
|
+
filter: { state: { in: ['ready', 'progress'] } },
|
|
633
|
+
w: 6,
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
id: 'biggest_open',
|
|
637
|
+
title: 'Biggest open orders',
|
|
638
|
+
kind: 'list',
|
|
639
|
+
model: 'production.order',
|
|
640
|
+
measure: 'sum:quantity',
|
|
641
|
+
filter: { state: 'confirmed' },
|
|
642
|
+
w: 6,
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
},
|
|
646
|
+
actions: {
|
|
647
|
+
'production.action_orders': action(ProductionOrder, {
|
|
648
|
+
label: 'Production orders',
|
|
649
|
+
views: ['list', 'kanban', 'form'],
|
|
650
|
+
defaultFilters: ['open'],
|
|
651
|
+
}),
|
|
652
|
+
'production.action_plans': action(ProductionPlan, {
|
|
653
|
+
label: 'Production plans',
|
|
654
|
+
views: ['list', 'kanban', 'form'],
|
|
655
|
+
}),
|
|
656
|
+
'production.action_schedules': action(ProductionSchedule, {
|
|
657
|
+
label: 'Batches',
|
|
658
|
+
views: ['list', 'kanban', 'gantt', 'form'],
|
|
659
|
+
}),
|
|
660
|
+
'production.action_plan_lines': action(ProductionPlanLine, {
|
|
661
|
+
label: 'Plan schedule',
|
|
662
|
+
views: ['gantt', 'list'],
|
|
663
|
+
}),
|
|
664
|
+
'production.action_workorders': action(ProductionWorkorder, {
|
|
665
|
+
label: 'Work orders',
|
|
666
|
+
views: ['gantt', 'list', 'form'],
|
|
667
|
+
defaultFilters: ['open'],
|
|
668
|
+
}),
|
|
669
|
+
'production.action_boms': action(ProductionBom, {
|
|
670
|
+
label: 'Bills of materials',
|
|
671
|
+
views: ['list', 'form'],
|
|
672
|
+
}),
|
|
673
|
+
'production.action_spec_parameters': action(ProductionSpecParameter, {
|
|
674
|
+
label: 'Specification parameters',
|
|
675
|
+
views: ['list', 'form'],
|
|
676
|
+
}),
|
|
677
|
+
'production.action_product_specs': action(ProductionProductSpec, {
|
|
678
|
+
label: 'Product specifications',
|
|
679
|
+
views: ['list', 'form'],
|
|
680
|
+
}),
|
|
681
|
+
'production.action_eligibility': action(ProductionBomEligibility, {
|
|
682
|
+
label: 'Component eligibility',
|
|
683
|
+
views: ['list', 'form'],
|
|
684
|
+
}),
|
|
685
|
+
'production.action_shifts': action(ProductionShift, {
|
|
686
|
+
label: 'Shifts',
|
|
687
|
+
views: ['list', 'form'],
|
|
688
|
+
}),
|
|
689
|
+
'production.action_workcenters': action(ProductionWorkcenter, {
|
|
690
|
+
label: 'Work centres',
|
|
691
|
+
views: ['list', 'form'],
|
|
692
|
+
}),
|
|
693
|
+
},
|
|
694
|
+
menus: [
|
|
695
|
+
{ id: 'production.root', label: 'Production', app: 'production' },
|
|
696
|
+
{
|
|
697
|
+
id: 'production.orders',
|
|
698
|
+
parent: 'production.root',
|
|
699
|
+
label: 'Production orders',
|
|
700
|
+
action: 'production.action_orders',
|
|
701
|
+
sequence: 1,
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
id: 'production.plans',
|
|
705
|
+
parent: 'production.root',
|
|
706
|
+
label: 'Production plans',
|
|
707
|
+
action: 'production.action_plans',
|
|
708
|
+
sequence: 2,
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
id: 'production.schedules',
|
|
712
|
+
parent: 'production.root',
|
|
713
|
+
label: 'Batches',
|
|
714
|
+
action: 'production.action_schedules',
|
|
715
|
+
sequence: 4,
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
id: 'production.plan_lines',
|
|
719
|
+
parent: 'production.root',
|
|
720
|
+
label: 'Plan schedule',
|
|
721
|
+
action: 'production.action_plan_lines',
|
|
722
|
+
sequence: 3,
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
id: 'production.workorders',
|
|
726
|
+
parent: 'production.root',
|
|
727
|
+
label: 'Work orders',
|
|
728
|
+
action: 'production.action_workorders',
|
|
729
|
+
sequence: 2,
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
id: 'production.boms',
|
|
733
|
+
parent: 'production.root',
|
|
734
|
+
label: 'Bills of materials',
|
|
735
|
+
action: 'production.action_boms',
|
|
736
|
+
sequence: 2,
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
id: 'production.configuration',
|
|
740
|
+
parent: 'production.root',
|
|
741
|
+
label: 'Configuration',
|
|
742
|
+
sequence: 9,
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
id: 'production.spec_parameters',
|
|
746
|
+
parent: 'production.configuration',
|
|
747
|
+
label: 'Specification parameters',
|
|
748
|
+
action: 'production.action_spec_parameters',
|
|
749
|
+
sequence: 2,
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: 'production.product_specs',
|
|
753
|
+
parent: 'production.configuration',
|
|
754
|
+
label: 'Product specifications',
|
|
755
|
+
action: 'production.action_product_specs',
|
|
756
|
+
sequence: 3,
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: 'production.eligibility',
|
|
760
|
+
parent: 'production.configuration',
|
|
761
|
+
label: 'Component eligibility',
|
|
762
|
+
action: 'production.action_eligibility',
|
|
763
|
+
sequence: 4,
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
id: 'production.shifts',
|
|
767
|
+
parent: 'production.configuration',
|
|
768
|
+
label: 'Shifts',
|
|
769
|
+
action: 'production.action_shifts',
|
|
770
|
+
sequence: 5,
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
id: 'production.workcenters',
|
|
774
|
+
parent: 'production.configuration',
|
|
775
|
+
label: 'Work centres',
|
|
776
|
+
action: 'production.action_workcenters',
|
|
777
|
+
sequence: 1,
|
|
778
|
+
},
|
|
779
|
+
],
|
|
780
|
+
views: {
|
|
781
|
+
'production.order.list': list(ProductionOrder, {
|
|
782
|
+
columns: [
|
|
783
|
+
'name',
|
|
784
|
+
'product',
|
|
785
|
+
'quantity',
|
|
786
|
+
'date',
|
|
787
|
+
{ field: 'totalCost', sum: true },
|
|
788
|
+
{ field: 'status', widget: 'badge' },
|
|
789
|
+
],
|
|
790
|
+
}),
|
|
791
|
+
'production.order.kanban': kanban(ProductionOrder, {
|
|
792
|
+
groupBy: 'status',
|
|
793
|
+
card: { title: 'name', subtitle: 'product', footer: ['quantity', 'date'] },
|
|
794
|
+
}),
|
|
795
|
+
'production.order.form': form(ProductionOrder, (k) => ({
|
|
796
|
+
header: {
|
|
797
|
+
statusbar: 'state',
|
|
798
|
+
buttons: [
|
|
799
|
+
k.button('check', { label: 'Check components' }),
|
|
800
|
+
k.button('confirm', { primary: true, label: 'Confirm' }),
|
|
801
|
+
k.button('reserve', { label: 'Check availability' }),
|
|
802
|
+
k.button('start', { label: 'Start' }),
|
|
803
|
+
k.button('produce', {
|
|
804
|
+
primary: true,
|
|
805
|
+
label: 'Produce',
|
|
806
|
+
confirm: 'Produce? The components are consumed and the product enters stock.',
|
|
807
|
+
}),
|
|
808
|
+
k.button('cancel', { label: 'Cancel' }),
|
|
809
|
+
k.button('redraft', { label: 'Back to draft' }),
|
|
810
|
+
],
|
|
811
|
+
},
|
|
812
|
+
sheet: [
|
|
813
|
+
k.group('main', ['product', 'quantity', 'bom', 'date', 'warehouse']),
|
|
814
|
+
k.group('cost', ['materialCost', 'operationCost', 'totalCost', 'unitCost', 'status'], {
|
|
815
|
+
label: 'Cost',
|
|
816
|
+
}),
|
|
817
|
+
k.lines('components', [
|
|
818
|
+
{ field: 'product', id: 'component_product' },
|
|
819
|
+
{ field: 'required', id: 'component_required' },
|
|
820
|
+
{ field: 'available', id: 'component_available' },
|
|
821
|
+
{ field: 'short', id: 'component_short' },
|
|
822
|
+
{ field: 'cost', id: 'component_cost' },
|
|
823
|
+
]),
|
|
824
|
+
k.lines('scraps', [
|
|
825
|
+
{ field: 'product', id: 'scrap_product' },
|
|
826
|
+
{ field: 'quantity', id: 'scrap_quantity' },
|
|
827
|
+
{ field: 'reason', id: 'scrap_reason' },
|
|
828
|
+
{ field: 'state', id: 'scrap_state' },
|
|
829
|
+
]),
|
|
830
|
+
k.lines('workorders', [
|
|
831
|
+
{ field: 'name', id: 'workorder_name' },
|
|
832
|
+
{ field: 'workcenter', id: 'workorder_workcenter' },
|
|
833
|
+
{ field: 'plannedStart', id: 'workorder_start' },
|
|
834
|
+
{ field: 'plannedStop', id: 'workorder_stop' },
|
|
835
|
+
{ field: 'state', id: 'workorder_state' },
|
|
836
|
+
]),
|
|
837
|
+
k.group('transfers', ['consumption', 'output']),
|
|
838
|
+
k.group('batch_yield', [
|
|
839
|
+
'schedule',
|
|
840
|
+
'stage',
|
|
841
|
+
'batch',
|
|
842
|
+
'sourceOrder',
|
|
843
|
+
'sourceLot',
|
|
844
|
+
'lot',
|
|
845
|
+
'producedQty',
|
|
846
|
+
'consumedQty',
|
|
847
|
+
'lossQty',
|
|
848
|
+
'lossPercent',
|
|
849
|
+
'yieldStatus',
|
|
850
|
+
], { label: 'Batch and yield' }),
|
|
851
|
+
k.group('execution', ['actualStart', 'actualEnd', 'operator', 'shift', 'manufacturingDate', 'expiryDate'], { label: 'Execution' }),
|
|
852
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
853
|
+
],
|
|
854
|
+
chatter: true,
|
|
855
|
+
})),
|
|
856
|
+
'production.schedule.list': list(ProductionSchedule, {
|
|
857
|
+
columns: [
|
|
858
|
+
'name',
|
|
859
|
+
'product',
|
|
860
|
+
'quantity',
|
|
861
|
+
'produced',
|
|
862
|
+
'workcenter',
|
|
863
|
+
'start',
|
|
864
|
+
'end',
|
|
865
|
+
'deficitCount',
|
|
866
|
+
'state',
|
|
867
|
+
],
|
|
868
|
+
}),
|
|
869
|
+
'production.schedule.kanban': kanban(ProductionSchedule, {
|
|
870
|
+
groupBy: 'state',
|
|
871
|
+
card: { title: 'name', subtitle: 'product', footer: ['quantity', 'workcenter'] },
|
|
872
|
+
}),
|
|
873
|
+
'production.schedule.gantt': gantt(ProductionSchedule, {
|
|
874
|
+
dateStart: 'start',
|
|
875
|
+
dateStop: 'end',
|
|
876
|
+
title: 'name',
|
|
877
|
+
groupBy: 'workcenter',
|
|
878
|
+
scale: 'day',
|
|
879
|
+
}),
|
|
880
|
+
'production.schedule.form': form(ProductionSchedule, (k) => ({
|
|
881
|
+
header: {
|
|
882
|
+
statusbar: 'state',
|
|
883
|
+
buttons: [
|
|
884
|
+
k.button('check', { primary: true, label: 'Check stock' }),
|
|
885
|
+
k.button('confirm', {
|
|
886
|
+
primary: true,
|
|
887
|
+
label: 'Confirm',
|
|
888
|
+
confirm: 'Confirm? The production orders are made.',
|
|
889
|
+
}),
|
|
890
|
+
k.button('finish', { label: 'Mark done' }),
|
|
891
|
+
k.button('redraft', { label: 'Set to draft' }),
|
|
892
|
+
k.button('cancel', { label: 'Cancel', confirm: 'Cancel this batch?' }),
|
|
893
|
+
],
|
|
894
|
+
},
|
|
895
|
+
sheet: [
|
|
896
|
+
k.stats('related', [
|
|
897
|
+
{
|
|
898
|
+
id: 'schedule_orders',
|
|
899
|
+
label: 'Production orders',
|
|
900
|
+
model: ProductionOrder,
|
|
901
|
+
where: { schedule: { $record: 'id' } },
|
|
902
|
+
action: 'production.action_orders',
|
|
903
|
+
},
|
|
904
|
+
]),
|
|
905
|
+
k.group('main', [
|
|
906
|
+
'name',
|
|
907
|
+
'product',
|
|
908
|
+
'bom',
|
|
909
|
+
'packagingBom',
|
|
910
|
+
'quantity',
|
|
911
|
+
'produced',
|
|
912
|
+
'remaining',
|
|
913
|
+
]),
|
|
914
|
+
k.group('where', ['workcenter', 'shift', 'start', 'end', 'warehouse', 'plan', 'deficitCount'], {
|
|
915
|
+
label: 'Where and when',
|
|
916
|
+
}),
|
|
917
|
+
k.lines('components', [
|
|
918
|
+
{ field: 'product', id: 'preflight_product' },
|
|
919
|
+
{ field: 'required', id: 'preflight_required' },
|
|
920
|
+
{ field: 'available', id: 'preflight_available' },
|
|
921
|
+
{ field: 'deficit', id: 'preflight_deficit' },
|
|
922
|
+
{ field: 'surplus', id: 'preflight_surplus' },
|
|
923
|
+
], { readonlyWhen: {} }),
|
|
924
|
+
k.lines('orders', [
|
|
925
|
+
{ field: 'name', id: 'batch_order_name' },
|
|
926
|
+
{ field: 'stage', id: 'batch_order_stage' },
|
|
927
|
+
{ field: 'state', id: 'batch_order_state' },
|
|
928
|
+
{ field: 'producedQty', id: 'batch_order_produced' },
|
|
929
|
+
{ field: 'yieldStatus', id: 'batch_order_yield' },
|
|
930
|
+
{ field: 'lot', id: 'batch_order_lot' },
|
|
931
|
+
], { readonlyWhen: {} }),
|
|
932
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
933
|
+
],
|
|
934
|
+
chatter: true,
|
|
935
|
+
})),
|
|
936
|
+
'production.plan.list': list(ProductionPlan, {
|
|
937
|
+
columns: ['name', 'title', 'dateFrom', 'dateTo', 'warehouse', 'shortageCount', 'state'],
|
|
938
|
+
}),
|
|
939
|
+
'production.plan.kanban': kanban(ProductionPlan, {
|
|
940
|
+
groupBy: 'state',
|
|
941
|
+
card: { title: 'name', subtitle: 'title', footer: ['dateFrom', 'shortageCount'] },
|
|
942
|
+
}),
|
|
943
|
+
'production.plan.form': form(ProductionPlan, (k) => ({
|
|
944
|
+
header: {
|
|
945
|
+
statusbar: 'state',
|
|
946
|
+
buttons: [
|
|
947
|
+
k.button('forecast', { primary: true, label: 'Generate forecast' }),
|
|
948
|
+
k.button('procure', { label: 'Procure the shortages' }),
|
|
949
|
+
k.button('submit', { primary: true, label: 'Submit for approval' }),
|
|
950
|
+
k.button('schedule', { primary: true, label: 'Schedule the orders' }),
|
|
951
|
+
k.button('redraft', { label: 'Set to draft' }),
|
|
952
|
+
k.button('cancel', { label: 'Cancel', confirm: 'Cancel this plan?' }),
|
|
953
|
+
],
|
|
954
|
+
},
|
|
955
|
+
sheet: [
|
|
956
|
+
k.stats('related', [
|
|
957
|
+
{
|
|
958
|
+
id: 'plan_orders',
|
|
959
|
+
label: 'Production orders',
|
|
960
|
+
model: ProductionOrder,
|
|
961
|
+
where: { plan: { $record: 'id' } },
|
|
962
|
+
action: 'production.action_orders',
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
id: 'plan_schedules',
|
|
966
|
+
label: 'Batches',
|
|
967
|
+
model: ProductionSchedule,
|
|
968
|
+
where: { plan: { $record: 'id' } },
|
|
969
|
+
action: 'production.action_schedules',
|
|
970
|
+
},
|
|
971
|
+
]),
|
|
972
|
+
k.group('main', ['name', 'title', 'dateFrom', 'dateTo', 'warehouse']),
|
|
973
|
+
k.group('where', [{ field: 'workcenters', widget: 'tags' }, 'shortageCount'], {
|
|
974
|
+
label: 'Work centres',
|
|
975
|
+
}),
|
|
976
|
+
k.component('approvals', 'approvals.Panel'),
|
|
977
|
+
k.lines('lines', [
|
|
978
|
+
{ field: 'product', id: 'plan_line_product' },
|
|
979
|
+
{ field: 'bom', id: 'plan_line_bom' },
|
|
980
|
+
{ field: 'packagingBom', id: 'plan_line_packaging' },
|
|
981
|
+
{ field: 'quantity', id: 'plan_line_quantity' },
|
|
982
|
+
{ field: 'workcenter', id: 'plan_line_workcenter' },
|
|
983
|
+
{ field: 'start', id: 'plan_line_start' },
|
|
984
|
+
{ field: 'end', id: 'plan_line_end' },
|
|
985
|
+
{ field: 'minutes', id: 'plan_line_minutes' },
|
|
986
|
+
{ field: 'capacityNote', id: 'plan_line_capacity' },
|
|
987
|
+
{ field: 'scheduleCount', id: 'plan_line_schedules' },
|
|
988
|
+
]),
|
|
989
|
+
k.lines('materials', [
|
|
990
|
+
{ field: 'product', id: 'plan_material_product' },
|
|
991
|
+
{ field: 'required', id: 'plan_material_required' },
|
|
992
|
+
{ field: 'onHand', id: 'plan_material_on_hand' },
|
|
993
|
+
{ field: 'onOrder', id: 'plan_material_on_order' },
|
|
994
|
+
{ field: 'shortage', id: 'plan_material_shortage' },
|
|
995
|
+
{ field: 'procured', id: 'plan_material_procured' },
|
|
996
|
+
{ field: 'document', id: 'plan_material_document' },
|
|
997
|
+
{ field: 'note', id: 'plan_material_note' },
|
|
998
|
+
], { readonlyWhen: {} }),
|
|
999
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
1000
|
+
],
|
|
1001
|
+
chatter: true,
|
|
1002
|
+
})),
|
|
1003
|
+
'production.plan.line.gantt': gantt(ProductionPlanLine, {
|
|
1004
|
+
dateStart: 'start',
|
|
1005
|
+
dateStop: 'end',
|
|
1006
|
+
title: 'label',
|
|
1007
|
+
groupBy: 'workcenter',
|
|
1008
|
+
scale: 'day',
|
|
1009
|
+
}),
|
|
1010
|
+
'production.plan.line.list': list(ProductionPlanLine, {
|
|
1011
|
+
columns: [
|
|
1012
|
+
'plan',
|
|
1013
|
+
'product',
|
|
1014
|
+
'quantity',
|
|
1015
|
+
'workcenter',
|
|
1016
|
+
'start',
|
|
1017
|
+
'end',
|
|
1018
|
+
'minutes',
|
|
1019
|
+
'capacityNote',
|
|
1020
|
+
'scheduleCount',
|
|
1021
|
+
],
|
|
1022
|
+
}),
|
|
1023
|
+
'production.workorder.gantt': gantt(ProductionWorkorder, {
|
|
1024
|
+
dateStart: 'plannedStart',
|
|
1025
|
+
dateStop: 'plannedStop',
|
|
1026
|
+
title: 'name',
|
|
1027
|
+
groupBy: 'workcenter',
|
|
1028
|
+
scale: 'day',
|
|
1029
|
+
}),
|
|
1030
|
+
'production.workorder.list': list(ProductionWorkorder, {
|
|
1031
|
+
columns: [
|
|
1032
|
+
'production',
|
|
1033
|
+
'name',
|
|
1034
|
+
'workcenter',
|
|
1035
|
+
'plannedStart',
|
|
1036
|
+
'plannedStop',
|
|
1037
|
+
'plannedMinutes',
|
|
1038
|
+
'actualMinutes',
|
|
1039
|
+
{ field: 'state', widget: 'badge' },
|
|
1040
|
+
],
|
|
1041
|
+
}),
|
|
1042
|
+
'production.workorder.form': form(ProductionWorkorder, (k) => ({
|
|
1043
|
+
chatter: true,
|
|
1044
|
+
header: {
|
|
1045
|
+
statusbar: 'state',
|
|
1046
|
+
buttons: [
|
|
1047
|
+
k.button('start', { primary: true, label: 'Start' }),
|
|
1048
|
+
k.button('finish', { primary: true, label: 'Finish' }),
|
|
1049
|
+
],
|
|
1050
|
+
},
|
|
1051
|
+
sheet: [
|
|
1052
|
+
k.group('main', ['production', 'name', 'workcenter']),
|
|
1053
|
+
k.group('plan', ['plannedStart', 'plannedStop', 'plannedMinutes']),
|
|
1054
|
+
k.group('actual', ['startedAt', 'finishedAt', 'actualMinutes']),
|
|
1055
|
+
],
|
|
1056
|
+
})),
|
|
1057
|
+
'production.bom.list': list(ProductionBom, {
|
|
1058
|
+
columns: [
|
|
1059
|
+
'product',
|
|
1060
|
+
'version',
|
|
1061
|
+
'kind',
|
|
1062
|
+
'quantity',
|
|
1063
|
+
'unitCost',
|
|
1064
|
+
'validFrom',
|
|
1065
|
+
'validTo',
|
|
1066
|
+
'state',
|
|
1067
|
+
],
|
|
1068
|
+
}),
|
|
1069
|
+
'production.bom.form': form(ProductionBom, (k) => ({
|
|
1070
|
+
header: {
|
|
1071
|
+
statusbar: 'state',
|
|
1072
|
+
buttons: [
|
|
1073
|
+
k.button('submit', { primary: true, label: 'Submit for review' }),
|
|
1074
|
+
k.button('approve', { primary: true, label: 'Approve' }),
|
|
1075
|
+
k.button('reject', { label: 'Send back' }),
|
|
1076
|
+
k.button('revise', { label: 'Create revision' }),
|
|
1077
|
+
k.button('deactivate', { label: 'Set inactive' }),
|
|
1078
|
+
k.button('reactivate', { label: 'Set active' }),
|
|
1079
|
+
],
|
|
1080
|
+
},
|
|
1081
|
+
sheet: [
|
|
1082
|
+
k.group('main', ['product', 'kind', 'quantity', 'version', 'validFrom', 'validTo']),
|
|
1083
|
+
k.group('batch', ['packSize', 'expectedLoss', 'tolerance', 'unitCost'], {
|
|
1084
|
+
label: 'Batch',
|
|
1085
|
+
description: 'A formula’s lines are shares of the batch; a packaging bill packs the product; losses are covered by the gross quantities.',
|
|
1086
|
+
}),
|
|
1087
|
+
k.component('approvals', 'approvals.Panel'),
|
|
1088
|
+
k.lines('lines', [
|
|
1089
|
+
{ field: 'product', id: 'bom_line_product' },
|
|
1090
|
+
{ field: 'quantity', id: 'bom_line_quantity' },
|
|
1091
|
+
{ field: 'uom', id: 'bom_line_uom' },
|
|
1092
|
+
{ field: 'ratio', id: 'bom_line_ratio' },
|
|
1093
|
+
{ field: 'loss', id: 'bom_line_loss' },
|
|
1094
|
+
{ field: 'netQuantity', id: 'bom_line_net' },
|
|
1095
|
+
{ field: 'grossQuantity', id: 'bom_line_gross' },
|
|
1096
|
+
]),
|
|
1097
|
+
k.lines('specs', [
|
|
1098
|
+
{ field: 'parameter', id: 'bom_spec_parameter' },
|
|
1099
|
+
{ field: 'minimum', id: 'bom_spec_min' },
|
|
1100
|
+
{ field: 'maximum', id: 'bom_spec_max' },
|
|
1101
|
+
{ field: 'value', id: 'bom_spec_value' },
|
|
1102
|
+
{ field: 'within', id: 'bom_spec_within' },
|
|
1103
|
+
]),
|
|
1104
|
+
k.lines('costs', [
|
|
1105
|
+
{ field: 'date', id: 'bom_cost_date' },
|
|
1106
|
+
{ field: 'unitCost', id: 'bom_cost_unit' },
|
|
1107
|
+
{ field: 'note', id: 'bom_cost_note' },
|
|
1108
|
+
]),
|
|
1109
|
+
k.lines('operations', [
|
|
1110
|
+
{ field: 'name', id: 'bom_operation_name' },
|
|
1111
|
+
{ field: 'workcenter', id: 'bom_operation_workcenter' },
|
|
1112
|
+
{ field: 'minutes', id: 'bom_operation_minutes' },
|
|
1113
|
+
]),
|
|
1114
|
+
k.lines('byproducts', [
|
|
1115
|
+
{ field: 'product', id: 'bom_byproduct_product' },
|
|
1116
|
+
{ field: 'quantity', id: 'bom_byproduct_quantity' },
|
|
1117
|
+
{ field: 'uom', id: 'bom_byproduct_uom' },
|
|
1118
|
+
{ field: 'costShare', id: 'bom_byproduct_share' },
|
|
1119
|
+
]),
|
|
1120
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
1121
|
+
],
|
|
1122
|
+
chatter: true,
|
|
1123
|
+
})),
|
|
1124
|
+
'production.workcenter.list': list(ProductionWorkcenter, {
|
|
1125
|
+
columns: ['name', 'code', 'hoursPerDay', 'costPerHour', 'batchMin', 'batchMax', 'oeeTarget'],
|
|
1126
|
+
}),
|
|
1127
|
+
'production.workcenter.form': form(ProductionWorkcenter, (k) => ({
|
|
1128
|
+
header: { buttons: [] },
|
|
1129
|
+
sheet: [
|
|
1130
|
+
k.group('main', ['name', 'code', 'hoursPerDay', 'costPerHour']),
|
|
1131
|
+
k.group('batches', ['batchMin', 'batchMax', 'setupMinutes', 'cleanupMinutes', 'oeeTarget'], {
|
|
1132
|
+
label: 'Batches and effectiveness',
|
|
1133
|
+
}),
|
|
1134
|
+
k.group('alternative_centres', [{ field: 'alternatives', widget: 'tags' }], {
|
|
1135
|
+
label: 'Alternatives',
|
|
1136
|
+
}),
|
|
1137
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
1138
|
+
],
|
|
1139
|
+
})),
|
|
1140
|
+
'production.spec.parameter.list': list(ProductionSpecParameter, {
|
|
1141
|
+
columns: ['name', 'unit'],
|
|
1142
|
+
inlineEdit: ['name', 'unit'],
|
|
1143
|
+
}),
|
|
1144
|
+
'production.spec.parameter.form': form(ProductionSpecParameter, (k) => ({
|
|
1145
|
+
header: { buttons: [] },
|
|
1146
|
+
sheet: [k.group('main', ['name', 'unit']), k.group('about', ['note'], { columns: 1 })],
|
|
1147
|
+
})),
|
|
1148
|
+
'production.product.spec.list': list(ProductionProductSpec, {
|
|
1149
|
+
columns: ['product', 'parameter', 'value'],
|
|
1150
|
+
inlineEdit: ['value'],
|
|
1151
|
+
}),
|
|
1152
|
+
'production.product.spec.form': form(ProductionProductSpec, (k) => ({
|
|
1153
|
+
header: { buttons: [] },
|
|
1154
|
+
sheet: [k.group('main', ['product', 'parameter', 'value'])],
|
|
1155
|
+
})),
|
|
1156
|
+
'production.bom.eligibility.list': list(ProductionBomEligibility, {
|
|
1157
|
+
columns: ['kind', { field: 'categories', widget: 'tags' }],
|
|
1158
|
+
}),
|
|
1159
|
+
'production.bom.eligibility.form': form(ProductionBomEligibility, (k) => ({
|
|
1160
|
+
header: { buttons: [] },
|
|
1161
|
+
sheet: [
|
|
1162
|
+
k.group('main', ['kind', { field: 'categories', widget: 'tags' }], {
|
|
1163
|
+
description: 'Lines of this kind of bill may only use products of these categories; others are refused with the reason.',
|
|
1164
|
+
}),
|
|
1165
|
+
k.group('about', ['note'], { columns: 1 }),
|
|
1166
|
+
],
|
|
1167
|
+
})),
|
|
1168
|
+
'production.shift.list': list(ProductionShift, {
|
|
1169
|
+
columns: ['name', 'start', 'end', 'hours'],
|
|
1170
|
+
inlineEdit: ['name', 'start', 'end'],
|
|
1171
|
+
}),
|
|
1172
|
+
'production.shift.form': form(ProductionShift, (k) => ({
|
|
1173
|
+
header: { buttons: [] },
|
|
1174
|
+
sheet: [k.group('main', ['name', 'start', 'end', 'hours'])],
|
|
1175
|
+
})),
|
|
1176
|
+
'production.bom.line.list': list(ProductionBomLine, {
|
|
1177
|
+
columns: ['bom', 'product', 'quantity', 'uom'],
|
|
1178
|
+
}),
|
|
1179
|
+
'production.order.component.list': list(ProductionOrderComponent, {
|
|
1180
|
+
columns: ['production', 'product', 'required', 'available', 'short'],
|
|
1181
|
+
}),
|
|
1182
|
+
},
|
|
1183
|
+
search: {
|
|
1184
|
+
'production.order': search(ProductionOrder, {
|
|
1185
|
+
fields: ['name', 'product.name'],
|
|
1186
|
+
filters: {
|
|
1187
|
+
open: { label: 'To do', domain: { state: { in: ['draft', 'confirmed'] } }, group: 'state' },
|
|
1188
|
+
waiting: { label: 'Short', domain: { status: 'waiting' }, group: 'state' },
|
|
1189
|
+
ready: { label: 'Ready', domain: { status: 'ready' }, group: 'state' },
|
|
1190
|
+
done: { label: 'Done', domain: { state: 'done' }, group: 'state' },
|
|
1191
|
+
},
|
|
1192
|
+
groupBy: ['product', 'status', 'date'],
|
|
1193
|
+
}),
|
|
1194
|
+
'production.bom': search(ProductionBom, {
|
|
1195
|
+
fields: ['product.name', 'version'],
|
|
1196
|
+
filters: {
|
|
1197
|
+
active: { label: 'Active', domain: { state: 'active' }, group: 'state' },
|
|
1198
|
+
review: { label: 'Under review', domain: { state: 'review' }, group: 'state' },
|
|
1199
|
+
formula: { label: 'Formulas', domain: { kind: 'formula' }, group: 'kind' },
|
|
1200
|
+
packaging: { label: 'Packaging', domain: { kind: 'packaging' }, group: 'kind' },
|
|
1201
|
+
},
|
|
1202
|
+
groupBy: ['product', 'kind', 'state'],
|
|
1203
|
+
}),
|
|
1204
|
+
'production.plan': search(ProductionPlan, {
|
|
1205
|
+
fields: ['name', 'title', 'lines.product.name'],
|
|
1206
|
+
filters: {
|
|
1207
|
+
open: {
|
|
1208
|
+
label: 'Open',
|
|
1209
|
+
domain: { state: { in: ['draft', 'forecast', 'to_approve', 'approved'] } },
|
|
1210
|
+
group: 'state',
|
|
1211
|
+
},
|
|
1212
|
+
short: { label: 'With shortages', domain: { shortageCount: { gt: 0 } }, group: 'state' },
|
|
1213
|
+
},
|
|
1214
|
+
groupBy: ['warehouse', 'state', 'dateFrom:month'],
|
|
1215
|
+
}),
|
|
1216
|
+
'production.schedule': search(ProductionSchedule, {
|
|
1217
|
+
fields: ['name', 'product.name'],
|
|
1218
|
+
filters: {
|
|
1219
|
+
open: {
|
|
1220
|
+
label: 'Open',
|
|
1221
|
+
domain: { state: { in: ['draft', 'checked', 'confirmed', 'progress'] } },
|
|
1222
|
+
group: 'state',
|
|
1223
|
+
},
|
|
1224
|
+
short: { label: 'Components short', domain: { deficitCount: { gt: 0 } }, group: 'state' },
|
|
1225
|
+
},
|
|
1226
|
+
groupBy: ['workcenter', 'state', 'product'],
|
|
1227
|
+
}),
|
|
1228
|
+
'production.plan.line': search(ProductionPlanLine, {
|
|
1229
|
+
fields: ['product.name', 'plan.name'],
|
|
1230
|
+
filters: {
|
|
1231
|
+
unfit: { label: 'Beyond capacity', domain: { capacityNote: { ne: '' } }, group: 'state' },
|
|
1232
|
+
},
|
|
1233
|
+
groupBy: ['workcenter', 'plan'],
|
|
1234
|
+
}),
|
|
1235
|
+
'production.spec.parameter': search(ProductionSpecParameter, { fields: ['name'] }),
|
|
1236
|
+
'production.product.spec': search(ProductionProductSpec, {
|
|
1237
|
+
fields: ['product.name', 'parameter.name'],
|
|
1238
|
+
groupBy: ['product', 'parameter'],
|
|
1239
|
+
}),
|
|
1240
|
+
'production.bom.eligibility': search(ProductionBomEligibility, {
|
|
1241
|
+
fields: ['kind'],
|
|
1242
|
+
groupBy: ['kind'],
|
|
1243
|
+
}),
|
|
1244
|
+
'production.shift': search(ProductionShift, { fields: ['name'] }),
|
|
1245
|
+
'production.workcenter': search(ProductionWorkcenter, { fields: ['name', 'code'] }),
|
|
1246
|
+
'production.workorder': search(ProductionWorkorder, {
|
|
1247
|
+
fields: ['name', 'production.name', 'workcenter.name'],
|
|
1248
|
+
filters: {
|
|
1249
|
+
open: { label: 'To do', domain: { state: { in: ['ready', 'progress'] } } },
|
|
1250
|
+
},
|
|
1251
|
+
groupBy: ['workcenter', 'production'],
|
|
1252
|
+
}),
|
|
1253
|
+
'production.bom.line': search(ProductionBomLine, { fields: ['product.name'] }),
|
|
1254
|
+
'production.order.component': search(ProductionOrderComponent, { fields: ['product.name'] }),
|
|
1255
|
+
},
|
|
1256
|
+
});
|