PurchaseOrder

This component allows you set up and maintain purchase orders and runs the Purchase Order Entry (POE) function.

This component also provides various methods that allow you to progress purchase orders through certain stages. If doing so, you must ensure that purchase orders are at the correct stage in order to be processed.

Note: This Help contains hyperlinks that are enabled when the Help is accessed within the application. However, if you have accessed this Help via the SunSystems Web portal, hyperlinks are not enabled.

Depending on how your purchase type stages have been set up, some component methods may not be relevant.

There are three ways to improve performance of purchase order imports:

  • Restricting the payload - the payload definition for purchase orders is composed of all data items that are used within order fulfillment. As your SunSystems installation may not use all available data items, you can reduce the time taken to process purchase orders by ensuring that your payloads only include those data items that you wish to work with.
  • Reduce the number of processing options in SunSystems. If you are importing Purchase Orders from an external application you can set up a particular purchase type that does not carry out the various calculations, validations and lookups that would normally happen. For example, you might ensure that budget checking and inventory allocation do not occur at order entry. These can significantly increase the time taken to process a given Purchase Order.
  • Ensure that line numbers are in numerical order as disordered line numbers will impact performance. If both the User Line Number (PurchaseOrder.PurchaseOrderLine.UserLineNumber) and the System Line Number (PurchaseOrder.PurchaseOrderLine.LineNumber) are provided, then User Line Number is used.
Note: SunSystems is unable to export purchase orders that have more than 33 value labels defined on them.

We do not support the import of Purchase Orders using a 'Start of Document', 'Line' or 'End of Document' preset type. 'Start of Document' and 'Line' preset types can cause inconsistency in the line numbers. For example, when importing a new Purchase Order using a 'Start of Document' preset type, the order is created with a preset line, then imported into a Purchase Type that also creates a preset line.

Creating new orders line using the 'End of Document' preset type will not work, because an empty line is required to insert the new lines information. However, the empty line is not present if this preset type has been used.

Methods

Note: Purchase Order Budget Override Flag (element PurchaseOrder.FlagOptions.BudgetOverrideFlag) controls the response to the budget override message, which occurs when budget checking fails. Values are 1 (Yes) or 0 (No). It can be used in any method where a budget override message may occur. For example, if the budget override message occurs during the entry stage, a response of 1, or Yes, overrides the message. A response of 0, or No, results in the lines being held. If the budget override message occurs during the confirm stage, a response of 1 results in completion whereas a response of 0 results in the rejection.
Approve
Driver Type: SASI
Use this method to approve an entire order or one or more lines within a purchase order.
The approval is performed at either line or order level, according to whether line information is supplied in the payload. If the line information is supplied then SSC calls the 'Approve Line' action from the Purchase Order Entry function, otherwise the 'Approve' action is called.
Approval (whether line-level or order-level) is performed by default. If an Unapprove is required, additional data must be added to the payload. The Unapprove flag must be set to Y and a Reason Code provided. See Examples of the Approve Method.
If the PurchaseOrderLine section is included in the payload, then UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
Note: Purchase Order Reference (payload element PurchaseOrderReference) is always required for the Approve method. Reason Code is required if Unapprove is used.
ConfirmLineOrder
Driver Type: SASI
Use this method to confirm one or more purchase order lines. If no line numbers are specified in the payload, the entire order, including all lines, is confirmed.
PurchaseOrderReference is mandatory. If the PurchaseOrderLine section is included in the payload, UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
CreateOrAmend
Driver Type: SASI
This method creates a purchase order if it does not exist already, and amends it if it does.
Note: To create/amend a temporary address via the Purchase Order CreateOrAmend method an extra setting must be added to the payload. Any temporary address data is ignored unless a value is provided for payload element PurchaseOrder.PurchaseOrderLine.TemporaryAddress.POAddressType.PurchaseAddressType to indicate the type of temporary address being created/amended.

Valid values are:

  • 1 - Supplier address
  • 2 - Invoice address
  • 3 - Order address
  • 4 - Delivery address.

