Here is a DB Tools file for the Entity Screen: WP_EntityScreen.zip (3.7 KB)
Here is some background info on how it works…
Each Editor Widget has Settings like the following - the Command Name and Local Setting Name is different for each depending on the Currency (HNL or USD) and the Denomination (500,100,50,20,10,5,1,etc). The Refreshing Widgets parameter is pretty much the same for each Editor Widget except for the Currency - this parameter invokes an update to the given Widgets when the value in the Editor Widget changes.
The Label Widgets contain calls to JScript to retrieve Task values. They are updated when an Editor Widget value changes via the Editor Widget “Refreshing Widgets” parameter. It is important to set a Name for the Label Widgets in the Widget Properties. It turns out that both the Upper and Lower Label Widgets shown here have the same Name, which we probably should not do, but it works nonetheless.
Upper Label Widget Text (Cash HNL):
<font Consolas><size 12>x 500 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','500')}','left',9," ")}
x 100 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','100')}','left',9," ")}
x 50 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','50')}','left',9," ")}
x 20 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','20')}','left',9," ")}
x 10 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','10')}','left',9," ")}
x 5 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','5')}','left',9," ")}
x 1 = {CALL:str.pad('{CALL:co.getTotal('Cash HNL','1')}','left',9," ")}</size></font>
Lower Label Widget Text (Cash HNL):
<font Consolas><size 12>-------------
{CALL:co.getTotal('Cash HNL')}
- {CALL:co.getTotal('Cash HNL','Float')}
-------------
{CALL:co.getTotal('Cash HNL','Balance')}
</size></font>
The Custom Report Widget has the following Settings. Again, it is important to set a Name for the Widget in the Widget Properties.
When we change a value in an Editor Widget, it will fire an Automation command such as:
CO Set HNL Count 500
CO Set HNL Count 100
CO Set HNL Count 50
CO Set HNL Count 20
CO Set HNL Count 10
CO Set HNL Count 5
CO Set HNL Count 1
|
'[:AutomationCommandName]'.substr(17,3)
We have 4 Rules that handle the Automation Commands depending on the Currency and whether it is Cash or CC. For example, the following Rule handles all Editor Widgets for Cash HNL. The [:CommandValue]
will contain the Editor Widget Value (the Count), and the [:AutomationCommandName]
has a sneaky way to include the Denomination as the last part of the name which we parse out with substr(17,3)
which gives us 500,100,50,etc.
We execute a Script function to set the Count for the Denomination:
co.setCount('Cash HNL','[:AutomationCommandName]'.substr(17,3),'[:CommandValue]')
… and to compute the Totals for the Currency:
co.setCount('Cash HNL','Account','[=TN("{ACCOUNT TOTAL:Cash HNL}") * TN("{REPORT TASK DETAILS:TSC.rate:(TST=Exchange Rate)}")]')