Categorie: reference Bijgewerkt: 2026-04-08 actionfield workflow actionfield1052

ActionField1052

Beschrijving: Create Invoices for PaymentTransactionRun. Custom: Nee

Propertiesbewerken

Property Type Accessor
PaymentTransactionRun PaymentTransactionRun Root
PaymentTransactionContext Context Optional

XMLbewerken

<Workflow Name="ActionField1052" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Create Invoices for PaymentTransactionRun.</Description>
	<Properties>
		<Property	Name="PaymentTransactionRun"		Type="PaymentTransactionRun"	Accessor="Root"		Direction="In" />

		<Property	Name="PaymentTransactionContext"	Type="Context"					Accessor="Optional"	Direction="In"		Default="PaymentTransactionContext.Refueling"	Comment="Context used for message #2214" />

		<Property	Name="NegativePaymentTransactions"	Type="List[PaymentTransaction]"	Accessor="Internal" />
		<Property	Name="PositivePaymentTransactions"	Type="List[PaymentTransaction]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Validation Name="PaymentTransactionRunStatus OK?" Condition="${PaymentTransactionRun.Status} == PaymentTransactionRunStatus.Valid" MessageCode="2049">
			<Parameter	Name="Action"					Direction="In"		Value="CreateInvoices" />
			<Parameter	Name="PaymentTransactionRun"	Direction="In"		Value="${PaymentTransactionRun}" />
		</Validation>
		<Validation Name="Invoices not already created?" Condition="${PaymentTransactionRun.InvoicesCreated} == False" MessageCode="2051">
			<Parameter	Name="PaymentTransactionRun"	Direction="In"		Value="${PaymentTransactionRun}" />
		</Validation>

		<Transaction>
			<GetList Name="Get all transactions having a positive quantity" Type="PaymentTransaction" OutputProperty="${PositivePaymentTransactions}" OrderBy="Site" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="PaymentTransactionRun"	Operator="="		PropertyValue="${PaymentTransactionRun}" />
					<PropertyFilter	PropertyName="Quantity"					Operator="&gt;="	PropertyValue="0" />
					<PropertyFilter	PropertyName="Price"					Operator="!="		PropertyValue="0" />
					<PropertyEmptyFilter PropertyName="InvoiceLine" />
				</Filters>
			</GetList>

			<GetList Name="Get all transactions having a negative quantity" Type="PaymentTransaction" OutputProperty="${NegativePaymentTransactions}" OrderBy="Site" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="PaymentTransactionRun"	Operator="="		PropertyValue="${PaymentTransactionRun}" />
					<PropertyFilter	PropertyName="Quantity"					Operator="&lt;"		PropertyValue="0" />
					<PropertyFilter	PropertyName="Price"					Operator="!="		PropertyValue="0" />
					<PropertyEmptyFilter PropertyName="InvoiceLine" />
				</Filters>
			</GetList>
		</Transaction>

		<Choose Name="any transactions found?">
			<When Name="When no transactions with cost found" Condition="${NegativePaymentTransactions.Count} == 0 &amp;&amp; ${PositivePaymentTransactions.Count} == 0">
				<Message Name="NoInvoicesCreatedBecauseNoPaymentTransactionsWithCostFound" MessageCode="2214">
					<Parameter	Name="PaymentTransactionContext"	Direction="In"		Value="${PaymentTransactionContext}" />
				</Message>
			</When>

			<Otherwise Name="When transactions with cost are found">
				<WorkflowCall Name="Create invoices for payment transactions" WorkflowName="PaymentTransactionRun_CreateInvoices">
					<Parameter	Name="CreditInvoice"			Direction="In"		Value="False" />
					<Parameter	Name="PaymentTransactionRun"	Direction="In"		Value="${PaymentTransactionRun}" />
					<Parameter	Name="PaymentTransactions"		Direction="In"		Value="${PositivePaymentTransactions}" />
				</WorkflowCall>

				<WorkflowCall Name="Create invoices for payment transactions" WorkflowName="PaymentTransactionRun_CreateInvoices">
					<Parameter	Name="CreditInvoice"			Direction="In"		Value="True" />
					<Parameter	Name="PaymentTransactionRun"	Direction="In"		Value="${PaymentTransactionRun}" />
					<Parameter	Name="PaymentTransactions"		Direction="In"		Value="${NegativePaymentTransactions}" />
				</WorkflowCall>
			</Otherwise>
		</Choose>

		<Transaction>
			<Assign Name="Set InvoicesCreated flag" Property="${PaymentTransactionRun.InvoicesCreated}" Value="True" />

			<Choose Name="Check setting to see if all required processing is done">
				<When Name="When setting is InvoicesOnly" Condition="#{UltimoSettings.RequirementsToProcessPaymentTransactionRun} == InvoicesOnly">
					<ChangeStatus Name="Change status of PaymentTransactionRun" DomainObject="${PaymentTransactionRun}" NewStatus="PaymentTransactionRunStatus.Processed" />
				</When>


				<When Name="When setting is ValuesAndInvoices" Condition="#{UltimoSettings.RequirementsToProcessPaymentTransactionRun} == ValuesAndInvoices">
					<When Name="When values are also processed already" Condition="${PaymentTransactionRun.ValuesProcessed} == True">
						<ChangeStatus Name="Change status of PaymentTransactionRun" DomainObject="${PaymentTransactionRun}" NewStatus="PaymentTransactionRunStatus.Processed" />
					</When>
				</When>
			</Choose>
		</Transaction>

		<UserContent Name="Post" />
	</Execution>
</Workflow>