Announcement

Collapse
No announcement yet.

production problem on calculated fields

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • production problem on calculated fields

    Hello,
    I have a routine da calculetes two field that on development all works fine but on production does not work!!.
    The method is fired on a combofield onchange.
    This is the method :

    $up = 0;
    $tp = 0;
    $d1 = strtotime({data_f});
    $d2 = strtotime({data_o});
    $dif = $d1-$d2;
    $gg = ceil($dif/86400); // giorni di noleggio
    {giorni} = $gg;
    //-----------------------------
    $error_test = $gg < '1'; // Error test
    $error_message = 'La data di check in deve essere piu grande della data di check out.'; // Error message
    if ($error_test)
    {
    sc_error_message($error_message);
    sc_error_exit();
    }
    else
    {
    //-----------------------------
    $att = {id_att};
    sc_lookup(dataset,"SELECT id_iva from attivita WHERE id_att = $att");
    $civa = {dataset[0][0]}; // codice aliquota iva

    sc_lookup(dataset,"select aliquota from iva where id = $civa");
    $alq = (({dataset[0][0]}/100)+1); // aliquota iva calcolo iva

    $grp = {id_grp};
    $ir = {id_rat};
    sc_lookup(dataset,"SELECT T1,T2,T3 FROM Tariffe WHERE attiva = 'Y' and id_grp = $grp and id_rat = '$ir'");
    $t1 = {dataset[0][0]};
    $t2 = {dataset[0][1]};
    $t3 = {dataset[0][2]};

    if ($gg <3)
    {$up= $t1;}

    if ($gg >2 and $gg <5)
    {$up= $t2;}

    if ($gg >4)
    {$up= $t3;}

    $tp = ($up*$gg)*$alq; // totale noleggio iva inclusa
    $up = $up*$alq; // costo giornaliero iva inclusa
    {u_price} = $up;
    {t_price} = $tp;
    }


    As i said it does not show the result in the fields {u_price} and {t_price} but in development it's OK.

    Please can anyone help
    Thanks
    Maurizio C.
Working...
X