SupplyNamesFromIntra, SupplyNamesFromIntra1to1

Description

This function returns a list of names of Supplies which represent internal flows (i.e. Transfer supplies) from given Accounts and which have the indicated ReleaseType and Destination.

Type

LIST {STRING}

Arguments

 

1

LIST { LIST { OBJECT, STRING } }

Source List: A List of pairs (represented as Lists) containing an Object and an Account Name of an Account on that Object.

2

STRING

ReleaseType name or "NONE" or "ALL"

3

STRING

Destination name or "NONE" or "ALL"

Evaluation

A temporary list of Accounts is created from the Source List. For each of those Accounts, we examine the outflow Supplies which:

(1) link an Account on the SAME Object, and

(2) have the indicated ReleaseType, and

(3) have the indicated Destination

In the case of SupplyNamesIntra, for each of these Accounts being considered, the names of all related Supplies matching the criteria are added to the returned List. In the case of SupplyNamesIntra1to1, there should be zero or one matching Supplies:

(1) If there are no Supplies matching the criteria, then an empty string ("") is added to the returned List, or

(2) If there is exactly ONE Supply matching the criteria, then the name of that Supply is added to the returned List, or

(3) If there is more than one Supply matching the criteria, then an error is generated.

In this way, the list returned by SupplyNamesIntra is guaranteed to contain exactly one string for each Account specified in the Source List.

If the ReleaseType argument or the Destination argument is "NONE," then only Supplies having the default (unassigned) attribute of that type are considered.

If the ReleaseType or the Destination argument is "ALL," then that Supply attribute is ignored.

Comments

ReleaseTypes and Destinations are properties of Supplies.

 
SupplyNamesFromIntra({{%"ResA","One"}, {%"ResA","Two"}}, "Account Fill", "Abiquiu")
 
SupplyNamesFromIntra: {"ResA One to ResA Two", "ResA Two to ResA Three"}
SupplyNamesFromIntra1to1: {"ResA One to ResA Two"}