PurchaseTypes

This component runs the Purchase Types (PTS) function.

Methods

Closed
Driver Type: SASI
Use this method to change the status of a purchase type to Closed.
Create
Driver Type: SASI
Use this method to create a purchase type. If the purchase type already exists, an error message is produced and the payload is rejected.
CreateAsDraft
Driver Type: SASI
Use this method to create a draft purchase type.
CreateOrAmend
Driver Type: SASI
Use this method to create or amend one or more purchase types. A purchase type is created if it does not exist and amended if it does. Whereas the Create and Amend methods depend on you to know whether the data does or does not exist in advance, this method can be used if you are unsure.
Note: Do not include Stage data in the payload for this method if there are existing Stage records for the transaction type. The update/insert of Stage records is prevented if any Stage data already exists. In this case, Stage records must be created/amended via SunSystems.
Delete
Driver Type: SASI
Use this method to delete purchase types.
Note: You cannot delete a PurchaseTypes record if child data, such as Stage or Value data, exist. When this occurs, use the DeleteChildData method prior to using the Delete method.
DeleteChildData
Driver Type: SASI
Use this method to delete child data (PO Assign Preset, PI Assign Preset, PO Analysis, Value, Stage) but retain the parent record (Purchase Type).
It is also possible to delete 'grandchild' data. The deletion of child and grandchild data is controlled by a <DeletionFlag> node at child level. If the flag is set to Y, both child and grandchild is deleted. Otherwise, the child data is retained.
For example, the <Stage> node contains child data, and the <LedgerIFReversal> node contains grandchild data. The <DeletionFlag> node is set to Y, so the <LedgerInterfaceDefinitionCode> data is deleted first, followed by the <Stage> data:
<PurchaseTypes>
		<PurchaseTypes.PurchaseTransactionType>PUR</PurchaseTypes.PurchaseTransactionType>
		<Stage>
				<Stage>0</Stage>
				<DeletionFlag>
						<DeleteStageAfterLIReversalDeleted>Y</DeleteStageAfterLIReversalDeleted>
				</DeletionFlag>
				<LedgerIFReversal>
						<LedgerInterfaceDefinitionCode>LIDEF</LedgerInterfaceDefinitionCode>
				</LedgerIFReversal>
		</Stage>
</PurchaseTypes>
Note: Stage data must be deleted in reverse order, i.e. you must not delete a stage that is defined as a Sequence on another record.

A SalesTypes payload deleting Sales Quantity is invalid and will return the error message One Sales Quantity must be set per Sales Transaction Type. This is because all Order Fulfilment transaction types must have one value label that is flagged as the Quantity.

Hidden
Driver Type: SASI
Use this method to change the status of a purchase type to Hidden.
Open
Driver Type: SASI
Use this method to change the status of a purchase type to Open.
Query
Driver Type: Export
Use this method to obtain purchase type details or to extract purchase types data from SunSystems.
Suspended/Held
Driver Type: SASI
Use this method to change the status of a purchase type to Suspended/Held.

Mandatory fields

General
  • When creating, amending or deleting a purchase type, a value must be supplied for the Purchase Transaction Type - payload element <PurchaseTransactionType>
  • When creating or amending purchase type accounts, a value must be supplied for:
    • Account Recognition Code - payload element <AccountRecognitionCode>
    • Account Code - payload element <AccountCode>
  • When creating or amending purchase type presets, a value must be supplied for the Preset Code - payload element <PresetCode>
  • When creating or amending purchase type stage, a value must be supplied for the Stage - payload element <Stage>
  • When creating or amending purchase type stage ledger interface reversal, a value must be supplied for the Ledger Interface Type - payload element <LedgerInterfaceType>
  • When creating or amending purchase type value entries, a value must be supplied for the Value Label Short Heading - payload element <ShortHeading>
Deleting Child Data
  • When deleting child data, a value must be supplied for the Purchase Transaction Type - payload element <PurchaseTransactionType>
  • When deleting PI Assign Preset child data, a value must be supplied for PI Assign Preset Code - payload element <PIAssignPreset.PresetCode>
  • When deleting PO Assign Preset child data, a value must be supplied for the PO Assign Preset Code - payload element <POAssignPreset.PresetCode>
  • When deleting PO Analysis child data, a value must be supplied for the PO Analysis Category ID - payload element <POAnalysis.AnalysisCategoryID.AnlCat_Shead>
  • When deleting Value child data, a value must be supplied for:
    • Value Category ID - payload element <Value.ValueCategoryID.ShortHeading>
    • Value Label Type - payload element <Value.ValueLabelValueType>
  • To delete Stage data, or establish the key of the Ledger IF Reversal data to be deleted, a value must be supplied for the Stage - payload element <Stage.Stage>
  • <Stage.LedgerIFReversal.LedgerInterfaceDefinitionCode>If Ledger IF Reversal is to be deleted, a value must also be supplied for the Ledger Interface Definition Code - payload element
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.

Related data

  • Account Recognition Code
  • Value Label
  • Purchase Order Assign Preset
  • Purchase Invoice Assign Preset
  • Stage including Ledger IF Reversal
  • Purchase Order Analysis.