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

ActionField1269

Beschrijving: Recalculate the Prices of PurchaseLine from currency of Purchase Custom: Nee

Propertiesbewerken

Property Type Accessor
Purchase Purchase Root

XMLbewerken

<Workflow Name="ActionField1269" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Recalculate the Prices of PurchaseLine from currency of Purchase</Description>
	<Properties>
		<Property	Name="Purchase"			Type="Purchase"				Accessor="Root"		Direction="In" />

		<Property	Name="PurchaseLines"	Type="List[PurchaseLine]"	Accessor="Internal" />
	</Properties>
	<Execution>
		<UserContent Name="Pre" />

		<Transaction>
			<Command Name="FindExchangeRateForBookDate" CommandName="FindExchangeRateForBookDate">
				<Parameter	Name="CounterCurrency"	Direction="In"		Value="${Purchase.Currency}" />
				<Parameter	Name="Date"				Direction="In"		Value="${Purchase.BookDate}" />
				<Parameter	Name="ConversionFactor"	Direction="Out"										OutputProperty="${Purchase.CurrencyConversionFactor}" />
				<Parameter	Name="Rate"				Direction="Out"										OutputProperty="${Purchase.CurrencyRate}" />
			</Command>

			<GetList Name="Get PurchaseLines" Type="PurchaseLine" OutputProperty="${PurchaseLines}" OrderBy="Id" OrderDirection="Ascending">
				<Filters>
					<PropertyFilter	PropertyName="Id.Purchase"	Operator="="		PropertyValue="${Purchase}" />
				</Filters>
			</GetList>

			<ForEach Name="Foreach PurchaseLine" In="${PurchaseLines}" As="PurchaseLine">
				<When Name="Purchase has CurrencyConversionFactor" Condition="${Purchase.CurrencyConversionFactor} != 0">
					<Command Name="CalculateCurrency" CommandName="CalculateCurrency">
						<Parameter	Name="ConversionFactor"	Direction="In"		Value="${Purchase.CurrencyConversionFactor}" />
						<Parameter	Name="Decimals"			Direction="In"		Value="${PurchaseLine.TotalPrice.DecimalDigits}" />
						<Parameter	Name="Rate"				Direction="In"		Value="${Purchase.CurrencyRate}" />
						<Parameter	Name="ToCalculate"		Direction="In"		Value="${PurchaseLine.TotalPrice}" />
						<Parameter	Name="Calculated"		Direction="Out"															OutputProperty="${PurchaseLine.StandardTotalPrice}" />
					</Command>

					<Assign Name="Set StandardVatPrice" Property="${PurchaseLine.StandardVatPrice}" Value="=${PurchaseLine.StandardTotalPrice} * (${PurchaseLine.VatPercentage} / 100)" />
					<Assign Name="Set StandardTotalPriceIncludingVat" Property="${PurchaseLine.StandardTotalPriceIncludingVat}" Value="=${PurchaseLine.StandardTotalPrice} + ${PurchaseLine.StandardVatPrice}" />
				</When>
			</ForEach>
		</Transaction>

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