Currently the prefix and suffix are combined with a sequence number and stored as a single value "poNumber". That doesn't change. However,
MODORDSTOR-133 introduces two additional fields "poNumberPrefix" and "poNumberSuffix" which should be populated upon order creation. This is an enabler for several features.
Given the user enters:
- prefix: FOO
- poNumber: 10001 (auto-populated)
- suffix: BAR
Then the order json would be populated as follows:
- This story only covers the "new" order form. Edit form changes will be handled in a separate story.
- The new fields do not need to be displayed in the order details pane (or anywhere). At this time they are only needed for internal use
- the prefix and suffix continue to be incorporated into the poNumber field
- the prefix and suffix are also stored independently in the new poNumberPrefix and poNumberSuffix fields
Note as discussed with devs the following has also been included in this issue from
When an order is edited
Parse and extract the number/sequence part of the poNumber using the new "poNumberPrefix" and "poNumberSuffix" fields.
e.g. Given poNumber: FOO10001BAR, poNumberPrefix: FOO, poNumberSuffix: BAR
Then the "poNumber" field should be populated with 10001
Pre-populate the prefix and suffix drop-downs with the values from "poNumberPrefix" and "poNumberSuffix"
If the setting is such that poNumbers can't be edited, disable the prefix and suffix drop-downs
When saved, the values of "prefix" and "suffix" are persisted in the corresponding "poNumberPrefix" and "poNumberSuffix" fields. The prefix, suffix, and poNumber are combined (<prefix> + <sequence> + <suffix>) and stored in the "poNumber" field.
This story only covers the order edit form, related changes to other forms/views will be addressed in separate stories
the edit form adjustments described above are made