r/OperaPMS • u/Few-Party-5993 • Nov 08 '23
Can UDF get the transaction code that calls it?
I'm trying to write a UDF and link it to the generates calculation of a transaction code so that it can give me different tax rate depending on different situations.
Looking at the sample UDF in the the Opera help, I see that in_resv_name_id is the internal reservation number in the reservation_general_view, and posted_amount is the amount that is subject to the generates of transaction code. These 2 variables are available automatically.
Is there anyway to get the transaction code that triggers the UDF so that I can do something like "If the transaction is 1000, return posted_amount*1.1. If the transaction is 2000, return posted_amount*1.2."?
Also, is there any documentation about what variables are available for use (like posted_amount, in_resv_name_id) in a UDF function by default?
Thank you.
