shutro-erp 0.3.4 → 0.3.6
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.d.ts +22 -0
- package/dist/account_asset/.kosh/bindings.js +15 -0
- package/dist/account_asset/.kosh/schema.d.ts +1755 -0
- 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/index.d.ts +9 -0
- package/dist/account_asset/index.js +335 -0
- package/dist/account_asset/module.d.ts +7622 -0
- package/dist/account_asset/module.js +230 -0
- package/dist/account_budget/.kosh/bindings.d.ts +22 -0
- package/dist/account_budget/.kosh/bindings.js +15 -0
- package/dist/account_budget/.kosh/schema.d.ts +1767 -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/index.d.ts +4 -0
- package/dist/account_budget/index.js +223 -0
- package/dist/account_budget/module.d.ts +13863 -0
- package/dist/account_budget/module.js +167 -0
- package/dist/account_portal/.kosh/bindings.js +1 -1
- package/dist/account_portal/.kosh/schema.d.ts +176 -6
- package/dist/account_portal/module.d.ts +505 -6
- package/dist/accounting/.kosh/bindings.js +1 -1
- package/dist/accounting/.kosh/schema.d.ts +176 -6
- package/dist/accounting/index.d.ts +1 -1
- package/dist/accounting/index.js +344 -4
- package/dist/accounting/module.d.ts +513 -5
- package/dist/accounting/module.js +55 -3
- package/dist/approvals/.kosh/bindings.d.ts +22 -0
- package/dist/approvals/.kosh/bindings.js +15 -0
- package/dist/approvals/.kosh/schema.d.ts +611 -0
- package/dist/approvals/index.d.ts +18 -0
- package/dist/approvals/index.js +302 -0
- package/dist/approvals/mails.d.ts +25 -0
- package/dist/approvals/mails.js +82 -0
- package/dist/approvals/module.d.ts +1 -0
- package/dist/approvals/module.js +12 -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/Mine.d.ts +7 -0
- package/dist/approvals/web/Mine.js +27 -0
- package/dist/approvals/web/index.d.ts +13 -0
- package/dist/approvals/web/index.js +22 -0
- package/dist/approvals/web/messages.d.ts +2 -0
- package/dist/approvals/web/messages.js +119 -0
- package/dist/approvals/web/shared.d.ts +59 -0
- package/dist/approvals/web/shared.js +46 -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 +1048 -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/index.d.ts +4 -0
- package/dist/attendance/index.js +513 -0
- package/dist/attendance/module.d.ts +3969 -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/calendar/.kosh/bindings.d.ts +22 -0
- package/dist/calendar/.kosh/bindings.js +15 -0
- package/dist/calendar/.kosh/schema.d.ts +795 -0
- package/dist/calendar/demo.d.ts +6 -0
- package/dist/calendar/demo.js +24 -0
- package/dist/calendar/index.d.ts +3 -0
- package/dist/calendar/index.js +291 -0
- package/dist/calendar/module.d.ts +1705 -0
- package/dist/calendar/module.js +180 -0
- package/dist/cli/init.js +80 -0
- package/dist/cli/templates.d.ts +1 -1
- package/dist/cli/templates.js +226 -0
- package/dist/contacts/.kosh/bindings.js +1 -1
- package/dist/contacts/.kosh/schema.d.ts +78 -3
- package/dist/contacts/demo.js +30 -1
- package/dist/contacts/index.d.ts +1 -1
- package/dist/contacts/index.js +155 -9
- package/dist/contacts/module.d.ts +338 -2
- package/dist/contacts/module.js +93 -5
- package/dist/crm/.kosh/bindings.d.ts +22 -0
- package/dist/crm/.kosh/bindings.js +15 -0
- package/dist/crm/.kosh/schema.d.ts +800 -0
- package/dist/crm/demo.d.ts +6 -0
- package/dist/crm/demo.js +45 -0
- package/dist/crm/index.d.ts +3 -0
- package/dist/crm/index.js +361 -0
- package/dist/crm/module.d.ts +1845 -0
- package/dist/crm/module.js +208 -0
- package/dist/documents/.kosh/bindings.d.ts +22 -0
- package/dist/documents/.kosh/bindings.js +15 -0
- package/dist/documents/.kosh/schema.d.ts +862 -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/index.d.ts +30 -0
- package/dist/documents/index.js +442 -0
- package/dist/documents/module.d.ts +2781 -0
- package/dist/documents/module.js +214 -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.d.ts +22 -0
- package/dist/event/.kosh/bindings.js +15 -0
- package/dist/event/.kosh/schema.d.ts +843 -0
- package/dist/event/demo.d.ts +6 -0
- package/dist/event/demo.js +65 -0
- package/dist/event/index.d.ts +14 -0
- package/dist/event/index.js +333 -0
- package/dist/event/mails.d.ts +15 -0
- package/dist/event/mails.js +112 -0
- package/dist/event/module.d.ts +2800 -0
- package/dist/event/module.js +323 -0
- package/dist/event/web/CheckInBox.d.ts +9 -0
- package/dist/event/web/CheckInBox.js +87 -0
- package/dist/event/web/index.d.ts +11 -0
- package/dist/event/web/index.js +16 -0
- package/dist/event/web/messages.d.ts +2 -0
- package/dist/event/web/messages.js +23 -0
- package/dist/event_account/.kosh/bindings.d.ts +22 -0
- package/dist/event_account/.kosh/bindings.js +15 -0
- package/dist/event_account/.kosh/schema.d.ts +1758 -0
- package/dist/event_account/index.d.ts +3 -0
- package/dist/event_account/index.js +28 -0
- package/dist/event_account/module.d.ts +7114 -0
- package/dist/event_account/module.js +90 -0
- package/dist/expense/.kosh/bindings.d.ts +22 -0
- package/dist/expense/.kosh/bindings.js +15 -0
- package/dist/expense/.kosh/schema.d.ts +1299 -0
- package/dist/expense/demo.d.ts +7 -0
- package/dist/expense/demo.js +69 -0
- package/dist/expense/index.d.ts +3 -0
- package/dist/expense/index.js +495 -0
- package/dist/expense/module.d.ts +4747 -0
- package/dist/expense/module.js +647 -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 +1936 -0
- package/dist/expense_account/index.d.ts +3 -0
- package/dist/expense_account/index.js +74 -0
- package/dist/expense_account/module.d.ts +9153 -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 +885 -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/index.d.ts +10 -0
- package/dist/helpdesk/index.js +461 -0
- package/dist/helpdesk/module.d.ts +2940 -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.d.ts +22 -0
- package/dist/hr/.kosh/bindings.js +15 -0
- package/dist/hr/.kosh/schema.d.ts +878 -0
- package/dist/hr/demo.d.ts +6 -0
- package/dist/hr/demo.js +60 -0
- package/dist/hr/index.d.ts +3 -0
- package/dist/hr/index.js +483 -0
- package/dist/hr/module.d.ts +2611 -0
- package/dist/hr/module.js +350 -0
- package/dist/l10n_bd/.kosh/bindings.js +1 -1
- package/dist/l10n_bd/.kosh/schema.d.ts +176 -6
- package/dist/l10n_bd/module.d.ts +505 -6
- 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 +2312 -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/index.d.ts +4 -0
- package/dist/l10n_bd_payroll/index.js +24 -0
- package/dist/l10n_bd_payroll/module.d.ts +12932 -0
- package/dist/l10n_bd_payroll/module.js +86 -0
- package/dist/l10n_in/.kosh/bindings.js +1 -1
- package/dist/l10n_in/.kosh/schema.d.ts +176 -6
- package/dist/l10n_in/module.d.ts +527 -7
- package/dist/mail/inbound/handle.js +6 -1
- package/dist/maintenance/.kosh/bindings.d.ts +22 -0
- package/dist/maintenance/.kosh/bindings.js +15 -0
- package/dist/maintenance/.kosh/schema.d.ts +911 -0
- package/dist/maintenance/demo.d.ts +6 -0
- package/dist/maintenance/demo.js +60 -0
- package/dist/maintenance/index.d.ts +3 -0
- package/dist/maintenance/index.js +422 -0
- package/dist/maintenance/module.d.ts +3545 -0
- package/dist/maintenance/module.js +446 -0
- package/dist/maintenance_stock/.kosh/bindings.d.ts +22 -0
- package/dist/maintenance_stock/.kosh/bindings.js +15 -0
- package/dist/maintenance_stock/.kosh/schema.d.ts +1446 -0
- package/dist/maintenance_stock/index.d.ts +9 -0
- package/dist/maintenance_stock/index.js +52 -0
- package/dist/maintenance_stock/module.d.ts +7675 -0
- package/dist/maintenance_stock/module.js +192 -0
- package/dist/modules-sdk/index.d.ts +1 -1
- package/dist/modules-sdk/manifest.d.ts +109 -2
- package/dist/modules-sdk/manifest.js +35 -1
- package/dist/mrp/.kosh/bindings.d.ts +22 -0
- package/dist/mrp/.kosh/bindings.js +15 -0
- package/dist/mrp/.kosh/schema.d.ts +1453 -0
- package/dist/mrp/demo.d.ts +7 -0
- package/dist/mrp/demo.js +42 -0
- package/dist/mrp/index.d.ts +3 -0
- package/dist/mrp/index.js +393 -0
- package/dist/mrp/module.d.ts +9335 -0
- package/dist/mrp/module.js +757 -0
- package/dist/mrp_account/.kosh/bindings.d.ts +22 -0
- package/dist/mrp_account/.kosh/bindings.js +15 -0
- package/dist/mrp_account/.kosh/schema.d.ts +2299 -0
- package/dist/mrp_account/index.d.ts +3 -0
- package/dist/mrp_account/index.js +22 -0
- package/dist/mrp_account/module.d.ts +23151 -0
- package/dist/mrp_account/module.js +123 -0
- package/dist/payment/.kosh/bindings.js +1 -1
- package/dist/payment/.kosh/schema.d.ts +178 -7
- package/dist/payment/index.d.ts +41 -0
- package/dist/payment/index.js +131 -74
- package/dist/payment/module.d.ts +569 -12
- package/dist/payment/module.js +19 -3
- package/dist/payment/settle.js +10 -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 +1390 -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/index.d.ts +230 -0
- package/dist/payroll/index.js +713 -0
- package/dist/payroll/module.d.ts +9390 -0
- 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 +2308 -0
- package/dist/payroll_account/index.d.ts +3 -0
- package/dist/payroll_account/index.js +40 -0
- package/dist/payroll_account/module.d.ts +12396 -0
- package/dist/payroll_account/module.js +256 -0
- package/dist/permissions/approvals.d.ts +131 -9
- package/dist/permissions/approvals.js +662 -57
- package/dist/permissions/index.d.ts +1 -1
- package/dist/permissions/index.js +2 -2
- package/dist/permissions/models.js +191 -12
- package/dist/permissions/routes.d.ts +6 -1
- package/dist/permissions/routes.js +37 -4
- package/dist/permissions/web/ApprovalPanel.d.ts +5 -4
- package/dist/permissions/web/ApprovalPanel.js +39 -13
- 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 +43 -0
- package/dist/portal/.kosh/bindings.js +1 -1
- package/dist/portal/.kosh/schema.d.ts +78 -3
- package/dist/portal/index.js +1 -1
- package/dist/portal/module.d.ts +166 -2
- package/dist/pos/.kosh/bindings.d.ts +22 -0
- package/dist/pos/.kosh/bindings.js +15 -0
- package/dist/pos/.kosh/schema.d.ts +1809 -0
- package/dist/pos/accounting.d.ts +10 -0
- package/dist/pos/accounting.js +149 -0
- package/dist/pos/demo.d.ts +6 -0
- package/dist/pos/demo.js +90 -0
- package/dist/pos/index.d.ts +9 -0
- package/dist/pos/index.js +353 -0
- package/dist/pos/module.d.ts +9783 -0
- package/dist/pos/module.js +423 -0
- package/dist/pos/routes.d.ts +39 -0
- package/dist/pos/routes.js +368 -0
- package/dist/pos/web/Register.d.ts +9 -0
- package/dist/pos/web/Register.js +252 -0
- package/dist/pos/web/index.d.ts +11 -0
- package/dist/pos/web/index.js +16 -0
- package/dist/pos/web/messages.d.ts +2 -0
- package/dist/pos/web/messages.js +87 -0
- package/dist/pos_stock/.kosh/bindings.d.ts +22 -0
- package/dist/pos_stock/.kosh/bindings.js +15 -0
- package/dist/pos_stock/.kosh/schema.d.ts +2208 -0
- package/dist/pos_stock/index.d.ts +9 -0
- package/dist/pos_stock/index.js +35 -0
- package/dist/pos_stock/module.d.ts +12803 -0
- package/dist/pos_stock/module.js +115 -0
- package/dist/product/.kosh/bindings.js +1 -1
- package/dist/product/.kosh/schema.d.ts +52 -1
- package/dist/product/index.js +94 -4
- package/dist/product/module.d.ts +45 -1
- package/dist/product/module.js +11 -3
- package/dist/project/.kosh/bindings.js +1 -1
- package/dist/project/.kosh/schema.d.ts +725 -3
- package/dist/project/index.d.ts +3 -1
- package/dist/project/index.js +1045 -18
- package/dist/project/module.d.ts +10168 -458
- package/dist/project/module.js +1578 -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 +2241 -0
- package/dist/project_account/index.d.ts +3 -0
- package/dist/project_account/index.js +27 -0
- package/dist/project_account/module.d.ts +11539 -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 +725 -3
- package/dist/project_portal/module.d.ts +5137 -119
- 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 +2320 -0
- package/dist/project_purchase/index.d.ts +9 -0
- package/dist/project_purchase/index.js +22 -0
- package/dist/project_purchase/module.d.ts +25147 -0
- package/dist/project_purchase/module.js +56 -0
- package/dist/purchase/.kosh/bindings.js +1 -1
- package/dist/purchase/.kosh/schema.d.ts +150 -6
- package/dist/purchase/index.js +163 -3
- package/dist/purchase/module.d.ts +228 -5
- package/dist/purchase/module.js +30 -3
- package/dist/purchase_account/.kosh/bindings.js +1 -1
- package/dist/purchase_account/.kosh/schema.d.ts +180 -8
- package/dist/purchase_account/index.js +27 -1
- package/dist/purchase_account/module.d.ts +591 -30
- package/dist/purchase_account/module.js +13 -2
- package/dist/purchase_portal/.kosh/bindings.js +1 -1
- package/dist/purchase_portal/.kosh/schema.d.ts +150 -6
- package/dist/purchase_portal/module.d.ts +372 -6
- package/dist/purchase_stock/.kosh/bindings.d.ts +22 -0
- package/dist/purchase_stock/.kosh/bindings.js +15 -0
- package/dist/purchase_stock/.kosh/schema.d.ts +1479 -0
- package/dist/purchase_stock/index.d.ts +7 -0
- package/dist/purchase_stock/index.js +98 -0
- package/dist/purchase_stock/module.d.ts +7535 -0
- package/dist/purchase_stock/module.js +380 -0
- package/dist/purchase_stock_account/.kosh/bindings.d.ts +22 -0
- package/dist/purchase_stock_account/.kosh/bindings.js +15 -0
- package/dist/purchase_stock_account/.kosh/schema.d.ts +2155 -0
- package/dist/purchase_stock_account/index.d.ts +3 -0
- package/dist/purchase_stock_account/index.js +24 -0
- package/dist/purchase_stock_account/module.d.ts +38015 -0
- package/dist/purchase_stock_account/module.js +168 -0
- package/dist/recruitment/.kosh/bindings.d.ts +22 -0
- package/dist/recruitment/.kosh/bindings.js +15 -0
- package/dist/recruitment/.kosh/schema.d.ts +991 -0
- package/dist/recruitment/demo.d.ts +6 -0
- package/dist/recruitment/demo.js +45 -0
- package/dist/recruitment/index.d.ts +3 -0
- package/dist/recruitment/index.js +385 -0
- package/dist/recruitment/module.d.ts +3249 -0
- package/dist/recruitment/module.js +194 -0
- package/dist/recruitment/web/HireButton.d.ts +9 -0
- package/dist/recruitment/web/HireButton.js +32 -0
- package/dist/recruitment/web/index.d.ts +11 -0
- package/dist/recruitment/web/index.js +16 -0
- package/dist/recruitment/web/messages.d.ts +2 -0
- package/dist/recruitment/web/messages.js +19 -0
- package/dist/reporting/documents.d.ts +5 -0
- package/dist/reporting/documents.js +28 -1
- package/dist/reporting/index.d.ts +1 -1
- package/dist/reporting/index.js +4 -2
- package/dist/reporting/models.js +9 -0
- package/dist/reporting/overviews.d.ts +16 -0
- package/dist/reporting/overviews.js +56 -0
- package/dist/reporting/routes-documents.js +1 -1
- package/dist/reporting/routes.js +138 -80
- package/dist/reporting/web/DashboardView.d.ts +11 -0
- package/dist/reporting/web/DashboardView.js +2 -2
- package/dist/reporting/web/DesignerView.js +5 -0
- package/dist/reporting/web/Overview.d.ts +9 -0
- package/dist/reporting/web/Overview.js +53 -0
- package/dist/reporting/web/index.d.ts +1 -0
- package/dist/reporting/web/index.js +4 -1
- package/dist/reporting/web/messages.js +9 -0
- package/dist/sale_account/.kosh/bindings.js +1 -1
- package/dist/sale_account/.kosh/schema.d.ts +181 -6
- package/dist/sale_account/index.js +22 -1
- package/dist/sale_account/module.d.ts +639 -38
- package/dist/sale_portal/.kosh/bindings.js +1 -1
- package/dist/sale_portal/.kosh/schema.d.ts +59 -3
- package/dist/sale_portal/module.d.ts +435 -5
- package/dist/sale_project/.kosh/bindings.js +1 -1
- package/dist/sale_project/.kosh/schema.d.ts +732 -3
- package/dist/sale_project/module.d.ts +5349 -208
- package/dist/sale_project/module.js +17 -1
- package/dist/sale_stock/.kosh/bindings.d.ts +22 -0
- package/dist/sale_stock/.kosh/bindings.js +15 -0
- package/dist/sale_stock/.kosh/schema.d.ts +1303 -0
- package/dist/sale_stock/index.d.ts +7 -0
- package/dist/sale_stock/index.js +84 -0
- package/dist/sale_stock/module.d.ts +7514 -0
- package/dist/sale_stock/module.js +146 -0
- package/dist/sales/.kosh/bindings.js +1 -1
- package/dist/sales/.kosh/schema.d.ts +59 -3
- package/dist/sales/index.js +195 -4
- package/dist/sales/module.d.ts +356 -3
- package/dist/sales/module.js +78 -3
- package/dist/server/api/metadata.d.ts +5 -0
- package/dist/server/api/metadata.js +5 -0
- package/dist/server/api/rest.js +64 -1
- package/dist/server/api/views.js +1 -0
- package/dist/server/app-settings.d.ts +7 -0
- package/dist/server/app-settings.js +10 -0
- package/dist/server/auth/base.js +9 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/settings/app-settings.d.ts +2 -0
- package/dist/settings/app-settings.js +518 -0
- package/dist/settings/index.d.ts +1 -0
- package/dist/settings/index.js +15 -0
- package/dist/settings/people.js +29 -5
- package/dist/settings/web/AppSettingsPage.d.ts +11 -0
- package/dist/settings/web/AppSettingsPage.js +210 -0
- package/dist/settings/web/OverviewPage.js +16 -3
- package/dist/settings/web/PeoplePage.js +20 -6
- package/dist/settings/web/index.d.ts +1 -0
- package/dist/settings/web/index.js +3 -0
- package/dist/settings/web/messages.js +118 -2
- package/dist/sign/.kosh/bindings.d.ts +22 -0
- package/dist/sign/.kosh/bindings.js +15 -0
- package/dist/sign/.kosh/schema.d.ts +990 -0
- package/dist/sign/index.d.ts +14 -0
- package/dist/sign/index.js +350 -0
- package/dist/sign/module.d.ts +4478 -0
- package/dist/sign/module.js +158 -0
- package/dist/sign/sign.d.ts +82 -0
- package/dist/sign/sign.js +474 -0
- package/dist/stock/.kosh/bindings.d.ts +22 -0
- package/dist/stock/.kosh/bindings.js +15 -0
- package/dist/stock/.kosh/schema.d.ts +1222 -0
- package/dist/stock/demo.d.ts +8 -0
- package/dist/stock/demo.js +82 -0
- package/dist/stock/index.d.ts +4 -0
- package/dist/stock/index.js +903 -0
- package/dist/stock/module.d.ts +7856 -0
- package/dist/stock/module.js +1880 -0
- package/dist/stock/replenish.d.ts +38 -0
- package/dist/stock/replenish.js +176 -0
- package/dist/stock/web/Replenishment.d.ts +8 -0
- package/dist/stock/web/Replenishment.js +84 -0
- package/dist/stock/web/ScanBox.d.ts +8 -0
- package/dist/stock/web/ScanBox.js +90 -0
- package/dist/stock/web/index.d.ts +13 -0
- package/dist/stock/web/index.js +20 -0
- package/dist/stock/web/messages.d.ts +2 -0
- package/dist/stock/web/messages.js +77 -0
- package/dist/stock_account/.kosh/bindings.d.ts +22 -0
- package/dist/stock_account/.kosh/bindings.js +15 -0
- package/dist/stock_account/.kosh/schema.d.ts +2068 -0
- package/dist/stock_account/index.d.ts +3 -0
- package/dist/stock_account/index.js +140 -0
- package/dist/stock_account/module.d.ts +11523 -0
- package/dist/stock_account/module.js +339 -0
- package/dist/storage/attachments.d.ts +5 -0
- package/dist/storage/attachments.js +12 -1
- package/dist/storage/models.js +3 -0
- package/dist/storage/routes.js +13 -2
- package/dist/todo/.kosh/bindings.d.ts +22 -0
- package/dist/todo/.kosh/bindings.js +15 -0
- package/dist/todo/.kosh/schema.d.ts +732 -0
- package/dist/todo/demo.d.ts +6 -0
- package/dist/todo/demo.js +35 -0
- package/dist/todo/index.d.ts +3 -0
- package/dist/todo/index.js +187 -0
- package/dist/todo/module.d.ts +1180 -0
- package/dist/todo/module.js +130 -0
- package/dist/trade_finance/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance/.kosh/bindings.js +15 -0
- package/dist/trade_finance/.kosh/schema.d.ts +884 -0
- package/dist/trade_finance/demo.d.ts +6 -0
- package/dist/trade_finance/demo.js +63 -0
- package/dist/trade_finance/index.d.ts +3 -0
- package/dist/trade_finance/index.js +415 -0
- package/dist/trade_finance/module.d.ts +3779 -0
- package/dist/trade_finance/module.js +507 -0
- package/dist/trade_finance_account/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_account/.kosh/bindings.js +15 -0
- package/dist/trade_finance_account/.kosh/schema.d.ts +1830 -0
- package/dist/trade_finance_account/index.d.ts +3 -0
- package/dist/trade_finance_account/index.js +93 -0
- package/dist/trade_finance_account/module.d.ts +8074 -0
- package/dist/trade_finance_account/module.js +245 -0
- package/dist/trade_finance_purchase/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_purchase/.kosh/bindings.js +15 -0
- package/dist/trade_finance_purchase/.kosh/schema.d.ts +1246 -0
- package/dist/trade_finance_purchase/index.d.ts +8 -0
- package/dist/trade_finance_purchase/index.js +50 -0
- package/dist/trade_finance_purchase/module.d.ts +4257 -0
- package/dist/trade_finance_purchase/module.js +44 -0
- package/dist/trade_finance_sale/.kosh/bindings.d.ts +22 -0
- package/dist/trade_finance_sale/.kosh/bindings.js +15 -0
- package/dist/trade_finance_sale/.kosh/schema.d.ts +1072 -0
- package/dist/trade_finance_sale/index.d.ts +8 -0
- package/dist/trade_finance_sale/index.js +50 -0
- package/dist/trade_finance_sale/module.d.ts +4281 -0
- package/dist/trade_finance_sale/module.js +44 -0
- package/dist/ui/api.d.ts +2 -1
- package/dist/ui/api.js +2 -1
- package/dist/ui/app.js +26 -13
- package/dist/ui/components/AppIcon.js +30 -1
- package/dist/ui/components/primitives.d.ts +2 -0
- package/dist/ui/components/primitives.js +7 -1
- package/dist/ui/i18n/messages.d.ts +27 -0
- package/dist/ui/i18n/messages.js +46 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +1 -0
- package/dist/ui/offline/queue.d.ts +5 -1
- package/dist/ui/offline/queue.js +2 -0
- package/dist/ui/registry.d.ts +5 -0
- package/dist/ui/shell/Home.js +55 -4
- package/dist/ui/views/FormView.js +102 -19
- package/dist/ui/views/KanbanView.d.ts +2 -0
- package/dist/ui/views/KanbanView.js +40 -3
- package/dist/ui/views/ListView.js +110 -11
- package/dist/ui/views/StatsRow.d.ts +14 -0
- package/dist/ui/views/StatsRow.js +88 -0
- package/dist/ui/views/widgets.d.ts +2 -1
- package/dist/ui/views/widgets.js +200 -1
- package/dist/views/builders.d.ts +19 -2
- package/dist/views/builders.js +21 -1
- package/dist/views/condition.d.ts +6 -0
- package/dist/views/condition.js +20 -0
- package/dist/views/documents.d.ts +8 -0
- package/dist/views/extend.d.ts +2 -2
- package/dist/views/extend.js +11 -1
- package/dist/views/index.d.ts +2 -2
- package/dist/views/index.js +2 -2
- package/dist/views/types.d.ts +52 -5
- package/dist/views/validate.js +39 -1
- package/dist/website/.kosh/bindings.d.ts +22 -0
- package/dist/website/.kosh/bindings.js +15 -0
- package/dist/website/.kosh/schema.d.ts +881 -0
- package/dist/website/demo.d.ts +6 -0
- package/dist/website/demo.js +115 -0
- package/dist/website/index.d.ts +9 -0
- package/dist/website/index.js +251 -0
- package/dist/website/module.d.ts +2987 -0
- package/dist/website/module.js +282 -0
- package/dist/website/render.d.ts +45 -0
- package/dist/website/render.js +102 -0
- package/dist/website/routes.d.ts +12 -0
- package/dist/website/routes.js +246 -0
- package/dist/website/web/PagePreview.d.ts +7 -0
- package/dist/website/web/PagePreview.js +33 -0
- package/dist/website/web/index.d.ts +11 -0
- package/dist/website/web/index.js +16 -0
- package/dist/website/web/messages.d.ts +2 -0
- package/dist/website/web/messages.js +15 -0
- package/dist/website_crm/.kosh/bindings.d.ts +22 -0
- package/dist/website_crm/.kosh/bindings.js +15 -0
- package/dist/website_crm/.kosh/schema.d.ts +967 -0
- package/dist/website_crm/index.d.ts +3 -0
- package/dist/website_crm/index.js +39 -0
- package/dist/website_crm/module.d.ts +2956 -0
- package/dist/website_crm/module.js +44 -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 +2284 -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/index.d.ts +49 -0
- package/dist/website_sale/index.js +538 -0
- package/dist/website_sale/module.d.ts +22027 -0
- package/dist/website_sale/module.js +397 -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 +649 -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 +2681 -0
- package/dist/website_sale_stock/index.d.ts +9 -0
- package/dist/website_sale_stock/index.js +20 -0
- package/dist/website_sale_stock/module.d.ts +24998 -0
- package/dist/website_sale_stock/module.js +28 -0
- package/package.json +200 -2
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The data layer of the Shop (RFC 0024 §2.7, in Sites): products published on a site's shop with a description in
|
|
3
|
+
* English and Bangla, a weight and related products; delivery methods with their fee — fixed, by weight or by zone
|
|
4
|
+
* (inside a set of cities, Dhaka, or outside) — free above an amount, cash on delivery or not; carts, which are
|
|
5
|
+
* quotations of the site's company with a secret token and the method chosen; and online payments of a shop's order,
|
|
6
|
+
* which confirm it, invoice it and register the payment once the provider confirms.
|
|
7
|
+
*/
|
|
8
|
+
import { createHash, randomBytes } from 'node:crypto';
|
|
9
|
+
import { paymentShutro } from '../payment/index.js';
|
|
10
|
+
import { productShutro } from '../product/index.js';
|
|
11
|
+
import { saleAccountShutro } from '../sale_account/index.js';
|
|
12
|
+
import { salesShutro } from '../sales/index.js';
|
|
13
|
+
import { orm } from '../server/orm.js';
|
|
14
|
+
import { websiteShutro } from '../website/index.js';
|
|
15
|
+
import { check, defineModel, defineModule, extendModel, f, method, records, } from './.kosh/bindings.js';
|
|
16
|
+
import { courierOf } from './couriers.js';
|
|
17
|
+
const ALL = ['read', 'write', 'create', 'unlink', 'export', 'import'];
|
|
18
|
+
const zero = orm.toDecimal(0);
|
|
19
|
+
/** A cart's secret: given to the visitor once; only its hash is kept. */
|
|
20
|
+
export const newCartToken = () => randomBytes(24).toString('base64url');
|
|
21
|
+
export const hashToken = (token) => createHash('sha256').update(token).digest('hex');
|
|
22
|
+
/** The couriers whose adapters book shipments (RFC 0024 §2.7; the adapters come with part 2). */
|
|
23
|
+
export const COURIERS = {
|
|
24
|
+
none: 'None (delivered by hand)',
|
|
25
|
+
fake: 'Test courier',
|
|
26
|
+
pathao: 'Pathao',
|
|
27
|
+
steadfast: 'Steadfast',
|
|
28
|
+
redx: 'RedX',
|
|
29
|
+
};
|
|
30
|
+
export const ProductShop = extendModel('product.product', {
|
|
31
|
+
fields: {
|
|
32
|
+
/** Shown on the sites' shops. */
|
|
33
|
+
published: f.boolean({ default: false, label: 'On the shop' }),
|
|
34
|
+
/** What the shop says about it (English and Bangla). */
|
|
35
|
+
websiteDescription: f.text({ translate: true, label: 'Shop description' }),
|
|
36
|
+
/** For fees by weight, in kg. */
|
|
37
|
+
weight: f.decimal({ scale: 3, label: 'Weight (kg)' }),
|
|
38
|
+
/** Shown with it on its page. */
|
|
39
|
+
related: f.many2many('product.product', {
|
|
40
|
+
relation: 'product_shop_related_rel',
|
|
41
|
+
label: 'Related products',
|
|
42
|
+
}),
|
|
43
|
+
/** The order on the shop (lowest first). */
|
|
44
|
+
shopSequence: f.integer({ required: true, default: 10, label: 'Shop order' }),
|
|
45
|
+
/** What search engines show (the name when empty), in English and Bangla. */
|
|
46
|
+
seoTitle: f.char({ translate: true, label: 'Search title' }),
|
|
47
|
+
seoDescription: f.text({ translate: true, label: 'Search description' }),
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
/**
|
|
51
|
+
* What each of these products has available for the shop, in its unit (a decimal string), or null when stock is
|
|
52
|
+
* not followed. Null here; `website_sale_stock` says what Stockroom has.
|
|
53
|
+
*/
|
|
54
|
+
shopAvailable: method('product.product', async function () {
|
|
55
|
+
return new Map(this.ids.map((id) => [id, null]));
|
|
56
|
+
}),
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
export const SiteShop = extendModel('website.site', {
|
|
60
|
+
fields: {
|
|
61
|
+
/** The site sells: its shop's API answers. */
|
|
62
|
+
shop: f.boolean({ default: false, label: 'Shop' }),
|
|
63
|
+
/** Cash-on-delivery orders above this stay quotations until someone confirms them (empty: no limit). */
|
|
64
|
+
codLimit: f.decimal({ scale: 2, label: 'Cash on delivery up to' }),
|
|
65
|
+
/** Who shop orders are assigned to (the site's creator when empty). */
|
|
66
|
+
salesperson: f.many2one('res.users', { ondelete: 'set null', label: 'Shop orders for' }),
|
|
67
|
+
/** With stock shown (`website_sale_stock`): at most this many is "few left". */
|
|
68
|
+
fewLeft: f.integer({ required: true, default: 5, label: 'Few left from' }),
|
|
69
|
+
/** With stock shown: whether more than is available may be ordered. */
|
|
70
|
+
allowBackorders: f.boolean({ default: true, label: 'Sell beyond stock' }),
|
|
71
|
+
/** Carts left this many hours with an email get one reminder (0: never). */
|
|
72
|
+
abandonedHours: f.integer({
|
|
73
|
+
required: true,
|
|
74
|
+
default: 24,
|
|
75
|
+
label: 'Remind abandoned carts after (h)',
|
|
76
|
+
}),
|
|
77
|
+
/** Who carts belong to before checkout (made with the first cart). */
|
|
78
|
+
visitor: f.many2one('res.partner', { ondelete: 'set null', label: 'Shop visitor' }),
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
export const DeliveryCarrier = defineModel('delivery.carrier', {
|
|
82
|
+
label: 'Delivery method',
|
|
83
|
+
recName: 'name',
|
|
84
|
+
order: ['sequence asc', 'id asc'],
|
|
85
|
+
archivable: true,
|
|
86
|
+
companyScoped: { required: true },
|
|
87
|
+
tracking: ['kind', 'price', 'freeOver'],
|
|
88
|
+
access: { 'sales.user': ['read'], 'sales.manager': ALL, 'website.manager': ALL },
|
|
89
|
+
fields: {
|
|
90
|
+
name: f.char({ required: true, translate: true }),
|
|
91
|
+
kind: f.selection({ fixed: 'Fixed fee', weight: 'By weight', zone: 'By zone' }, { required: true, default: 'fixed', label: 'Fee by' }),
|
|
92
|
+
/** The fixed fee; by weight, the fee of the first kg. */
|
|
93
|
+
price: f.decimal({ scale: 2, required: true, default: '0', label: 'Fee' }),
|
|
94
|
+
/** By weight: each kg (or part of one) beyond the first. */
|
|
95
|
+
pricePerKg: f.decimal({ scale: 2, required: true, default: '0', label: 'Each further kg' }),
|
|
96
|
+
/** By zone: the cities inside, comma separated (`Dhaka`). */
|
|
97
|
+
zoneCities: f.char({ default: 'Dhaka', label: 'Inside: cities' }),
|
|
98
|
+
priceInside: f.decimal({ scale: 2, required: true, default: '0', label: 'Fee inside' }),
|
|
99
|
+
priceOutside: f.decimal({ scale: 2, required: true, default: '0', label: 'Fee outside' }),
|
|
100
|
+
/** Free when the goods come to this much or more (empty: never). */
|
|
101
|
+
freeOver: f.decimal({ scale: 2, label: 'Free from' }),
|
|
102
|
+
/** Customers may pay the courier on delivery. */
|
|
103
|
+
cod: f.boolean({ default: true, label: 'Cash on delivery' }),
|
|
104
|
+
courier: f.selection(COURIERS, { required: true, default: 'none', label: 'Courier' }),
|
|
105
|
+
/** The service product the fee is charged as on orders (made with the method). */
|
|
106
|
+
product: f.many2one('product.product', { ondelete: 'restrict', label: 'Fee product' }),
|
|
107
|
+
sequence: f.integer({ required: true, default: 10 }),
|
|
108
|
+
description: f.text({ translate: true }),
|
|
109
|
+
},
|
|
110
|
+
sqlConstraints: {
|
|
111
|
+
fees: {
|
|
112
|
+
check: orm.sql `price >= 0 AND price_per_kg >= 0 AND price_inside >= 0 AND price_outside >= 0 AND (free_over IS NULL OR free_over >= 0)`,
|
|
113
|
+
message: 'Fees are zero or more.',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
/** The fee of `carrier` for goods worth `amount` weighing `weight` kg, delivered to `city`. */
|
|
118
|
+
export function feeOf(carrier, amount, weight, city) {
|
|
119
|
+
if (carrier.freeOver !== null && amount.gte(carrier.freeOver))
|
|
120
|
+
return zero;
|
|
121
|
+
if (carrier.kind === 'weight') {
|
|
122
|
+
const beyond = weight.minus(1);
|
|
123
|
+
return carrier.price.plus(beyond.gt(0) ? beyond.ceil().times(carrier.pricePerKg) : zero);
|
|
124
|
+
}
|
|
125
|
+
if (carrier.kind === 'zone') {
|
|
126
|
+
const inside = (carrier.zoneCities ?? '')
|
|
127
|
+
.split(',')
|
|
128
|
+
.map((c) => c.trim().toLowerCase())
|
|
129
|
+
.filter((c) => c !== '');
|
|
130
|
+
const here = (city ?? '').trim().toLowerCase();
|
|
131
|
+
return here !== '' && inside.includes(here) ? carrier.priceInside : carrier.priceOutside;
|
|
132
|
+
}
|
|
133
|
+
return carrier.price;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A coupon of the shop (RFC 0024 §2.7): a code that takes a percentage off the goods, an amount off, or the delivery
|
|
137
|
+
* fee — from a minimum, between two dates, up to a number of uses, once per customer if it says so.
|
|
138
|
+
*/
|
|
139
|
+
export const ShopCoupon = defineModel('shop.coupon', {
|
|
140
|
+
label: 'Coupon',
|
|
141
|
+
recName: 'code',
|
|
142
|
+
order: ['code asc'],
|
|
143
|
+
archivable: true,
|
|
144
|
+
companyScoped: { required: true },
|
|
145
|
+
tracking: ['value', 'validTo', 'maxUses'],
|
|
146
|
+
access: { 'sales.user': ['read'], 'sales.manager': ALL, 'website.manager': ALL },
|
|
147
|
+
fields: {
|
|
148
|
+
/** What the customer types (upper case). */
|
|
149
|
+
code: f.char({ required: true, size: 40 }),
|
|
150
|
+
name: f.char({ translate: true, label: 'What it gives' }),
|
|
151
|
+
kind: f.selection({ percent: 'Percentage off the goods', amount: 'Amount off', free_delivery: 'Free delivery' }, { required: true, default: 'percent', label: 'Gives' }),
|
|
152
|
+
value: f.decimal({ scale: 2, required: true, default: '0', label: 'Value' }),
|
|
153
|
+
/** The goods must come to this much. */
|
|
154
|
+
minimum: f.decimal({ scale: 2, required: true, default: '0', label: 'From' }),
|
|
155
|
+
validFrom: f.date({ label: 'Valid from' }),
|
|
156
|
+
validTo: f.date({ label: 'Valid until' }),
|
|
157
|
+
/** Empty: as often as it is used. */
|
|
158
|
+
maxUses: f.integer({ label: 'Uses at most' }),
|
|
159
|
+
uses: f.integer({ required: true, default: 0, label: 'Used' }),
|
|
160
|
+
oncePerCustomer: f.boolean({ default: false, label: 'Once per customer' }),
|
|
161
|
+
/** The service product an amount off is charged as (made with its first use). */
|
|
162
|
+
product: f.many2one('product.product', { ondelete: 'set null', label: 'Discount product' }),
|
|
163
|
+
},
|
|
164
|
+
sqlConstraints: {
|
|
165
|
+
oneCode: { unique: ['company', 'code'], message: 'Another coupon has this code.' },
|
|
166
|
+
values: {
|
|
167
|
+
check: orm.sql `value >= 0 AND minimum >= 0 AND (kind <> 'percent' OR value <= 100) AND (max_uses IS NULL OR max_uses > 0)`,
|
|
168
|
+
message: 'A coupon gives zero or more (a percentage up to 100), from zero or more.',
|
|
169
|
+
},
|
|
170
|
+
period: {
|
|
171
|
+
check: orm.sql `valid_from IS NULL OR valid_to IS NULL OR valid_to >= valid_from`,
|
|
172
|
+
message: 'A coupon ends on or after it starts.',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
constraints: {
|
|
176
|
+
upperCase: {
|
|
177
|
+
...check('shop.coupon', ['code'], async (coupons) => coupons.filter((c) => !/^[A-Z0-9_-]{2,40}$/.test(c.code)).map((c) => c.id)),
|
|
178
|
+
message: 'A code is 2 to 40 capital letters, digits, dashes or underscores (EID10).',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
export const OrderShop = extendModel('sale.order', {
|
|
183
|
+
fields: {
|
|
184
|
+
/** The site the order was placed on. */
|
|
185
|
+
website: f.many2one('website.site', { ondelete: 'set null', label: 'Site' }),
|
|
186
|
+
/** The hash of the cart's secret token (the visitor holds the token). */
|
|
187
|
+
cartToken: f.char({ index: true, label: 'Cart token' }),
|
|
188
|
+
carrier: f.many2one('delivery.carrier', { ondelete: 'set null', label: 'Delivery method' }),
|
|
189
|
+
shopPayment: f.selection({ cod: 'Cash on delivery', online: 'Paid online' }, { label: 'Payment' }),
|
|
190
|
+
/** Placed by the customer (checked out); a cart before that. */
|
|
191
|
+
placedAt: f.datetime({ label: 'Placed at' }),
|
|
192
|
+
shopNote: f.text({ label: 'Customer note' }),
|
|
193
|
+
coupon: f.many2one('shop.coupon', { ondelete: 'set null', label: 'Coupon' }),
|
|
194
|
+
/** The email a visitor left on their cart (reminded once if they leave it). */
|
|
195
|
+
contactEmail: f.char({ label: 'Cart email' }),
|
|
196
|
+
/** The hash of the cart's recovery code, sent with the reminder. */
|
|
197
|
+
recoveryToken: f.char({ index: true, label: 'Recovery code' }),
|
|
198
|
+
remindedAt: f.datetime({ label: 'Reminded at' }),
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
export const LineShop = extendModel('sale.order.line', {
|
|
202
|
+
fields: {
|
|
203
|
+
/** The delivery fee's line (replaced when the method or the cart changes). */
|
|
204
|
+
isDelivery: f.boolean({ default: false, label: 'Delivery fee' }),
|
|
205
|
+
/** A coupon's amount off (replaced when the cart or the coupon changes). */
|
|
206
|
+
isDiscount: f.boolean({ default: false, label: 'Coupon discount' }),
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
export const TransactionOrder = extendModel('payment.transaction', {
|
|
210
|
+
fields: {
|
|
211
|
+
saleOrder: f.many2one('sale.order', { ondelete: 'set null', label: 'Sales order' }),
|
|
212
|
+
},
|
|
213
|
+
overrides: {
|
|
214
|
+
// A shop's order is confirmed, invoiced and its invoice posted when its payment is confirmed; the payment pays it.
|
|
215
|
+
payable: async function (next) {
|
|
216
|
+
const out = await next();
|
|
217
|
+
const txs = this;
|
|
218
|
+
const env = txs.env;
|
|
219
|
+
for (const t of await txs.load({ saleOrder: true })) {
|
|
220
|
+
if ((out.get(t.id) ?? []).length > 0 || t.saleOrder === null)
|
|
221
|
+
continue;
|
|
222
|
+
const order = env.model('sale.order').browse([t.saleOrder.id]);
|
|
223
|
+
const [o] = await order.load({ invoices: true });
|
|
224
|
+
if (o === undefined)
|
|
225
|
+
continue;
|
|
226
|
+
if (o.state === 'draft' || o.state === 'sent')
|
|
227
|
+
await order.confirm();
|
|
228
|
+
let invoice = [...o.invoices].find((i) => i.state !== 'cancel')?.id;
|
|
229
|
+
if (invoice === undefined) {
|
|
230
|
+
await order.invoice();
|
|
231
|
+
const [again] = await order.load({ invoices: true });
|
|
232
|
+
invoice = [...(again?.invoices ?? [])].find((i) => i.state !== 'cancel')?.id;
|
|
233
|
+
}
|
|
234
|
+
if (invoice === undefined)
|
|
235
|
+
continue;
|
|
236
|
+
const move = env.model('account.move').browse([invoice]);
|
|
237
|
+
const [m] = await move.load({});
|
|
238
|
+
if (m?.state === 'draft')
|
|
239
|
+
await move.post();
|
|
240
|
+
await txs.env.model('payment.transaction').browse([t.id]).write({ move: invoice });
|
|
241
|
+
out.set(t.id, [invoice]);
|
|
242
|
+
}
|
|
243
|
+
return out;
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
/**
|
|
248
|
+
* A shipment (RFC 0024 §2.7): a shop order's parcel with its courier — made as a draft when an order whose delivery
|
|
249
|
+
* method has a courier is confirmed, booked by the team (the courier's consignment id and label), then moved along by
|
|
250
|
+
* what the courier says (picked, in transit, delivered or returned) with its events; delivered with the cash to
|
|
251
|
+
* collect, the cash is collected.
|
|
252
|
+
*/
|
|
253
|
+
export const DeliveryShipment = defineModel('delivery.shipment', {
|
|
254
|
+
label: 'Shipment',
|
|
255
|
+
recName: 'name',
|
|
256
|
+
order: ['id desc'],
|
|
257
|
+
companyScoped: { required: true },
|
|
258
|
+
tracking: ['state', 'trackingRef'],
|
|
259
|
+
access: { 'sales.user': ['read', 'write', 'create'], 'sales.manager': ALL },
|
|
260
|
+
fields: {
|
|
261
|
+
name: f.char({
|
|
262
|
+
required: true,
|
|
263
|
+
readonly: true,
|
|
264
|
+
sequence: { code: 'delivery.shipment' },
|
|
265
|
+
label: 'Reference',
|
|
266
|
+
}),
|
|
267
|
+
order: f.many2one('sale.order', { required: true, ondelete: 'restrict', label: 'Order' }),
|
|
268
|
+
carrier: f.many2one('delivery.carrier', { required: true, ondelete: 'restrict' }),
|
|
269
|
+
courier: f.selection(COURIERS, { required: true, default: 'fake' }),
|
|
270
|
+
recipient: f.char({ required: true }),
|
|
271
|
+
phone: f.char({ required: true }),
|
|
272
|
+
address: f.char({ required: true }),
|
|
273
|
+
city: f.char({ required: true }),
|
|
274
|
+
/** The cash the courier collects (0: paid online). */
|
|
275
|
+
cod: f.decimal({ scale: 2, required: true, default: '0', label: 'Cash to collect' }),
|
|
276
|
+
weight: f.decimal({ scale: 3, required: true, default: '0', label: 'Weight (kg)' }),
|
|
277
|
+
trackingRef: f.char({ index: true, label: 'Consignment' }),
|
|
278
|
+
labelUrl: f.char({ label: 'Label' }),
|
|
279
|
+
codCollected: f.boolean({ default: false, label: 'Cash collected' }),
|
|
280
|
+
codCollectedAt: f.datetime({ label: 'Collected at' }),
|
|
281
|
+
events: f.one2many('delivery.shipment.event', 'shipment', { label: 'Tracking' }),
|
|
282
|
+
note: f.text(),
|
|
283
|
+
state: f.state({
|
|
284
|
+
states: {
|
|
285
|
+
draft: 'To book',
|
|
286
|
+
booked: 'Booked',
|
|
287
|
+
picked: 'Picked up',
|
|
288
|
+
in_transit: 'In transit',
|
|
289
|
+
delivered: 'Delivered',
|
|
290
|
+
returned: 'Returned',
|
|
291
|
+
cancel: 'Cancelled',
|
|
292
|
+
},
|
|
293
|
+
initial: 'draft',
|
|
294
|
+
transitions: {
|
|
295
|
+
/** Books the parcel with the courier: its consignment id and label. */
|
|
296
|
+
book: {
|
|
297
|
+
from: ['draft'],
|
|
298
|
+
to: 'booked',
|
|
299
|
+
before: records('delivery.shipment', async (shipments) => {
|
|
300
|
+
for (const s of await shipments.load({})) {
|
|
301
|
+
const courier = courierOf(s.courier);
|
|
302
|
+
if (courier === null)
|
|
303
|
+
throw new orm.ValidationError('delivery.shipment', ['courier'], `The ${COURIERS[s.courier] ?? s.courier} courier is not set up on this server.`, 'Its credentials go in the server’s environment; the test courier always works.');
|
|
304
|
+
let booked;
|
|
305
|
+
try {
|
|
306
|
+
booked = await courier.book({
|
|
307
|
+
reference: s.name,
|
|
308
|
+
recipient: {
|
|
309
|
+
name: s.recipient,
|
|
310
|
+
phone: s.phone,
|
|
311
|
+
address: s.address,
|
|
312
|
+
city: s.city,
|
|
313
|
+
},
|
|
314
|
+
cod: s.cod.toFixed(2),
|
|
315
|
+
weightKg: s.weight.toFixed(3),
|
|
316
|
+
note: s.note ?? '',
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
throw new orm.ValidationError('delivery.shipment', ['courier'], `The courier refused the booking: ${error instanceof Error ? error.message : String(error)}`, 'Check the address and phone number, then book again.');
|
|
321
|
+
}
|
|
322
|
+
await s.write({ trackingRef: booked.trackingRef, labelUrl: booked.labelUrl ?? null });
|
|
323
|
+
await shipments.env
|
|
324
|
+
.model('delivery.shipment.event')
|
|
325
|
+
.create([{ shipment: s.id, status: 'booked', note: 'Booked with the courier' }]);
|
|
326
|
+
}
|
|
327
|
+
}),
|
|
328
|
+
},
|
|
329
|
+
pick: { from: ['booked'], to: 'picked' },
|
|
330
|
+
transit: { from: ['booked', 'picked'], to: 'in_transit' },
|
|
331
|
+
deliver: {
|
|
332
|
+
from: ['booked', 'picked', 'in_transit'],
|
|
333
|
+
to: 'delivered',
|
|
334
|
+
after: records('delivery.shipment', async (shipments) => {
|
|
335
|
+
for (const s of await shipments.load({}))
|
|
336
|
+
if (s.cod.gt(0) && !s.codCollected)
|
|
337
|
+
await s.write({ codCollected: true, codCollectedAt: new Date() });
|
|
338
|
+
}),
|
|
339
|
+
},
|
|
340
|
+
bounce: { from: ['booked', 'picked', 'in_transit'], to: 'returned' },
|
|
341
|
+
cancel: {
|
|
342
|
+
from: ['draft', 'booked'],
|
|
343
|
+
to: 'cancel',
|
|
344
|
+
before: records('delivery.shipment', async (shipments) => {
|
|
345
|
+
for (const s of await shipments.load({})) {
|
|
346
|
+
if (s.trackingRef === null)
|
|
347
|
+
continue;
|
|
348
|
+
const courier = courierOf(s.courier);
|
|
349
|
+
try {
|
|
350
|
+
await courier?.cancel(s.trackingRef);
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
throw new orm.ValidationError('delivery.shipment', ['state'], `The courier did not cancel it: ${error instanceof Error ? error.message : String(error)}`, 'Ask the courier to return the parcel instead.');
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}),
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
}),
|
|
360
|
+
},
|
|
361
|
+
sqlConstraints: {
|
|
362
|
+
amounts: { check: orm.sql `cod >= 0 AND weight >= 0`, message: 'Amounts are zero or more.' },
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
export const DeliveryShipmentEvent = defineModel('delivery.shipment.event', {
|
|
366
|
+
label: 'Tracking event',
|
|
367
|
+
order: ['at asc', 'id asc'],
|
|
368
|
+
access: { 'sales.user': ['read', 'create'], 'sales.manager': ['read', 'create', 'unlink'] },
|
|
369
|
+
fields: {
|
|
370
|
+
shipment: f.many2one('delivery.shipment', { required: true, ondelete: 'cascade' }),
|
|
371
|
+
at: f.datetime({ required: true, default: () => new Date(), label: 'When' }),
|
|
372
|
+
status: f.char({ required: true }),
|
|
373
|
+
note: f.char(),
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
export const websiteSaleShutro = defineModule({
|
|
377
|
+
name: 'website_sale',
|
|
378
|
+
version: '0.3.0',
|
|
379
|
+
depends: [websiteShutro, salesShutro, saleAccountShutro, paymentShutro, productShutro],
|
|
380
|
+
groups: [
|
|
381
|
+
orm.defineGroup({
|
|
382
|
+
code: 'website_sale.manager',
|
|
383
|
+
label: 'Shop manager',
|
|
384
|
+
implies: ['website.manager', 'sales.manager'],
|
|
385
|
+
}),
|
|
386
|
+
],
|
|
387
|
+
sequences: [
|
|
388
|
+
orm.defineSequence({
|
|
389
|
+
code: 'delivery.shipment',
|
|
390
|
+
prefix: 'SHP/{year}/',
|
|
391
|
+
padding: 5,
|
|
392
|
+
reset: 'yearly',
|
|
393
|
+
}),
|
|
394
|
+
],
|
|
395
|
+
models: [DeliveryCarrier, DeliveryShipment, DeliveryShipmentEvent, ShopCoupon],
|
|
396
|
+
extensions: [ProductShop, SiteShop, OrderShop, LineShop, TransactionOrder],
|
|
397
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Env } from './.kosh/bindings.js';
|
|
2
|
+
/** Makes the draft shipment of each confirmed shop order of `ids` sent with a courier, once; returns how many. */
|
|
3
|
+
export declare function draftShipments(env: Env, ids: readonly number[]): Promise<number>;
|
|
4
|
+
/** Asks the couriers about the open shipments (those of `ids`, or all); returns how many moved. */
|
|
5
|
+
export declare function refreshShipments(env: Env, ids?: readonly number[]): Promise<number>;
|
|
6
|
+
/** A placed order's shipments as its customer may follow them. */
|
|
7
|
+
export declare function trackingOf(env: Env, order: number): Promise<{
|
|
8
|
+
name: string;
|
|
9
|
+
state: string;
|
|
10
|
+
trackingRef: string | null;
|
|
11
|
+
events: {
|
|
12
|
+
at: string;
|
|
13
|
+
status: string;
|
|
14
|
+
note: string | null;
|
|
15
|
+
}[];
|
|
16
|
+
}[]>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shipments of shop orders (RFC 0024 §2.7): a draft for each confirmed shop order whose delivery method has a
|
|
3
|
+
* courier — once — with the customer's name, phone and address, the weight of its goods and, paid on delivery, the
|
|
4
|
+
* cash to collect; and tracking: what the courier says of each open shipment becomes its events and moves it along
|
|
5
|
+
* (picked, in transit, delivered — the cash collected — or returned).
|
|
6
|
+
*/
|
|
7
|
+
import { orm } from '../server/orm.js';
|
|
8
|
+
import { courierOf } from './couriers.js';
|
|
9
|
+
const zero = orm.toDecimal(0);
|
|
10
|
+
const OPEN = ['booked', 'picked', 'in_transit'];
|
|
11
|
+
/** The transitions that bring a shipment to what the courier says. */
|
|
12
|
+
const TO = {
|
|
13
|
+
picked: ['pick'],
|
|
14
|
+
in_transit: ['transit'],
|
|
15
|
+
delivered: ['deliver'],
|
|
16
|
+
returned: ['bounce'],
|
|
17
|
+
};
|
|
18
|
+
/** Makes the draft shipment of each confirmed shop order of `ids` sent with a courier, once; returns how many. */
|
|
19
|
+
export async function draftShipments(env, ids) {
|
|
20
|
+
let made = 0;
|
|
21
|
+
for (const o of await env
|
|
22
|
+
.model('sale.order')
|
|
23
|
+
.browse(ids)
|
|
24
|
+
.load({ carrier: true, partner: true, lines: { product: true }, company: true })) {
|
|
25
|
+
if (o.website === null || o.carrier === null || o.carrier.courier === 'none')
|
|
26
|
+
continue;
|
|
27
|
+
if (o.state !== 'sale' && o.state !== 'done')
|
|
28
|
+
continue;
|
|
29
|
+
const existing = await env
|
|
30
|
+
.model('delivery.shipment')
|
|
31
|
+
.search({ where: { order: o.id, state: { ne: 'cancel' } }, limit: 1 });
|
|
32
|
+
if (existing.length > 0)
|
|
33
|
+
continue;
|
|
34
|
+
const weight = [...o.lines]
|
|
35
|
+
.filter((l) => !l.isDelivery)
|
|
36
|
+
.reduce((s, l) => s.plus((l.product.weight ?? zero).times(l.quantity)), zero);
|
|
37
|
+
await env.model('delivery.shipment').create([
|
|
38
|
+
{
|
|
39
|
+
order: o.id,
|
|
40
|
+
carrier: o.carrier.id,
|
|
41
|
+
courier: o.carrier.courier,
|
|
42
|
+
company: o.company.id,
|
|
43
|
+
recipient: o.partner.name,
|
|
44
|
+
phone: o.partner.phone ?? o.partner.mobile ?? '-',
|
|
45
|
+
address: o.partner.street ?? '-',
|
|
46
|
+
city: o.partner.city ?? '-',
|
|
47
|
+
cod: o.shopPayment === 'cod' ? (o.amountTotal?.amount ?? zero) : zero,
|
|
48
|
+
weight,
|
|
49
|
+
note: o.shopNote,
|
|
50
|
+
},
|
|
51
|
+
]);
|
|
52
|
+
made += 1;
|
|
53
|
+
}
|
|
54
|
+
await env.flush();
|
|
55
|
+
return made;
|
|
56
|
+
}
|
|
57
|
+
/** Asks the couriers about the open shipments (those of `ids`, or all); returns how many moved. */
|
|
58
|
+
export async function refreshShipments(env, ids) {
|
|
59
|
+
const found = await env.model('delivery.shipment').search({
|
|
60
|
+
where: {
|
|
61
|
+
state: { in: OPEN },
|
|
62
|
+
trackingRef: { isNull: false },
|
|
63
|
+
...(ids === undefined ? {} : { id: { in: ids } }),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
let moved = 0;
|
|
67
|
+
for (const s of await found.load({ events: true })) {
|
|
68
|
+
const courier = courierOf(s.courier);
|
|
69
|
+
if (courier === null || s.trackingRef === null)
|
|
70
|
+
continue;
|
|
71
|
+
let tracking;
|
|
72
|
+
try {
|
|
73
|
+
tracking = await courier.track(s.trackingRef);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
continue; // asked again next time
|
|
77
|
+
}
|
|
78
|
+
const known = s.events.length;
|
|
79
|
+
const fresh = tracking.events.slice(known);
|
|
80
|
+
if (fresh.length > 0)
|
|
81
|
+
await env.model('delivery.shipment.event').create(fresh.map((e) => ({
|
|
82
|
+
shipment: s.id,
|
|
83
|
+
at: new Date(e.at),
|
|
84
|
+
status: e.status,
|
|
85
|
+
note: e.note,
|
|
86
|
+
})));
|
|
87
|
+
const steps = TO[tracking.status];
|
|
88
|
+
if (steps !== undefined && tracking.status !== s.state) {
|
|
89
|
+
const one = env.model('delivery.shipment').browse([s.id]);
|
|
90
|
+
for (const step of steps)
|
|
91
|
+
await one[step]?.();
|
|
92
|
+
moved += 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
await env.flush();
|
|
96
|
+
return moved;
|
|
97
|
+
}
|
|
98
|
+
/** A placed order's shipments as its customer may follow them. */
|
|
99
|
+
export async function trackingOf(env, order) {
|
|
100
|
+
const found = await (await env
|
|
101
|
+
.model('delivery.shipment')
|
|
102
|
+
.search({ where: { order: order, state: { ne: 'cancel' } } })).load({ events: true });
|
|
103
|
+
return [...found].map((s) => ({
|
|
104
|
+
name: s.name,
|
|
105
|
+
state: s.state,
|
|
106
|
+
trackingRef: s.trackingRef,
|
|
107
|
+
events: [...s.events].map((e) => ({
|
|
108
|
+
at: e.at instanceof Date ? e.at.toISOString() : String(e.at),
|
|
109
|
+
status: e.status,
|
|
110
|
+
note: e.note,
|
|
111
|
+
})),
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type Decimal, type Id } from '../server/orm.js';
|
|
2
|
+
import type { Env } from './.kosh/bindings.js';
|
|
3
|
+
export interface Site {
|
|
4
|
+
readonly id: number;
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly company: number;
|
|
7
|
+
}
|
|
8
|
+
/** The environment reading in the visitor's language. */
|
|
9
|
+
export declare const inLang: (env: Env, lang: string) => Env;
|
|
10
|
+
/** Published products on sale, searched, filtered, sorted and paged. */
|
|
11
|
+
export declare function catalogue(env: Env, query: {
|
|
12
|
+
readonly q?: string;
|
|
13
|
+
readonly category?: number;
|
|
14
|
+
readonly min?: Decimal;
|
|
15
|
+
readonly max?: Decimal;
|
|
16
|
+
readonly sort?: string;
|
|
17
|
+
readonly page?: number;
|
|
18
|
+
readonly size?: number;
|
|
19
|
+
}, site?: Site): Promise<{
|
|
20
|
+
products: Record<string, unknown>[];
|
|
21
|
+
total: number;
|
|
22
|
+
page: number;
|
|
23
|
+
pages: number;
|
|
24
|
+
}>;
|
|
25
|
+
export declare function productPage(env: Env, id: number, site?: Site): Promise<Record<string, unknown> | null>;
|
|
26
|
+
/** The product categories that hold published products, with their parents. */
|
|
27
|
+
export declare function categories(env: Env): Promise<{
|
|
28
|
+
id: number;
|
|
29
|
+
name: string;
|
|
30
|
+
parent: number | null;
|
|
31
|
+
}[]>;
|
|
32
|
+
/** A new cart: a quotation of the site's company for its visitor, with a new secret token. */
|
|
33
|
+
export declare function newCart(env: Env, site: Site): Promise<{
|
|
34
|
+
token: string;
|
|
35
|
+
id: number;
|
|
36
|
+
}>;
|
|
37
|
+
/** The order of `token` on the site: a cart (not checked out) unless `placed`. */
|
|
38
|
+
export declare function orderOf(env: Env, site: Site, token: string, placed?: boolean): Promise<Id<'sale.order'> | null>;
|
|
39
|
+
/** What the visitor sees of a cart or an order. */
|
|
40
|
+
export declare function cartView(env: Env, id: Id<'sale.order'>): Promise<Record<string, unknown>>;
|
|
41
|
+
/** Sets how many of `product` the cart holds (0 removes it), at the product's price; the fee follows. */
|
|
42
|
+
export declare function setLine(env: Env, id: Id<'sale.order'>, product: number, quantity: Decimal): Promise<void>;
|
|
43
|
+
/** Puts a coupon on the cart (an empty code takes it off). @throws 422 with why it does not apply */
|
|
44
|
+
export declare function setCoupon(env: Env, site: Site, id: Id<'sale.order'>, code: string): Promise<void>;
|
|
45
|
+
/** The company's delivery methods with their fee for the cart, delivered to `city`. */
|
|
46
|
+
export declare function carriersFor(env: Env, id: Id<'sale.order'>, city: string | null): Promise<{
|
|
47
|
+
id: number;
|
|
48
|
+
name: string;
|
|
49
|
+
fee: string;
|
|
50
|
+
cod: boolean;
|
|
51
|
+
description: string | null;
|
|
52
|
+
}[]>;
|
|
53
|
+
/** Chooses the delivery method: its fee, for the cart and `city`, replaces the cart's fee line. */
|
|
54
|
+
export declare function setDelivery(env: Env, id: Id<'sale.order'>, carrier: number, city: string | null): Promise<void>;
|
|
55
|
+
export interface CheckoutInput {
|
|
56
|
+
readonly name: string;
|
|
57
|
+
readonly email: string;
|
|
58
|
+
readonly phone: string;
|
|
59
|
+
readonly street: string;
|
|
60
|
+
readonly city: string;
|
|
61
|
+
readonly carrier: number;
|
|
62
|
+
/** `cod`, or a payment provider's id. */
|
|
63
|
+
readonly payment: string;
|
|
64
|
+
readonly note?: string;
|
|
65
|
+
/** Where the customer comes back to after paying online (http(s)). */
|
|
66
|
+
readonly returnUrl?: string;
|
|
67
|
+
}
|
|
68
|
+
/** Reads and checks a checkout's input. */
|
|
69
|
+
export declare function checkoutInput(body: unknown): CheckoutInput;
|
|
70
|
+
/**
|
|
71
|
+
* Places the cart: the customer (found by email in the company, else made), the delivery to their city, the note.
|
|
72
|
+
* Cash on delivery confirms it when the method takes cash and the total is within the site's limit (above it, it
|
|
73
|
+
* stays a quotation for the team to confirm); paying online starts a payment and returns where to send the visitor.
|
|
74
|
+
*/
|
|
75
|
+
export declare function checkout(env: Env, site: Site, id: Id<'sale.order'>, input: CheckoutInput): Promise<{
|
|
76
|
+
order: string;
|
|
77
|
+
state: string;
|
|
78
|
+
total: string;
|
|
79
|
+
redirectUrl?: string;
|
|
80
|
+
reference?: string;
|
|
81
|
+
}>;
|