If amending a purchase order, PurchaseOrderReference must be provided. If PurchaseOrderReference is specified in the payload, but there is no existing order with this reference, then a new order is created. However, the new order may have a different transaction reference, depending on the Purchase Transaction Type used, i.e. if the associated transaction reference format does not contain any items for a user to specify, then the purchase order reference will be system generated, and the existing payload values are not used.

DeleteLineOrder
Driver Type: SASI
Use this method to delete one or more purchase order lines. If no line numbers are specified in the payload, the entire order, including all lines, is deleted.
PurchaseOrderReference is mandatory. If the PurchaseOrderLine section is included in the payload, UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
DeleteLines
Driver Type: SASI
Use this method to delete specific lines from a purchase order.
PurchaseOrderReference is mandatory and either UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
DeleteWholeOrder
Driver Type: SASI
Use this method to delete a purchase order and all lines.
PurchaseOrderReference is mandatory.
HoldLineOrder
Driver Type: SASI
Use this method to hold one or more purchase order lines. If no line numbers are specified in the payload, the entire order, including all lines, is held.
PurchaseOrderReference is mandatory. If the PurchaseOrderLine section is included in the payload, UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
ReleaseLineOrder
Driver Type: SASI
Use this method to release one or more purchase order lines. If no line numbers are specified in the payload, the entire order including all lines is released.
PurchaseOrderReference is mandatory. If the PurchaseOrderLine section is included in the payload, UserLineNumber or LineNumber must be specified. If both are provided, UserLineNumber is used.
Query
Driver Type: Export
Use this method to obtain purchase order details or to extract purchase order data from SunSystems.

Mandatory fields

As purchase orders can be tailored to suit customer needs, there are no fields that are always mandatory. The minimum amount of data required for entering purchase orders is very small. However, you should bear in mind that the actual amount needed to create meaningful orders and to progress those orders is much larger. This is wholly dependent on how your system is configured.

As a guide, you may find that the following need to be supplied:

  • Purchase Transaction Type - payload element <PurchaseTransactionType>
  • Purchase Order Reference - payload element <PurchaseOrderReference>
  • Either User Line Number - payload element <UserLineNumber> or Line Number - payload element <LineNumber>
  • Item Code - payload element <ItemCode>.

See individual methods for specific field requirements.

Note: At runtime the component validates the payload contents to ensure that the values supplied are correct. Various combinations of values may require other elements in the payload to be specified before the payload can be processed successfully.

Examples of the Approve Method

The following example is used to unapprove all lines on the purchase order:

<PurchaseOrder>
		<PurchaseOrderReference>PO/002104</PurchaseOrderReference>
				<Approval>
					<Unapprove>Y</Unapprove>
					<ReasonCode>DAMAGED</ReasonCode>
				</Approval>
		</PurchaseOrder>

The following example is used to unapprove line 1 and Approve lines 2 and 3 on the purchase order:

<PurchaseOrder>
		<PurchaseOrderReference>PO/002104</PurchaseOrderReference>
				<PurchaseOrderLine>LineNumber>1</LineNumber>
				<Approval>
						<Unapprove>Y</Unapprove>
						<ReasonCode>DAMAGED</ReasonCode>
				</Approval>
		</PurchaseOrderLine>
		<PurchaseOrderLine>
				<LineNumber>2</LineNumber>
				<Approval>
						<Unapprove>N</Unapprove>
						<ReasonCode>DAMAGED</ReasonCode>
				</Approval>
		</PurchaseOrderLine>
		<PurchaseOrderLine>
				<LineNumber>3</LineNumber>
		</PurchaseOrderLine>
</PurchaseOrder>

Related data

  • Stage
  • Item Characteristics
  • Analysis Quantity 1-10
  • Approval Stamp
  • Consumed Budget
  • Value Labels 1-50
  • Temporary Address
  • Purchase Order Standard Text
  • Purchase Order Line Standard Text.