@ketvietlab/ketsuite 0.1.1
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/LICENSE +21 -0
- package/README.md +19 -0
- package/dist/index.d.ts +119 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/account/functions.d.ts +14 -0
- package/dist/modules/account/functions.d.ts.map +1 -0
- package/dist/modules/account/functions.js +1038 -0
- package/dist/modules/account/functions.js.map +1 -0
- package/dist/modules/account/index.d.ts +5 -0
- package/dist/modules/account/index.d.ts.map +1 -0
- package/dist/modules/account/index.js +31 -0
- package/dist/modules/account/index.js.map +1 -0
- package/dist/modules/account/models.d.ts +3 -0
- package/dist/modules/account/models.d.ts.map +1 -0
- package/dist/modules/account/models.js +151 -0
- package/dist/modules/account/models.js.map +1 -0
- package/dist/modules/account/relations.d.ts +3 -0
- package/dist/modules/account/relations.d.ts.map +1 -0
- package/dist/modules/account/relations.js +35 -0
- package/dist/modules/account/relations.js.map +1 -0
- package/dist/modules/account/setup.d.ts +4 -0
- package/dist/modules/account/setup.d.ts.map +1 -0
- package/dist/modules/account/setup.js +179 -0
- package/dist/modules/account/setup.js.map +1 -0
- package/dist/modules/account/tt99.d.ts +30 -0
- package/dist/modules/account/tt99.d.ts.map +1 -0
- package/dist/modules/account/tt99.js +1661 -0
- package/dist/modules/account/tt99.js.map +1 -0
- package/dist/modules/account_activity_backend/index.d.ts +5 -0
- package/dist/modules/account_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/account_activity_backend/index.js +27 -0
- package/dist/modules/account_activity_backend/index.js.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts +18 -0
- package/dist/modules/account_backend/accounting-overview-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounting-overview-screen.js +104 -0
- package/dist/modules/account_backend/accounting-overview-screen.js.map +1 -0
- package/dist/modules/account_backend/accounts-screen.d.ts +13 -0
- package/dist/modules/account_backend/accounts-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/accounts-screen.js +49 -0
- package/dist/modules/account_backend/accounts-screen.js.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts +14 -0
- package/dist/modules/account_backend/customer-invoices-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/customer-invoices-screen.js +63 -0
- package/dist/modules/account_backend/customer-invoices-screen.js.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts +13 -0
- package/dist/modules/account_backend/general-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/general-ledger-screen.js +56 -0
- package/dist/modules/account_backend/general-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/index.d.ts +3 -0
- package/dist/modules/account_backend/index.d.ts.map +1 -0
- package/dist/modules/account_backend/index.js +1516 -0
- package/dist/modules/account_backend/index.js.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts +14 -0
- package/dist/modules/account_backend/journal-entries-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journal-entries-screen.js +45 -0
- package/dist/modules/account_backend/journal-entries-screen.js.map +1 -0
- package/dist/modules/account_backend/journals-screen.d.ts +14 -0
- package/dist/modules/account_backend/journals-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/journals-screen.js +53 -0
- package/dist/modules/account_backend/journals-screen.js.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts +10 -0
- package/dist/modules/account_backend/move-detail-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/move-detail-screen.js +100 -0
- package/dist/modules/account_backend/move-detail-screen.js.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts +14 -0
- package/dist/modules/account_backend/partner-ledger-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/partner-ledger-screen.js +69 -0
- package/dist/modules/account_backend/partner-ledger-screen.js.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts +14 -0
- package/dist/modules/account_backend/payment-terms-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payment-terms-screen.js +40 -0
- package/dist/modules/account_backend/payment-terms-screen.js.map +1 -0
- package/dist/modules/account_backend/payments-screen.d.ts +14 -0
- package/dist/modules/account_backend/payments-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/payments-screen.js +54 -0
- package/dist/modules/account_backend/payments-screen.js.map +1 -0
- package/dist/modules/account_backend/screens.d.ts +7 -0
- package/dist/modules/account_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_backend/screens.js +7 -0
- package/dist/modules/account_backend/screens.js.map +1 -0
- package/dist/modules/account_backend/taxes-screen.d.ts +15 -0
- package/dist/modules/account_backend/taxes-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/taxes-screen.js +73 -0
- package/dist/modules/account_backend/taxes-screen.js.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts +13 -0
- package/dist/modules/account_backend/trial-balance-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/trial-balance-screen.js +62 -0
- package/dist/modules/account_backend/trial-balance-screen.js.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts +14 -0
- package/dist/modules/account_backend/vendor-bills-screen.d.ts.map +1 -0
- package/dist/modules/account_backend/vendor-bills-screen.js +59 -0
- package/dist/modules/account_backend/vendor-bills-screen.js.map +1 -0
- package/dist/modules/account_mail_backend/index.d.ts +5 -0
- package/dist/modules/account_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/account_mail_backend/index.js +28 -0
- package/dist/modules/account_mail_backend/index.js.map +1 -0
- package/dist/modules/account_partner/functions.d.ts +3 -0
- package/dist/modules/account_partner/functions.d.ts.map +1 -0
- package/dist/modules/account_partner/functions.js +85 -0
- package/dist/modules/account_partner/functions.js.map +1 -0
- package/dist/modules/account_partner/index.d.ts +3 -0
- package/dist/modules/account_partner/index.d.ts.map +1 -0
- package/dist/modules/account_partner/index.js +48 -0
- package/dist/modules/account_partner/index.js.map +1 -0
- package/dist/modules/account_partner_backend/index.d.ts +4 -0
- package/dist/modules/account_partner_backend/index.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/index.js +49 -0
- package/dist/modules/account_partner_backend/index.js.map +1 -0
- package/dist/modules/account_partner_backend/routes.d.ts +3 -0
- package/dist/modules/account_partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/routes.js +69 -0
- package/dist/modules/account_partner_backend/routes.js.map +1 -0
- package/dist/modules/account_partner_backend/screens.d.ts +16 -0
- package/dist/modules/account_partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/account_partner_backend/screens.js +26 -0
- package/dist/modules/account_partner_backend/screens.js.map +1 -0
- package/dist/modules/activity/functions.d.ts +3 -0
- package/dist/modules/activity/functions.d.ts.map +1 -0
- package/dist/modules/activity/functions.js +250 -0
- package/dist/modules/activity/functions.js.map +1 -0
- package/dist/modules/activity/index.d.ts +9 -0
- package/dist/modules/activity/index.d.ts.map +1 -0
- package/dist/modules/activity/index.js +33 -0
- package/dist/modules/activity/index.js.map +1 -0
- package/dist/modules/activity/models.d.ts +3 -0
- package/dist/modules/activity/models.d.ts.map +1 -0
- package/dist/modules/activity/models.js +81 -0
- package/dist/modules/activity/models.js.map +1 -0
- package/dist/modules/activity/operations.d.ts +39 -0
- package/dist/modules/activity/operations.d.ts.map +1 -0
- package/dist/modules/activity/operations.js +226 -0
- package/dist/modules/activity/operations.js.map +1 -0
- package/dist/modules/activity/relations.d.ts +3 -0
- package/dist/modules/activity/relations.d.ts.map +1 -0
- package/dist/modules/activity/relations.js +24 -0
- package/dist/modules/activity/relations.js.map +1 -0
- package/dist/modules/activity/target.d.ts +4 -0
- package/dist/modules/activity/target.d.ts.map +1 -0
- package/dist/modules/activity/target.js +149 -0
- package/dist/modules/activity/target.js.map +1 -0
- package/dist/modules/activity/types.d.ts +9 -0
- package/dist/modules/activity/types.d.ts.map +1 -0
- package/dist/modules/activity/types.js +5 -0
- package/dist/modules/activity/types.js.map +1 -0
- package/dist/modules/activity_backend/index.d.ts +5 -0
- package/dist/modules/activity_backend/index.d.ts.map +1 -0
- package/dist/modules/activity_backend/index.js +80 -0
- package/dist/modules/activity_backend/index.js.map +1 -0
- package/dist/modules/activity_backend/islands.d.ts +3 -0
- package/dist/modules/activity_backend/islands.d.ts.map +1 -0
- package/dist/modules/activity_backend/islands.js +20 -0
- package/dist/modules/activity_backend/islands.js.map +1 -0
- package/dist/modules/activity_backend/routes.d.ts +5 -0
- package/dist/modules/activity_backend/routes.d.ts.map +1 -0
- package/dist/modules/activity_backend/routes.js +53 -0
- package/dist/modules/activity_backend/routes.js.map +1 -0
- package/dist/modules/activity_backend/screens.d.ts +5 -0
- package/dist/modules/activity_backend/screens.d.ts.map +1 -0
- package/dist/modules/activity_backend/screens.js +52 -0
- package/dist/modules/activity_backend/screens.js.map +1 -0
- package/dist/modules/address/data/VN/NOTICE.md +15 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0001.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0002.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0003.json +8002 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/divisions/0004.json +2842 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/manifest.json +77 -0
- package/dist/modules/address/data/VN/catalogs/2025-07-01/policy.json +49 -0
- package/dist/modules/address/data/countries.json +11 -0
- package/dist/modules/address/data/index.json +14 -0
- package/dist/modules/address/format.d.ts +37 -0
- package/dist/modules/address/format.d.ts.map +1 -0
- package/dist/modules/address/format.js +146 -0
- package/dist/modules/address/format.js.map +1 -0
- package/dist/modules/address/functions.d.ts +3 -0
- package/dist/modules/address/functions.d.ts.map +1 -0
- package/dist/modules/address/functions.js +320 -0
- package/dist/modules/address/functions.js.map +1 -0
- package/dist/modules/address/index.d.ts +6 -0
- package/dist/modules/address/index.d.ts.map +1 -0
- package/dist/modules/address/index.js +20 -0
- package/dist/modules/address/index.js.map +1 -0
- package/dist/modules/address/loader.d.ts +74 -0
- package/dist/modules/address/loader.d.ts.map +1 -0
- package/dist/modules/address/loader.js +144 -0
- package/dist/modules/address/loader.js.map +1 -0
- package/dist/modules/address/messages.d.ts +51 -0
- package/dist/modules/address/messages.d.ts.map +1 -0
- package/dist/modules/address/messages.js +51 -0
- package/dist/modules/address/messages.js.map +1 -0
- package/dist/modules/address/models.d.ts +8 -0
- package/dist/modules/address/models.d.ts.map +1 -0
- package/dist/modules/address/models.js +98 -0
- package/dist/modules/address/models.js.map +1 -0
- package/dist/modules/address/relations.d.ts +3 -0
- package/dist/modules/address/relations.d.ts.map +1 -0
- package/dist/modules/address/relations.js +22 -0
- package/dist/modules/address/relations.js.map +1 -0
- package/dist/modules/address_backend/index.d.ts +4 -0
- package/dist/modules/address_backend/index.d.ts.map +1 -0
- package/dist/modules/address_backend/index.js +90 -0
- package/dist/modules/address_backend/index.js.map +1 -0
- package/dist/modules/address_backend/routes.d.ts +3 -0
- package/dist/modules/address_backend/routes.d.ts.map +1 -0
- package/dist/modules/address_backend/routes.js +87 -0
- package/dist/modules/address_backend/routes.js.map +1 -0
- package/dist/modules/address_backend/screens.d.ts +31 -0
- package/dist/modules/address_backend/screens.d.ts.map +1 -0
- package/dist/modules/address_backend/screens.js +147 -0
- package/dist/modules/address_backend/screens.js.map +1 -0
- package/dist/modules/attendance/functions.d.ts +3 -0
- package/dist/modules/attendance/functions.d.ts.map +1 -0
- package/dist/modules/attendance/functions.js +750 -0
- package/dist/modules/attendance/functions.js.map +1 -0
- package/dist/modules/attendance/index.d.ts +5 -0
- package/dist/modules/attendance/index.d.ts.map +1 -0
- package/dist/modules/attendance/index.js +20 -0
- package/dist/modules/attendance/index.js.map +1 -0
- package/dist/modules/attendance/messages.d.ts +41 -0
- package/dist/modules/attendance/messages.d.ts.map +1 -0
- package/dist/modules/attendance/messages.js +41 -0
- package/dist/modules/attendance/messages.js.map +1 -0
- package/dist/modules/attendance/models.d.ts +3 -0
- package/dist/modules/attendance/models.d.ts.map +1 -0
- package/dist/modules/attendance/models.js +158 -0
- package/dist/modules/attendance/models.js.map +1 -0
- package/dist/modules/attendance/relations.d.ts +3 -0
- package/dist/modules/attendance/relations.d.ts.map +1 -0
- package/dist/modules/attendance/relations.js +12 -0
- package/dist/modules/attendance/relations.js.map +1 -0
- package/dist/modules/attendance/types.d.ts +9 -0
- package/dist/modules/attendance/types.d.ts.map +1 -0
- package/dist/modules/attendance/types.js +5 -0
- package/dist/modules/attendance/types.js.map +1 -0
- package/dist/modules/attendance_backend/index.d.ts +4 -0
- package/dist/modules/attendance_backend/index.d.ts.map +1 -0
- package/dist/modules/attendance_backend/index.js +182 -0
- package/dist/modules/attendance_backend/index.js.map +1 -0
- package/dist/modules/attendance_backend/qr.d.ts +2 -0
- package/dist/modules/attendance_backend/qr.d.ts.map +1 -0
- package/dist/modules/attendance_backend/qr.js +120 -0
- package/dist/modules/attendance_backend/qr.js.map +1 -0
- package/dist/modules/attendance_backend/routes.d.ts +3 -0
- package/dist/modules/attendance_backend/routes.d.ts.map +1 -0
- package/dist/modules/attendance_backend/routes.js +131 -0
- package/dist/modules/attendance_backend/routes.js.map +1 -0
- package/dist/modules/attendance_backend/screens.d.ts +10 -0
- package/dist/modules/attendance_backend/screens.d.ts.map +1 -0
- package/dist/modules/attendance_backend/screens.js +227 -0
- package/dist/modules/attendance_backend/screens.js.map +1 -0
- package/dist/modules/backend/catalogue.d.ts +10 -0
- package/dist/modules/backend/catalogue.d.ts.map +1 -0
- package/dist/modules/backend/catalogue.js +615 -0
- package/dist/modules/backend/catalogue.js.map +1 -0
- package/dist/modules/backend/design/HANDOFF.md +356 -0
- package/dist/modules/backend/design/admin.css +4229 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select-view.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs +335 -0
- package/dist/modules/backend/design/client/relation-select-view.mjs.map +1 -0
- package/dist/modules/backend/design/client/relation-select.d.mts +5 -0
- package/dist/modules/backend/design/client/relation-select.d.mts.map +1 -0
- package/dist/modules/backend/design/client/relation-select.mjs +7 -0
- package/dist/modules/backend/design/client/relation-select.mjs.map +1 -0
- package/dist/modules/backend/design/fixtures/product-back.svg +11 -0
- package/dist/modules/backend/design/fixtures/product-front.svg +9 -0
- package/dist/modules/backend/design/screenshots/apps-desktop-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/list-mobile-dark.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-favorites-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-desktop-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-filter-mobile-en.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-desktop.png +0 -0
- package/dist/modules/backend/design/screenshots/product-list-grouped-mobile.png +0 -0
- package/dist/modules/backend/design/tokens.css +132 -0
- package/dist/modules/backend/forms.d.ts +7 -0
- package/dist/modules/backend/forms.d.ts.map +1 -0
- package/dist/modules/backend/forms.js +25 -0
- package/dist/modules/backend/forms.js.map +1 -0
- package/dist/modules/backend/index.d.ts +24 -0
- package/dist/modules/backend/index.d.ts.map +1 -0
- package/dist/modules/backend/index.js +61 -0
- package/dist/modules/backend/index.js.map +1 -0
- package/dist/modules/backend/islands.d.ts +3 -0
- package/dist/modules/backend/islands.d.ts.map +1 -0
- package/dist/modules/backend/islands.js +13 -0
- package/dist/modules/backend/islands.js.map +1 -0
- package/dist/modules/backend/joints.d.ts +13 -0
- package/dist/modules/backend/joints.d.ts.map +1 -0
- package/dist/modules/backend/joints.js +33 -0
- package/dist/modules/backend/joints.js.map +1 -0
- package/dist/modules/backend/menus.d.ts +3 -0
- package/dist/modules/backend/menus.d.ts.map +1 -0
- package/dist/modules/backend/menus.js +25 -0
- package/dist/modules/backend/menus.js.map +1 -0
- package/dist/modules/backend/messages.d.ts +11 -0
- package/dist/modules/backend/messages.d.ts.map +1 -0
- package/dist/modules/backend/messages.js +161 -0
- package/dist/modules/backend/messages.js.map +1 -0
- package/dist/modules/backend/paging.d.ts +22 -0
- package/dist/modules/backend/paging.d.ts.map +1 -0
- package/dist/modules/backend/paging.js +56 -0
- package/dist/modules/backend/paging.js.map +1 -0
- package/dist/modules/backend/relation-select.d.ts +63 -0
- package/dist/modules/backend/relation-select.d.ts.map +1 -0
- package/dist/modules/backend/relation-select.js +20 -0
- package/dist/modules/backend/relation-select.js.map +1 -0
- package/dist/modules/backend/routes.d.ts +10 -0
- package/dist/modules/backend/routes.d.ts.map +1 -0
- package/dist/modules/backend/routes.js +123 -0
- package/dist/modules/backend/routes.js.map +1 -0
- package/dist/modules/backend/saved-searches.d.ts +4 -0
- package/dist/modules/backend/saved-searches.d.ts.map +1 -0
- package/dist/modules/backend/saved-searches.js +138 -0
- package/dist/modules/backend/saved-searches.js.map +1 -0
- package/dist/modules/backend/screens.d.ts +37 -0
- package/dist/modules/backend/screens.d.ts.map +1 -0
- package/dist/modules/backend/screens.js +107 -0
- package/dist/modules/backend/screens.js.map +1 -0
- package/dist/modules/calendar/functions.d.ts +3 -0
- package/dist/modules/calendar/functions.d.ts.map +1 -0
- package/dist/modules/calendar/functions.js +259 -0
- package/dist/modules/calendar/functions.js.map +1 -0
- package/dist/modules/calendar/index.d.ts +9 -0
- package/dist/modules/calendar/index.d.ts.map +1 -0
- package/dist/modules/calendar/index.js +36 -0
- package/dist/modules/calendar/index.js.map +1 -0
- package/dist/modules/calendar/jobs.d.ts +3 -0
- package/dist/modules/calendar/jobs.d.ts.map +1 -0
- package/dist/modules/calendar/jobs.js +57 -0
- package/dist/modules/calendar/jobs.js.map +1 -0
- package/dist/modules/calendar/models.d.ts +3 -0
- package/dist/modules/calendar/models.d.ts.map +1 -0
- package/dist/modules/calendar/models.js +90 -0
- package/dist/modules/calendar/models.js.map +1 -0
- package/dist/modules/calendar/operations.d.ts +45 -0
- package/dist/modules/calendar/operations.d.ts.map +1 -0
- package/dist/modules/calendar/operations.js +280 -0
- package/dist/modules/calendar/operations.js.map +1 -0
- package/dist/modules/calendar/recurrence.d.ts +28 -0
- package/dist/modules/calendar/recurrence.d.ts.map +1 -0
- package/dist/modules/calendar/recurrence.js +175 -0
- package/dist/modules/calendar/recurrence.js.map +1 -0
- package/dist/modules/calendar/relations.d.ts +3 -0
- package/dist/modules/calendar/relations.d.ts.map +1 -0
- package/dist/modules/calendar/relations.js +22 -0
- package/dist/modules/calendar/relations.js.map +1 -0
- package/dist/modules/calendar/types.d.ts +10 -0
- package/dist/modules/calendar/types.d.ts.map +1 -0
- package/dist/modules/calendar/types.js +6 -0
- package/dist/modules/calendar/types.js.map +1 -0
- package/dist/modules/calendar_activity/index.d.ts +6 -0
- package/dist/modules/calendar_activity/index.d.ts.map +1 -0
- package/dist/modules/calendar_activity/index.js +250 -0
- package/dist/modules/calendar_activity/index.js.map +1 -0
- package/dist/modules/calendar_backend/index.d.ts +5 -0
- package/dist/modules/calendar_backend/index.d.ts.map +1 -0
- package/dist/modules/calendar_backend/index.js +47 -0
- package/dist/modules/calendar_backend/index.js.map +1 -0
- package/dist/modules/calendar_backend/islands.d.ts +3 -0
- package/dist/modules/calendar_backend/islands.d.ts.map +1 -0
- package/dist/modules/calendar_backend/islands.js +12 -0
- package/dist/modules/calendar_backend/islands.js.map +1 -0
- package/dist/modules/calendar_backend/routes.d.ts +3 -0
- package/dist/modules/calendar_backend/routes.d.ts.map +1 -0
- package/dist/modules/calendar_backend/routes.js +43 -0
- package/dist/modules/calendar_backend/routes.js.map +1 -0
- package/dist/modules/calendar_backend/screens.d.ts +5 -0
- package/dist/modules/calendar_backend/screens.d.ts.map +1 -0
- package/dist/modules/calendar_backend/screens.js +4 -0
- package/dist/modules/calendar_backend/screens.js.map +1 -0
- package/dist/modules/calendar_mail_transport/index.d.ts +6 -0
- package/dist/modules/calendar_mail_transport/index.d.ts.map +1 -0
- package/dist/modules/calendar_mail_transport/index.js +138 -0
- package/dist/modules/calendar_mail_transport/index.js.map +1 -0
- package/dist/modules/catalog/index.d.ts +3 -0
- package/dist/modules/catalog/index.d.ts.map +1 -0
- package/dist/modules/catalog/index.js +68 -0
- package/dist/modules/catalog/index.js.map +1 -0
- package/dist/modules/checkout/index.d.ts +3 -0
- package/dist/modules/checkout/index.d.ts.map +1 -0
- package/dist/modules/checkout/index.js +50 -0
- package/dist/modules/checkout/index.js.map +1 -0
- package/dist/modules/company/functions.d.ts +3 -0
- package/dist/modules/company/functions.d.ts.map +1 -0
- package/dist/modules/company/functions.js +337 -0
- package/dist/modules/company/functions.js.map +1 -0
- package/dist/modules/company/index.d.ts +3 -0
- package/dist/modules/company/index.d.ts.map +1 -0
- package/dist/modules/company/index.js +23 -0
- package/dist/modules/company/index.js.map +1 -0
- package/dist/modules/company/messages.d.ts +63 -0
- package/dist/modules/company/messages.d.ts.map +1 -0
- package/dist/modules/company/messages.js +63 -0
- package/dist/modules/company/messages.js.map +1 -0
- package/dist/modules/company/models.d.ts +19 -0
- package/dist/modules/company/models.d.ts.map +1 -0
- package/dist/modules/company/models.js +61 -0
- package/dist/modules/company/models.js.map +1 -0
- package/dist/modules/company/relations.d.ts +3 -0
- package/dist/modules/company/relations.d.ts.map +1 -0
- package/dist/modules/company/relations.js +14 -0
- package/dist/modules/company/relations.js.map +1 -0
- package/dist/modules/company_backend/index.d.ts +5 -0
- package/dist/modules/company_backend/index.d.ts.map +1 -0
- package/dist/modules/company_backend/index.js +136 -0
- package/dist/modules/company_backend/index.js.map +1 -0
- package/dist/modules/company_backend/menus.d.ts +3 -0
- package/dist/modules/company_backend/menus.d.ts.map +1 -0
- package/dist/modules/company_backend/menus.js +17 -0
- package/dist/modules/company_backend/menus.js.map +1 -0
- package/dist/modules/company_backend/routes.d.ts +3 -0
- package/dist/modules/company_backend/routes.d.ts.map +1 -0
- package/dist/modules/company_backend/routes.js +269 -0
- package/dist/modules/company_backend/routes.js.map +1 -0
- package/dist/modules/company_backend/screens.d.ts +62 -0
- package/dist/modules/company_backend/screens.d.ts.map +1 -0
- package/dist/modules/company_backend/screens.js +268 -0
- package/dist/modules/company_backend/screens.js.map +1 -0
- package/dist/modules/crm/functions.d.ts +5 -0
- package/dist/modules/crm/functions.d.ts.map +1 -0
- package/dist/modules/crm/functions.js +840 -0
- package/dist/modules/crm/functions.js.map +1 -0
- package/dist/modules/crm/index.d.ts +6 -0
- package/dist/modules/crm/index.d.ts.map +1 -0
- package/dist/modules/crm/index.js +22 -0
- package/dist/modules/crm/index.js.map +1 -0
- package/dist/modules/crm/jobs.d.ts +4 -0
- package/dist/modules/crm/jobs.d.ts.map +1 -0
- package/dist/modules/crm/jobs.js +3 -0
- package/dist/modules/crm/jobs.js.map +1 -0
- package/dist/modules/crm/messages.d.ts +37 -0
- package/dist/modules/crm/messages.d.ts.map +1 -0
- package/dist/modules/crm/messages.js +68 -0
- package/dist/modules/crm/messages.js.map +1 -0
- package/dist/modules/crm/models.d.ts +3 -0
- package/dist/modules/crm/models.d.ts.map +1 -0
- package/dist/modules/crm/models.js +215 -0
- package/dist/modules/crm/models.js.map +1 -0
- package/dist/modules/crm/operations.d.ts +121 -0
- package/dist/modules/crm/operations.d.ts.map +1 -0
- package/dist/modules/crm/operations.js +744 -0
- package/dist/modules/crm/operations.js.map +1 -0
- package/dist/modules/crm/search.d.ts +67 -0
- package/dist/modules/crm/search.d.ts.map +1 -0
- package/dist/modules/crm/search.js +89 -0
- package/dist/modules/crm/search.js.map +1 -0
- package/dist/modules/crm/types.d.ts +10 -0
- package/dist/modules/crm/types.d.ts.map +1 -0
- package/dist/modules/crm/types.js +6 -0
- package/dist/modules/crm/types.js.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts +8 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs +129 -0
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts +3 -0
- package/dist/modules/crm_backend/client/crm-kanban.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs +7 -0
- package/dist/modules/crm_backend/client/crm-kanban.mjs.map +1 -0
- package/dist/modules/crm_backend/client/crm.css +69 -0
- package/dist/modules/crm_backend/index.d.ts +4 -0
- package/dist/modules/crm_backend/index.d.ts.map +1 -0
- package/dist/modules/crm_backend/index.js +54 -0
- package/dist/modules/crm_backend/index.js.map +1 -0
- package/dist/modules/crm_backend/islands.d.ts +9 -0
- package/dist/modules/crm_backend/islands.d.ts.map +1 -0
- package/dist/modules/crm_backend/islands.js +13 -0
- package/dist/modules/crm_backend/islands.js.map +1 -0
- package/dist/modules/crm_backend/list-search.d.ts +21 -0
- package/dist/modules/crm_backend/list-search.d.ts.map +1 -0
- package/dist/modules/crm_backend/list-search.js +220 -0
- package/dist/modules/crm_backend/list-search.js.map +1 -0
- package/dist/modules/crm_backend/messages.d.ts +183 -0
- package/dist/modules/crm_backend/messages.d.ts.map +1 -0
- package/dist/modules/crm_backend/messages.js +182 -0
- package/dist/modules/crm_backend/messages.js.map +1 -0
- package/dist/modules/crm_backend/routes.d.ts +3 -0
- package/dist/modules/crm_backend/routes.d.ts.map +1 -0
- package/dist/modules/crm_backend/routes.js +520 -0
- package/dist/modules/crm_backend/routes.js.map +1 -0
- package/dist/modules/crm_backend/screens.d.ts +32 -0
- package/dist/modules/crm_backend/screens.d.ts.map +1 -0
- package/dist/modules/crm_backend/screens.js +405 -0
- package/dist/modules/crm_backend/screens.js.map +1 -0
- package/dist/modules/crm_sale/index.d.ts +4 -0
- package/dist/modules/crm_sale/index.d.ts.map +1 -0
- package/dist/modules/crm_sale/index.js +18 -0
- package/dist/modules/crm_sale/index.js.map +1 -0
- package/dist/modules/crm_sale/messages.d.ts +10 -0
- package/dist/modules/crm_sale/messages.d.ts.map +1 -0
- package/dist/modules/crm_sale/messages.js +14 -0
- package/dist/modules/crm_sale/messages.js.map +1 -0
- package/dist/modules/crm_sale/models.d.ts +3 -0
- package/dist/modules/crm_sale/models.d.ts.map +1 -0
- package/dist/modules/crm_sale/models.js +16 -0
- package/dist/modules/crm_sale/models.js.map +1 -0
- package/dist/modules/crm_sale/sale-functions.d.ts +15 -0
- package/dist/modules/crm_sale/sale-functions.d.ts.map +1 -0
- package/dist/modules/crm_sale/sale-functions.js +139 -0
- package/dist/modules/crm_sale/sale-functions.js.map +1 -0
- package/dist/modules/crm_website/functions.d.ts +3 -0
- package/dist/modules/crm_website/functions.d.ts.map +1 -0
- package/dist/modules/crm_website/functions.js +65 -0
- package/dist/modules/crm_website/functions.js.map +1 -0
- package/dist/modules/crm_website/index.d.ts +3 -0
- package/dist/modules/crm_website/index.d.ts.map +1 -0
- package/dist/modules/crm_website/index.js +19 -0
- package/dist/modules/crm_website/index.js.map +1 -0
- package/dist/modules/crm_website/messages.d.ts +20 -0
- package/dist/modules/crm_website/messages.d.ts.map +1 -0
- package/dist/modules/crm_website/messages.js +34 -0
- package/dist/modules/crm_website/messages.js.map +1 -0
- package/dist/modules/crm_website/models.d.ts +3 -0
- package/dist/modules/crm_website/models.d.ts.map +1 -0
- package/dist/modules/crm_website/models.js +15 -0
- package/dist/modules/crm_website/models.js.map +1 -0
- package/dist/modules/crm_website/routes.d.ts +3 -0
- package/dist/modules/crm_website/routes.d.ts.map +1 -0
- package/dist/modules/crm_website/routes.js +71 -0
- package/dist/modules/crm_website/routes.js.map +1 -0
- package/dist/modules/crm_website/screens.d.ts +5 -0
- package/dist/modules/crm_website/screens.d.ts.map +1 -0
- package/dist/modules/crm_website/screens.js +15 -0
- package/dist/modules/crm_website/screens.js.map +1 -0
- package/dist/modules/hospitality_core/calendar.d.ts +9 -0
- package/dist/modules/hospitality_core/calendar.d.ts.map +1 -0
- package/dist/modules/hospitality_core/calendar.js +41 -0
- package/dist/modules/hospitality_core/calendar.js.map +1 -0
- package/dist/modules/hospitality_core/content.d.ts +13 -0
- package/dist/modules/hospitality_core/content.d.ts.map +1 -0
- package/dist/modules/hospitality_core/content.js +345 -0
- package/dist/modules/hospitality_core/content.js.map +1 -0
- package/dist/modules/hospitality_core/functions.d.ts +3 -0
- package/dist/modules/hospitality_core/functions.d.ts.map +1 -0
- package/dist/modules/hospitality_core/functions.js +1558 -0
- package/dist/modules/hospitality_core/functions.js.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts +3 -0
- package/dist/modules/hospitality_core/housekeeping.d.ts.map +1 -0
- package/dist/modules/hospitality_core/housekeeping.js +352 -0
- package/dist/modules/hospitality_core/housekeeping.js.map +1 -0
- package/dist/modules/hospitality_core/index.d.ts +5 -0
- package/dist/modules/hospitality_core/index.d.ts.map +1 -0
- package/dist/modules/hospitality_core/index.js +41 -0
- package/dist/modules/hospitality_core/index.js.map +1 -0
- package/dist/modules/hospitality_core/inventory.d.ts +40 -0
- package/dist/modules/hospitality_core/inventory.d.ts.map +1 -0
- package/dist/modules/hospitality_core/inventory.js +627 -0
- package/dist/modules/hospitality_core/inventory.js.map +1 -0
- package/dist/modules/hospitality_core/menus.d.ts +3 -0
- package/dist/modules/hospitality_core/menus.d.ts.map +1 -0
- package/dist/modules/hospitality_core/menus.js +134 -0
- package/dist/modules/hospitality_core/menus.js.map +1 -0
- package/dist/modules/hospitality_core/messages.d.ts +3 -0
- package/dist/modules/hospitality_core/messages.d.ts.map +1 -0
- package/dist/modules/hospitality_core/messages.js +2011 -0
- package/dist/modules/hospitality_core/messages.js.map +1 -0
- package/dist/modules/hospitality_core/models.d.ts +10 -0
- package/dist/modules/hospitality_core/models.d.ts.map +1 -0
- package/dist/modules/hospitality_core/models.js +657 -0
- package/dist/modules/hospitality_core/models.js.map +1 -0
- package/dist/modules/hospitality_core/night-audit.d.ts +26 -0
- package/dist/modules/hospitality_core/night-audit.d.ts.map +1 -0
- package/dist/modules/hospitality_core/night-audit.js +381 -0
- package/dist/modules/hospitality_core/night-audit.js.map +1 -0
- package/dist/modules/hospitality_core/operations.d.ts +3 -0
- package/dist/modules/hospitality_core/operations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/operations.js +1562 -0
- package/dist/modules/hospitality_core/operations.js.map +1 -0
- package/dist/modules/hospitality_core/relations.d.ts +3 -0
- package/dist/modules/hospitality_core/relations.d.ts.map +1 -0
- package/dist/modules/hospitality_core/relations.js +175 -0
- package/dist/modules/hospitality_core/relations.js.map +1 -0
- package/dist/modules/hospitality_core/routes.d.ts +3 -0
- package/dist/modules/hospitality_core/routes.d.ts.map +1 -0
- package/dist/modules/hospitality_core/routes.js +1556 -0
- package/dist/modules/hospitality_core/routes.js.map +1 -0
- package/dist/modules/hospitality_core/screens.d.ts +763 -0
- package/dist/modules/hospitality_core/screens.d.ts.map +1 -0
- package/dist/modules/hospitality_core/screens.js +4138 -0
- package/dist/modules/hospitality_core/screens.js.map +1 -0
- package/dist/modules/hospitality_core/services.d.ts +9 -0
- package/dist/modules/hospitality_core/services.d.ts.map +1 -0
- package/dist/modules/hospitality_core/services.js +586 -0
- package/dist/modules/hospitality_core/services.js.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts +11 -0
- package/dist/modules/hospitality_core/stay-notices.d.ts.map +1 -0
- package/dist/modules/hospitality_core/stay-notices.js +338 -0
- package/dist/modules/hospitality_core/stay-notices.js.map +1 -0
- package/dist/modules/hospitality_core/types.d.ts +61 -0
- package/dist/modules/hospitality_core/types.d.ts.map +1 -0
- package/dist/modules/hospitality_core/types.js +65 -0
- package/dist/modules/hospitality_core/types.js.map +1 -0
- package/dist/modules/hr/functions.d.ts +3 -0
- package/dist/modules/hr/functions.d.ts.map +1 -0
- package/dist/modules/hr/functions.js +711 -0
- package/dist/modules/hr/functions.js.map +1 -0
- package/dist/modules/hr/index.d.ts +5 -0
- package/dist/modules/hr/index.d.ts.map +1 -0
- package/dist/modules/hr/index.js +20 -0
- package/dist/modules/hr/index.js.map +1 -0
- package/dist/modules/hr/messages.d.ts +45 -0
- package/dist/modules/hr/messages.d.ts.map +1 -0
- package/dist/modules/hr/messages.js +45 -0
- package/dist/modules/hr/messages.js.map +1 -0
- package/dist/modules/hr/models.d.ts +3 -0
- package/dist/modules/hr/models.d.ts.map +1 -0
- package/dist/modules/hr/models.js +166 -0
- package/dist/modules/hr/models.js.map +1 -0
- package/dist/modules/hr/relations.d.ts +3 -0
- package/dist/modules/hr/relations.d.ts.map +1 -0
- package/dist/modules/hr/relations.js +19 -0
- package/dist/modules/hr/relations.js.map +1 -0
- package/dist/modules/hr/types.d.ts +9 -0
- package/dist/modules/hr/types.d.ts.map +1 -0
- package/dist/modules/hr/types.js +5 -0
- package/dist/modules/hr/types.js.map +1 -0
- package/dist/modules/hr_backend/index.d.ts +4 -0
- package/dist/modules/hr_backend/index.d.ts.map +1 -0
- package/dist/modules/hr_backend/index.js +142 -0
- package/dist/modules/hr_backend/index.js.map +1 -0
- package/dist/modules/hr_backend/routes.d.ts +3 -0
- package/dist/modules/hr_backend/routes.d.ts.map +1 -0
- package/dist/modules/hr_backend/routes.js +83 -0
- package/dist/modules/hr_backend/routes.js.map +1 -0
- package/dist/modules/hr_backend/screens.d.ts +9 -0
- package/dist/modules/hr_backend/screens.d.ts.map +1 -0
- package/dist/modules/hr_backend/screens.js +144 -0
- package/dist/modules/hr_backend/screens.js.map +1 -0
- package/dist/modules/inventory/index.d.ts +3 -0
- package/dist/modules/inventory/index.d.ts.map +1 -0
- package/dist/modules/inventory/index.js +31 -0
- package/dist/modules/inventory/index.js.map +1 -0
- package/dist/modules/loyalty/admin-functions.d.ts +3 -0
- package/dist/modules/loyalty/admin-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/admin-functions.js +692 -0
- package/dist/modules/loyalty/admin-functions.js.map +1 -0
- package/dist/modules/loyalty/engine.d.ts +31 -0
- package/dist/modules/loyalty/engine.d.ts.map +1 -0
- package/dist/modules/loyalty/engine.js +412 -0
- package/dist/modules/loyalty/engine.js.map +1 -0
- package/dist/modules/loyalty/index.d.ts +5 -0
- package/dist/modules/loyalty/index.d.ts.map +1 -0
- package/dist/modules/loyalty/index.js +24 -0
- package/dist/modules/loyalty/index.js.map +1 -0
- package/dist/modules/loyalty/jobs.d.ts +4 -0
- package/dist/modules/loyalty/jobs.d.ts.map +1 -0
- package/dist/modules/loyalty/jobs.js +103 -0
- package/dist/modules/loyalty/jobs.js.map +1 -0
- package/dist/modules/loyalty/ledger.d.ts +48 -0
- package/dist/modules/loyalty/ledger.d.ts.map +1 -0
- package/dist/modules/loyalty/ledger.js +164 -0
- package/dist/modules/loyalty/ledger.js.map +1 -0
- package/dist/modules/loyalty/membership-functions.d.ts +4 -0
- package/dist/modules/loyalty/membership-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/membership-functions.js +163 -0
- package/dist/modules/loyalty/membership-functions.js.map +1 -0
- package/dist/modules/loyalty/messages.d.ts +119 -0
- package/dist/modules/loyalty/messages.d.ts.map +1 -0
- package/dist/modules/loyalty/messages.js +119 -0
- package/dist/modules/loyalty/messages.js.map +1 -0
- package/dist/modules/loyalty/models.d.ts +3 -0
- package/dist/modules/loyalty/models.d.ts.map +1 -0
- package/dist/modules/loyalty/models.js +259 -0
- package/dist/modules/loyalty/models.js.map +1 -0
- package/dist/modules/loyalty/order-functions.d.ts +3 -0
- package/dist/modules/loyalty/order-functions.d.ts.map +1 -0
- package/dist/modules/loyalty/order-functions.js +656 -0
- package/dist/modules/loyalty/order-functions.js.map +1 -0
- package/dist/modules/loyalty/relations.d.ts +3 -0
- package/dist/modules/loyalty/relations.d.ts.map +1 -0
- package/dist/modules/loyalty/relations.js +19 -0
- package/dist/modules/loyalty/relations.js.map +1 -0
- package/dist/modules/loyalty/types.d.ts +83 -0
- package/dist/modules/loyalty/types.d.ts.map +1 -0
- package/dist/modules/loyalty/types.js +23 -0
- package/dist/modules/loyalty/types.js.map +1 -0
- package/dist/modules/loyalty_backend/index.d.ts +3 -0
- package/dist/modules/loyalty_backend/index.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/index.js +636 -0
- package/dist/modules/loyalty_backend/index.js.map +1 -0
- package/dist/modules/loyalty_backend/messages.d.ts +162 -0
- package/dist/modules/loyalty_backend/messages.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/messages.js +318 -0
- package/dist/modules/loyalty_backend/messages.js.map +1 -0
- package/dist/modules/loyalty_backend/screens.d.ts +33 -0
- package/dist/modules/loyalty_backend/screens.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/screens.js +562 -0
- package/dist/modules/loyalty_backend/screens.js.map +1 -0
- package/dist/modules/loyalty_pos/functions.d.ts +19 -0
- package/dist/modules/loyalty_pos/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/functions.js +274 -0
- package/dist/modules/loyalty_pos/functions.js.map +1 -0
- package/dist/modules/loyalty_pos/index.d.ts +3 -0
- package/dist/modules/loyalty_pos/index.d.ts.map +1 -0
- package/dist/modules/loyalty_pos/index.js +45 -0
- package/dist/modules/loyalty_pos/index.js.map +1 -0
- package/dist/modules/loyalty_sale/functions.d.ts +19 -0
- package/dist/modules/loyalty_sale/functions.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/functions.js +275 -0
- package/dist/modules/loyalty_sale/functions.js.map +1 -0
- package/dist/modules/loyalty_sale/index.d.ts +3 -0
- package/dist/modules/loyalty_sale/index.d.ts.map +1 -0
- package/dist/modules/loyalty_sale/index.js +45 -0
- package/dist/modules/loyalty_sale/index.js.map +1 -0
- package/dist/modules/mail/functions.d.ts +3 -0
- package/dist/modules/mail/functions.d.ts.map +1 -0
- package/dist/modules/mail/functions.js +129 -0
- package/dist/modules/mail/functions.js.map +1 -0
- package/dist/modules/mail/index.d.ts +9 -0
- package/dist/modules/mail/index.d.ts.map +1 -0
- package/dist/modules/mail/index.js +22 -0
- package/dist/modules/mail/index.js.map +1 -0
- package/dist/modules/mail/messages.d.ts +13 -0
- package/dist/modules/mail/messages.d.ts.map +1 -0
- package/dist/modules/mail/messages.js +13 -0
- package/dist/modules/mail/messages.js.map +1 -0
- package/dist/modules/mail/models.d.ts +3 -0
- package/dist/modules/mail/models.d.ts.map +1 -0
- package/dist/modules/mail/models.js +124 -0
- package/dist/modules/mail/models.js.map +1 -0
- package/dist/modules/mail/operations.d.ts +60 -0
- package/dist/modules/mail/operations.d.ts.map +1 -0
- package/dist/modules/mail/operations.js +249 -0
- package/dist/modules/mail/operations.js.map +1 -0
- package/dist/modules/mail/relations.d.ts +3 -0
- package/dist/modules/mail/relations.d.ts.map +1 -0
- package/dist/modules/mail/relations.js +41 -0
- package/dist/modules/mail/relations.js.map +1 -0
- package/dist/modules/mail/target.d.ts +16 -0
- package/dist/modules/mail/target.d.ts.map +1 -0
- package/dist/modules/mail/target.js +245 -0
- package/dist/modules/mail/target.js.map +1 -0
- package/dist/modules/mail/types.d.ts +7 -0
- package/dist/modules/mail/types.d.ts.map +1 -0
- package/dist/modules/mail/types.js +4 -0
- package/dist/modules/mail/types.js.map +1 -0
- package/dist/modules/mail_backend/index.d.ts +5 -0
- package/dist/modules/mail_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_backend/index.js +56 -0
- package/dist/modules/mail_backend/index.js.map +1 -0
- package/dist/modules/mail_backend/islands.d.ts +3 -0
- package/dist/modules/mail_backend/islands.d.ts.map +1 -0
- package/dist/modules/mail_backend/islands.js +20 -0
- package/dist/modules/mail_backend/islands.js.map +1 -0
- package/dist/modules/mail_backend/routes.d.ts +5 -0
- package/dist/modules/mail_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_backend/routes.js +37 -0
- package/dist/modules/mail_backend/routes.js.map +1 -0
- package/dist/modules/mail_backend/screens.d.ts +5 -0
- package/dist/modules/mail_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_backend/screens.js +11 -0
- package/dist/modules/mail_backend/screens.js.map +1 -0
- package/dist/modules/mail_inbound/functions.d.ts +27 -0
- package/dist/modules/mail_inbound/functions.d.ts.map +1 -0
- package/dist/modules/mail_inbound/functions.js +178 -0
- package/dist/modules/mail_inbound/functions.js.map +1 -0
- package/dist/modules/mail_inbound/index.d.ts +10 -0
- package/dist/modules/mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound/index.js +38 -0
- package/dist/modules/mail_inbound/index.js.map +1 -0
- package/dist/modules/mail_inbound/jobs.d.ts +3 -0
- package/dist/modules/mail_inbound/jobs.d.ts.map +1 -0
- package/dist/modules/mail_inbound/jobs.js +29 -0
- package/dist/modules/mail_inbound/jobs.js.map +1 -0
- package/dist/modules/mail_inbound/models.d.ts +3 -0
- package/dist/modules/mail_inbound/models.d.ts.map +1 -0
- package/dist/modules/mail_inbound/models.js +68 -0
- package/dist/modules/mail_inbound/models.js.map +1 -0
- package/dist/modules/mail_inbound/operations.d.ts +17 -0
- package/dist/modules/mail_inbound/operations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/operations.js +273 -0
- package/dist/modules/mail_inbound/operations.js.map +1 -0
- package/dist/modules/mail_inbound/relations.d.ts +3 -0
- package/dist/modules/mail_inbound/relations.d.ts.map +1 -0
- package/dist/modules/mail_inbound/relations.js +19 -0
- package/dist/modules/mail_inbound/relations.js.map +1 -0
- package/dist/modules/mail_inbound/routes.d.ts +4 -0
- package/dist/modules/mail_inbound/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound/routes.js +156 -0
- package/dist/modules/mail_inbound/routes.js.map +1 -0
- package/dist/modules/mail_inbound/types.d.ts +37 -0
- package/dist/modules/mail_inbound/types.d.ts.map +1 -0
- package/dist/modules/mail_inbound/types.js +3 -0
- package/dist/modules/mail_inbound/types.js.map +1 -0
- package/dist/modules/mail_inbound_backend/index.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/index.js +59 -0
- package/dist/modules/mail_inbound_backend/index.js.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/routes.js +31 -0
- package/dist/modules/mail_inbound_backend/routes.js.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts +5 -0
- package/dist/modules/mail_inbound_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_inbound_backend/screens.js +25 -0
- package/dist/modules/mail_inbound_backend/screens.js.map +1 -0
- package/dist/modules/mail_transport/functions.d.ts +3 -0
- package/dist/modules/mail_transport/functions.d.ts.map +1 -0
- package/dist/modules/mail_transport/functions.js +280 -0
- package/dist/modules/mail_transport/functions.js.map +1 -0
- package/dist/modules/mail_transport/index.d.ts +11 -0
- package/dist/modules/mail_transport/index.d.ts.map +1 -0
- package/dist/modules/mail_transport/index.js +37 -0
- package/dist/modules/mail_transport/index.js.map +1 -0
- package/dist/modules/mail_transport/jobs.d.ts +3 -0
- package/dist/modules/mail_transport/jobs.d.ts.map +1 -0
- package/dist/modules/mail_transport/jobs.js +79 -0
- package/dist/modules/mail_transport/jobs.js.map +1 -0
- package/dist/modules/mail_transport/models.d.ts +3 -0
- package/dist/modules/mail_transport/models.d.ts.map +1 -0
- package/dist/modules/mail_transport/models.js +88 -0
- package/dist/modules/mail_transport/models.js.map +1 -0
- package/dist/modules/mail_transport/operations.d.ts +16 -0
- package/dist/modules/mail_transport/operations.d.ts.map +1 -0
- package/dist/modules/mail_transport/operations.js +122 -0
- package/dist/modules/mail_transport/operations.js.map +1 -0
- package/dist/modules/mail_transport/relations.d.ts +3 -0
- package/dist/modules/mail_transport/relations.d.ts.map +1 -0
- package/dist/modules/mail_transport/relations.js +19 -0
- package/dist/modules/mail_transport/relations.js.map +1 -0
- package/dist/modules/mail_transport/target.d.ts +8 -0
- package/dist/modules/mail_transport/target.d.ts.map +1 -0
- package/dist/modules/mail_transport/target.js +43 -0
- package/dist/modules/mail_transport/target.js.map +1 -0
- package/dist/modules/mail_transport/template.d.ts +4 -0
- package/dist/modules/mail_transport/template.d.ts.map +1 -0
- package/dist/modules/mail_transport/template.js +52 -0
- package/dist/modules/mail_transport/template.js.map +1 -0
- package/dist/modules/mail_transport/types.d.ts +9 -0
- package/dist/modules/mail_transport/types.d.ts.map +1 -0
- package/dist/modules/mail_transport/types.js +3 -0
- package/dist/modules/mail_transport/types.js.map +1 -0
- package/dist/modules/mail_transport_backend/index.d.ts +5 -0
- package/dist/modules/mail_transport_backend/index.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/index.js +69 -0
- package/dist/modules/mail_transport_backend/index.js.map +1 -0
- package/dist/modules/mail_transport_backend/routes.d.ts +5 -0
- package/dist/modules/mail_transport_backend/routes.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/routes.js +42 -0
- package/dist/modules/mail_transport_backend/routes.js.map +1 -0
- package/dist/modules/mail_transport_backend/screens.d.ts +5 -0
- package/dist/modules/mail_transport_backend/screens.d.ts.map +1 -0
- package/dist/modules/mail_transport_backend/screens.js +35 -0
- package/dist/modules/mail_transport_backend/screens.js.map +1 -0
- package/dist/modules/oauth/functions.d.ts +3 -0
- package/dist/modules/oauth/functions.d.ts.map +1 -0
- package/dist/modules/oauth/functions.js +817 -0
- package/dist/modules/oauth/functions.js.map +1 -0
- package/dist/modules/oauth/index.d.ts +4 -0
- package/dist/modules/oauth/index.d.ts.map +1 -0
- package/dist/modules/oauth/index.js +22 -0
- package/dist/modules/oauth/index.js.map +1 -0
- package/dist/modules/oauth/messages.d.ts +129 -0
- package/dist/modules/oauth/messages.d.ts.map +1 -0
- package/dist/modules/oauth/messages.js +129 -0
- package/dist/modules/oauth/messages.js.map +1 -0
- package/dist/modules/oauth/models.d.ts +4 -0
- package/dist/modules/oauth/models.d.ts.map +1 -0
- package/dist/modules/oauth/models.js +83 -0
- package/dist/modules/oauth/models.js.map +1 -0
- package/dist/modules/oauth/protocol.d.ts +54 -0
- package/dist/modules/oauth/protocol.d.ts.map +1 -0
- package/dist/modules/oauth/protocol.js +309 -0
- package/dist/modules/oauth/protocol.js.map +1 -0
- package/dist/modules/oauth/relations.d.ts +3 -0
- package/dist/modules/oauth/relations.d.ts.map +1 -0
- package/dist/modules/oauth/relations.js +18 -0
- package/dist/modules/oauth/relations.js.map +1 -0
- package/dist/modules/oauth/routes.d.ts +3 -0
- package/dist/modules/oauth/routes.d.ts.map +1 -0
- package/dist/modules/oauth/routes.js +185 -0
- package/dist/modules/oauth/routes.js.map +1 -0
- package/dist/modules/oauth_backend/index.d.ts +4 -0
- package/dist/modules/oauth_backend/index.d.ts.map +1 -0
- package/dist/modules/oauth_backend/index.js +23 -0
- package/dist/modules/oauth_backend/index.js.map +1 -0
- package/dist/modules/oauth_backend/menus.d.ts +3 -0
- package/dist/modules/oauth_backend/menus.d.ts.map +1 -0
- package/dist/modules/oauth_backend/menus.js +17 -0
- package/dist/modules/oauth_backend/menus.js.map +1 -0
- package/dist/modules/oauth_backend/messages.d.ts +169 -0
- package/dist/modules/oauth_backend/messages.d.ts.map +1 -0
- package/dist/modules/oauth_backend/messages.js +169 -0
- package/dist/modules/oauth_backend/messages.js.map +1 -0
- package/dist/modules/oauth_backend/routes.d.ts +3 -0
- package/dist/modules/oauth_backend/routes.d.ts.map +1 -0
- package/dist/modules/oauth_backend/routes.js +231 -0
- package/dist/modules/oauth_backend/routes.js.map +1 -0
- package/dist/modules/oauth_backend/screens.d.ts +66 -0
- package/dist/modules/oauth_backend/screens.d.ts.map +1 -0
- package/dist/modules/oauth_backend/screens.js +323 -0
- package/dist/modules/oauth_backend/screens.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/functions.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/functions.js +128 -0
- package/dist/modules/odoo_collaboration_import/functions.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts +6 -0
- package/dist/modules/odoo_collaboration_import/index.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/index.js +31 -0
- package/dist/modules/odoo_collaboration_import/index.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/models.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/models.js +76 -0
- package/dist/modules/odoo_collaboration_import/models.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts +14 -0
- package/dist/modules/odoo_collaboration_import/operations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/operations.js +1139 -0
- package/dist/modules/odoo_collaboration_import/operations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts +3 -0
- package/dist/modules/odoo_collaboration_import/relations.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/relations.js +19 -0
- package/dist/modules/odoo_collaboration_import/relations.js.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts +58 -0
- package/dist/modules/odoo_collaboration_import/types.d.ts.map +1 -0
- package/dist/modules/odoo_collaboration_import/types.js +2 -0
- package/dist/modules/odoo_collaboration_import/types.js.map +1 -0
- package/dist/modules/partner/functions.d.ts +5 -0
- package/dist/modules/partner/functions.d.ts.map +1 -0
- package/dist/modules/partner/functions.js +563 -0
- package/dist/modules/partner/functions.js.map +1 -0
- package/dist/modules/partner/index.d.ts +5 -0
- package/dist/modules/partner/index.d.ts.map +1 -0
- package/dist/modules/partner/index.js +23 -0
- package/dist/modules/partner/index.js.map +1 -0
- package/dist/modules/partner/messages.d.ts +55 -0
- package/dist/modules/partner/messages.d.ts.map +1 -0
- package/dist/modules/partner/messages.js +55 -0
- package/dist/modules/partner/messages.js.map +1 -0
- package/dist/modules/partner/models.d.ts +23 -0
- package/dist/modules/partner/models.d.ts.map +1 -0
- package/dist/modules/partner/models.js +124 -0
- package/dist/modules/partner/models.js.map +1 -0
- package/dist/modules/partner/relations.d.ts +4 -0
- package/dist/modules/partner/relations.d.ts.map +1 -0
- package/dist/modules/partner/relations.js +35 -0
- package/dist/modules/partner/relations.js.map +1 -0
- package/dist/modules/partner/types.d.ts +17 -0
- package/dist/modules/partner/types.d.ts.map +1 -0
- package/dist/modules/partner/types.js +14 -0
- package/dist/modules/partner/types.js.map +1 -0
- package/dist/modules/partner/views.d.ts +4 -0
- package/dist/modules/partner/views.d.ts.map +1 -0
- package/dist/modules/partner/views.js +19 -0
- package/dist/modules/partner/views.js.map +1 -0
- package/dist/modules/partner_backend/client/address-view.d.mts +5 -0
- package/dist/modules/partner_backend/client/address-view.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address-view.mjs +193 -0
- package/dist/modules/partner_backend/client/address-view.mjs.map +1 -0
- package/dist/modules/partner_backend/client/address.css +12 -0
- package/dist/modules/partner_backend/client/address.d.mts +5 -0
- package/dist/modules/partner_backend/client/address.d.mts.map +1 -0
- package/dist/modules/partner_backend/client/address.mjs +7 -0
- package/dist/modules/partner_backend/client/address.mjs.map +1 -0
- package/dist/modules/partner_backend/index.d.ts +5 -0
- package/dist/modules/partner_backend/index.d.ts.map +1 -0
- package/dist/modules/partner_backend/index.js +178 -0
- package/dist/modules/partner_backend/index.js.map +1 -0
- package/dist/modules/partner_backend/islands.d.ts +3 -0
- package/dist/modules/partner_backend/islands.d.ts.map +1 -0
- package/dist/modules/partner_backend/islands.js +23 -0
- package/dist/modules/partner_backend/islands.js.map +1 -0
- package/dist/modules/partner_backend/menus.d.ts +3 -0
- package/dist/modules/partner_backend/menus.d.ts.map +1 -0
- package/dist/modules/partner_backend/menus.js +11 -0
- package/dist/modules/partner_backend/menus.js.map +1 -0
- package/dist/modules/partner_backend/relation-control.d.ts +22 -0
- package/dist/modules/partner_backend/relation-control.d.ts.map +1 -0
- package/dist/modules/partner_backend/relation-control.js +46 -0
- package/dist/modules/partner_backend/relation-control.js.map +1 -0
- package/dist/modules/partner_backend/routes.d.ts +3 -0
- package/dist/modules/partner_backend/routes.d.ts.map +1 -0
- package/dist/modules/partner_backend/routes.js +300 -0
- package/dist/modules/partner_backend/routes.js.map +1 -0
- package/dist/modules/partner_backend/screens.d.ts +53 -0
- package/dist/modules/partner_backend/screens.d.ts.map +1 -0
- package/dist/modules/partner_backend/screens.js +169 -0
- package/dist/modules/partner_backend/screens.js.map +1 -0
- package/dist/modules/pos/functions.d.ts +6 -0
- package/dist/modules/pos/functions.d.ts.map +1 -0
- package/dist/modules/pos/functions.js +953 -0
- package/dist/modules/pos/functions.js.map +1 -0
- package/dist/modules/pos/index.d.ts +4 -0
- package/dist/modules/pos/index.d.ts.map +1 -0
- package/dist/modules/pos/index.js +34 -0
- package/dist/modules/pos/index.js.map +1 -0
- package/dist/modules/pos/models.d.ts +3 -0
- package/dist/modules/pos/models.d.ts.map +1 -0
- package/dist/modules/pos/models.js +107 -0
- package/dist/modules/pos/models.js.map +1 -0
- package/dist/modules/pos/relations.d.ts +3 -0
- package/dist/modules/pos/relations.d.ts.map +1 -0
- package/dist/modules/pos/relations.js +37 -0
- package/dist/modules/pos/relations.js.map +1 -0
- package/dist/modules/pos_backend/index.d.ts +3 -0
- package/dist/modules/pos_backend/index.d.ts.map +1 -0
- package/dist/modules/pos_backend/index.js +654 -0
- package/dist/modules/pos_backend/index.js.map +1 -0
- package/dist/modules/pos_backend/screens.d.ts +15 -0
- package/dist/modules/pos_backend/screens.d.ts.map +1 -0
- package/dist/modules/pos_backend/screens.js +320 -0
- package/dist/modules/pos_backend/screens.js.map +1 -0
- package/dist/modules/pricing/functions.d.ts +6 -0
- package/dist/modules/pricing/functions.d.ts.map +1 -0
- package/dist/modules/pricing/functions.js +318 -0
- package/dist/modules/pricing/functions.js.map +1 -0
- package/dist/modules/pricing/index.d.ts +4 -0
- package/dist/modules/pricing/index.d.ts.map +1 -0
- package/dist/modules/pricing/index.js +30 -0
- package/dist/modules/pricing/index.js.map +1 -0
- package/dist/modules/pricing/models.d.ts +3 -0
- package/dist/modules/pricing/models.d.ts.map +1 -0
- package/dist/modules/pricing/models.js +34 -0
- package/dist/modules/pricing/models.js.map +1 -0
- package/dist/modules/pricing/relations.d.ts +3 -0
- package/dist/modules/pricing/relations.d.ts.map +1 -0
- package/dist/modules/pricing/relations.js +11 -0
- package/dist/modules/pricing/relations.js.map +1 -0
- package/dist/modules/pricing_backend/index.d.ts +3 -0
- package/dist/modules/pricing_backend/index.d.ts.map +1 -0
- package/dist/modules/pricing_backend/index.js +241 -0
- package/dist/modules/pricing_backend/index.js.map +1 -0
- package/dist/modules/pricing_backend/screens.d.ts +13 -0
- package/dist/modules/pricing_backend/screens.d.ts.map +1 -0
- package/dist/modules/pricing_backend/screens.js +182 -0
- package/dist/modules/pricing_backend/screens.js.map +1 -0
- package/dist/modules/product/functions.d.ts +3 -0
- package/dist/modules/product/functions.d.ts.map +1 -0
- package/dist/modules/product/functions.js +627 -0
- package/dist/modules/product/functions.js.map +1 -0
- package/dist/modules/product/index.d.ts +6 -0
- package/dist/modules/product/index.d.ts.map +1 -0
- package/dist/modules/product/index.js +24 -0
- package/dist/modules/product/index.js.map +1 -0
- package/dist/modules/product/messages.d.ts +3 -0
- package/dist/modules/product/messages.d.ts.map +1 -0
- package/dist/modules/product/messages.js +19 -0
- package/dist/modules/product/messages.js.map +1 -0
- package/dist/modules/product/models.d.ts +11 -0
- package/dist/modules/product/models.d.ts.map +1 -0
- package/dist/modules/product/models.js +116 -0
- package/dist/modules/product/models.js.map +1 -0
- package/dist/modules/product/relations.d.ts +8 -0
- package/dist/modules/product/relations.d.ts.map +1 -0
- package/dist/modules/product/relations.js +53 -0
- package/dist/modules/product/relations.js.map +1 -0
- package/dist/modules/product/search.d.ts +73 -0
- package/dist/modules/product/search.d.ts.map +1 -0
- package/dist/modules/product/search.js +66 -0
- package/dist/modules/product/search.js.map +1 -0
- package/dist/modules/product/types.d.ts +14 -0
- package/dist/modules/product/types.d.ts.map +1 -0
- package/dist/modules/product/types.js +2 -0
- package/dist/modules/product/types.js.map +1 -0
- package/dist/modules/product/views.d.ts +4 -0
- package/dist/modules/product/views.d.ts.map +1 -0
- package/dist/modules/product/views.js +7 -0
- package/dist/modules/product/views.js.map +1 -0
- package/dist/modules/product_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_activity_backend/index.js +29 -0
- package/dist/modules/product_activity_backend/index.js.map +1 -0
- package/dist/modules/product_backend/attributes-screen.d.ts +7 -0
- package/dist/modules/product_backend/attributes-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/attributes-screen.js +76 -0
- package/dist/modules/product_backend/attributes-screen.js.map +1 -0
- package/dist/modules/product_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/product_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/product_backend/client/editor-view.mjs +141 -0
- package/dist/modules/product_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/product_backend/client/product.d.mts +6 -0
- package/dist/modules/product_backend/client/product.d.mts.map +1 -0
- package/dist/modules/product_backend/client/product.mjs +8 -0
- package/dist/modules/product_backend/client/product.mjs.map +1 -0
- package/dist/modules/product_backend/create-screen.d.ts +12 -0
- package/dist/modules/product_backend/create-screen.d.ts.map +1 -0
- package/dist/modules/product_backend/create-screen.js +83 -0
- package/dist/modules/product_backend/create-screen.js.map +1 -0
- package/dist/modules/product_backend/index.d.ts +20 -0
- package/dist/modules/product_backend/index.d.ts.map +1 -0
- package/dist/modules/product_backend/index.js +287 -0
- package/dist/modules/product_backend/index.js.map +1 -0
- package/dist/modules/product_backend/islands.d.ts +3 -0
- package/dist/modules/product_backend/islands.d.ts.map +1 -0
- package/dist/modules/product_backend/islands.js +13 -0
- package/dist/modules/product_backend/islands.js.map +1 -0
- package/dist/modules/product_backend/menus.d.ts +3 -0
- package/dist/modules/product_backend/menus.d.ts.map +1 -0
- package/dist/modules/product_backend/menus.js +25 -0
- package/dist/modules/product_backend/menus.js.map +1 -0
- package/dist/modules/product_backend/routes.d.ts +14 -0
- package/dist/modules/product_backend/routes.d.ts.map +1 -0
- package/dist/modules/product_backend/routes.js +990 -0
- package/dist/modules/product_backend/routes.js.map +1 -0
- package/dist/modules/product_backend/screens.d.ts +68 -0
- package/dist/modules/product_backend/screens.d.ts.map +1 -0
- package/dist/modules/product_backend/screens.js +388 -0
- package/dist/modules/product_backend/screens.js.map +1 -0
- package/dist/modules/product_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_mail_backend/index.js +30 -0
- package/dist/modules/product_mail_backend/index.js.map +1 -0
- package/dist/modules/product_media/functions.d.ts +3 -0
- package/dist/modules/product_media/functions.d.ts.map +1 -0
- package/dist/modules/product_media/functions.js +183 -0
- package/dist/modules/product_media/functions.js.map +1 -0
- package/dist/modules/product_media/index.d.ts +3 -0
- package/dist/modules/product_media/index.d.ts.map +1 -0
- package/dist/modules/product_media/index.js +29 -0
- package/dist/modules/product_media/index.js.map +1 -0
- package/dist/modules/product_media/models.d.ts +4 -0
- package/dist/modules/product_media/models.d.ts.map +1 -0
- package/dist/modules/product_media/models.js +24 -0
- package/dist/modules/product_media/models.js.map +1 -0
- package/dist/modules/product_media/relations.d.ts +3 -0
- package/dist/modules/product_media/relations.d.ts.map +1 -0
- package/dist/modules/product_media/relations.js +8 -0
- package/dist/modules/product_media/relations.js.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_activity_backend/index.js +29 -0
- package/dist/modules/product_variant_activity_backend/index.js.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts +5 -0
- package/dist/modules/product_variant_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/product_variant_mail_backend/index.js +30 -0
- package/dist/modules/product_variant_mail_backend/index.js.map +1 -0
- package/dist/modules/purchase/functions.d.ts +6 -0
- package/dist/modules/purchase/functions.d.ts.map +1 -0
- package/dist/modules/purchase/functions.js +743 -0
- package/dist/modules/purchase/functions.js.map +1 -0
- package/dist/modules/purchase/index.d.ts +4 -0
- package/dist/modules/purchase/index.d.ts.map +1 -0
- package/dist/modules/purchase/index.js +35 -0
- package/dist/modules/purchase/index.js.map +1 -0
- package/dist/modules/purchase/models.d.ts +3 -0
- package/dist/modules/purchase/models.d.ts.map +1 -0
- package/dist/modules/purchase/models.js +68 -0
- package/dist/modules/purchase/models.js.map +1 -0
- package/dist/modules/purchase/relations.d.ts +3 -0
- package/dist/modules/purchase/relations.d.ts.map +1 -0
- package/dist/modules/purchase/relations.js +20 -0
- package/dist/modules/purchase/relations.js.map +1 -0
- package/dist/modules/purchase_backend/index.d.ts +3 -0
- package/dist/modules/purchase_backend/index.d.ts.map +1 -0
- package/dist/modules/purchase_backend/index.js +615 -0
- package/dist/modules/purchase_backend/index.js.map +1 -0
- package/dist/modules/purchase_backend/screens.d.ts +29 -0
- package/dist/modules/purchase_backend/screens.d.ts.map +1 -0
- package/dist/modules/purchase_backend/screens.js +324 -0
- package/dist/modules/purchase_backend/screens.js.map +1 -0
- package/dist/modules/sale/functions.d.ts +6 -0
- package/dist/modules/sale/functions.d.ts.map +1 -0
- package/dist/modules/sale/functions.js +611 -0
- package/dist/modules/sale/functions.js.map +1 -0
- package/dist/modules/sale/index.d.ts +4 -0
- package/dist/modules/sale/index.d.ts.map +1 -0
- package/dist/modules/sale/index.js +35 -0
- package/dist/modules/sale/index.js.map +1 -0
- package/dist/modules/sale/models.d.ts +3 -0
- package/dist/modules/sale/models.d.ts.map +1 -0
- package/dist/modules/sale/models.js +46 -0
- package/dist/modules/sale/models.js.map +1 -0
- package/dist/modules/sale/relations.d.ts +3 -0
- package/dist/modules/sale/relations.d.ts.map +1 -0
- package/dist/modules/sale/relations.js +16 -0
- package/dist/modules/sale/relations.js.map +1 -0
- package/dist/modules/sale_activity_backend/index.d.ts +5 -0
- package/dist/modules/sale_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_activity_backend/index.js +29 -0
- package/dist/modules/sale_activity_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/sale_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/editor-view.mjs +132 -0
- package/dist/modules/sale_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/sale_backend/client/sale.d.mts +6 -0
- package/dist/modules/sale_backend/client/sale.d.mts.map +1 -0
- package/dist/modules/sale_backend/client/sale.mjs +8 -0
- package/dist/modules/sale_backend/client/sale.mjs.map +1 -0
- package/dist/modules/sale_backend/index.d.ts +3 -0
- package/dist/modules/sale_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_backend/index.js +681 -0
- package/dist/modules/sale_backend/index.js.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts +14 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js +36 -0
- package/dist/modules/sale_backend/invoicing-policies-screen.js.map +1 -0
- package/dist/modules/sale_backend/islands.d.ts +3 -0
- package/dist/modules/sale_backend/islands.d.ts.map +1 -0
- package/dist/modules/sale_backend/islands.js +13 -0
- package/dist/modules/sale_backend/islands.js.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts +18 -0
- package/dist/modules/sale_backend/order-detail-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/order-detail-screen.js +217 -0
- package/dist/modules/sale_backend/order-detail-screen.js.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts +15 -0
- package/dist/modules/sale_backend/quotations-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/quotations-screen.js +64 -0
- package/dist/modules/sale_backend/quotations-screen.js.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts +12 -0
- package/dist/modules/sale_backend/sales-orders-screen.d.ts.map +1 -0
- package/dist/modules/sale_backend/sales-orders-screen.js +65 -0
- package/dist/modules/sale_backend/sales-orders-screen.js.map +1 -0
- package/dist/modules/sale_backend/screens.d.ts +23 -0
- package/dist/modules/sale_backend/screens.d.ts.map +1 -0
- package/dist/modules/sale_backend/screens.js +275 -0
- package/dist/modules/sale_backend/screens.js.map +1 -0
- package/dist/modules/sale_mail_backend/index.d.ts +5 -0
- package/dist/modules/sale_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/sale_mail_backend/index.js +30 -0
- package/dist/modules/sale_mail_backend/index.js.map +1 -0
- package/dist/modules/stock/functions.d.ts +10 -0
- package/dist/modules/stock/functions.d.ts.map +1 -0
- package/dist/modules/stock/functions.js +1523 -0
- package/dist/modules/stock/functions.js.map +1 -0
- package/dist/modules/stock/index.d.ts +5 -0
- package/dist/modules/stock/index.d.ts.map +1 -0
- package/dist/modules/stock/index.js +35 -0
- package/dist/modules/stock/index.js.map +1 -0
- package/dist/modules/stock/models.d.ts +3 -0
- package/dist/modules/stock/models.d.ts.map +1 -0
- package/dist/modules/stock/models.js +185 -0
- package/dist/modules/stock/models.js.map +1 -0
- package/dist/modules/stock/relations.d.ts +3 -0
- package/dist/modules/stock/relations.d.ts.map +1 -0
- package/dist/modules/stock/relations.js +40 -0
- package/dist/modules/stock/relations.js.map +1 -0
- package/dist/modules/stock/routing.d.ts +7 -0
- package/dist/modules/stock/routing.d.ts.map +1 -0
- package/dist/modules/stock/routing.js +527 -0
- package/dist/modules/stock/routing.js.map +1 -0
- package/dist/modules/stock_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_activity_backend/index.js +29 -0
- package/dist/modules/stock_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts +5 -0
- package/dist/modules/stock_backend/client/editor-view.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/editor-view.mjs +147 -0
- package/dist/modules/stock_backend/client/editor-view.mjs.map +1 -0
- package/dist/modules/stock_backend/client/stock.d.mts +6 -0
- package/dist/modules/stock_backend/client/stock.d.mts.map +1 -0
- package/dist/modules/stock_backend/client/stock.mjs +8 -0
- package/dist/modules/stock_backend/client/stock.mjs.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts +28 -0
- package/dist/modules/stock_backend/forecast-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/forecast-screen.js +108 -0
- package/dist/modules/stock_backend/forecast-screen.js.map +1 -0
- package/dist/modules/stock_backend/index.d.ts +3 -0
- package/dist/modules/stock_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_backend/index.js +880 -0
- package/dist/modules/stock_backend/index.js.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts +27 -0
- package/dist/modules/stock_backend/inventory-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/inventory-screen.js +141 -0
- package/dist/modules/stock_backend/inventory-screen.js.map +1 -0
- package/dist/modules/stock_backend/islands.d.ts +3 -0
- package/dist/modules/stock_backend/islands.d.ts.map +1 -0
- package/dist/modules/stock_backend/islands.js +13 -0
- package/dist/modules/stock_backend/islands.js.map +1 -0
- package/dist/modules/stock_backend/locations-screen.d.ts +18 -0
- package/dist/modules/stock_backend/locations-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/locations-screen.js +92 -0
- package/dist/modules/stock_backend/locations-screen.js.map +1 -0
- package/dist/modules/stock_backend/lot-screen.d.ts +30 -0
- package/dist/modules/stock_backend/lot-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lot-screen.js +86 -0
- package/dist/modules/stock_backend/lot-screen.js.map +1 -0
- package/dist/modules/stock_backend/lots-screen.d.ts +21 -0
- package/dist/modules/stock_backend/lots-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/lots-screen.js +79 -0
- package/dist/modules/stock_backend/lots-screen.js.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts +21 -0
- package/dist/modules/stock_backend/picking-types-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/picking-types-screen.js +110 -0
- package/dist/modules/stock_backend/picking-types-screen.js.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts +29 -0
- package/dist/modules/stock_backend/replenishment-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/replenishment-screen.js +131 -0
- package/dist/modules/stock_backend/replenishment-screen.js.map +1 -0
- package/dist/modules/stock_backend/routes.d.ts +3 -0
- package/dist/modules/stock_backend/routes.d.ts.map +1 -0
- package/dist/modules/stock_backend/routes.js +950 -0
- package/dist/modules/stock_backend/routes.js.map +1 -0
- package/dist/modules/stock_backend/screens.d.ts +14 -0
- package/dist/modules/stock_backend/screens.d.ts.map +1 -0
- package/dist/modules/stock_backend/screens.js +40 -0
- package/dist/modules/stock_backend/screens.js.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts +30 -0
- package/dist/modules/stock_backend/stock-route-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-route-screen.js +129 -0
- package/dist/modules/stock_backend/stock-route-screen.js.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts +17 -0
- package/dist/modules/stock_backend/stock-routes-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/stock-routes-screen.js +60 -0
- package/dist/modules/stock_backend/stock-routes-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts +26 -0
- package/dist/modules/stock_backend/transfer-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfer-screen.js +95 -0
- package/dist/modules/stock_backend/transfer-screen.js.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts +21 -0
- package/dist/modules/stock_backend/transfers-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/transfers-screen.js +88 -0
- package/dist/modules/stock_backend/transfers-screen.js.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts +17 -0
- package/dist/modules/stock_backend/warehouses-screen.d.ts.map +1 -0
- package/dist/modules/stock_backend/warehouses-screen.js +96 -0
- package/dist/modules/stock_backend/warehouses-screen.js.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_activity_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_activity_backend/index.js +29 -0
- package/dist/modules/stock_lot_activity_backend/index.js.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_lot_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_lot_mail_backend/index.js +30 -0
- package/dist/modules/stock_lot_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_backend/index.d.ts +5 -0
- package/dist/modules/stock_mail_backend/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_backend/index.js +30 -0
- package/dist/modules/stock_mail_backend/index.js.map +1 -0
- package/dist/modules/stock_mail_inbound/index.d.ts +6 -0
- package/dist/modules/stock_mail_inbound/index.d.ts.map +1 -0
- package/dist/modules/stock_mail_inbound/index.js +104 -0
- package/dist/modules/stock_mail_inbound/index.js.map +1 -0
- package/dist/modules/storage/functions.d.ts +3 -0
- package/dist/modules/storage/functions.d.ts.map +1 -0
- package/dist/modules/storage/functions.js +129 -0
- package/dist/modules/storage/functions.js.map +1 -0
- package/dist/modules/storage/index.d.ts +3 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +31 -0
- package/dist/modules/storage/index.js.map +1 -0
- package/dist/modules/storage/jobs.d.ts +3 -0
- package/dist/modules/storage/jobs.d.ts.map +1 -0
- package/dist/modules/storage/jobs.js +37 -0
- package/dist/modules/storage/jobs.js.map +1 -0
- package/dist/modules/storage/models.d.ts +3 -0
- package/dist/modules/storage/models.d.ts.map +1 -0
- package/dist/modules/storage/models.js +23 -0
- package/dist/modules/storage/models.js.map +1 -0
- package/dist/modules/storage/routes.d.ts +27 -0
- package/dist/modules/storage/routes.d.ts.map +1 -0
- package/dist/modules/storage/routes.js +180 -0
- package/dist/modules/storage/routes.js.map +1 -0
- package/dist/modules/uom/convert.d.ts +52 -0
- package/dist/modules/uom/convert.d.ts.map +1 -0
- package/dist/modules/uom/convert.js +76 -0
- package/dist/modules/uom/convert.js.map +1 -0
- package/dist/modules/uom/functions.d.ts +5 -0
- package/dist/modules/uom/functions.d.ts.map +1 -0
- package/dist/modules/uom/functions.js +235 -0
- package/dist/modules/uom/functions.js.map +1 -0
- package/dist/modules/uom/index.d.ts +5 -0
- package/dist/modules/uom/index.d.ts.map +1 -0
- package/dist/modules/uom/index.js +19 -0
- package/dist/modules/uom/index.js.map +1 -0
- package/dist/modules/uom/messages.d.ts +3 -0
- package/dist/modules/uom/messages.d.ts.map +1 -0
- package/dist/modules/uom/messages.js +19 -0
- package/dist/modules/uom/messages.js.map +1 -0
- package/dist/modules/uom/models.d.ts +4 -0
- package/dist/modules/uom/models.d.ts.map +1 -0
- package/dist/modules/uom/models.js +34 -0
- package/dist/modules/uom/models.js.map +1 -0
- package/dist/modules/uom/relations.d.ts +3 -0
- package/dist/modules/uom/relations.d.ts.map +1 -0
- package/dist/modules/uom/relations.js +7 -0
- package/dist/modules/uom/relations.js.map +1 -0
- package/dist/modules/user/functions.d.ts +8 -0
- package/dist/modules/user/functions.d.ts.map +1 -0
- package/dist/modules/user/functions.js +1094 -0
- package/dist/modules/user/functions.js.map +1 -0
- package/dist/modules/user/index.d.ts +8 -0
- package/dist/modules/user/index.d.ts.map +1 -0
- package/dist/modules/user/index.js +34 -0
- package/dist/modules/user/index.js.map +1 -0
- package/dist/modules/user/login.d.ts +28 -0
- package/dist/modules/user/login.d.ts.map +1 -0
- package/dist/modules/user/login.js +46 -0
- package/dist/modules/user/login.js.map +1 -0
- package/dist/modules/user/messages.d.ts +115 -0
- package/dist/modules/user/messages.d.ts.map +1 -0
- package/dist/modules/user/messages.js +115 -0
- package/dist/modules/user/messages.js.map +1 -0
- package/dist/modules/user/models.d.ts +16 -0
- package/dist/modules/user/models.d.ts.map +1 -0
- package/dist/modules/user/models.js +168 -0
- package/dist/modules/user/models.js.map +1 -0
- package/dist/modules/user/password.d.ts +11 -0
- package/dist/modules/user/password.d.ts.map +1 -0
- package/dist/modules/user/password.js +74 -0
- package/dist/modules/user/password.js.map +1 -0
- package/dist/modules/user/relations.d.ts +3 -0
- package/dist/modules/user/relations.d.ts.map +1 -0
- package/dist/modules/user/relations.js +31 -0
- package/dist/modules/user/relations.js.map +1 -0
- package/dist/modules/user/roles.d.ts +12 -0
- package/dist/modules/user/roles.d.ts.map +1 -0
- package/dist/modules/user/roles.js +254 -0
- package/dist/modules/user/roles.js.map +1 -0
- package/dist/modules/user/routes.d.ts +3 -0
- package/dist/modules/user/routes.d.ts.map +1 -0
- package/dist/modules/user/routes.js +244 -0
- package/dist/modules/user/routes.js.map +1 -0
- package/dist/modules/user/session-context.d.ts +10 -0
- package/dist/modules/user/session-context.d.ts.map +1 -0
- package/dist/modules/user/session-context.js +31 -0
- package/dist/modules/user/session-context.js.map +1 -0
- package/dist/modules/user_backend/index.d.ts +5 -0
- package/dist/modules/user_backend/index.d.ts.map +1 -0
- package/dist/modules/user_backend/index.js +24 -0
- package/dist/modules/user_backend/index.js.map +1 -0
- package/dist/modules/user_backend/menus.d.ts +3 -0
- package/dist/modules/user_backend/menus.d.ts.map +1 -0
- package/dist/modules/user_backend/menus.js +24 -0
- package/dist/modules/user_backend/menus.js.map +1 -0
- package/dist/modules/user_backend/messages.d.ts +189 -0
- package/dist/modules/user_backend/messages.d.ts.map +1 -0
- package/dist/modules/user_backend/messages.js +189 -0
- package/dist/modules/user_backend/messages.js.map +1 -0
- package/dist/modules/user_backend/routes.d.ts +3 -0
- package/dist/modules/user_backend/routes.d.ts.map +1 -0
- package/dist/modules/user_backend/routes.js +474 -0
- package/dist/modules/user_backend/routes.js.map +1 -0
- package/dist/modules/user_backend/screens.d.ts +70 -0
- package/dist/modules/user_backend/screens.d.ts.map +1 -0
- package/dist/modules/user_backend/screens.js +308 -0
- package/dist/modules/user_backend/screens.js.map +1 -0
- package/dist/modules/website/access.d.ts +15 -0
- package/dist/modules/website/access.d.ts.map +1 -0
- package/dist/modules/website/access.js +39 -0
- package/dist/modules/website/access.js.map +1 -0
- package/dist/modules/website/cms.d.ts +3 -0
- package/dist/modules/website/cms.d.ts.map +1 -0
- package/dist/modules/website/cms.js +1142 -0
- package/dist/modules/website/cms.js.map +1 -0
- package/dist/modules/website/content-types.d.ts +4 -0
- package/dist/modules/website/content-types.d.ts.map +1 -0
- package/dist/modules/website/content-types.js +30 -0
- package/dist/modules/website/content-types.js.map +1 -0
- package/dist/modules/website/customer-password.d.ts +4 -0
- package/dist/modules/website/customer-password.d.ts.map +1 -0
- package/dist/modules/website/customer-password.js +51 -0
- package/dist/modules/website/customer-password.js.map +1 -0
- package/dist/modules/website/customer-routes.d.ts +3 -0
- package/dist/modules/website/customer-routes.d.ts.map +1 -0
- package/dist/modules/website/customer-routes.js +322 -0
- package/dist/modules/website/customer-routes.js.map +1 -0
- package/dist/modules/website/customer.d.ts +5 -0
- package/dist/modules/website/customer.d.ts.map +1 -0
- package/dist/modules/website/customer.js +442 -0
- package/dist/modules/website/customer.js.map +1 -0
- package/dist/modules/website/functions.d.ts +3 -0
- package/dist/modules/website/functions.d.ts.map +1 -0
- package/dist/modules/website/functions.js +96 -0
- package/dist/modules/website/functions.js.map +1 -0
- package/dist/modules/website/index.d.ts +4 -0
- package/dist/modules/website/index.d.ts.map +1 -0
- package/dist/modules/website/index.js +152 -0
- package/dist/modules/website/index.js.map +1 -0
- package/dist/modules/website/jobs.d.ts +3 -0
- package/dist/modules/website/jobs.d.ts.map +1 -0
- package/dist/modules/website/jobs.js +25 -0
- package/dist/modules/website/jobs.js.map +1 -0
- package/dist/modules/website/joints.d.ts +4 -0
- package/dist/modules/website/joints.d.ts.map +1 -0
- package/dist/modules/website/joints.js +7 -0
- package/dist/modules/website/joints.js.map +1 -0
- package/dist/modules/website/models.d.ts +8 -0
- package/dist/modules/website/models.d.ts.map +1 -0
- package/dist/modules/website/models.js +260 -0
- package/dist/modules/website/models.js.map +1 -0
- package/dist/modules/website/sections.d.ts +8 -0
- package/dist/modules/website/sections.d.ts.map +1 -0
- package/dist/modules/website/sections.js +16 -0
- package/dist/modules/website/sections.js.map +1 -0
- package/dist/modules/website/tokens.d.ts +2 -0
- package/dist/modules/website/tokens.d.ts.map +1 -0
- package/dist/modules/website/tokens.js +5 -0
- package/dist/modules/website/tokens.js.map +1 -0
- package/dist/modules/website/types.d.ts +6 -0
- package/dist/modules/website/types.d.ts.map +1 -0
- package/dist/modules/website/types.js +2 -0
- package/dist/modules/website/types.js.map +1 -0
- package/dist/modules/website/views.d.ts +4 -0
- package/dist/modules/website/views.d.ts.map +1 -0
- package/dist/modules/website/views.js +5 -0
- package/dist/modules/website/views.js.map +1 -0
- package/dist/modules/website_backend/index.d.ts +3 -0
- package/dist/modules/website_backend/index.d.ts.map +1 -0
- package/dist/modules/website_backend/index.js +290 -0
- package/dist/modules/website_backend/index.js.map +1 -0
- package/dist/modules/website_backend/menus.d.ts +3 -0
- package/dist/modules/website_backend/menus.d.ts.map +1 -0
- package/dist/modules/website_backend/menus.js +54 -0
- package/dist/modules/website_backend/menus.js.map +1 -0
- package/dist/modules/website_backend/routes.d.ts +3 -0
- package/dist/modules/website_backend/routes.d.ts.map +1 -0
- package/dist/modules/website_backend/routes.js +625 -0
- package/dist/modules/website_backend/routes.js.map +1 -0
- package/dist/modules/website_backend/screens.d.ts +114 -0
- package/dist/modules/website_backend/screens.d.ts.map +1 -0
- package/dist/modules/website_backend/screens.js +625 -0
- package/dist/modules/website_backend/screens.js.map +1 -0
- package/dist/modules/website_form/functions.d.ts +3 -0
- package/dist/modules/website_form/functions.d.ts.map +1 -0
- package/dist/modules/website_form/functions.js +305 -0
- package/dist/modules/website_form/functions.js.map +1 -0
- package/dist/modules/website_form/index.d.ts +3 -0
- package/dist/modules/website_form/index.d.ts.map +1 -0
- package/dist/modules/website_form/index.js +72 -0
- package/dist/modules/website_form/index.js.map +1 -0
- package/dist/modules/website_form/models.d.ts +3 -0
- package/dist/modules/website_form/models.d.ts.map +1 -0
- package/dist/modules/website_form/models.js +46 -0
- package/dist/modules/website_form/models.js.map +1 -0
- package/dist/modules/website_form/routes.d.ts +3 -0
- package/dist/modules/website_form/routes.d.ts.map +1 -0
- package/dist/modules/website_form/routes.js +74 -0
- package/dist/modules/website_form/routes.js.map +1 -0
- package/dist/modules/website_form/sections.d.ts +3 -0
- package/dist/modules/website_form/sections.d.ts.map +1 -0
- package/dist/modules/website_form/sections.js +7 -0
- package/dist/modules/website_form/sections.js.map +1 -0
- package/dist/modules/website_hospitality/content-types.d.ts +3 -0
- package/dist/modules/website_hospitality/content-types.d.ts.map +1 -0
- package/dist/modules/website_hospitality/content-types.js +9 -0
- package/dist/modules/website_hospitality/content-types.js.map +1 -0
- package/dist/modules/website_hospitality/functions.d.ts +3 -0
- package/dist/modules/website_hospitality/functions.d.ts.map +1 -0
- package/dist/modules/website_hospitality/functions.js +296 -0
- package/dist/modules/website_hospitality/functions.js.map +1 -0
- package/dist/modules/website_hospitality/index.d.ts +3 -0
- package/dist/modules/website_hospitality/index.d.ts.map +1 -0
- package/dist/modules/website_hospitality/index.js +67 -0
- package/dist/modules/website_hospitality/index.js.map +1 -0
- package/dist/modules/website_hospitality/models.d.ts +3 -0
- package/dist/modules/website_hospitality/models.d.ts.map +1 -0
- package/dist/modules/website_hospitality/models.js +49 -0
- package/dist/modules/website_hospitality/models.js.map +1 -0
- package/dist/modules/website_hospitality/routes.d.ts +3 -0
- package/dist/modules/website_hospitality/routes.d.ts.map +1 -0
- package/dist/modules/website_hospitality/routes.js +78 -0
- package/dist/modules/website_hospitality/routes.js.map +1 -0
- package/dist/modules/website_hospitality/sections.d.ts +3 -0
- package/dist/modules/website_hospitality/sections.d.ts.map +1 -0
- package/dist/modules/website_hospitality/sections.js +11 -0
- package/dist/modules/website_hospitality/sections.js.map +1 -0
- package/dist/modules/website_menu/functions.d.ts +3 -0
- package/dist/modules/website_menu/functions.d.ts.map +1 -0
- package/dist/modules/website_menu/functions.js +79 -0
- package/dist/modules/website_menu/functions.js.map +1 -0
- package/dist/modules/website_menu/index.d.ts +3 -0
- package/dist/modules/website_menu/index.d.ts.map +1 -0
- package/dist/modules/website_menu/index.js +31 -0
- package/dist/modules/website_menu/index.js.map +1 -0
- package/dist/modules/website_menu/models.d.ts +3 -0
- package/dist/modules/website_menu/models.d.ts.map +1 -0
- package/dist/modules/website_menu/models.js +15 -0
- package/dist/modules/website_menu/models.js.map +1 -0
- package/dist/modules/website_menu/sections.d.ts +3 -0
- package/dist/modules/website_menu/sections.d.ts.map +1 -0
- package/dist/modules/website_menu/sections.js +4 -0
- package/dist/modules/website_menu/sections.js.map +1 -0
- package/dist/modules/website_menu/views.d.ts +3 -0
- package/dist/modules/website_menu/views.d.ts.map +1 -0
- package/dist/modules/website_menu/views.js +4 -0
- package/dist/modules/website_menu/views.js.map +1 -0
- package/dist/modules/website_retail/content-types.d.ts +3 -0
- package/dist/modules/website_retail/content-types.d.ts.map +1 -0
- package/dist/modules/website_retail/content-types.js +10 -0
- package/dist/modules/website_retail/content-types.js.map +1 -0
- package/dist/modules/website_retail/functions.d.ts +3 -0
- package/dist/modules/website_retail/functions.d.ts.map +1 -0
- package/dist/modules/website_retail/functions.js +321 -0
- package/dist/modules/website_retail/functions.js.map +1 -0
- package/dist/modules/website_retail/index.d.ts +3 -0
- package/dist/modules/website_retail/index.d.ts.map +1 -0
- package/dist/modules/website_retail/index.js +63 -0
- package/dist/modules/website_retail/index.js.map +1 -0
- package/dist/modules/website_retail/models.d.ts +3 -0
- package/dist/modules/website_retail/models.d.ts.map +1 -0
- package/dist/modules/website_retail/models.js +50 -0
- package/dist/modules/website_retail/models.js.map +1 -0
- package/dist/modules/website_retail/sections.d.ts +3 -0
- package/dist/modules/website_retail/sections.d.ts.map +1 -0
- package/dist/modules/website_retail/sections.js +11 -0
- package/dist/modules/website_retail/sections.js.map +1 -0
- package/dist/modules/website_search/client/search.d.mts +6 -0
- package/dist/modules/website_search/client/search.d.mts.map +1 -0
- package/dist/modules/website_search/client/search.mjs +25 -0
- package/dist/modules/website_search/client/search.mjs.map +1 -0
- package/dist/modules/website_search/fills.d.ts +3 -0
- package/dist/modules/website_search/fills.d.ts.map +1 -0
- package/dist/modules/website_search/fills.js +5 -0
- package/dist/modules/website_search/fills.js.map +1 -0
- package/dist/modules/website_search/index.d.ts +3 -0
- package/dist/modules/website_search/index.d.ts.map +1 -0
- package/dist/modules/website_search/index.js +28 -0
- package/dist/modules/website_search/index.js.map +1 -0
- package/dist/modules/website_search/islands.d.ts +7 -0
- package/dist/modules/website_search/islands.d.ts.map +1 -0
- package/dist/modules/website_search/islands.js +23 -0
- package/dist/modules/website_search/islands.js.map +1 -0
- package/dist/modules/website_seo/extend.d.ts +7 -0
- package/dist/modules/website_seo/extend.d.ts.map +1 -0
- package/dist/modules/website_seo/extend.js +20 -0
- package/dist/modules/website_seo/extend.js.map +1 -0
- package/dist/modules/website_seo/fills.d.ts +3 -0
- package/dist/modules/website_seo/fills.d.ts.map +1 -0
- package/dist/modules/website_seo/fills.js +8 -0
- package/dist/modules/website_seo/fills.js.map +1 -0
- package/dist/modules/website_seo/index.d.ts +3 -0
- package/dist/modules/website_seo/index.d.ts.map +1 -0
- package/dist/modules/website_seo/index.js +30 -0
- package/dist/modules/website_seo/index.js.map +1 -0
- package/dist/modules/website_seo/views.d.ts +3 -0
- package/dist/modules/website_seo/views.d.ts.map +1 -0
- package/dist/modules/website_seo/views.js +5 -0
- package/dist/modules/website_seo/views.js.map +1 -0
- package/dist/themes/default/index.d.ts +3 -0
- package/dist/themes/default/index.d.ts.map +1 -0
- package/dist/themes/default/index.js +16 -0
- package/dist/themes/default/index.js.map +1 -0
- package/dist/themes/default/templates/layout.ktl +7 -0
- package/dist/themes/default/templates/product.detail.ktl +10 -0
- package/dist/themes/default/templates/product.related_row.ktl +1 -0
- package/dist/themes/hospitality/assets/theme.css +109 -0
- package/dist/themes/hospitality/index.d.ts +3 -0
- package/dist/themes/hospitality/index.d.ts.map +1 -0
- package/dist/themes/hospitality/index.js +26 -0
- package/dist/themes/hospitality/index.js.map +1 -0
- package/dist/themes/hospitality/templates/layout.ktl +17 -0
- package/dist/themes/hospitality/templates/menu.item.ktl +1 -0
- package/dist/themes/hospitality/templates/menu.primary.ktl +1 -0
- package/dist/themes/hospitality/templates/website.hero.ktl +6 -0
- package/dist/themes/hospitality/templates/website.page.ktl +1 -0
- package/dist/themes/hospitality/templates/website.rich_text.ktl +3 -0
- package/dist/themes/hospitality/templates/website_form.form.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.booking.ktl +1 -0
- package/dist/themes/hospitality/templates/website_hospitality.stays.ktl +1 -0
- package/dist/themes/hospitality/tokens.d.ts +2 -0
- package/dist/themes/hospitality/tokens.d.ts.map +1 -0
- package/dist/themes/hospitality/tokens.js +9 -0
- package/dist/themes/hospitality/tokens.js.map +1 -0
- package/dist/themes/paper/index.d.ts +9 -0
- package/dist/themes/paper/index.d.ts.map +1 -0
- package/dist/themes/paper/index.js +30 -0
- package/dist/themes/paper/index.js.map +1 -0
- package/dist/themes/paper/templates/layout.ktl +14 -0
- package/dist/themes/paper/templates/menu.item.ktl +3 -0
- package/dist/themes/paper/templates/menu.primary.ktl +3 -0
- package/dist/themes/paper/templates/website.hero.ktl +6 -0
- package/dist/themes/paper/templates/website.page.ktl +2 -0
- package/dist/themes/paper/templates/website.rich_text.ktl +4 -0
- package/dist/themes/paper/tokens.d.ts +2 -0
- package/dist/themes/paper/tokens.d.ts.map +1 -0
- package/dist/themes/paper/tokens.js +11 -0
- package/dist/themes/paper/tokens.js.map +1 -0
- package/dist/themes/retail/assets/theme.css +114 -0
- package/dist/themes/retail/index.d.ts +3 -0
- package/dist/themes/retail/index.d.ts.map +1 -0
- package/dist/themes/retail/index.js +26 -0
- package/dist/themes/retail/index.js.map +1 -0
- package/dist/themes/retail/templates/layout.ktl +5 -0
- package/dist/themes/retail/templates/menu.item.ktl +1 -0
- package/dist/themes/retail/templates/menu.primary.ktl +1 -0
- package/dist/themes/retail/templates/website.hero.ktl +1 -0
- package/dist/themes/retail/templates/website.page.ktl +1 -0
- package/dist/themes/retail/templates/website.rich_text.ktl +1 -0
- package/dist/themes/retail/templates/website_form.form.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.cart.ktl +1 -0
- package/dist/themes/retail/templates/website_retail.products.ktl +1 -0
- package/dist/themes/retail/tokens.d.ts +2 -0
- package/dist/themes/retail/tokens.d.ts.map +1 -0
- package/dist/themes/retail/tokens.js +9 -0
- package/dist/themes/retail/tokens.js.map +1 -0
- package/dist/ui/actions.d.ts +38 -0
- package/dist/ui/actions.d.ts.map +1 -0
- package/dist/ui/actions.js +20 -0
- package/dist/ui/actions.js.map +1 -0
- package/dist/ui/activity.d.ts +4 -0
- package/dist/ui/activity.d.ts.map +1 -0
- package/dist/ui/activity.js +73 -0
- package/dist/ui/activity.js.map +1 -0
- package/dist/ui/attachments.d.ts +18 -0
- package/dist/ui/attachments.d.ts.map +1 -0
- package/dist/ui/attachments.js +15 -0
- package/dist/ui/attachments.js.map +1 -0
- package/dist/ui/auth.d.ts +9 -0
- package/dist/ui/auth.d.ts.map +1 -0
- package/dist/ui/auth.js +44 -0
- package/dist/ui/auth.js.map +1 -0
- package/dist/ui/calendar.d.ts +4 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +51 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/chrome.d.ts +66 -0
- package/dist/ui/chrome.d.ts.map +1 -0
- package/dist/ui/chrome.js +39 -0
- package/dist/ui/chrome.js.map +1 -0
- package/dist/ui/client/activity-view.d.mts +12 -0
- package/dist/ui/client/activity-view.d.mts.map +1 -0
- package/dist/ui/client/activity-view.mjs +393 -0
- package/dist/ui/client/activity-view.mjs.map +1 -0
- package/dist/ui/client/activity.css +269 -0
- package/dist/ui/client/activity.d.mts +11 -0
- package/dist/ui/client/activity.d.mts.map +1 -0
- package/dist/ui/client/activity.mjs +10 -0
- package/dist/ui/client/activity.mjs.map +1 -0
- package/dist/ui/client/calendar-view.d.mts +5 -0
- package/dist/ui/client/calendar-view.d.mts.map +1 -0
- package/dist/ui/client/calendar-view.mjs +266 -0
- package/dist/ui/client/calendar-view.mjs.map +1 -0
- package/dist/ui/client/calendar.css +170 -0
- package/dist/ui/client/calendar.d.mts +6 -0
- package/dist/ui/client/calendar.d.mts.map +1 -0
- package/dist/ui/client/calendar.mjs +6 -0
- package/dist/ui/client/calendar.mjs.map +1 -0
- package/dist/ui/client/mail-view.d.mts +9 -0
- package/dist/ui/client/mail-view.d.mts.map +1 -0
- package/dist/ui/client/mail-view.mjs +350 -0
- package/dist/ui/client/mail-view.mjs.map +1 -0
- package/dist/ui/client/mail.css +230 -0
- package/dist/ui/client/mail.d.mts +11 -0
- package/dist/ui/client/mail.d.mts.map +1 -0
- package/dist/ui/client/mail.mjs +10 -0
- package/dist/ui/client/mail.mjs.map +1 -0
- package/dist/ui/data.d.ts +25 -0
- package/dist/ui/data.d.ts.map +1 -0
- package/dist/ui/data.js +23 -0
- package/dist/ui/data.js.map +1 -0
- package/dist/ui/date-picker.d.ts +36 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +40 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/form.d.ts +67 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +75 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/format.d.ts +4 -0
- package/dist/ui/format.d.ts.map +1 -0
- package/dist/ui/format.js +33 -0
- package/dist/ui/format.js.map +1 -0
- package/dist/ui/hooks.d.ts +5 -0
- package/dist/ui/hooks.d.ts.map +1 -0
- package/dist/ui/hooks.js +82 -0
- package/dist/ui/hooks.js.map +1 -0
- package/dist/ui/icons.d.ts +12 -0
- package/dist/ui/icons.d.ts.map +1 -0
- package/dist/ui/icons.js +76 -0
- package/dist/ui/icons.js.map +1 -0
- package/dist/ui/index.d.ts +39 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +39 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout.d.ts +80 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +86 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/mail.d.ts +5 -0
- package/dist/ui/mail.d.ts.map +1 -0
- package/dist/ui/mail.js +69 -0
- package/dist/ui/mail.js.map +1 -0
- package/dist/ui/media.d.ts +42 -0
- package/dist/ui/media.d.ts.map +1 -0
- package/dist/ui/media.js +48 -0
- package/dist/ui/media.js.map +1 -0
- package/dist/ui/modal.d.ts +9 -0
- package/dist/ui/modal.d.ts.map +1 -0
- package/dist/ui/modal.js +13 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/nav.d.ts +34 -0
- package/dist/ui/nav.d.ts.map +1 -0
- package/dist/ui/nav.js +77 -0
- package/dist/ui/nav.js.map +1 -0
- package/dist/ui/navigation.d.ts +22 -0
- package/dist/ui/navigation.d.ts.map +1 -0
- package/dist/ui/navigation.js +9 -0
- package/dist/ui/navigation.js.map +1 -0
- package/dist/ui/primitives.d.ts +61 -0
- package/dist/ui/primitives.d.ts.map +1 -0
- package/dist/ui/primitives.js +74 -0
- package/dist/ui/primitives.js.map +1 -0
- package/dist/ui/record.d.ts +44 -0
- package/dist/ui/record.d.ts.map +1 -0
- package/dist/ui/record.js +39 -0
- package/dist/ui/record.js.map +1 -0
- package/dist/ui/schedule.d.ts +34 -0
- package/dist/ui/schedule.d.ts.map +1 -0
- package/dist/ui/schedule.js +39 -0
- package/dist/ui/schedule.js.map +1 -0
- package/dist/ui/state.d.ts +19 -0
- package/dist/ui/state.d.ts.map +1 -0
- package/dist/ui/state.js +34 -0
- package/dist/ui/state.js.map +1 -0
- package/dist/ui/surfaces.d.ts +38 -0
- package/dist/ui/surfaces.d.ts.map +1 -0
- package/dist/ui/surfaces.js +36 -0
- package/dist/ui/surfaces.js.map +1 -0
- package/dist/ui/table.d.ts +48 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +53 -0
- package/dist/ui/table.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,1523 @@
|
|
|
1
|
+
import { defineFn, eq, from } from '@ketvietlab/ketjs';
|
|
2
|
+
import { compareQty } from '../uom/convert.js';
|
|
3
|
+
import { pushFromCompletedMove } from './routing.js';
|
|
4
|
+
export const RECEPTION_STEPS = ['one_step', 'two_steps', 'three_steps'];
|
|
5
|
+
export const DELIVERY_STEPS = ['ship_only', 'pick_ship', 'pick_pack_ship'];
|
|
6
|
+
export const PICKING_TYPE_CODES = ['incoming', 'outgoing', 'internal'];
|
|
7
|
+
export const LOCATION_USAGES = [
|
|
8
|
+
'supplier',
|
|
9
|
+
'view',
|
|
10
|
+
'internal',
|
|
11
|
+
'customer',
|
|
12
|
+
'inventory',
|
|
13
|
+
'production',
|
|
14
|
+
'transit',
|
|
15
|
+
];
|
|
16
|
+
export const MOVE_STATES = [
|
|
17
|
+
'draft',
|
|
18
|
+
'waiting',
|
|
19
|
+
'confirmed',
|
|
20
|
+
'partially_available',
|
|
21
|
+
'assigned',
|
|
22
|
+
'done',
|
|
23
|
+
'cancel',
|
|
24
|
+
];
|
|
25
|
+
export const PICKING_STATES = ['draft', 'waiting', 'confirmed', 'assigned', 'done', 'cancel'];
|
|
26
|
+
export const TRACKING = ['none', 'lot', 'serial'];
|
|
27
|
+
const invalid = (field, message) => ({ ok: false, errors: [{ field, message }] });
|
|
28
|
+
const company = (ctx) => {
|
|
29
|
+
if (!ctx.scope.company)
|
|
30
|
+
throw new Error('stock operation requires a company in scope');
|
|
31
|
+
return ctx.scope.company;
|
|
32
|
+
};
|
|
33
|
+
const lotKey = (lotId) => (lotId == null ? '' : String(lotId));
|
|
34
|
+
const quantId = (ctx, productId, locationId, lotId) => `${company(ctx)}:${String(productId)}:${String(locationId)}:${lotKey(lotId) || '_'}`;
|
|
35
|
+
async function trackingOf(ctx, productId) {
|
|
36
|
+
const product = (await ctx.db.select('product.Product', { id: productId }))[0];
|
|
37
|
+
if (!product)
|
|
38
|
+
throw new Error(`unknown product ${String(productId)}`);
|
|
39
|
+
const template = (await ctx.db.select('product.Template', { id: product.templateId }))[0];
|
|
40
|
+
const tracking = String(template?.tracking ?? 'none');
|
|
41
|
+
return TRACKING.includes(tracking) ? tracking : 'none';
|
|
42
|
+
}
|
|
43
|
+
async function isStorable(ctx, productId) {
|
|
44
|
+
const product = (await ctx.db.select('product.Product', { id: productId }))[0];
|
|
45
|
+
const template = product && (await ctx.db.select('product.Template', { id: product.templateId }))[0];
|
|
46
|
+
return Boolean(template?.isStorable);
|
|
47
|
+
}
|
|
48
|
+
async function mutateQuant(ctx, args) {
|
|
49
|
+
const id = quantId(ctx, args.productId, args.locationId, args.lotId);
|
|
50
|
+
for (let attempt = 0; attempt < 8; attempt++) {
|
|
51
|
+
const current = (await ctx.db.select('stock.Quant', { id }))[0];
|
|
52
|
+
if (!current) {
|
|
53
|
+
// Odoo keeps the other side of completed moves on supplier, customer and
|
|
54
|
+
// inventory locations as well. Those virtual locations legitimately carry
|
|
55
|
+
// negative quantities; only a positive physical balance can be reserved.
|
|
56
|
+
if (args.reserved < 0 || args.reserved > Math.max(args.quantity, 0))
|
|
57
|
+
throw new Error('quant cannot become over-reserved');
|
|
58
|
+
const inserted = await ctx.db.insertIfAbsent('stock.Quant', {
|
|
59
|
+
id,
|
|
60
|
+
productId: args.productId,
|
|
61
|
+
locationId: args.locationId,
|
|
62
|
+
lotId: args.lotId ?? null,
|
|
63
|
+
lotKey: lotKey(args.lotId),
|
|
64
|
+
quantity: String(args.quantity),
|
|
65
|
+
reservedQuantity: String(args.reserved),
|
|
66
|
+
inDate: new Date().toISOString(),
|
|
67
|
+
version: 0,
|
|
68
|
+
});
|
|
69
|
+
// A dry run writes nothing, so there is no row to re-read and nothing for the
|
|
70
|
+
// retry loop to converge on. Report the quant that would have been created
|
|
71
|
+
// rather than spinning eight times and blaming concurrency.
|
|
72
|
+
if ('dryRun' in inserted)
|
|
73
|
+
return {
|
|
74
|
+
id,
|
|
75
|
+
productId: args.productId,
|
|
76
|
+
locationId: args.locationId,
|
|
77
|
+
lotId: args.lotId ?? null,
|
|
78
|
+
lotKey: lotKey(args.lotId),
|
|
79
|
+
quantity: args.quantity,
|
|
80
|
+
reservedQuantity: args.reserved,
|
|
81
|
+
version: 0,
|
|
82
|
+
};
|
|
83
|
+
if (inserted.inserted)
|
|
84
|
+
return (await ctx.db.select('stock.Quant', { id }))[0];
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const quantity = Number(current.quantity) + args.quantity;
|
|
88
|
+
const reservedQuantity = Number(current.reservedQuantity) + args.reserved;
|
|
89
|
+
if (reservedQuantity < -1e-12 || reservedQuantity - Math.max(quantity, 0) > 1e-12)
|
|
90
|
+
throw new Error(`quant ${id} cannot become over-reserved`);
|
|
91
|
+
const changed = await ctx.db.compareAndSet('stock.Quant', { id }, {
|
|
92
|
+
quantity: current.quantity,
|
|
93
|
+
reservedQuantity: current.reservedQuantity,
|
|
94
|
+
version: current.version,
|
|
95
|
+
}, {
|
|
96
|
+
quantity: String(quantity),
|
|
97
|
+
reservedQuantity: String(reservedQuantity),
|
|
98
|
+
version: Number(current.version) + 1,
|
|
99
|
+
});
|
|
100
|
+
if ('dryRun' in changed || changed.matched)
|
|
101
|
+
return { ...current, quantity, reservedQuantity, version: Number(current.version) + 1 };
|
|
102
|
+
}
|
|
103
|
+
throw new Error(`concurrent quant update did not settle for ${id}`);
|
|
104
|
+
}
|
|
105
|
+
/** How much of a quant is already spoken for; 0 when the quant does not exist. */
|
|
106
|
+
async function reservedOn(ctx, productId, locationId, lotId) {
|
|
107
|
+
const id = quantId(ctx, productId, locationId, lotId);
|
|
108
|
+
const quant = (await ctx.db.select('stock.Quant', { id }))[0];
|
|
109
|
+
return quant ? Number(quant.reservedQuantity) : 0;
|
|
110
|
+
}
|
|
111
|
+
async function updatePickingState(ctx, pickingId) {
|
|
112
|
+
const picking = (await ctx.db.select('stock.Picking', { id: pickingId }))[0];
|
|
113
|
+
// draft belongs to confirmPicking and cancel is terminal. Deriving a state from the
|
|
114
|
+
// moves and writing it unconditionally let a reservation confirm a draft transfer
|
|
115
|
+
// and resurrect a cancelled one.
|
|
116
|
+
if (!picking || picking.state === 'draft' || picking.state === 'cancel')
|
|
117
|
+
return;
|
|
118
|
+
const moves = await ctx.db.select('stock.Move', { pickingId });
|
|
119
|
+
const live = moves.filter((move) => move.state !== 'cancel');
|
|
120
|
+
let state = 'confirmed';
|
|
121
|
+
if (moves.length && !live.length)
|
|
122
|
+
state = 'cancel';
|
|
123
|
+
else if (live.length && live.every((move) => move.state === 'done'))
|
|
124
|
+
state = 'done';
|
|
125
|
+
else if (live.some((move) => move.state === 'assigned' || move.state === 'partially_available'))
|
|
126
|
+
state = 'assigned';
|
|
127
|
+
else if (live.some((move) => move.state === 'waiting'))
|
|
128
|
+
state = 'waiting';
|
|
129
|
+
await ctx.db.update('stock.Picking', { id: pickingId }, { state });
|
|
130
|
+
}
|
|
131
|
+
export const functions = {
|
|
132
|
+
listStorableProducts: defineFn({
|
|
133
|
+
input: {},
|
|
134
|
+
effects: ['read:product.Template', 'read:product.Product'],
|
|
135
|
+
agent: true,
|
|
136
|
+
handler: (ctx) => {
|
|
137
|
+
const Template = ctx.table('product.Template');
|
|
138
|
+
return ctx.db.all(from(Template)
|
|
139
|
+
.where(eq(Template.active, true))
|
|
140
|
+
.where(eq(Template.isStorable, true))
|
|
141
|
+
.preload('variants'));
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
getProductConfig: defineFn({
|
|
145
|
+
input: { templateId: 'id' },
|
|
146
|
+
output: { templateId: 'id', isStorable: 'bool', tracking: 'text' },
|
|
147
|
+
effects: ['read:product.Template'],
|
|
148
|
+
agent: true,
|
|
149
|
+
handler: async (ctx, args) => {
|
|
150
|
+
const template = (await ctx.db.select('product.Template', { id: args.templateId }))[0];
|
|
151
|
+
return template
|
|
152
|
+
? {
|
|
153
|
+
templateId: args.templateId,
|
|
154
|
+
isStorable: Boolean(template.isStorable),
|
|
155
|
+
tracking: String(template.tracking ?? 'none'),
|
|
156
|
+
}
|
|
157
|
+
: null;
|
|
158
|
+
},
|
|
159
|
+
}),
|
|
160
|
+
configureProduct: defineFn({
|
|
161
|
+
input: { templateId: 'id', isStorable: 'bool', tracking: 'text?' },
|
|
162
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
163
|
+
effects: ['read:product.Template', 'write:product.Template'],
|
|
164
|
+
idempotent: true,
|
|
165
|
+
agent: true,
|
|
166
|
+
handler: async (ctx, args) => {
|
|
167
|
+
const template = (await ctx.db.select('product.Template', { id: args.templateId }))[0];
|
|
168
|
+
if (!template)
|
|
169
|
+
return invalid('templateId', 'template không tồn tại');
|
|
170
|
+
const tracking = String(args.tracking ?? 'none');
|
|
171
|
+
if (!TRACKING.includes(tracking))
|
|
172
|
+
return invalid('tracking', `phải là: ${TRACKING.join(', ')}`);
|
|
173
|
+
if (!args.isStorable && tracking !== 'none')
|
|
174
|
+
return invalid('tracking', 'sản phẩm không lưu kho phải dùng tracking none');
|
|
175
|
+
await ctx.db.update('product.Template', { id: args.templateId }, { isStorable: args.isStorable, tracking });
|
|
176
|
+
return { ok: true, id: args.templateId };
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
listWarehouses: defineFn({
|
|
180
|
+
input: {},
|
|
181
|
+
effects: ['read:stock.Warehouse'],
|
|
182
|
+
agent: true,
|
|
183
|
+
handler: (ctx) => ctx.db.select('stock.Warehouse', { active: true }),
|
|
184
|
+
}),
|
|
185
|
+
listPickings: defineFn({
|
|
186
|
+
input: { state: 'text?' },
|
|
187
|
+
effects: ['read:stock.Picking'],
|
|
188
|
+
agent: true,
|
|
189
|
+
handler: async (ctx, args) => args.state ? ctx.db.select('stock.Picking', { state: args.state }) : ctx.db.select('stock.Picking'),
|
|
190
|
+
}),
|
|
191
|
+
getPicking: defineFn({
|
|
192
|
+
input: { id: 'id' },
|
|
193
|
+
effects: ['read:stock.Picking', 'read:stock.Move', 'read:stock.MoveLine'],
|
|
194
|
+
agent: true,
|
|
195
|
+
handler: async (ctx, args) => {
|
|
196
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
197
|
+
if (!picking)
|
|
198
|
+
return null;
|
|
199
|
+
const moves = await ctx.db.select('stock.Move', { pickingId: args.id });
|
|
200
|
+
return {
|
|
201
|
+
...picking,
|
|
202
|
+
moves: await Promise.all(moves.map(async (move) => ({
|
|
203
|
+
...move,
|
|
204
|
+
lines: await ctx.db.select('stock.MoveLine', { moveId: move.id }),
|
|
205
|
+
}))),
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
}),
|
|
209
|
+
listLocations: defineFn({
|
|
210
|
+
input: { warehouseId: 'id?' },
|
|
211
|
+
effects: ['read:stock.Location'],
|
|
212
|
+
agent: true,
|
|
213
|
+
handler: (ctx, args) => ctx.db.select('stock.Location', args.warehouseId ? { warehouseId: args.warehouseId } : {}),
|
|
214
|
+
}),
|
|
215
|
+
listPickingTypes: defineFn({
|
|
216
|
+
input: {},
|
|
217
|
+
effects: ['read:stock.PickingType'],
|
|
218
|
+
agent: true,
|
|
219
|
+
handler: (ctx) => ctx.db.select('stock.PickingType', { active: true }),
|
|
220
|
+
}),
|
|
221
|
+
listLots: defineFn({
|
|
222
|
+
input: { productId: 'id?' },
|
|
223
|
+
effects: ['read:stock.Lot'],
|
|
224
|
+
agent: true,
|
|
225
|
+
handler: (ctx, args) => ctx.db.select('stock.Lot', args.productId ? { productId: args.productId } : {}),
|
|
226
|
+
}),
|
|
227
|
+
listQuants: defineFn({
|
|
228
|
+
input: { productId: 'id?', locationId: 'id?' },
|
|
229
|
+
effects: ['read:stock.Quant'],
|
|
230
|
+
agent: true,
|
|
231
|
+
handler: (ctx, args) => ctx.db.select('stock.Quant', {
|
|
232
|
+
...(args.productId ? { productId: args.productId } : {}),
|
|
233
|
+
...(args.locationId ? { locationId: args.locationId } : {}),
|
|
234
|
+
}),
|
|
235
|
+
}),
|
|
236
|
+
saveWarehouse: defineFn({
|
|
237
|
+
input: { id: 'id', name: 'text', code: 'text', receptionSteps: 'text?', deliverySteps: 'text?' },
|
|
238
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
239
|
+
effects: [
|
|
240
|
+
'read:stock.Warehouse',
|
|
241
|
+
'write:stock.Warehouse',
|
|
242
|
+
'read:stock.Location',
|
|
243
|
+
'write:stock.Location',
|
|
244
|
+
'read:stock.PickingType',
|
|
245
|
+
'write:stock.PickingType',
|
|
246
|
+
'read:stock.Route',
|
|
247
|
+
'write:stock.Route',
|
|
248
|
+
'read:stock.Rule',
|
|
249
|
+
'write:stock.Rule',
|
|
250
|
+
'read:stock.WarehouseRoute',
|
|
251
|
+
'write:stock.WarehouseRoute',
|
|
252
|
+
],
|
|
253
|
+
idempotent: true,
|
|
254
|
+
agent: true,
|
|
255
|
+
handler: async (ctx, args) => {
|
|
256
|
+
const receptionSteps = args.receptionSteps ?? 'one_step';
|
|
257
|
+
const deliverySteps = args.deliverySteps ?? 'ship_only';
|
|
258
|
+
if (!RECEPTION_STEPS.includes(receptionSteps))
|
|
259
|
+
return invalid('receptionSteps', `phải là: ${RECEPTION_STEPS.join(', ')}`);
|
|
260
|
+
if (!DELIVERY_STEPS.includes(deliverySteps))
|
|
261
|
+
return invalid('deliverySteps', `phải là: ${DELIVERY_STEPS.join(', ')}`);
|
|
262
|
+
const existing = (await ctx.db.select('stock.Warehouse', { id: args.id }))[0];
|
|
263
|
+
const values = { ...args, receptionSteps, deliverySteps, active: true };
|
|
264
|
+
const cs = ctx
|
|
265
|
+
.change('stock.Warehouse', values, existing ?? null)
|
|
266
|
+
.cast(['id', 'name', 'code', 'receptionSteps', 'deliverySteps', 'active'])
|
|
267
|
+
.required(['name', 'code']);
|
|
268
|
+
if (!cs.valid)
|
|
269
|
+
return { ok: false, errors: cs.errors };
|
|
270
|
+
await ctx.tx(async (tx) => {
|
|
271
|
+
await tx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
272
|
+
const viewId = `${String(args.id)}:view`;
|
|
273
|
+
const locations = [
|
|
274
|
+
{ suffix: 'view', name: String(args.name), usage: 'view', parentId: null, active: true },
|
|
275
|
+
{ suffix: 'stock', name: 'Stock', usage: 'internal', parentId: viewId, active: true },
|
|
276
|
+
{
|
|
277
|
+
suffix: 'input',
|
|
278
|
+
name: 'Input',
|
|
279
|
+
usage: 'internal',
|
|
280
|
+
parentId: viewId,
|
|
281
|
+
active: receptionSteps !== 'one_step',
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
suffix: 'quality',
|
|
285
|
+
name: 'Quality',
|
|
286
|
+
usage: 'internal',
|
|
287
|
+
parentId: viewId,
|
|
288
|
+
active: receptionSteps === 'three_steps',
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
suffix: 'output',
|
|
292
|
+
name: 'Output',
|
|
293
|
+
usage: 'internal',
|
|
294
|
+
parentId: viewId,
|
|
295
|
+
active: deliverySteps !== 'ship_only',
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
suffix: 'pick',
|
|
299
|
+
name: 'Pick',
|
|
300
|
+
usage: 'internal',
|
|
301
|
+
parentId: viewId,
|
|
302
|
+
active: deliverySteps !== 'ship_only',
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
suffix: 'pack',
|
|
306
|
+
name: 'Pack',
|
|
307
|
+
usage: 'internal',
|
|
308
|
+
parentId: viewId,
|
|
309
|
+
active: deliverySteps === 'pick_pack_ship',
|
|
310
|
+
},
|
|
311
|
+
{ suffix: 'supplier', name: 'Supplier', usage: 'supplier', parentId: null, active: true },
|
|
312
|
+
{ suffix: 'customer', name: 'Customer', usage: 'customer', parentId: null, active: true },
|
|
313
|
+
];
|
|
314
|
+
for (const location of locations) {
|
|
315
|
+
const id = `${String(args.id)}:${location.suffix}`;
|
|
316
|
+
const values = {
|
|
317
|
+
name: location.name,
|
|
318
|
+
usage: location.usage,
|
|
319
|
+
parentId: location.parentId,
|
|
320
|
+
parentPath: location.parentId ? `${viewId}/${id}/` : `${id}/`,
|
|
321
|
+
warehouseId: args.id,
|
|
322
|
+
active: location.active,
|
|
323
|
+
};
|
|
324
|
+
const found = (await tx.db.select('stock.Location', { id }))[0];
|
|
325
|
+
if (found)
|
|
326
|
+
await tx.db.update('stock.Location', { id }, values);
|
|
327
|
+
else
|
|
328
|
+
await tx.db.insert('stock.Location', { id, ...values });
|
|
329
|
+
}
|
|
330
|
+
const incomingDestination = receptionSteps === 'one_step' ? `${String(args.id)}:stock` : `${String(args.id)}:input`;
|
|
331
|
+
const outgoingSource = deliverySteps === 'ship_only' ? `${String(args.id)}:stock` : `${String(args.id)}:output`;
|
|
332
|
+
const types = [
|
|
333
|
+
{
|
|
334
|
+
id: `${String(args.id)}:incoming`,
|
|
335
|
+
name: 'Receipts',
|
|
336
|
+
code: 'incoming',
|
|
337
|
+
source: `${String(args.id)}:supplier`,
|
|
338
|
+
destination: incomingDestination,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: `${String(args.id)}:outgoing`,
|
|
342
|
+
name: 'Delivery Orders',
|
|
343
|
+
code: 'outgoing',
|
|
344
|
+
source: outgoingSource,
|
|
345
|
+
destination: `${String(args.id)}:customer`,
|
|
346
|
+
active: true,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
id: `${String(args.id)}:internal`,
|
|
350
|
+
name: 'Internal Transfers',
|
|
351
|
+
code: 'internal',
|
|
352
|
+
source: `${String(args.id)}:stock`,
|
|
353
|
+
destination: `${String(args.id)}:output`,
|
|
354
|
+
active: true,
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
id: `${String(args.id)}:quality`,
|
|
358
|
+
name: 'Quality Control',
|
|
359
|
+
code: 'internal',
|
|
360
|
+
source: `${String(args.id)}:input`,
|
|
361
|
+
destination: `${String(args.id)}:quality`,
|
|
362
|
+
active: receptionSteps === 'three_steps',
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
id: `${String(args.id)}:store`,
|
|
366
|
+
name: 'Store',
|
|
367
|
+
code: 'internal',
|
|
368
|
+
source: receptionSteps === 'three_steps' ? `${String(args.id)}:quality` : `${String(args.id)}:input`,
|
|
369
|
+
destination: `${String(args.id)}:stock`,
|
|
370
|
+
active: receptionSteps !== 'one_step',
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: `${String(args.id)}:pick`,
|
|
374
|
+
name: 'Pick',
|
|
375
|
+
code: 'internal',
|
|
376
|
+
source: `${String(args.id)}:stock`,
|
|
377
|
+
destination: deliverySteps === 'pick_pack_ship' ? `${String(args.id)}:pack` : `${String(args.id)}:output`,
|
|
378
|
+
active: deliverySteps !== 'ship_only',
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
id: `${String(args.id)}:pack`,
|
|
382
|
+
name: 'Pack',
|
|
383
|
+
code: 'internal',
|
|
384
|
+
source: `${String(args.id)}:pack`,
|
|
385
|
+
destination: `${String(args.id)}:output`,
|
|
386
|
+
active: deliverySteps === 'pick_pack_ship',
|
|
387
|
+
},
|
|
388
|
+
];
|
|
389
|
+
for (const type of types) {
|
|
390
|
+
const values = {
|
|
391
|
+
name: type.name,
|
|
392
|
+
code: type.code,
|
|
393
|
+
warehouseId: args.id,
|
|
394
|
+
defaultLocationSrcId: type.source,
|
|
395
|
+
defaultLocationDestId: type.destination,
|
|
396
|
+
createBackorder: 'ask',
|
|
397
|
+
active: type.active ?? true,
|
|
398
|
+
};
|
|
399
|
+
const found = (await tx.db.select('stock.PickingType', { id: type.id }))[0];
|
|
400
|
+
if (found)
|
|
401
|
+
await tx.db.update('stock.PickingType', { id: type.id }, values);
|
|
402
|
+
else
|
|
403
|
+
await tx.db.insert('stock.PickingType', { id: type.id, ...values });
|
|
404
|
+
}
|
|
405
|
+
const warehouseId = String(args.id);
|
|
406
|
+
const receiptRouteId = `${warehouseId}:receipt-route`;
|
|
407
|
+
const deliveryRouteId = `${warehouseId}:delivery-route`;
|
|
408
|
+
const routes = [
|
|
409
|
+
{ id: receiptRouteId, name: `${String(args.name)}: ${receptionSteps}`, sequence: 50 },
|
|
410
|
+
{ id: deliveryRouteId, name: `${String(args.name)}: ${deliverySteps}`, sequence: 60 },
|
|
411
|
+
];
|
|
412
|
+
for (const route of routes) {
|
|
413
|
+
const found = (await tx.db.select('stock.Route', { id: route.id }))[0];
|
|
414
|
+
const values = { name: route.name, sequence: route.sequence, active: true };
|
|
415
|
+
if (found)
|
|
416
|
+
await tx.db.update('stock.Route', { id: route.id }, values);
|
|
417
|
+
else
|
|
418
|
+
await tx.db.insert('stock.Route', { id: route.id, ...values });
|
|
419
|
+
await tx.db.insertIfAbsent('stock.WarehouseRoute', {
|
|
420
|
+
id: `${company(tx)}:${warehouseId}:${route.id}`,
|
|
421
|
+
warehouseId: args.id,
|
|
422
|
+
routeId: route.id,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
// The subset executes route chains backwards from demand, so each leg is
|
|
426
|
+
// represented as a pull rule. The resulting locations and operation types
|
|
427
|
+
// match Odoo 19's receipt/delivery topology.
|
|
428
|
+
const ruleDefinitions = [
|
|
429
|
+
{
|
|
430
|
+
id: `${warehouseId}:receipt:supplier-stock`,
|
|
431
|
+
name: 'Receive in Stock',
|
|
432
|
+
routeId: receiptRouteId,
|
|
433
|
+
source: `${warehouseId}:supplier`,
|
|
434
|
+
destination: `${warehouseId}:stock`,
|
|
435
|
+
pickingTypeId: `${warehouseId}:incoming`,
|
|
436
|
+
active: receptionSteps === 'one_step',
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
id: `${warehouseId}:receipt:supplier-input`,
|
|
440
|
+
name: 'Receive in Input',
|
|
441
|
+
routeId: receiptRouteId,
|
|
442
|
+
source: `${warehouseId}:supplier`,
|
|
443
|
+
destination: `${warehouseId}:input`,
|
|
444
|
+
pickingTypeId: `${warehouseId}:incoming`,
|
|
445
|
+
active: receptionSteps !== 'one_step',
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: `${warehouseId}:receipt:input-stock`,
|
|
449
|
+
name: 'Input to Stock',
|
|
450
|
+
routeId: receiptRouteId,
|
|
451
|
+
source: `${warehouseId}:input`,
|
|
452
|
+
destination: `${warehouseId}:stock`,
|
|
453
|
+
pickingTypeId: `${warehouseId}:store`,
|
|
454
|
+
active: receptionSteps === 'two_steps',
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: `${warehouseId}:receipt:input-quality`,
|
|
458
|
+
name: 'Input to Quality',
|
|
459
|
+
routeId: receiptRouteId,
|
|
460
|
+
source: `${warehouseId}:input`,
|
|
461
|
+
destination: `${warehouseId}:quality`,
|
|
462
|
+
pickingTypeId: `${warehouseId}:quality`,
|
|
463
|
+
active: receptionSteps === 'three_steps',
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
id: `${warehouseId}:receipt:quality-stock`,
|
|
467
|
+
name: 'Quality to Stock',
|
|
468
|
+
routeId: receiptRouteId,
|
|
469
|
+
source: `${warehouseId}:quality`,
|
|
470
|
+
destination: `${warehouseId}:stock`,
|
|
471
|
+
pickingTypeId: `${warehouseId}:store`,
|
|
472
|
+
active: receptionSteps === 'three_steps',
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: `${warehouseId}:delivery:stock-customer`,
|
|
476
|
+
name: 'Deliver from Stock',
|
|
477
|
+
routeId: deliveryRouteId,
|
|
478
|
+
source: `${warehouseId}:stock`,
|
|
479
|
+
destination: `${warehouseId}:customer`,
|
|
480
|
+
pickingTypeId: `${warehouseId}:outgoing`,
|
|
481
|
+
active: deliverySteps === 'ship_only',
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: `${warehouseId}:delivery:stock-output`,
|
|
485
|
+
name: 'Pick to Output',
|
|
486
|
+
routeId: deliveryRouteId,
|
|
487
|
+
source: `${warehouseId}:stock`,
|
|
488
|
+
destination: `${warehouseId}:output`,
|
|
489
|
+
pickingTypeId: `${warehouseId}:pick`,
|
|
490
|
+
procureMethod: 'make_to_stock',
|
|
491
|
+
active: deliverySteps === 'pick_ship',
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
id: `${warehouseId}:delivery:stock-pack`,
|
|
495
|
+
name: 'Pick to Pack',
|
|
496
|
+
routeId: deliveryRouteId,
|
|
497
|
+
source: `${warehouseId}:stock`,
|
|
498
|
+
destination: `${warehouseId}:pack`,
|
|
499
|
+
pickingTypeId: `${warehouseId}:pick`,
|
|
500
|
+
procureMethod: 'make_to_stock',
|
|
501
|
+
active: deliverySteps === 'pick_pack_ship',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
id: `${warehouseId}:delivery:pack-output`,
|
|
505
|
+
name: 'Pack to Output',
|
|
506
|
+
routeId: deliveryRouteId,
|
|
507
|
+
source: `${warehouseId}:pack`,
|
|
508
|
+
destination: `${warehouseId}:output`,
|
|
509
|
+
pickingTypeId: `${warehouseId}:pack`,
|
|
510
|
+
active: deliverySteps === 'pick_pack_ship',
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
id: `${warehouseId}:delivery:output-customer`,
|
|
514
|
+
name: 'Ship from Output',
|
|
515
|
+
routeId: deliveryRouteId,
|
|
516
|
+
source: `${warehouseId}:output`,
|
|
517
|
+
destination: `${warehouseId}:customer`,
|
|
518
|
+
pickingTypeId: `${warehouseId}:outgoing`,
|
|
519
|
+
active: deliverySteps !== 'ship_only',
|
|
520
|
+
},
|
|
521
|
+
];
|
|
522
|
+
for (const [sequence, rule] of ruleDefinitions.entries()) {
|
|
523
|
+
const values = {
|
|
524
|
+
name: rule.name,
|
|
525
|
+
routeId: rule.routeId,
|
|
526
|
+
action: 'pull',
|
|
527
|
+
sequence: sequence + 10,
|
|
528
|
+
locationSrcId: rule.source,
|
|
529
|
+
locationDestId: rule.destination,
|
|
530
|
+
pickingTypeId: rule.pickingTypeId,
|
|
531
|
+
procureMethod: rule.procureMethod ?? 'make_to_order',
|
|
532
|
+
active: rule.active,
|
|
533
|
+
};
|
|
534
|
+
const found = (await tx.db.select('stock.Rule', { id: rule.id }))[0];
|
|
535
|
+
if (found)
|
|
536
|
+
await tx.db.update('stock.Rule', { id: rule.id }, values);
|
|
537
|
+
else
|
|
538
|
+
await tx.db.insert('stock.Rule', { id: rule.id, ...values });
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
return { ok: true, id: args.id };
|
|
542
|
+
},
|
|
543
|
+
}),
|
|
544
|
+
saveLocation: defineFn({
|
|
545
|
+
input: { id: 'id', name: 'text', usage: 'text', parentId: 'id?', warehouseId: 'id?' },
|
|
546
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
547
|
+
effects: ['read:stock.Location', 'write:stock.Location'],
|
|
548
|
+
idempotent: true,
|
|
549
|
+
agent: true,
|
|
550
|
+
handler: async (ctx, args) => {
|
|
551
|
+
if (!LOCATION_USAGES.includes(args.usage))
|
|
552
|
+
return invalid('usage', `phải là: ${LOCATION_USAGES.join(', ')}`);
|
|
553
|
+
if (args.parentId === args.id)
|
|
554
|
+
return invalid('parentId', 'location không thể là cha của chính nó');
|
|
555
|
+
let parentPath = `${String(args.id)}/`;
|
|
556
|
+
if (args.parentId) {
|
|
557
|
+
const parent = (await ctx.db.select('stock.Location', { id: args.parentId }))[0];
|
|
558
|
+
if (!parent)
|
|
559
|
+
return invalid('parentId', 'location cha không tồn tại');
|
|
560
|
+
if (String(parent.parentPath).split('/').includes(String(args.id)))
|
|
561
|
+
return invalid('parentId', 'cây location có vòng lặp');
|
|
562
|
+
parentPath = `${String(parent.parentPath)}${String(args.id)}/`;
|
|
563
|
+
}
|
|
564
|
+
const existing = (await ctx.db.select('stock.Location', { id: args.id }))[0];
|
|
565
|
+
const values = { ...args, parentPath, active: true };
|
|
566
|
+
const cs = ctx
|
|
567
|
+
.change('stock.Location', values, existing ?? null)
|
|
568
|
+
.cast(['id', 'name', 'usage', 'parentId', 'parentPath', 'warehouseId', 'active'])
|
|
569
|
+
.required(['name', 'usage']);
|
|
570
|
+
if (!cs.valid)
|
|
571
|
+
return { ok: false, errors: cs.errors };
|
|
572
|
+
await ctx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
573
|
+
return { ok: true, id: args.id };
|
|
574
|
+
},
|
|
575
|
+
}),
|
|
576
|
+
savePickingType: defineFn({
|
|
577
|
+
input: {
|
|
578
|
+
id: 'id',
|
|
579
|
+
name: 'text',
|
|
580
|
+
code: 'text',
|
|
581
|
+
warehouseId: 'id?',
|
|
582
|
+
defaultLocationSrcId: 'id?',
|
|
583
|
+
defaultLocationDestId: 'id?',
|
|
584
|
+
createBackorder: 'text?',
|
|
585
|
+
},
|
|
586
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
587
|
+
effects: ['read:stock.PickingType', 'write:stock.PickingType'],
|
|
588
|
+
idempotent: true,
|
|
589
|
+
agent: true,
|
|
590
|
+
handler: async (ctx, args) => {
|
|
591
|
+
if (!PICKING_TYPE_CODES.includes(args.code))
|
|
592
|
+
return invalid('code', `phải là: ${PICKING_TYPE_CODES.join(', ')}`);
|
|
593
|
+
const createBackorder = String(args.createBackorder ?? 'ask');
|
|
594
|
+
if (!['ask', 'always', 'never'].includes(createBackorder))
|
|
595
|
+
return invalid('createBackorder', 'phải là ask, always hoặc never');
|
|
596
|
+
const existing = (await ctx.db.select('stock.PickingType', { id: args.id }))[0];
|
|
597
|
+
const values = { ...args, createBackorder, active: true };
|
|
598
|
+
const cs = ctx
|
|
599
|
+
.change('stock.PickingType', values, existing ?? null)
|
|
600
|
+
.cast([
|
|
601
|
+
'id',
|
|
602
|
+
'name',
|
|
603
|
+
'code',
|
|
604
|
+
'warehouseId',
|
|
605
|
+
'defaultLocationSrcId',
|
|
606
|
+
'defaultLocationDestId',
|
|
607
|
+
'createBackorder',
|
|
608
|
+
'active',
|
|
609
|
+
])
|
|
610
|
+
.required(['name', 'code']);
|
|
611
|
+
if (!cs.valid)
|
|
612
|
+
return { ok: false, errors: cs.errors };
|
|
613
|
+
await ctx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
614
|
+
return { ok: true, id: args.id };
|
|
615
|
+
},
|
|
616
|
+
}),
|
|
617
|
+
createLot: defineFn({
|
|
618
|
+
input: { id: 'id', productId: 'id', name: 'text', ref: 'text?', note: 'text?' },
|
|
619
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
620
|
+
effects: ['read:product.Product', 'write:stock.Lot'],
|
|
621
|
+
idempotent: true,
|
|
622
|
+
agent: true,
|
|
623
|
+
handler: async (ctx, args) => {
|
|
624
|
+
if (!(await ctx.db.select('product.Product', { id: args.productId }))[0])
|
|
625
|
+
return invalid('productId', 'biến thể không tồn tại');
|
|
626
|
+
const result = await ctx.db.insertIfAbsent('stock.Lot', { ...args, active: true });
|
|
627
|
+
return 'inserted' in result && !result.inserted
|
|
628
|
+
? invalid('name', 'lot/serial đã tồn tại cho sản phẩm')
|
|
629
|
+
: { ok: true, id: args.id };
|
|
630
|
+
},
|
|
631
|
+
}),
|
|
632
|
+
createPicking: defineFn({
|
|
633
|
+
input: {
|
|
634
|
+
id: 'id',
|
|
635
|
+
name: 'text',
|
|
636
|
+
pickingTypeId: 'id',
|
|
637
|
+
locationId: 'id?',
|
|
638
|
+
locationDestId: 'id?',
|
|
639
|
+
moveType: 'text?',
|
|
640
|
+
scheduledDate: 'datetime?',
|
|
641
|
+
backorderId: 'id?',
|
|
642
|
+
},
|
|
643
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
644
|
+
effects: ['read:stock.PickingType', 'write:stock.Picking'],
|
|
645
|
+
idempotent: true,
|
|
646
|
+
agent: true,
|
|
647
|
+
handler: async (ctx, args) => {
|
|
648
|
+
const type = (await ctx.db.select('stock.PickingType', { id: args.pickingTypeId }))[0];
|
|
649
|
+
if (!type)
|
|
650
|
+
return invalid('pickingTypeId', 'operation type không tồn tại');
|
|
651
|
+
const locationId = args.locationId ?? type.defaultLocationSrcId;
|
|
652
|
+
const locationDestId = args.locationDestId ?? type.defaultLocationDestId;
|
|
653
|
+
if (!locationId || !locationDestId)
|
|
654
|
+
return invalid('locationId', 'cần source và destination location');
|
|
655
|
+
const moveType = String(args.moveType ?? 'direct');
|
|
656
|
+
if (!['direct', 'one'].includes(moveType))
|
|
657
|
+
return invalid('moveType', 'phải là direct hoặc one');
|
|
658
|
+
const inserted = await ctx.db.insertIfAbsent('stock.Picking', {
|
|
659
|
+
id: args.id,
|
|
660
|
+
name: args.name,
|
|
661
|
+
pickingTypeId: args.pickingTypeId,
|
|
662
|
+
locationId,
|
|
663
|
+
locationDestId,
|
|
664
|
+
moveType,
|
|
665
|
+
state: 'draft',
|
|
666
|
+
backorderId: args.backorderId ?? null,
|
|
667
|
+
scheduledDate: args.scheduledDate ?? new Date().toISOString(),
|
|
668
|
+
dateDone: null,
|
|
669
|
+
});
|
|
670
|
+
return 'inserted' in inserted && !inserted.inserted
|
|
671
|
+
? { ok: true, id: args.id }
|
|
672
|
+
: { ok: true, id: args.id };
|
|
673
|
+
},
|
|
674
|
+
}),
|
|
675
|
+
addMove: defineFn({
|
|
676
|
+
input: {
|
|
677
|
+
id: 'id',
|
|
678
|
+
name: 'text',
|
|
679
|
+
pickingId: 'id?',
|
|
680
|
+
productId: 'id',
|
|
681
|
+
productUomId: 'id',
|
|
682
|
+
productUomQty: 'decimal',
|
|
683
|
+
locationId: 'id?',
|
|
684
|
+
locationDestId: 'id?',
|
|
685
|
+
procureMethod: 'text?',
|
|
686
|
+
ruleId: 'id?',
|
|
687
|
+
origin: 'text?',
|
|
688
|
+
},
|
|
689
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
690
|
+
effects: ['read:stock.Picking', 'read:product.Product', 'read:uom.Unit', 'write:stock.Move'],
|
|
691
|
+
idempotent: true,
|
|
692
|
+
agent: true,
|
|
693
|
+
handler: async (ctx, args) => {
|
|
694
|
+
const picking = args.pickingId
|
|
695
|
+
? (await ctx.db.select('stock.Picking', { id: args.pickingId }))[0]
|
|
696
|
+
: null;
|
|
697
|
+
if (args.pickingId && !picking)
|
|
698
|
+
return invalid('pickingId', 'transfer không tồn tại');
|
|
699
|
+
if (picking && ['done', 'cancel'].includes(String(picking.state)))
|
|
700
|
+
return invalid('pickingId', 'không thể thêm move vào transfer đã kết thúc');
|
|
701
|
+
if (!(await ctx.db.select('product.Product', { id: args.productId }))[0])
|
|
702
|
+
return invalid('productId', 'biến thể không tồn tại');
|
|
703
|
+
if (!(await ctx.db.select('uom.Unit', { id: args.productUomId }))[0])
|
|
704
|
+
return invalid('productUomId', 'đơn vị không tồn tại');
|
|
705
|
+
if (!(Number(args.productUomQty) > 0))
|
|
706
|
+
return invalid('productUomQty', 'phải lớn hơn 0');
|
|
707
|
+
const locationId = args.locationId ?? picking?.locationId;
|
|
708
|
+
const locationDestId = args.locationDestId ?? picking?.locationDestId;
|
|
709
|
+
if (!locationId || !locationDestId)
|
|
710
|
+
return invalid('locationId', 'cần source và destination location');
|
|
711
|
+
const procureMethod = String(args.procureMethod ?? 'make_to_stock');
|
|
712
|
+
if (!['make_to_stock', 'make_to_order'].includes(procureMethod))
|
|
713
|
+
return invalid('procureMethod', 'move chỉ nhận make_to_stock hoặc make_to_order');
|
|
714
|
+
await ctx.db.insertIfAbsent('stock.Move', {
|
|
715
|
+
id: args.id,
|
|
716
|
+
name: args.name,
|
|
717
|
+
pickingId: args.pickingId ?? null,
|
|
718
|
+
productId: args.productId,
|
|
719
|
+
productUomId: args.productUomId,
|
|
720
|
+
productUomQty: args.productUomQty,
|
|
721
|
+
quantity: '0',
|
|
722
|
+
locationId,
|
|
723
|
+
locationDestId,
|
|
724
|
+
state: picking?.state === 'draft' ? 'draft' : 'confirmed',
|
|
725
|
+
picked: false,
|
|
726
|
+
procureMethod,
|
|
727
|
+
ruleId: args.ruleId ?? null,
|
|
728
|
+
origin: args.origin ?? null,
|
|
729
|
+
});
|
|
730
|
+
return { ok: true, id: args.id };
|
|
731
|
+
},
|
|
732
|
+
}),
|
|
733
|
+
confirmPicking: defineFn({
|
|
734
|
+
input: { id: 'id' },
|
|
735
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
736
|
+
effects: ['read:stock.Picking', 'read:stock.Move', 'write:stock.Picking', 'write:stock.Move'],
|
|
737
|
+
idempotent: true,
|
|
738
|
+
agent: true,
|
|
739
|
+
handler: async (ctx, args) => {
|
|
740
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
741
|
+
if (!picking)
|
|
742
|
+
return invalid('id', 'transfer không tồn tại');
|
|
743
|
+
if (picking.state === 'done' || picking.state === 'cancel')
|
|
744
|
+
return invalid('state', 'transfer đã kết thúc');
|
|
745
|
+
await ctx.db.update('stock.Picking', { id: args.id }, { state: 'confirmed' });
|
|
746
|
+
for (const move of await ctx.db.select('stock.Move', { pickingId: args.id }))
|
|
747
|
+
if (move.state === 'draft')
|
|
748
|
+
await ctx.db.update('stock.Move', { id: move.id }, { state: 'confirmed' });
|
|
749
|
+
return { ok: true, id: args.id };
|
|
750
|
+
},
|
|
751
|
+
}),
|
|
752
|
+
reserveMove: defineFn({
|
|
753
|
+
input: { id: 'id' },
|
|
754
|
+
output: { ok: 'bool', reserved: 'decimal?', state: 'text?', errors: 'json?' },
|
|
755
|
+
effects: [
|
|
756
|
+
'read:stock.Move',
|
|
757
|
+
'write:stock.Move',
|
|
758
|
+
'read:stock.Picking',
|
|
759
|
+
'write:stock.Picking',
|
|
760
|
+
'read:stock.MoveLine',
|
|
761
|
+
'write:stock.MoveLine',
|
|
762
|
+
'read:stock.Quant',
|
|
763
|
+
'write:stock.Quant',
|
|
764
|
+
'read:product.Product',
|
|
765
|
+
'read:product.Template',
|
|
766
|
+
],
|
|
767
|
+
idempotent: true,
|
|
768
|
+
agent: true,
|
|
769
|
+
handler: async (ctx, args) => {
|
|
770
|
+
const move = (await ctx.db.select('stock.Move', { id: args.id }))[0];
|
|
771
|
+
if (!move)
|
|
772
|
+
return invalid('id', 'move không tồn tại');
|
|
773
|
+
if (!(await isStorable(ctx, move.productId)))
|
|
774
|
+
return invalid('productId', 'chỉ sản phẩm lưu kho mới được reserve');
|
|
775
|
+
if (['done', 'cancel'].includes(String(move.state)))
|
|
776
|
+
return invalid('state', 'move đã kết thúc');
|
|
777
|
+
if (move.state === 'draft')
|
|
778
|
+
return invalid('state', 'xác nhận transfer trước khi reserve');
|
|
779
|
+
const demand = Number(move.productUomQty);
|
|
780
|
+
let reserved = (await ctx.db.select('stock.MoveLine', { moveId: move.id }))
|
|
781
|
+
.filter((line) => !line.picked)
|
|
782
|
+
.reduce((sum, line) => sum + Number(line.quantity), 0);
|
|
783
|
+
let state = 'confirmed';
|
|
784
|
+
const tracking = await trackingOf(ctx, move.productId);
|
|
785
|
+
const quants = (await ctx.db.select('stock.Quant', { productId: move.productId, locationId: move.locationId })).sort((a, b) => String(a.lotKey).localeCompare(String(b.lotKey)));
|
|
786
|
+
await ctx.tx(async (tx) => {
|
|
787
|
+
for (const quant of quants) {
|
|
788
|
+
if (reserved >= demand)
|
|
789
|
+
break;
|
|
790
|
+
if (tracking !== 'none' && !quant.lotId)
|
|
791
|
+
continue;
|
|
792
|
+
const available = Number(quant.quantity) - Number(quant.reservedQuantity);
|
|
793
|
+
if (available <= 0)
|
|
794
|
+
continue;
|
|
795
|
+
const take = Math.min(available, demand - reserved, tracking === 'serial' ? 1 : Number.POSITIVE_INFINITY);
|
|
796
|
+
await mutateQuant(tx, {
|
|
797
|
+
productId: move.productId,
|
|
798
|
+
locationId: move.locationId,
|
|
799
|
+
lotId: quant.lotId,
|
|
800
|
+
quantity: 0,
|
|
801
|
+
reserved: take,
|
|
802
|
+
});
|
|
803
|
+
const lineId = `${String(move.id)}:reserve:${String(quant.id)}`;
|
|
804
|
+
const line = (await tx.db.select('stock.MoveLine', { id: lineId }))[0];
|
|
805
|
+
if (line)
|
|
806
|
+
await tx.db.update('stock.MoveLine', { id: lineId }, { quantity: String(Number(line.quantity) + take) });
|
|
807
|
+
else
|
|
808
|
+
await tx.db.insert('stock.MoveLine', {
|
|
809
|
+
id: lineId,
|
|
810
|
+
moveId: move.id,
|
|
811
|
+
pickingId: move.pickingId,
|
|
812
|
+
productId: move.productId,
|
|
813
|
+
productUomId: move.productUomId,
|
|
814
|
+
quantity: String(take),
|
|
815
|
+
quantityProductUom: String(take),
|
|
816
|
+
locationId: move.locationId,
|
|
817
|
+
locationDestId: move.locationDestId,
|
|
818
|
+
lotId: quant.lotId,
|
|
819
|
+
picked: false,
|
|
820
|
+
});
|
|
821
|
+
reserved += take;
|
|
822
|
+
}
|
|
823
|
+
state =
|
|
824
|
+
compareQty(reserved, demand, 0.000001) >= 0
|
|
825
|
+
? 'assigned'
|
|
826
|
+
: reserved > 0
|
|
827
|
+
? 'partially_available'
|
|
828
|
+
: 'confirmed';
|
|
829
|
+
await tx.db.update('stock.Move', { id: move.id }, { state, quantity: String(reserved) });
|
|
830
|
+
if (move.pickingId)
|
|
831
|
+
await updatePickingState(tx, move.pickingId);
|
|
832
|
+
});
|
|
833
|
+
// The state that was written, not a second derivation of it: the tolerant
|
|
834
|
+
// compareQty above and a bare `reserved >= demand` disagree inside 1e-6, and
|
|
835
|
+
// the caller was being told the opposite of what landed in the row.
|
|
836
|
+
return { ok: true, reserved: String(reserved), state };
|
|
837
|
+
},
|
|
838
|
+
}),
|
|
839
|
+
saveMoveLine: defineFn({
|
|
840
|
+
input: { id: 'id', moveId: 'id', quantity: 'decimal', lotId: 'id?', picked: 'bool?' },
|
|
841
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
842
|
+
effects: [
|
|
843
|
+
'read:stock.Move',
|
|
844
|
+
'read:stock.MoveLine',
|
|
845
|
+
'write:stock.MoveLine',
|
|
846
|
+
'read:stock.Lot',
|
|
847
|
+
'read:stock.Location',
|
|
848
|
+
'read:stock.Quant',
|
|
849
|
+
'write:stock.Quant',
|
|
850
|
+
'read:product.Product',
|
|
851
|
+
'read:product.Template',
|
|
852
|
+
],
|
|
853
|
+
idempotent: true,
|
|
854
|
+
agent: true,
|
|
855
|
+
handler: async (ctx, args) => {
|
|
856
|
+
const move = (await ctx.db.select('stock.Move', { id: args.moveId }))[0];
|
|
857
|
+
if (!move)
|
|
858
|
+
return invalid('moveId', 'move không tồn tại');
|
|
859
|
+
if (['done', 'cancel'].includes(String(move.state)))
|
|
860
|
+
return invalid('moveId', 'không thể sửa dòng của move đã kết thúc');
|
|
861
|
+
const tracking = await trackingOf(ctx, move.productId);
|
|
862
|
+
if (tracking !== 'none' && !args.lotId)
|
|
863
|
+
return invalid('lotId', `${tracking} tracked product cần lot/serial`);
|
|
864
|
+
if (!(Number(args.quantity) > 0))
|
|
865
|
+
return invalid('quantity', 'phải lớn hơn 0');
|
|
866
|
+
if (tracking === 'serial' && compareQty(Number(args.quantity), 1, 0.000001) > 0)
|
|
867
|
+
return invalid('quantity', 'serial move line không được lớn hơn 1');
|
|
868
|
+
if (tracking === 'serial' && args.picked && compareQty(Number(args.quantity), 1, 0.000001) !== 0)
|
|
869
|
+
return invalid('quantity', 'serial đã pick phải có quantity đúng 1');
|
|
870
|
+
if (args.lotId) {
|
|
871
|
+
const lot = (await ctx.db.select('stock.Lot', { id: args.lotId }))[0];
|
|
872
|
+
if (!lot || lot.productId !== move.productId)
|
|
873
|
+
return invalid('lotId', 'lot/serial không thuộc sản phẩm');
|
|
874
|
+
}
|
|
875
|
+
const existing = (await ctx.db.select('stock.MoveLine', { id: args.id }))[0];
|
|
876
|
+
const values = {
|
|
877
|
+
id: args.id,
|
|
878
|
+
moveId: move.id,
|
|
879
|
+
pickingId: move.pickingId,
|
|
880
|
+
productId: move.productId,
|
|
881
|
+
productUomId: move.productUomId,
|
|
882
|
+
quantity: args.quantity,
|
|
883
|
+
quantityProductUom: args.quantity,
|
|
884
|
+
locationId: move.locationId,
|
|
885
|
+
locationDestId: move.locationDestId,
|
|
886
|
+
lotId: args.lotId ?? null,
|
|
887
|
+
picked: args.picked ?? false,
|
|
888
|
+
};
|
|
889
|
+
const cs = ctx
|
|
890
|
+
.change('stock.MoveLine', values, existing ?? null)
|
|
891
|
+
.cast([
|
|
892
|
+
'id',
|
|
893
|
+
'moveId',
|
|
894
|
+
'pickingId',
|
|
895
|
+
'productId',
|
|
896
|
+
'productUomId',
|
|
897
|
+
'quantity',
|
|
898
|
+
'quantityProductUom',
|
|
899
|
+
'locationId',
|
|
900
|
+
'locationDestId',
|
|
901
|
+
'lotId',
|
|
902
|
+
'picked',
|
|
903
|
+
])
|
|
904
|
+
.required(['moveId', 'productId', 'productUomId', 'quantity', 'locationId', 'locationDestId']);
|
|
905
|
+
if (!cs.valid)
|
|
906
|
+
return { ok: false, errors: cs.errors };
|
|
907
|
+
await ctx.tx(async (tx) => {
|
|
908
|
+
const source = (await tx.db.select('stock.Location', { id: move.locationId }))[0];
|
|
909
|
+
if (source && ['internal', 'transit'].includes(String(source.usage))) {
|
|
910
|
+
const oldQuantity = existing && !existing.picked ? Number(existing.quantity) : 0;
|
|
911
|
+
const newQuantity = Number(args.quantity);
|
|
912
|
+
if (existing && lotKey(existing.lotId) !== lotKey(args.lotId) && oldQuantity)
|
|
913
|
+
await mutateQuant(tx, {
|
|
914
|
+
productId: move.productId,
|
|
915
|
+
locationId: move.locationId,
|
|
916
|
+
lotId: existing.lotId,
|
|
917
|
+
quantity: 0,
|
|
918
|
+
reserved: -oldQuantity,
|
|
919
|
+
});
|
|
920
|
+
const delta = lotKey(existing?.lotId) === lotKey(args.lotId) ? newQuantity - oldQuantity : newQuantity;
|
|
921
|
+
if (delta)
|
|
922
|
+
await mutateQuant(tx, {
|
|
923
|
+
productId: move.productId,
|
|
924
|
+
locationId: move.locationId,
|
|
925
|
+
lotId: args.lotId,
|
|
926
|
+
quantity: 0,
|
|
927
|
+
reserved: delta,
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
await tx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
931
|
+
});
|
|
932
|
+
return { ok: true, id: args.id };
|
|
933
|
+
},
|
|
934
|
+
}),
|
|
935
|
+
completePicking: defineFn({
|
|
936
|
+
input: { id: 'id', quantities: 'json?', createBackorder: 'bool?', pickedOnly: 'bool?' },
|
|
937
|
+
output: { ok: 'bool', id: 'id?', backorderId: 'id?', errors: 'json?' },
|
|
938
|
+
effects: [
|
|
939
|
+
'read:stock.Picking',
|
|
940
|
+
'write:stock.Picking',
|
|
941
|
+
'read:stock.PickingType',
|
|
942
|
+
'read:stock.Move',
|
|
943
|
+
'write:stock.Move',
|
|
944
|
+
'read:stock.MoveLine',
|
|
945
|
+
'write:stock.MoveLine',
|
|
946
|
+
'read:stock.Location',
|
|
947
|
+
'read:stock.Quant',
|
|
948
|
+
'write:stock.Quant',
|
|
949
|
+
'read:product.Product',
|
|
950
|
+
'read:product.Template',
|
|
951
|
+
'read:product.Category',
|
|
952
|
+
'read:stock.Route',
|
|
953
|
+
'read:stock.Rule',
|
|
954
|
+
'read:stock.ProductRoute',
|
|
955
|
+
'read:stock.CategoryRoute',
|
|
956
|
+
'read:stock.WarehouseRoute',
|
|
957
|
+
'read:stock.MoveLink',
|
|
958
|
+
'write:stock.MoveLink',
|
|
959
|
+
],
|
|
960
|
+
agent: true,
|
|
961
|
+
handler: async (ctx, args) => {
|
|
962
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
963
|
+
if (!picking)
|
|
964
|
+
return invalid('id', 'transfer không tồn tại');
|
|
965
|
+
if (picking.state === 'done')
|
|
966
|
+
return { ok: true, id: args.id };
|
|
967
|
+
if (picking.state === 'cancel')
|
|
968
|
+
return invalid('state', 'transfer đã hủy');
|
|
969
|
+
const requested = new Map();
|
|
970
|
+
if (Array.isArray(args.quantities))
|
|
971
|
+
for (const entry of args.quantities)
|
|
972
|
+
requested.set(String(entry.moveLineId), Number(entry.quantity));
|
|
973
|
+
const moves = await ctx.db.select('stock.Move', { pickingId: args.id });
|
|
974
|
+
const remaining = [];
|
|
975
|
+
await ctx.tx(async (tx) => {
|
|
976
|
+
for (const move of moves) {
|
|
977
|
+
const tracking = await trackingOf(tx, move.productId);
|
|
978
|
+
const source = (await tx.db.select('stock.Location', { id: move.locationId }))[0];
|
|
979
|
+
const destination = (await tx.db.select('stock.Location', { id: move.locationDestId }))[0];
|
|
980
|
+
const lines = await tx.db.select('stock.MoveLine', { moveId: move.id });
|
|
981
|
+
let done = 0;
|
|
982
|
+
for (const line of lines) {
|
|
983
|
+
const reserved = Number(line.quantity);
|
|
984
|
+
if (args.pickedOnly && !line.picked) {
|
|
985
|
+
if ((source.usage === 'internal' || source.usage === 'transit') && reserved)
|
|
986
|
+
await mutateQuant(tx, {
|
|
987
|
+
productId: move.productId,
|
|
988
|
+
locationId: move.locationId,
|
|
989
|
+
lotId: line.lotId,
|
|
990
|
+
quantity: 0,
|
|
991
|
+
reserved: -reserved,
|
|
992
|
+
});
|
|
993
|
+
await tx.db.update('stock.MoveLine', { id: line.id }, { quantity: '0', quantityProductUom: '0', picked: true });
|
|
994
|
+
continue;
|
|
995
|
+
}
|
|
996
|
+
const quantity = requested.has(String(line.id))
|
|
997
|
+
? requested.get(String(line.id))
|
|
998
|
+
: requested.size
|
|
999
|
+
? 0
|
|
1000
|
+
: reserved;
|
|
1001
|
+
if (quantity < 0 || quantity > reserved)
|
|
1002
|
+
throw new Error(`invalid done quantity for ${String(line.id)}`);
|
|
1003
|
+
if (tracking !== 'none' && !line.lotId)
|
|
1004
|
+
throw new Error(`${tracking} tracked product requires a lot/serial`);
|
|
1005
|
+
if (tracking === 'serial' && quantity > 0 && compareQty(quantity, 1, 0.000001) !== 0)
|
|
1006
|
+
throw new Error('serial picked move line quantity must equal 1');
|
|
1007
|
+
if (source.usage === 'internal' || source.usage === 'transit') {
|
|
1008
|
+
// Release only what this line actually holds. A line written by
|
|
1009
|
+
// saveMoveLine never incremented the quant's reservedQuantity, so
|
|
1010
|
+
// releasing its full quantity drove the mirror negative and threw —
|
|
1011
|
+
// leaving the transfer impossible to complete by any later call.
|
|
1012
|
+
const held = await reservedOn(tx, move.productId, move.locationId, line.lotId);
|
|
1013
|
+
await mutateQuant(tx, {
|
|
1014
|
+
productId: move.productId,
|
|
1015
|
+
locationId: move.locationId,
|
|
1016
|
+
lotId: line.lotId,
|
|
1017
|
+
quantity: -quantity,
|
|
1018
|
+
reserved: -Math.min(reserved, held),
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
await mutateQuant(tx, {
|
|
1023
|
+
productId: move.productId,
|
|
1024
|
+
locationId: move.locationId,
|
|
1025
|
+
lotId: line.lotId,
|
|
1026
|
+
quantity: -quantity,
|
|
1027
|
+
reserved: 0,
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
// Keep both sides of every completed move in the quant ledger. The
|
|
1031
|
+
// forecast still counts only internal/transit locations.
|
|
1032
|
+
if (destination)
|
|
1033
|
+
await mutateQuant(tx, {
|
|
1034
|
+
productId: move.productId,
|
|
1035
|
+
locationId: move.locationDestId,
|
|
1036
|
+
lotId: line.lotId,
|
|
1037
|
+
quantity,
|
|
1038
|
+
reserved: 0,
|
|
1039
|
+
});
|
|
1040
|
+
await tx.db.update('stock.MoveLine', { id: line.id }, { quantity: String(quantity), quantityProductUom: String(quantity), picked: true });
|
|
1041
|
+
done += quantity;
|
|
1042
|
+
}
|
|
1043
|
+
await tx.db.update('stock.Move', { id: move.id }, { quantity: String(done), picked: true, state: 'done' });
|
|
1044
|
+
await pushFromCompletedMove(tx, move, done);
|
|
1045
|
+
const left = Math.max(0, Number(move.productUomQty) - done);
|
|
1046
|
+
if (left > 0)
|
|
1047
|
+
remaining.push({ move, quantity: left });
|
|
1048
|
+
}
|
|
1049
|
+
await tx.db.update('stock.Picking', { id: args.id }, { state: 'done', dateDone: new Date().toISOString() });
|
|
1050
|
+
});
|
|
1051
|
+
const type = (await ctx.db.select('stock.PickingType', { id: picking.pickingTypeId }))[0];
|
|
1052
|
+
const shouldBackorder = remaining.length > 0 && (args.createBackorder ?? type?.createBackorder !== 'never');
|
|
1053
|
+
let backorderId = null;
|
|
1054
|
+
if (shouldBackorder) {
|
|
1055
|
+
backorderId = `${String(args.id)}:backorder:${Date.now()}`;
|
|
1056
|
+
await ctx.db.insert('stock.Picking', {
|
|
1057
|
+
id: backorderId,
|
|
1058
|
+
name: `${String(picking.name)} backorder`,
|
|
1059
|
+
pickingTypeId: picking.pickingTypeId,
|
|
1060
|
+
locationId: picking.locationId,
|
|
1061
|
+
locationDestId: picking.locationDestId,
|
|
1062
|
+
moveType: picking.moveType,
|
|
1063
|
+
state: 'confirmed',
|
|
1064
|
+
backorderId: picking.id,
|
|
1065
|
+
scheduledDate: new Date().toISOString(),
|
|
1066
|
+
dateDone: null,
|
|
1067
|
+
});
|
|
1068
|
+
for (const { move, quantity } of remaining) {
|
|
1069
|
+
const id = `${String(move.id)}:backorder:${Date.now()}`;
|
|
1070
|
+
await ctx.db.insert('stock.Move', {
|
|
1071
|
+
...Object.fromEntries(Object.entries(move).filter(([key]) => key !== 'companyId')),
|
|
1072
|
+
id,
|
|
1073
|
+
pickingId: backorderId,
|
|
1074
|
+
productUomQty: String(quantity),
|
|
1075
|
+
quantity: '0',
|
|
1076
|
+
state: 'confirmed',
|
|
1077
|
+
picked: false,
|
|
1078
|
+
});
|
|
1079
|
+
await ctx.db.insertIfAbsent('stock.MoveLink', {
|
|
1080
|
+
id: `${String(move.id)}:${id}`,
|
|
1081
|
+
originMoveId: move.id,
|
|
1082
|
+
destinationMoveId: id,
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return { ok: true, id: args.id, backorderId };
|
|
1087
|
+
},
|
|
1088
|
+
}),
|
|
1089
|
+
adjustInventory: defineFn({
|
|
1090
|
+
input: {
|
|
1091
|
+
id: 'id',
|
|
1092
|
+
productId: 'id',
|
|
1093
|
+
locationId: 'id',
|
|
1094
|
+
inventoryLocationId: 'id',
|
|
1095
|
+
countedQuantity: 'decimal',
|
|
1096
|
+
lotId: 'id?',
|
|
1097
|
+
productUomId: 'id',
|
|
1098
|
+
},
|
|
1099
|
+
output: { ok: 'bool', pickingId: 'id?', moveId: 'id?', difference: 'decimal?', errors: 'json?' },
|
|
1100
|
+
effects: [
|
|
1101
|
+
'read:stock.Quant',
|
|
1102
|
+
'write:stock.Quant',
|
|
1103
|
+
'read:stock.Location',
|
|
1104
|
+
'read:stock.Lot',
|
|
1105
|
+
'read:stock.PickingType',
|
|
1106
|
+
'write:stock.PickingType',
|
|
1107
|
+
'write:stock.Picking',
|
|
1108
|
+
'write:stock.Move',
|
|
1109
|
+
'write:stock.MoveLine',
|
|
1110
|
+
'read:product.Product',
|
|
1111
|
+
'read:product.Template',
|
|
1112
|
+
],
|
|
1113
|
+
idempotent: true,
|
|
1114
|
+
agent: true,
|
|
1115
|
+
handler: async (ctx, args) => {
|
|
1116
|
+
if (!(await isStorable(ctx, args.productId)))
|
|
1117
|
+
return invalid('productId', 'chỉ sản phẩm lưu kho mới kiểm kê');
|
|
1118
|
+
if (Number(args.countedQuantity) < 0)
|
|
1119
|
+
return invalid('countedQuantity', 'số lượng kiểm kê không được âm');
|
|
1120
|
+
const tracking = await trackingOf(ctx, args.productId);
|
|
1121
|
+
if (tracking !== 'none' && !args.lotId)
|
|
1122
|
+
return invalid('lotId', `${tracking} tracked product cần lot/serial`);
|
|
1123
|
+
if (tracking === 'serial' && compareQty(Number(args.countedQuantity), 1, 0.000001) > 0)
|
|
1124
|
+
return invalid('countedQuantity', 'mỗi serial chỉ có thể có số lượng 0 hoặc 1');
|
|
1125
|
+
if (args.lotId) {
|
|
1126
|
+
const lot = (await ctx.db.select('stock.Lot', { id: args.lotId }))[0];
|
|
1127
|
+
if (!lot || lot.productId !== args.productId)
|
|
1128
|
+
return invalid('lotId', 'lot/serial không thuộc sản phẩm');
|
|
1129
|
+
}
|
|
1130
|
+
const current = (await ctx.db.select('stock.Quant', {
|
|
1131
|
+
productId: args.productId,
|
|
1132
|
+
locationId: args.locationId,
|
|
1133
|
+
lotKey: lotKey(args.lotId),
|
|
1134
|
+
}))[0];
|
|
1135
|
+
const difference = Number(args.countedQuantity) - Number(current?.quantity ?? 0);
|
|
1136
|
+
if (Math.abs(difference) < 1e-12)
|
|
1137
|
+
return { ok: true, moveId: args.id, difference: '0' };
|
|
1138
|
+
const incoming = difference > 0;
|
|
1139
|
+
const source = incoming ? args.inventoryLocationId : args.locationId;
|
|
1140
|
+
const destination = incoming ? args.locationId : args.inventoryLocationId;
|
|
1141
|
+
const pickingTypeId = `${String(args.inventoryLocationId)}:adjustment`;
|
|
1142
|
+
const pickingId = `${String(args.id)}:picking`;
|
|
1143
|
+
await ctx.tx(async (tx) => {
|
|
1144
|
+
await mutateQuant(tx, {
|
|
1145
|
+
productId: args.productId,
|
|
1146
|
+
locationId: source,
|
|
1147
|
+
lotId: args.lotId,
|
|
1148
|
+
quantity: -Math.abs(difference),
|
|
1149
|
+
reserved: 0,
|
|
1150
|
+
});
|
|
1151
|
+
await mutateQuant(tx, {
|
|
1152
|
+
productId: args.productId,
|
|
1153
|
+
locationId: destination,
|
|
1154
|
+
lotId: args.lotId,
|
|
1155
|
+
quantity: Math.abs(difference),
|
|
1156
|
+
reserved: 0,
|
|
1157
|
+
});
|
|
1158
|
+
await tx.db.insertIfAbsent('stock.PickingType', {
|
|
1159
|
+
id: pickingTypeId,
|
|
1160
|
+
name: 'Inventory Adjustments',
|
|
1161
|
+
code: 'internal',
|
|
1162
|
+
warehouseId: null,
|
|
1163
|
+
defaultLocationSrcId: args.inventoryLocationId,
|
|
1164
|
+
defaultLocationDestId: args.locationId,
|
|
1165
|
+
createBackorder: 'never',
|
|
1166
|
+
active: true,
|
|
1167
|
+
});
|
|
1168
|
+
await tx.db.insertIfAbsent('stock.Picking', {
|
|
1169
|
+
id: pickingId,
|
|
1170
|
+
name: `Inventory ${String(args.id)}`,
|
|
1171
|
+
pickingTypeId,
|
|
1172
|
+
locationId: source,
|
|
1173
|
+
locationDestId: destination,
|
|
1174
|
+
moveType: 'direct',
|
|
1175
|
+
state: 'done',
|
|
1176
|
+
backorderId: null,
|
|
1177
|
+
scheduledDate: new Date().toISOString(),
|
|
1178
|
+
dateDone: new Date().toISOString(),
|
|
1179
|
+
});
|
|
1180
|
+
await tx.db.insertIfAbsent('stock.Move', {
|
|
1181
|
+
id: args.id,
|
|
1182
|
+
name: 'Inventory adjustment',
|
|
1183
|
+
pickingId,
|
|
1184
|
+
productId: args.productId,
|
|
1185
|
+
productUomId: args.productUomId,
|
|
1186
|
+
productUomQty: String(Math.abs(difference)),
|
|
1187
|
+
quantity: String(Math.abs(difference)),
|
|
1188
|
+
locationId: source,
|
|
1189
|
+
locationDestId: destination,
|
|
1190
|
+
state: 'done',
|
|
1191
|
+
picked: true,
|
|
1192
|
+
procureMethod: 'make_to_stock',
|
|
1193
|
+
ruleId: null,
|
|
1194
|
+
origin: 'inventory',
|
|
1195
|
+
});
|
|
1196
|
+
await tx.db.insertIfAbsent('stock.MoveLine', {
|
|
1197
|
+
id: `${args.id}:line`,
|
|
1198
|
+
moveId: args.id,
|
|
1199
|
+
pickingId,
|
|
1200
|
+
productId: args.productId,
|
|
1201
|
+
productUomId: args.productUomId,
|
|
1202
|
+
quantity: String(Math.abs(difference)),
|
|
1203
|
+
quantityProductUom: String(Math.abs(difference)),
|
|
1204
|
+
locationId: source,
|
|
1205
|
+
locationDestId: destination,
|
|
1206
|
+
lotId: args.lotId ?? null,
|
|
1207
|
+
picked: true,
|
|
1208
|
+
});
|
|
1209
|
+
});
|
|
1210
|
+
return { ok: true, pickingId, moveId: args.id, difference: String(difference) };
|
|
1211
|
+
},
|
|
1212
|
+
}),
|
|
1213
|
+
forecast: defineFn({
|
|
1214
|
+
input: { productId: 'id', warehouseId: 'id?', locationId: 'id?' },
|
|
1215
|
+
output: {
|
|
1216
|
+
productId: 'id',
|
|
1217
|
+
onHand: 'decimal',
|
|
1218
|
+
reserved: 'decimal',
|
|
1219
|
+
available: 'decimal',
|
|
1220
|
+
incoming: 'decimal',
|
|
1221
|
+
outgoing: 'decimal',
|
|
1222
|
+
forecasted: 'decimal',
|
|
1223
|
+
forecast: 'decimal',
|
|
1224
|
+
},
|
|
1225
|
+
effects: ['read:stock.Quant', 'read:stock.Move', 'read:stock.Location'],
|
|
1226
|
+
agent: true,
|
|
1227
|
+
handler: async (ctx, args) => {
|
|
1228
|
+
const locations = await ctx.db.select('stock.Location');
|
|
1229
|
+
const anchor = args.locationId ? locations.find((location) => location.id === args.locationId) : null;
|
|
1230
|
+
const inside = new Set(locations
|
|
1231
|
+
.filter((location) => ['internal', 'transit'].includes(String(location.usage)))
|
|
1232
|
+
.filter((location) => {
|
|
1233
|
+
if (args.warehouseId)
|
|
1234
|
+
return location.warehouseId === args.warehouseId;
|
|
1235
|
+
if (anchor)
|
|
1236
|
+
return String(location.parentPath).startsWith(String(anchor.parentPath));
|
|
1237
|
+
return true;
|
|
1238
|
+
})
|
|
1239
|
+
.map((location) => String(location.id)));
|
|
1240
|
+
const quants = (await ctx.db.select('stock.Quant', { productId: args.productId })).filter((quant) => inside.has(String(quant.locationId)));
|
|
1241
|
+
const onHand = quants.reduce((sum, quant) => sum + Number(quant.quantity), 0);
|
|
1242
|
+
const reserved = quants.reduce((sum, quant) => sum + Number(quant.reservedQuantity), 0);
|
|
1243
|
+
const moves = (await ctx.db.select('stock.Move', { productId: args.productId })).filter((move) => !['done', 'cancel', 'draft'].includes(String(move.state)));
|
|
1244
|
+
let incoming = 0, outgoing = 0;
|
|
1245
|
+
for (const move of moves) {
|
|
1246
|
+
const remaining = Math.max(0, Number(move.productUomQty) - Number(move.quantity));
|
|
1247
|
+
const sourceInside = inside.has(String(move.locationId));
|
|
1248
|
+
const destinationInside = inside.has(String(move.locationDestId));
|
|
1249
|
+
if (!sourceInside && destinationInside)
|
|
1250
|
+
incoming += remaining;
|
|
1251
|
+
if (sourceInside && !destinationInside)
|
|
1252
|
+
outgoing += remaining;
|
|
1253
|
+
}
|
|
1254
|
+
const forecasted = onHand + incoming - outgoing;
|
|
1255
|
+
return {
|
|
1256
|
+
productId: args.productId,
|
|
1257
|
+
onHand: String(onHand),
|
|
1258
|
+
reserved: String(reserved),
|
|
1259
|
+
available: String(onHand - reserved),
|
|
1260
|
+
incoming: String(incoming),
|
|
1261
|
+
outgoing: String(outgoing),
|
|
1262
|
+
forecasted: String(forecasted),
|
|
1263
|
+
forecast: String(forecasted),
|
|
1264
|
+
};
|
|
1265
|
+
},
|
|
1266
|
+
}),
|
|
1267
|
+
};
|
|
1268
|
+
functions.savePicking = defineFn({
|
|
1269
|
+
input: {
|
|
1270
|
+
id: 'id',
|
|
1271
|
+
name: 'text',
|
|
1272
|
+
pickingTypeId: 'id',
|
|
1273
|
+
locationId: 'id?',
|
|
1274
|
+
locationDestId: 'id?',
|
|
1275
|
+
moveType: 'text?',
|
|
1276
|
+
scheduledDate: 'datetime?',
|
|
1277
|
+
backorderId: 'id?',
|
|
1278
|
+
},
|
|
1279
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1280
|
+
effects: ['read:stock.PickingType', 'read:stock.Picking', 'write:stock.Picking'],
|
|
1281
|
+
idempotent: true,
|
|
1282
|
+
agent: true,
|
|
1283
|
+
handler: async (ctx, args) => {
|
|
1284
|
+
const type = (await ctx.db.select('stock.PickingType', { id: args.pickingTypeId }))[0];
|
|
1285
|
+
if (!type)
|
|
1286
|
+
return invalid('pickingTypeId', 'operation type không tồn tại');
|
|
1287
|
+
const existing = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
1288
|
+
const values = {
|
|
1289
|
+
...args,
|
|
1290
|
+
locationId: args.locationId ?? type.defaultLocationSrcId,
|
|
1291
|
+
locationDestId: args.locationDestId ?? type.defaultLocationDestId,
|
|
1292
|
+
moveType: args.moveType ?? 'direct',
|
|
1293
|
+
state: existing?.state ?? 'draft',
|
|
1294
|
+
backorderId: args.backorderId ?? existing?.backorderId ?? null,
|
|
1295
|
+
scheduledDate: args.scheduledDate ?? existing?.scheduledDate ?? new Date().toISOString(),
|
|
1296
|
+
dateDone: existing?.dateDone ?? null,
|
|
1297
|
+
};
|
|
1298
|
+
if (!values.locationId || !values.locationDestId)
|
|
1299
|
+
return invalid('locationId', 'cần source và destination location');
|
|
1300
|
+
const cs = ctx
|
|
1301
|
+
.change('stock.Picking', values, existing ?? null)
|
|
1302
|
+
.cast([
|
|
1303
|
+
'id',
|
|
1304
|
+
'name',
|
|
1305
|
+
'pickingTypeId',
|
|
1306
|
+
'locationId',
|
|
1307
|
+
'locationDestId',
|
|
1308
|
+
'moveType',
|
|
1309
|
+
'state',
|
|
1310
|
+
'backorderId',
|
|
1311
|
+
'scheduledDate',
|
|
1312
|
+
'dateDone',
|
|
1313
|
+
])
|
|
1314
|
+
.required([
|
|
1315
|
+
'name',
|
|
1316
|
+
'pickingTypeId',
|
|
1317
|
+
'locationId',
|
|
1318
|
+
'locationDestId',
|
|
1319
|
+
'moveType',
|
|
1320
|
+
'state',
|
|
1321
|
+
'scheduledDate',
|
|
1322
|
+
]);
|
|
1323
|
+
if (!cs.valid)
|
|
1324
|
+
return { ok: false, errors: cs.errors };
|
|
1325
|
+
await ctx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
1326
|
+
return { ok: true, id: args.id };
|
|
1327
|
+
},
|
|
1328
|
+
});
|
|
1329
|
+
functions.saveLot = defineFn({
|
|
1330
|
+
input: { id: 'id', productId: 'id', name: 'text', ref: 'text?', note: 'text?', active: 'bool?' },
|
|
1331
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1332
|
+
effects: ['read:product.Product', 'read:stock.Lot', 'write:stock.Lot', 'read:stock.MoveLine'],
|
|
1333
|
+
idempotent: true,
|
|
1334
|
+
agent: true,
|
|
1335
|
+
handler: async (ctx, args) => {
|
|
1336
|
+
if (!(await ctx.db.select('product.Product', { id: args.productId }))[0])
|
|
1337
|
+
return invalid('productId', 'biến thể không tồn tại');
|
|
1338
|
+
const existing = (await ctx.db.select('stock.Lot', { id: args.id }))[0];
|
|
1339
|
+
if (existing && existing.productId !== args.productId) {
|
|
1340
|
+
const moveLines = await ctx.db.select('stock.MoveLine', { lotId: args.id });
|
|
1341
|
+
if (moveLines.length)
|
|
1342
|
+
return invalid('productId', 'không thể đổi sản phẩm khi lô hoặc sê-ri đã được dùng trong dịch chuyển kho');
|
|
1343
|
+
}
|
|
1344
|
+
const values = { ...args, active: args.active ?? existing?.active ?? true };
|
|
1345
|
+
const cs = ctx
|
|
1346
|
+
.change('stock.Lot', values, existing ?? null)
|
|
1347
|
+
.cast(['id', 'productId', 'name', 'ref', 'note', 'active'])
|
|
1348
|
+
.required(['productId', 'name']);
|
|
1349
|
+
if (!cs.valid)
|
|
1350
|
+
return { ok: false, errors: cs.errors };
|
|
1351
|
+
await ctx.db.commit(cs, existing ? { id: args.id } : undefined);
|
|
1352
|
+
return { ok: true, id: args.id };
|
|
1353
|
+
},
|
|
1354
|
+
});
|
|
1355
|
+
functions.assignPicking = defineFn({
|
|
1356
|
+
input: { id: 'id' },
|
|
1357
|
+
output: { ok: 'bool', state: 'text?', allocations: 'json?', shortages: 'json?', errors: 'json?' },
|
|
1358
|
+
effects: [
|
|
1359
|
+
'read:stock.Picking',
|
|
1360
|
+
'write:stock.Picking',
|
|
1361
|
+
'read:stock.Move',
|
|
1362
|
+
'write:stock.Move',
|
|
1363
|
+
'read:stock.MoveLine',
|
|
1364
|
+
'write:stock.MoveLine',
|
|
1365
|
+
'read:stock.Quant',
|
|
1366
|
+
'write:stock.Quant',
|
|
1367
|
+
'read:product.Product',
|
|
1368
|
+
'read:product.Template',
|
|
1369
|
+
],
|
|
1370
|
+
idempotent: true,
|
|
1371
|
+
agent: true,
|
|
1372
|
+
handler: async (ctx, args) => {
|
|
1373
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
1374
|
+
if (!picking)
|
|
1375
|
+
return invalid('id', 'transfer không tồn tại');
|
|
1376
|
+
if (picking.state === 'draft')
|
|
1377
|
+
return invalid('state', 'xác nhận transfer trước khi giữ hàng');
|
|
1378
|
+
if (picking.state === 'done' || picking.state === 'cancel')
|
|
1379
|
+
return invalid('state', 'transfer đã kết thúc');
|
|
1380
|
+
const allocations = [];
|
|
1381
|
+
const shortages = [];
|
|
1382
|
+
for (const move of await ctx.db.select('stock.Move', { pickingId: args.id })) {
|
|
1383
|
+
const result = (await functions.reserveMove.handler(ctx, { id: move.id }));
|
|
1384
|
+
const reserved = Number(result.reserved ?? 0);
|
|
1385
|
+
allocations.push(...(await ctx.db.select('stock.MoveLine', { moveId: move.id })));
|
|
1386
|
+
const shortage = Math.max(0, Number(move.productUomQty) - reserved);
|
|
1387
|
+
if (shortage)
|
|
1388
|
+
shortages.push({ moveId: move.id, quantity: String(shortage) });
|
|
1389
|
+
}
|
|
1390
|
+
const updated = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
1391
|
+
return { ok: true, state: updated.state, allocations, shortages };
|
|
1392
|
+
},
|
|
1393
|
+
});
|
|
1394
|
+
functions.cancelPicking = defineFn({
|
|
1395
|
+
input: { id: 'id' },
|
|
1396
|
+
output: { ok: 'bool', id: 'id?', errors: 'json?' },
|
|
1397
|
+
effects: [
|
|
1398
|
+
'read:stock.Picking',
|
|
1399
|
+
'write:stock.Picking',
|
|
1400
|
+
'read:stock.Move',
|
|
1401
|
+
'write:stock.Move',
|
|
1402
|
+
'read:stock.MoveLine',
|
|
1403
|
+
'write:stock.MoveLine',
|
|
1404
|
+
'read:stock.Location',
|
|
1405
|
+
'read:stock.Quant',
|
|
1406
|
+
'write:stock.Quant',
|
|
1407
|
+
],
|
|
1408
|
+
idempotent: true,
|
|
1409
|
+
agent: true,
|
|
1410
|
+
handler: async (ctx, args) => {
|
|
1411
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
1412
|
+
if (!picking)
|
|
1413
|
+
return invalid('id', 'transfer không tồn tại');
|
|
1414
|
+
if (picking.state === 'done')
|
|
1415
|
+
return invalid('state', 'transfer đã hoàn thành');
|
|
1416
|
+
await ctx.tx(async (tx) => {
|
|
1417
|
+
for (const move of await tx.db.select('stock.Move', { pickingId: args.id })) {
|
|
1418
|
+
const source = (await tx.db.select('stock.Location', { id: move.locationId }))[0];
|
|
1419
|
+
for (const line of await tx.db.select('stock.MoveLine', { moveId: move.id })) {
|
|
1420
|
+
if (!line.picked && source && ['internal', 'transit'].includes(String(source.usage)))
|
|
1421
|
+
await mutateQuant(tx, {
|
|
1422
|
+
productId: move.productId,
|
|
1423
|
+
locationId: move.locationId,
|
|
1424
|
+
lotId: line.lotId,
|
|
1425
|
+
quantity: 0,
|
|
1426
|
+
reserved: -Number(line.quantity),
|
|
1427
|
+
});
|
|
1428
|
+
await tx.db.update('stock.MoveLine', { id: line.id }, { quantity: '0', quantityProductUom: '0', picked: true });
|
|
1429
|
+
}
|
|
1430
|
+
await tx.db.update('stock.Move', { id: move.id }, { state: 'cancel', quantity: '0', picked: false });
|
|
1431
|
+
}
|
|
1432
|
+
await tx.db.update('stock.Picking', { id: args.id }, { state: 'cancel' });
|
|
1433
|
+
});
|
|
1434
|
+
return { ok: true, id: args.id };
|
|
1435
|
+
},
|
|
1436
|
+
});
|
|
1437
|
+
functions.reconcileReservations = defineFn({
|
|
1438
|
+
input: { productId: 'id?', locationId: 'id?' },
|
|
1439
|
+
output: { ok: 'bool', changed: 'int' },
|
|
1440
|
+
effects: [
|
|
1441
|
+
'read:stock.Move',
|
|
1442
|
+
'read:stock.MoveLine',
|
|
1443
|
+
'read:stock.Location',
|
|
1444
|
+
'read:stock.Quant',
|
|
1445
|
+
'write:stock.Quant',
|
|
1446
|
+
],
|
|
1447
|
+
idempotent: true,
|
|
1448
|
+
agent: true,
|
|
1449
|
+
handler: async (ctx, args) => {
|
|
1450
|
+
const moves = new Map((await ctx.db.select('stock.Move')).map((move) => [String(move.id), move]));
|
|
1451
|
+
const locations = new Map((await ctx.db.select('stock.Location')).map((location) => [String(location.id), location]));
|
|
1452
|
+
const wanted = new Map();
|
|
1453
|
+
for (const line of await ctx.db.select('stock.MoveLine')) {
|
|
1454
|
+
const move = moves.get(String(line.moveId));
|
|
1455
|
+
const location = locations.get(String(line.locationId));
|
|
1456
|
+
if (line.picked ||
|
|
1457
|
+
!move ||
|
|
1458
|
+
['done', 'cancel'].includes(String(move.state)) ||
|
|
1459
|
+
!location ||
|
|
1460
|
+
!['internal', 'transit'].includes(String(location.usage)) ||
|
|
1461
|
+
(args.productId && line.productId !== args.productId) ||
|
|
1462
|
+
(args.locationId && line.locationId !== args.locationId))
|
|
1463
|
+
continue;
|
|
1464
|
+
const id = quantId(ctx, line.productId, line.locationId, line.lotId);
|
|
1465
|
+
wanted.set(id, (wanted.get(id) ?? 0) + Number(line.quantity));
|
|
1466
|
+
}
|
|
1467
|
+
let changed = 0;
|
|
1468
|
+
for (const quant of await ctx.db.select('stock.Quant')) {
|
|
1469
|
+
if (args.productId && quant.productId !== args.productId)
|
|
1470
|
+
continue;
|
|
1471
|
+
if (args.locationId && quant.locationId !== args.locationId)
|
|
1472
|
+
continue;
|
|
1473
|
+
const expected = wanted.get(String(quant.id)) ?? 0;
|
|
1474
|
+
const delta = expected - Number(quant.reservedQuantity);
|
|
1475
|
+
if (Math.abs(delta) > 1e-12) {
|
|
1476
|
+
await mutateQuant(ctx, {
|
|
1477
|
+
productId: quant.productId,
|
|
1478
|
+
locationId: quant.locationId,
|
|
1479
|
+
lotId: quant.lotId,
|
|
1480
|
+
quantity: 0,
|
|
1481
|
+
reserved: delta,
|
|
1482
|
+
});
|
|
1483
|
+
changed++;
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
return { ok: true, changed };
|
|
1487
|
+
},
|
|
1488
|
+
});
|
|
1489
|
+
functions.validatePicking = defineFn({
|
|
1490
|
+
input: { id: 'id', backorder: 'text?' },
|
|
1491
|
+
output: { ok: 'bool', id: 'id?', backorderId: 'id?', errors: 'json?' },
|
|
1492
|
+
effects: functions.completePicking.effects,
|
|
1493
|
+
agent: true,
|
|
1494
|
+
handler: async (ctx, args) => {
|
|
1495
|
+
const picking = (await ctx.db.select('stock.Picking', { id: args.id }))[0];
|
|
1496
|
+
if (!picking)
|
|
1497
|
+
return invalid('id', 'transfer không tồn tại');
|
|
1498
|
+
const type = (await ctx.db.select('stock.PickingType', { id: picking.pickingTypeId }))[0];
|
|
1499
|
+
const moves = await ctx.db.select('stock.Move', { pickingId: args.id });
|
|
1500
|
+
let hasRemaining = false;
|
|
1501
|
+
for (const move of moves) {
|
|
1502
|
+
const done = (await ctx.db.select('stock.MoveLine', { moveId: move.id }))
|
|
1503
|
+
.filter((line) => line.picked)
|
|
1504
|
+
.reduce((sum, line) => sum + Number(line.quantity), 0);
|
|
1505
|
+
if (done + 1e-12 < Number(move.productUomQty))
|
|
1506
|
+
hasRemaining = true;
|
|
1507
|
+
}
|
|
1508
|
+
let createBackorder = false;
|
|
1509
|
+
if (hasRemaining && type?.createBackorder === 'always')
|
|
1510
|
+
createBackorder = true;
|
|
1511
|
+
else if (hasRemaining && type?.createBackorder === 'ask') {
|
|
1512
|
+
if (!['create', 'cancel'].includes(String(args.backorder ?? '')))
|
|
1513
|
+
return invalid('backorder', 'phải chọn create hoặc cancel');
|
|
1514
|
+
createBackorder = args.backorder === 'create';
|
|
1515
|
+
}
|
|
1516
|
+
return functions.completePicking.handler(ctx, {
|
|
1517
|
+
id: args.id,
|
|
1518
|
+
createBackorder,
|
|
1519
|
+
pickedOnly: true,
|
|
1520
|
+
});
|
|
1521
|
+
},
|
|
1522
|
+
});
|
|
1523
|
+
//# sourceMappingURL=functions.js.map
|