Framework
A custom quote import should use the same total calculation and numbering rules as a quote created in the back office. Resolve the Sales services from the current container and let them perform the operation on behalf of the importing module.
| Service key | Description |
|---|---|
salesCalculationService | Runs the full document and line calculation pipeline. Always use this instead of inline price math. |
taxCalculationService | Handles tax calculation for sales documents. |
salesDocumentNumberGenerator | Generates sequential document numbers for orders, quotes, invoices, etc. |
// src/modules/<your_module>/di.ts
export function register(container) {
// salesCalculationService is already registered by the sales module
}
// In a command handler or service:
const calcService = container.resolve('salesCalculationService')
Previous: Search indexes for sales records · Next: Built-in Subscribers