diff --git a/_includes/reference.html b/_includes/reference.html deleted file mode 100644 index 529fe00..0000000 --- a/_includes/reference.html +++ /dev/null @@ -1,35 +0,0 @@ -Each {{ label }} is uniquely identified by a Reference field. - -

Reference Pattern

-

- The {{ label }} reference field must conform to a (configurable) pattern, allowing users to define a standard for identifying individual orders.
- In addition to being used ensure the reference fields conform to a standard format, the reference pattern is also used to automatically generate sequential reference values. -

-

- The default pattern for the {{ label }} reference pattern is {{ prefix }}{ref:04d}.
- This will generate a sequence of reference values like: - -

- - The {{ label }} reference pattern can be configured to generate a different reference sequence as required. -

-

- The {{ label }} pattern is implemented as follows: -

-

- -
-

Reference Formatting

-

- The reference field pattern uses Python string formatting for value substitution. -

-
\ No newline at end of file diff --git a/docs/build/build.md b/docs/build/build.md index f435411..fa5a545 100644 --- a/docs/build/build.md +++ b/docs/build/build.md @@ -42,9 +42,7 @@ To navigate to the Build Order display, select *Build* from the main navigation ### Build Order Reference -{% with prefix="BO-", label="Build Order" %} -{% include "reference.html" %} -{% endwith %} +Each Build Order is uniquely identified by its *Reference* field. Read more about [reference fields](../settings/reference.md). ### Build Parameters diff --git a/docs/buy/po.md b/docs/buy/po.md index cf098f6..1750767 100644 --- a/docs/buy/po.md +++ b/docs/buy/po.md @@ -14,9 +14,7 @@ To access the purchase order page, click on the Python string formatting for value substitution. + +!!! tip "Date Formatting" + The `{% raw %}{date}{% endraw %}` variable can be formatted using the [Python Format Codes](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior). + +#### Substitution Examples + +Some examples below demonstrate how the variable substitution can be implemented: + +| Pattern | Description | Example Output | +| --- | --- | --- | +| `{% raw %}PO-{ref}{% endraw %}` | Render the *reference* variable without any custom formatting | PO-123 | +| `{% raw %}PO-{ref:05d}{% endraw %}` | Render the *reference* variable as a 5-digit decimal number | PO-00123 | +| `{% raw %}PO-{ref:05d}-{date:%Y-%M-%d}{% endraw %}` | Render the *date* variable in isoformat | PO-00123-2023-01-17 | diff --git a/mkdocs.yml b/mkdocs.yml index ccc5f08..c083c17 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -124,6 +124,7 @@ nav: - Admin: - Global Settings: settings/global.md - User Settings: settings/user.md + - Reference Patterns: settings/reference.md - Admin Interface: settings/admin.md - User Permissions: settings/permissions.md - Single Sign on: settings/SSO.md