W164: Bulk-import sales orders
Creates many SOs at once from an uploaded CSV or Excel file. Triggered from the Data page, SO import. Atomic.
Steps
-
Parse the upload. Read the file into rows of
{ header, items[] }. Collect parse errors into a list. -
Abort on parse failures. Raise a
ValidationErrorlisting the failed rows. Nothing is persisted. -
Create each SO inside one transaction. For each parsed row, run W144 steps 1 to 5 inside
withTransaction. The step-5 reconciliation projector seeds FGDEMAND/ALLOCATE/CONSUMEledger entries per the row's initial status. -
Commit. Any single-row failure rolls the whole batch back.
Returns
The list of created SO numbers.
Business rules
- All or nothing. Atomic import.
Errors
ValidationError. Parse failures or any single row failing the Create SO rules.