How to access payment item name
The Description field of financal transactions is mostly unused. I am going through the various archetypes setting the derived expression to give something useful to show on the Customers|Accounts screen. For example setting "concat(openvpms:get(.,'location.entity.name'),'/',openvpms:get(.,'clinician.entity.name'))" for the act.customerAccountChargesInvoice archetype is useful to us.
For payments I would like to show the till and the payment type of the first item. The first (the till) is easy, but I am having difficuty with the second. I tried openvpms:get(.,'items[0].target.name') and also openvpms:get(.,'items[1].target.name') but both of these cause errors.
Is there a syntax that will allow me to get the name field of the first payment item?
Regards, Tim G
Re: How to access payment item name
There's a few problems with this:
If you aren't concerned with this, the following should work some of the time:
openvpms:get(openvpms:get(.,'items')[1],'target.name')
-Tim A
Re: How to access payment item name
Tim - thanks for the prompt reply. However, you are correct - the evaluation order is killing me.
I also tried to be clever and prempt Jira-1360 by including the id of the transaction in the description, but since the description is derived before the transaction is written (and thus gets a id number), the id comes out -1.
So I will give up the idea of putting the payment type of the 1st item in the description - after all if you click on the item, you get shown its details and can thus see the payment types.
I thus have the following descriptions being generated:
Thanks for the assist, Regards, Tim G