Hi all,
I’ve a php method with a calculation, where I do the update of 2 forms grid fields.
Only when you access to form the first time all calculation and fields are sincronized and correct.
If you edit a row value, for istance VAT percentage of the item, and then click on update row button nothing happens.
I put the calculation … everywhere but without result. The echo message are all correct so the calculation is correct.
Only the 2 fields updating is missing.
Really mysterious to me.
The two fields to be updated are: {total_row_value} and {total_row_vat_incl}
Calculation :
$tot_value = round({quantityOrdered} * {price} * {exchange_rate},2);
IF (!{VatRate})
{
echo " No VAT " . $tot_value ;
{total_row_value} = $tot_value;
{total_row_vat_incl} = $tot_value;
}
else
{
sc_lookup(vat_perc,“SELECT VarPerc
FROM vatrates
WHERE VatID
= {VatRate}”);
$vat_perc = {vat_perc[0][0]};
$tot_value_vat = $tot_value + ($tot_value * $vat_perc / 100);
{total_row_value} = $tot_value;
{total_row_vat_incl} = $tot_value_vat;
echo " CON IVA VAT " . $tot_value_vat;
}