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
package/dist/payment/index.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* - `GET|POST /api/v1/payment/return/:reference` back from the provider: on to the portal
|
|
14
14
|
*
|
|
15
15
|
* The callbacks arrive at `POST /api/v1/hooks/<token>` (the provider's endpoint, made with its first payment).
|
|
16
|
+
* Other apps start payments with `startPayment` (`website_sale`: a shop's checkout) and say what a transaction pays by
|
|
17
|
+
* overriding `payable()` on `payment.transaction`.
|
|
16
18
|
*/
|
|
17
19
|
import { accountPortal } from '../account_portal/index.js';
|
|
18
20
|
import { accounting } from '../accounting/index.js';
|
|
@@ -21,7 +23,7 @@ import { defineModule } from '../modules-sdk/index.js';
|
|
|
21
23
|
import { portalDocuments } from '../portal/index.js';
|
|
22
24
|
import { HttpProblem } from '../server/index.js';
|
|
23
25
|
import { orm } from '../server/orm.js';
|
|
24
|
-
import { action, form, list } from '../views/index.js';
|
|
26
|
+
import { action, form, list, search } from '../views/index.js';
|
|
25
27
|
import { bkashFromEnvironment } from './bkash.js';
|
|
26
28
|
import { PaymentProvider, PaymentTransaction, paymentShutro } from './module.js';
|
|
27
29
|
import { ADAPTERS, FAKE_SIGNATURE, fakeAdapter } from './providers.js';
|
|
@@ -56,6 +58,102 @@ function callbackHooks(adapters) {
|
|
|
56
58
|
},
|
|
57
59
|
}));
|
|
58
60
|
}
|
|
61
|
+
/** The adapters and addresses of the running server (set when the routes are registered). */
|
|
62
|
+
let current = null;
|
|
63
|
+
const adapterOf = (code) => {
|
|
64
|
+
const adapter = current?.adapters.get(code);
|
|
65
|
+
if (adapter === undefined)
|
|
66
|
+
throw new HttpProblem(409, 'no-adapter', 'Provider unavailable', `The ${code} adapter is not installed.`);
|
|
67
|
+
return adapter;
|
|
68
|
+
};
|
|
69
|
+
/** The provider's callback endpoint (made on first use), with its token. */
|
|
70
|
+
async function endpointOf(su, provider) {
|
|
71
|
+
const [p] = await su
|
|
72
|
+
.model('payment.provider')
|
|
73
|
+
.browse([provider.id])
|
|
74
|
+
.load({ endpoint: true });
|
|
75
|
+
if (p?.endpoint !== null && p?.endpoint !== undefined)
|
|
76
|
+
return p.endpoint.token;
|
|
77
|
+
const made = await su
|
|
78
|
+
.model('webhook.endpoint')
|
|
79
|
+
.create([{ name: `${provider.name} callbacks`, hook: `payment.${provider.code}` }]);
|
|
80
|
+
await su
|
|
81
|
+
.model('payment.provider')
|
|
82
|
+
.browse([provider.id])
|
|
83
|
+
.write({ endpoint: made.ids[0] });
|
|
84
|
+
const [e] = await made.load({});
|
|
85
|
+
return e?.token ?? '';
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Starts a payment as the system: a pending transaction for `amount` with the provider, and where to send the
|
|
89
|
+
* customer. The provider must be enabled, configured on this server, and the fake never live.
|
|
90
|
+
*/
|
|
91
|
+
export async function startPayment(su, input) {
|
|
92
|
+
if (current === null)
|
|
93
|
+
throw new HttpProblem(503, 'no-payments', 'Payments unavailable', 'Payments are not set up.');
|
|
94
|
+
const urls = current.urls;
|
|
95
|
+
const [provider] = await (await su.model('payment.provider').search({
|
|
96
|
+
where: {
|
|
97
|
+
id: orm.asId(input.provider, 'payment.provider'),
|
|
98
|
+
state: { in: ['test', 'live'] },
|
|
99
|
+
company: orm.asId(input.company, 'res.company'),
|
|
100
|
+
},
|
|
101
|
+
limit: 1,
|
|
102
|
+
})).load({});
|
|
103
|
+
if (provider === undefined)
|
|
104
|
+
throw new HttpProblem(422, 'invalid-provider', 'No such provider', 'Choose one of the providers offered.');
|
|
105
|
+
const adapter = adapterOf(provider.code);
|
|
106
|
+
if (provider.code === 'fake' && provider.state === 'live')
|
|
107
|
+
throw new HttpProblem(409, 'fake-live', 'Test provider', 'The test provider moves no money: it cannot be live.');
|
|
108
|
+
if (!adapter.configured(provider.state === 'live' ? 'live' : 'test'))
|
|
109
|
+
throw new HttpProblem(409, 'not-configured', 'Provider not set up', `The ${provider.name} provider has no credentials for ${provider.state} payments on this server.`);
|
|
110
|
+
const token = await endpointOf(su, provider);
|
|
111
|
+
const created = await su.model('payment.transaction').create([
|
|
112
|
+
{
|
|
113
|
+
...input.values,
|
|
114
|
+
provider: provider.id,
|
|
115
|
+
move: input.move ?? null,
|
|
116
|
+
partner: input.partner?.id ?? null,
|
|
117
|
+
currency: input.currency.id,
|
|
118
|
+
amount: input.amount.toFixed(),
|
|
119
|
+
company: input.company,
|
|
120
|
+
returnUrl: input.returnUrl ?? null,
|
|
121
|
+
},
|
|
122
|
+
]);
|
|
123
|
+
await su.flush(); // company checks run in this superuser scope, not at commit (Shutro request #11)
|
|
124
|
+
const tx = su.model('payment.transaction').browse(created.ids);
|
|
125
|
+
const [t] = await tx.load({});
|
|
126
|
+
const reference = t?.reference ?? '';
|
|
127
|
+
const p = input.partner;
|
|
128
|
+
let started;
|
|
129
|
+
try {
|
|
130
|
+
started = await adapter.createPayment({
|
|
131
|
+
reference,
|
|
132
|
+
amount: input.amount.toFixed(input.currency.decimalPlaces ?? 2),
|
|
133
|
+
currency: input.currency.name,
|
|
134
|
+
description: input.description,
|
|
135
|
+
customer: {
|
|
136
|
+
name: p?.name ?? '',
|
|
137
|
+
email: p?.email ?? null,
|
|
138
|
+
phone: p?.phone ?? p?.mobile ?? null,
|
|
139
|
+
street: p?.street ?? null,
|
|
140
|
+
city: p?.city ?? null,
|
|
141
|
+
zip: p?.zip ?? null,
|
|
142
|
+
country: (p?.country ?? null),
|
|
143
|
+
},
|
|
144
|
+
returnUrl: `${urls.api}/api/v1/payment/return/${encodeURIComponent(reference)}`,
|
|
145
|
+
callbackUrl: `${urls.api}/api/v1/hooks/${token}`,
|
|
146
|
+
mode: provider.state === 'live' ? 'live' : 'test',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
throw new HttpProblem(502, 'provider-error', 'The payment could not start', error instanceof Error ? error.message : String(error));
|
|
151
|
+
}
|
|
152
|
+
if (started.providerReference !== undefined)
|
|
153
|
+
await tx.write({ providerReference: started.providerReference });
|
|
154
|
+
await su.flush();
|
|
155
|
+
return { reference, redirectUrl: started.redirectUrl };
|
|
156
|
+
}
|
|
59
157
|
function registerPaymentRoutes(context, adapters, urls) {
|
|
60
158
|
const { app } = context;
|
|
61
159
|
const documents = portalDocuments(context.registry);
|
|
@@ -63,30 +161,7 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
63
161
|
if (!env.groups.has('portal.user') || env.groups.has('base.user'))
|
|
64
162
|
throw new HttpProblem(403, 'portal-only', 'Portal users only', 'This is the portal’s API.');
|
|
65
163
|
};
|
|
66
|
-
|
|
67
|
-
const adapter = adapters.get(code);
|
|
68
|
-
if (adapter === undefined)
|
|
69
|
-
throw new HttpProblem(409, 'no-adapter', 'Provider unavailable', `The ${code} adapter is not installed.`);
|
|
70
|
-
return adapter;
|
|
71
|
-
};
|
|
72
|
-
/** The provider's callback endpoint (made on first use), with its token. */
|
|
73
|
-
const endpointOf = async (su, provider) => {
|
|
74
|
-
const [p] = await su
|
|
75
|
-
.model('payment.provider')
|
|
76
|
-
.browse([provider.id])
|
|
77
|
-
.load({ endpoint: true });
|
|
78
|
-
if (p?.endpoint !== null && p?.endpoint !== undefined)
|
|
79
|
-
return p.endpoint.token;
|
|
80
|
-
const made = await su
|
|
81
|
-
.model('webhook.endpoint')
|
|
82
|
-
.create([{ name: `${provider.name} callbacks`, hook: `payment.${provider.code}` }]);
|
|
83
|
-
await su
|
|
84
|
-
.model('payment.provider')
|
|
85
|
-
.browse([provider.id])
|
|
86
|
-
.write({ endpoint: made.ids[0] });
|
|
87
|
-
const [e] = await made.load({});
|
|
88
|
-
return e?.token ?? '';
|
|
89
|
-
};
|
|
164
|
+
current = { adapters, urls };
|
|
90
165
|
app.get('/api/portal/v1/payments/providers', async (request) => request.env((env) => {
|
|
91
166
|
portalOnly(env);
|
|
92
167
|
return env.asSuperuser({ reason: 'portal: payment providers' }, async (su) => {
|
|
@@ -137,11 +212,6 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
137
212
|
})).load({});
|
|
138
213
|
if (provider === undefined)
|
|
139
214
|
throw new HttpProblem(422, 'invalid-provider', 'No such provider', 'Choose one of the providers offered.');
|
|
140
|
-
const adapter = adapterOf(provider.code);
|
|
141
|
-
if (provider.code === 'fake' && provider.state === 'live')
|
|
142
|
-
throw new HttpProblem(409, 'fake-live', 'Test provider', 'The test provider moves no money: it cannot be live.');
|
|
143
|
-
if (!adapter.configured(provider.state === 'live' ? 'live' : 'test'))
|
|
144
|
-
throw new HttpProblem(409, 'not-configured', 'Provider not set up', `The ${provider.name} provider has no credentials for ${provider.state} payments on this server.`);
|
|
145
215
|
const [move] = await su
|
|
146
216
|
.model('account.move')
|
|
147
217
|
.browse([id])
|
|
@@ -151,48 +221,15 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
151
221
|
const due = move.amountResidual?.amount;
|
|
152
222
|
if (due === undefined || !due.gt(0))
|
|
153
223
|
throw new HttpProblem(409, 'not-payable', 'Nothing to pay', 'Nothing is due on this document.');
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
]);
|
|
165
|
-
await su.flush(); // company checks run in this superuser scope, not at commit (Shutro request #11)
|
|
166
|
-
const [tx] = await created.load({});
|
|
167
|
-
const reference = tx?.reference ?? '';
|
|
168
|
-
let started;
|
|
169
|
-
try {
|
|
170
|
-
started = await adapter.createPayment({
|
|
171
|
-
reference,
|
|
172
|
-
amount: due.toFixed(move.currency.decimalPlaces ?? 2),
|
|
173
|
-
currency: move.currency.name,
|
|
174
|
-
description: `${d.spec.label} ${move.name}`,
|
|
175
|
-
customer: {
|
|
176
|
-
name: move.partner?.name ?? '',
|
|
177
|
-
email: move.partner?.email ?? null,
|
|
178
|
-
phone: move.partner?.phone ?? move.partner?.mobile ?? null,
|
|
179
|
-
street: move.partner?.street ?? null,
|
|
180
|
-
city: move.partner?.city ?? null,
|
|
181
|
-
zip: move.partner?.zip ?? null,
|
|
182
|
-
country: move.partner?.country ?? null,
|
|
183
|
-
},
|
|
184
|
-
returnUrl: `${urls.api}/api/v1/payment/return/${encodeURIComponent(reference)}`,
|
|
185
|
-
callbackUrl: `${urls.api}/api/v1/hooks/${token}`,
|
|
186
|
-
mode: provider.state === 'live' ? 'live' : 'test',
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
throw new HttpProblem(502, 'provider-error', 'The payment could not start', error instanceof Error ? error.message : String(error));
|
|
191
|
-
}
|
|
192
|
-
if (started.providerReference !== undefined)
|
|
193
|
-
await created.write({ providerReference: started.providerReference });
|
|
194
|
-
await su.flush();
|
|
195
|
-
return { reference, redirectUrl: started.redirectUrl };
|
|
224
|
+
return startPayment(su, {
|
|
225
|
+
provider: provider.id,
|
|
226
|
+
move: move.id,
|
|
227
|
+
partner: move.partner,
|
|
228
|
+
currency: move.currency,
|
|
229
|
+
amount: due,
|
|
230
|
+
company,
|
|
231
|
+
description: `${d.spec.label} ${move.name}`,
|
|
232
|
+
});
|
|
196
233
|
});
|
|
197
234
|
return reply.status(201).send(started);
|
|
198
235
|
});
|
|
@@ -210,7 +247,7 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
210
247
|
return t === undefined
|
|
211
248
|
? null
|
|
212
249
|
: {
|
|
213
|
-
move: t.move
|
|
250
|
+
move: t.move?.id ?? 0,
|
|
214
251
|
state: t.state,
|
|
215
252
|
amount: t.amount.amount.toFixed(t.currency.decimalPlaces ?? 2),
|
|
216
253
|
currency: t.currency.name,
|
|
@@ -294,7 +331,8 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
294
331
|
return t === undefined
|
|
295
332
|
? null
|
|
296
333
|
: {
|
|
297
|
-
move: t.move
|
|
334
|
+
move: t.move?.id ?? null,
|
|
335
|
+
returnUrl: t.returnUrl,
|
|
298
336
|
company: t.company.id,
|
|
299
337
|
state: t.state,
|
|
300
338
|
code: t.provider.code,
|
|
@@ -322,6 +360,8 @@ function registerPaymentRoutes(context, adapters, urls) {
|
|
|
322
360
|
}
|
|
323
361
|
}
|
|
324
362
|
const move = tx?.move ?? null;
|
|
363
|
+
if (tx?.returnUrl !== null && tx?.returnUrl !== undefined && tx.returnUrl !== '')
|
|
364
|
+
return reply.redirect(`${tx.returnUrl}${tx.returnUrl.includes('?') ? '&' : '?'}payment=${encodeURIComponent(reference)}`, 303);
|
|
325
365
|
return reply.redirect(move === null
|
|
326
366
|
? `${urls.portal}/`
|
|
327
367
|
: `${urls.portal}/d/${encodeURIComponent(payable)}/${move}?payment=${encodeURIComponent(reference)}`, 303);
|
|
@@ -391,11 +431,27 @@ export function paymentModule(options = {}) {
|
|
|
391
431
|
sequence: 3.7,
|
|
392
432
|
},
|
|
393
433
|
],
|
|
434
|
+
search: {
|
|
435
|
+
'payment.provider': search(PaymentProvider, {
|
|
436
|
+
fields: ['name'],
|
|
437
|
+
groupBy: ['code', 'state'],
|
|
438
|
+
}),
|
|
439
|
+
'payment.transaction': search(PaymentTransaction, {
|
|
440
|
+
fields: ['reference', 'providerReference', 'partner.name'],
|
|
441
|
+
filters: {
|
|
442
|
+
done: { label: 'Done', domain: { state: 'done' }, group: 'state' },
|
|
443
|
+
pending: { label: 'Pending', domain: { state: 'pending' }, group: 'state' },
|
|
444
|
+
failed: { label: 'Failed', domain: { state: 'failed' }, group: 'state' },
|
|
445
|
+
},
|
|
446
|
+
groupBy: ['provider', 'state', 'doneAt:month'],
|
|
447
|
+
}),
|
|
448
|
+
},
|
|
394
449
|
views: {
|
|
395
450
|
'payment.provider.list': list(PaymentProvider, {
|
|
396
451
|
columns: ['name', 'code', 'state', 'journal'],
|
|
397
452
|
}),
|
|
398
453
|
'payment.provider.form': form(PaymentProvider, (k) => ({
|
|
454
|
+
chatter: true,
|
|
399
455
|
sheet: [
|
|
400
456
|
k.group('main', ['name', 'code', 'state']),
|
|
401
457
|
k.group('accounting', ['journal', 'sequence', 'endpoint']),
|
|
@@ -405,6 +461,7 @@ export function paymentModule(options = {}) {
|
|
|
405
461
|
columns: ['reference', 'move', 'partner', 'provider', 'amount', 'state', 'doneAt'],
|
|
406
462
|
}),
|
|
407
463
|
'payment.transaction.form': form(PaymentTransaction, (k) => ({
|
|
464
|
+
chatter: true,
|
|
408
465
|
sheet: [
|
|
409
466
|
k.group('main', ['reference', 'move', 'partner', 'provider']),
|
|
410
467
|
k.group('outcome', [
|