This topic is locked

Calculated Fields

6/10/2005 6:29:28 AM
PHPRunner General questions
adamdidthis author

I have upgraded to versoin 2 and am using the following code to generate some calculated fields:

select *,

(cost1 + cost2 + cost3 + Cost4 + Cost5 + Cost6 + Cost7 + Cost8 + Cost9 + Cost10 + Cost11 + Cost12 + Cost13 + Cost14 + Cost15 + delivery) * 0.175 as myvat,

(cost1 + cost2 + cost3 + Cost4 + Cost5 + Cost6 + Cost7 + Cost8 + Cost9 + Cost10 + Cost11 + Cost12 + Cost13 + Cost14 + Cost15 + delivery) * 1.175 as mytotal

From `order`


The fields appear on the pages but they do not calculate, the fields are set as currency, does this matter.

Sergey Kornilov admin 6/10/2005

Hi,
calculated fields will display in saved records only. For example on the List/View pages.
They will not display on the Addpage and will not update on the Editpage before you save the changes.
If you don't see myvatand mytotalfields even on the List page then make sure that neither of cost1-delivery fields contain NULL value.
When you edit these fields you have to enter 0 instead to leave them empty. To make it easely set default value for these fields as 0on the Formattingtab in PHPRunner.

adamdidthis author 6/14/2005

Good news, it's working now