PurchaseInvoice

This component allows you set up and maintain purchase invoices and runs the Purchase Invoice Entry (PIE) function.

This component also provides various methods that allow you to progress purchase invoices through certain stages.

To improve performance, ensure that line numbers are in numerical order, as disordered line numbers will impact performance. If both the User Line Number (PurchaseInvoice.PurchaseInvoiceLine.UserLineNumber) and the System Line Number (PurchaseInvoice.PurchaseInvoiceLine.PurchaseInvoiceLineNumber) are provided, then User Line Number is used. This applies to all methods except GenerateAndMatch and Query.

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.

Methods

ConfirmLineInvoice
Driver Type: SASI
Use this method to confirm one or more purchase invoice lines. If no line numbers are specified in the payload, the entire invoice, including all lines, is confirmed.
PurchaseInvoiceReference is mandatory. If the PurchaseInvoiceLine section is included in the payload, it must contain UserLineNumber or PurchaseInvoiceLineNumber. If both are provided, UserLineNumber is used.
CreateOrAmend
Driver Type: SASI

Use this method to create or amend one or more purchase invoices. A purchase invoice is created if it does not exist and amends it if it does.

Note: If amending a purchase invoice, PurchaseInvoiceReference must be provided. If PurchaseInvoiceReference is specified in the payload, but there is no existing invoice with this reference, then a new invoice is created. However, the new invoice may have a different transaction reference, depending on the transaction type used, i.e. if the associated transaction reference format does not contain any items for a user to specify, then the purchase invoice reference will be system generated, and the existing payload values are not used.
CreateOrAmendAndConfirm
Driver Type: SASI
Use this method to create or amend, and confirm, one or more purchase invoices. A purchase invoice is created if it does not exist and amended it if it does. It then confirms the invoice.
Note: If amending a purchase invoice, PurchaseInvoiceReference must be provided. If PurchaseInvoiceReference is specified in the payload, but there is no existing invoice with this reference, then a new invoice is created. However, the new invoice may have a different transaction reference, depending on the transaction type used, i.e. if the associated transaction reference format does not contain any items for a user to specify, then the purchase invoice reference will be system generated, and the existing payload values are not used.
DeleteLineInvoice
Driver Type: SASI
Use this method to delete one or more purchase invoice lines. If no line numbers are specified in the payload, the entire invoice including all lines is deleted.
PurchaseInvoiceReference is mandatory. If the PurchaseInvoiceLine section is included in the payload, it must contain UserLineNumber or PurchaseInvoiceLineNumber. If both are provided, UserLineNumber is used.
DeleteLines
Driver Type: SASI
Use this method to delete specific lines from a purchase invoice.
PurchaseInvoiceReference is mandatory and either UserLineNumber or PurchaseInvoiceLineNumber must be specified. If both are provided, UserLineNumber is used.
DeleteWholeInvoice
Driver Type: SASI
Use this method to delete a purchase invoice and all lines.
PurchaseInvoiceReference is mandatory.
HoldLineInvoice
Driver Type: SASI
Use this method to hold one or more purchase invoice lines. If no line numbers are specified in the payload, the entire invoice including all lines is held.
PurchaseInvoiceReference is mandatory. If the PurchaseInvoiceLine section is included in the payload, it must contain UserLineNumber or PurchaseInvoiceLineNumber. If both are provided, UserLineNumber is used.
Query
Driver Type: Export
Use this method to obtain purchase invoice details or to extract purchase invoice data from SunSystems.
ReleaseLineInvoice
Driver Type: SASI
Use this method to release one or more purchase invoice lines. If no line numbers are specified in the payload, the entire invoice including all lines is released.
PurchaseInvoiceReference is mandatory. If the PurchaseInvoiceLine section is included in the payload, it must contain UserLineNumber or PurchaseInvoiceLineNumber. If both are provided, UserLineNumber is used.
GenerateAndMatch
Driver Type: SASI
Use this method to generate purchase invoices per suppliers. It then matches invoices back to purchase orders.
If you want to create a purchase invoice for one purchase order, you need to set POReferenceFrom and POReferenceTo to the order reference. If the From/To values are not supplied, it will be interpreted as the first/last order reference satisfying the other selection criteria. This might cause failures if the order range goes across different supplier codes.
An order range can be specified, in which case all of the orders in the range go to one purchase invoice. This order range must be for the same supplier code.
One payload can contain orders for multiple suppliers. The selection criteria for each supplier must be within a new <Input> node.
The following example shows a simple version of this part of the payload:
<SSC>
		<SunSystemsContext>
				<BusinessUnit></BusinessUnit>
		</SunSystemsContext>
		<Payload>
				<Input>
						<POReferenceFrom></POReferenceFrom>
						<POReferenceTo></POReferenceTo>
						<PurchaseTransactionType></PurchaseTransactionType>
						<SupplierCode></SupplierCode>
				</Input>
				<Input>
						<POReferenceFrom></POReferenceFrom>
						<POReferenceTo></POReferenceTo>
						<PurchaseTransactionType></PurchaseTransactionType>
						<SupplierCode></SupplierCode>
				</Input>
		</Payload>
</SSC>
Note: The match action happens at the order level; not line level.

Mandatory fields

General
As purchase invoices can be tailored to suit customer needs, there are no fields that are always mandatory. As a guide though, you will probably find that the following may need to be supplied:
  • Purchase Transaction Type - payload element <PurchaseTransactionType>
  • Purchase Invoice Reference - payload element <PurchaseInvoiceReference>
  • Either User Line Number - payload element <UserLineNumber> or Purchase Invoice Line Number - payload element <PurchaseInvoiceLineNumber>
  • Supplier Code - payload element <SupplierCode>
  • Item Code - payload element <ItemCode>.
See individual methods for specific field requirements. PurchaseInvoiceLineNumber is never mandatory, but depending on the method, you will need either UserLineNumber or PurchaseInvoiceLineNumber.
Standard Text
When creating or attaching Standard Text associated with a Purchase Invoice, values for the following must be supplied:
  • Purchase Invoice Reference - payload element <StdTextPi_PiTxnRef>
  • Standard Text Class Code - payload element <StdTextPi_StdTextClassCode>
  • Standard Text Code - payload element <StdTextPi_StdTextCode>.
When creating or attaching Standard Text associated with a Purchase Invoice Line, values for the following must be specified:
  • Purchase Invoice Reference - payload element <StdTextPil_PiTxnRef>
  • Purchase Invoice Line Number - payload element <StdTextPil_PilNum>
  • Standard Text Class Code - payload element <StdTextPil_StdTextClassCode>
  • Standard Text Code - payload element <StdTextPil_StdTextCode>.
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

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