Multiply Currency field in PDF template (or in Calculated Formula if not in pdf)

Hello friends...
Any tips for this? 

I had this working as a test initially using a text field for the Value and multiply that by a text field that just contained one digit.  

Then, for "globalness" I made the Value field a currency field.  Then it wouldn't work.  I think it cannot multiply by a currency field?

______________________________

I want to do this in the PDF template:  example >  {$fields.name*$fields.description}

My actual fields are:  {$fields.s_serialnumber_r_rma_1.value_for_customs_c*$fields.numberofitems}

Value for Customs is actually a currency field with a formula to bring in the value from another currency field on our Product module.
(I have done edit and save on my records that I am testing with and the values are populated in the fields)

Number of items is a text field with mostly just a digit in there, mostly 1.  But I want to multiply the value by this for rare occasions when the number is more.

So, that didn't work when I started using the Currency Field so I thought I would bring the total value into a new field on the module required with a calculated formula...  maybe cleaner?  But using the PDF is rare (commercial export invoice) and we don't really need to have the fields calculated for every record - which is why my preference was for doing in inside the PDF - so that would only calculate it for the rare occasions we need it. 

Anyway, I then got stuck on how to write the multiply formula!  

multiply($numberofitems,related($s_serialnumber_r_rma_1,"value_for_customs_c"))

ERROR:   " multiply: All parameters must be of type 'number' "

Any tips to correct this?  thanks.

I would like to stick to the PDF option if poss.  So is there a way with Smarty modifiers to strip out the number from the currency, do the calculation, then display that result?  Maybe to add the users currency symbol or something?

Any advice welcome.  
Thanks in advance.  
Luke.

Parents Reply Children