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

ActionField774

Beschrijving: Batch de-activate and activate Depreciation for Equipments. Custom: Nee

Propertiesbewerken

Property Type Accessor
SetFirstDayOfMonth Boolean Optional

XMLbewerken

<Workflow Name="ActionField774" Version="2025.07.28" WorkflowType="Standard" xmlns="urn:Ultimo.Framework.Workflow-mapping">
	<Security EditLevel="10" ViewLevel="20" UserContentLevel="30" />
	<Description>Batch de-activate and activate Depreciation for Equipments.</Description>
	<Properties>
		<Property	Name="SetFirstDayOfMonth"	Type="Boolean"			Accessor="Optional"	Direction="In"		Default="True"	Comment="Set DepreciationStartDate to first day of month" />

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

		<Transaction>
			<GetList Name="Get Equipments with DepreciationType method Linear" Type="Equipment" OutputProperty="${Equipments}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="DepreciationMethodTax"	Alias="depmtax"	Type="InnerJoin" />
					<Join	Name="depmtax.DepreciationType"	Alias="deptype"	Type="InnerJoin" />
				</Joins>
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationActivated"	Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="PurchasePrice"			Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="DepreciationStartDate" />
						</NotFilter>
						<PropertyFilter	PropertyName="depmtax.Activated"		Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="deptype.Method"			Operator="="		PropertyValue="Linear" />
						<PropertyFilter	PropertyName="depmtax.Life"				Operator="&gt;"		PropertyValue="0" />
					</CombinedFilter>
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="EachEquipment" In="${Equipments}" As="Equipment">
			<WorkflowCall Name="Deactivate depreciation" WorkflowName="Equipment_DeactivateDepreciation">
				<Parameter	Name="Equipment"	Direction="In"		Value="${Equipment}" />
			</WorkflowCall>

			<WorkflowCall Name="Activate depreciation" WorkflowName="Equipment_ActivateDepreciation">
				<Parameter	Name="AskQuestionFirstDayMonth"	Direction="In"		Value="False" />
				<Parameter	Name="Equipment"				Direction="In"		Value="${Equipment}" />
				<Parameter	Name="SetFirstDayOfMonth"		Direction="In"		Value="${SetFirstDayOfMonth}" />
			</WorkflowCall>
		</ForEach>

		<Transaction>
			<GetList Name="Get Equipments with DepreciationType method LinearToResidualValue" Type="Equipment" OutputProperty="${Equipments}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="DepreciationMethodTax"	Alias="depmtax"	Type="InnerJoin" />
					<Join	Name="depmtax.DepreciationType"	Alias="deptype"	Type="InnerJoin" />
				</Joins>
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationActivated"	Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="PurchasePrice"			Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="DepreciationStartDate" />
						</NotFilter>
						<PropertyFilter	PropertyName="depmtax.Activated"		Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="deptype.Method"			Operator="="		PropertyValue="LinearToResidualValue" />
						<PropertyFilter	PropertyName="ResidualValue"			Operator="&gt;"		PropertyValue="0" />
						<PropertyFilter	PropertyName="depmtax.Life"				Operator="&gt;"		PropertyValue="0" />
					</CombinedFilter>
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="EachEquipment" In="${Equipments}" As="Equipment">
			<WorkflowCall Name="Deactivate depreciation" WorkflowName="Equipment_DeactivateDepreciation">
				<Parameter	Name="Equipment"	Direction="In"		Value="${Equipment}" />
			</WorkflowCall>

			<WorkflowCall Name="Activate depreciation" WorkflowName="Equipment_ActivateDepreciation">
				<Parameter	Name="AskQuestionFirstDayMonth"	Direction="In"		Value="False" />
				<Parameter	Name="Equipment"				Direction="In"		Value="${Equipment}" />
				<Parameter	Name="SetFirstDayOfMonth"		Direction="In"		Value="${SetFirstDayOfMonth}" />
			</WorkflowCall>
		</ForEach>

		<Transaction>
			<GetList Name="Get Equipments with DepreciationType method Decreasing" Type="Equipment" OutputProperty="${Equipments}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="DepreciationMethodTax"	Alias="depmtax"	Type="InnerJoin" />
					<Join	Name="depmtax.DepreciationType"	Alias="deptype"	Type="InnerJoin" />
				</Joins>
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationActivated"		Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="PurchasePrice"				Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="DepreciationStartDate" />
						</NotFilter>
						<PropertyFilter	PropertyName="depmtax.Activated"			Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="deptype.Method"				Operator="="		PropertyValue="Decreasing" />
						<PropertyFilter	PropertyName="ResidualValue"				Operator="&gt;"		PropertyValue="0" />
						<PropertyFilter	PropertyName="depmtax.PercentageDecreasing"	Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="depmtax.BookMethod" />
						</NotFilter>
					</CombinedFilter>
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="EachEquipment" In="${Equipments}" As="Equipment" Condition="${Equipment.ResidualValue} &lt;= ${Equipment.PurchasePrice}">
			<WorkflowCall Name="Deactivate depreciation" WorkflowName="Equipment_DeactivateDepreciation">
				<Parameter	Name="Equipment"	Direction="In"		Value="${Equipment}" />
			</WorkflowCall>

			<WorkflowCall Name="Activate depreciation" WorkflowName="Equipment_ActivateDepreciation">
				<Parameter	Name="AskQuestionFirstDayMonth"	Direction="In"		Value="False" />
				<Parameter	Name="Equipment"				Direction="In"		Value="${Equipment}" />
				<Parameter	Name="SetFirstDayOfMonth"		Direction="In"		Value="${SetFirstDayOfMonth}" />
			</WorkflowCall>
		</ForEach>

		<Transaction>
			<GetList Name="Get Equipments with DepreciationType method DecreasingToLinear" Type="Equipment" OutputProperty="${Equipments}" OrderBy="Id" OrderDirection="Ascending">
				<Joins>
					<Join	Name="DepreciationMethodTax"	Alias="depmtax"	Type="InnerJoin" />
					<Join	Name="depmtax.DepreciationType"	Alias="deptype"	Type="InnerJoin" />
				</Joins>
				<Filters>
					<CombinedFilter FilterOperator="And">
						<PropertyFilter	PropertyName="DepreciationActivated"		Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="PurchasePrice"				Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="DepreciationStartDate" />
						</NotFilter>
						<PropertyFilter	PropertyName="depmtax.Activated"			Operator="="		PropertyValue="True" />
						<PropertyFilter	PropertyName="deptype.Method"				Operator="="		PropertyValue="DecreasingToLinear" />
						<PropertyFilter	PropertyName="ResidualValue"				Operator="&gt;="	PropertyValue="0" />
						<PropertyFilter	PropertyName="depmtax.PercentageDecreasing"	Operator="&gt;"		PropertyValue="0" />
						<PropertyFilter	PropertyName="depmtax.PercentageLinear"		Operator="&gt;"		PropertyValue="0" />
						<NotFilter>
							<PropertyEmptyFilter PropertyName="depmtax.BookMethod" />
						</NotFilter>
					</CombinedFilter>
				</Filters>
			</GetList>
		</Transaction>

		<ForEach Name="EachEquipment" In="${Equipments}" As="Equipment" Condition="${Equipment.ResidualValue} &lt; ${Equipment.PurchasePrice} &amp;&amp; ${Equipment.DepreciationMethodTax.PercentageDecreasing} &gt; ${Equipment.DepreciationMethodTax.PercentageLinear}">
			<WorkflowCall Name="Deactivate depreciation" WorkflowName="Equipment_DeactivateDepreciation">
				<Parameter	Name="Equipment"	Direction="In"		Value="${Equipment}" />
			</WorkflowCall>

			<WorkflowCall Name="Activate depreciation" WorkflowName="Equipment_ActivateDepreciation">
				<Parameter	Name="AskQuestionFirstDayMonth"	Direction="In"		Value="False" />
				<Parameter	Name="Equipment"				Direction="In"		Value="${Equipment}" />
				<Parameter	Name="SetFirstDayOfMonth"		Direction="In"		Value="${SetFirstDayOfMonth}" />
			</WorkflowCall>
		</ForEach>

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