/[phpcompta]/phpcompta/include/user_form_ven.php
ViewVC logotype

Diff of /phpcompta/include/user_form_ven.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by sparkyx, Sun Oct 30 21:17:50 2005 UTC revision 1.6 by sparkyx, Fri Nov 4 20:52:34 2005 UTC
# Line 571  function RecordInvoice($p_cn,$p_array,$p Line 571  function RecordInvoice($p_cn,$p_array,$p
571    // Get the default period    // Get the default period
572    $periode=$p_user->GetPeriode();    $periode=$p_user->GetPeriode();
573    $amount=0.0;    $amount=0.0;
574      $amount_jrn=0.0;
575    // Computing total customer    // Computing total customer
576    //--    //--
577    for ($i=0;$i<$nb_item;$i++) {    for ($i=0;$i<$nb_item;$i++) {
# Line 589  function RecordInvoice($p_cn,$p_array,$p Line 590  function RecordInvoice($p_cn,$p_array,$p
590        // The price is valid        // The price is valid
591        $a_price[$i]=${"e_march$i"."_sell"};        $a_price[$i]=${"e_march$i"."_sell"};
592      }      }
593      $amount+=$a_price[$i]*$a_quant[$i];      $cost=$a_price[$i]*$a_quant[$i];
594        $amount+=$cost;
595        // if cost < 0 not added to jr_montant
596        $amount_jrn+=($cost<0)?0:$cost;
597    }// for    }// for
598    
599    $comm=FormatString($e_comm);    $comm=FormatString($e_comm);
# Line 645  function RecordInvoice($p_cn,$p_array,$p Line 649  function RecordInvoice($p_cn,$p_array,$p
649        }        }
650      }      }
651    echo_debug(__FILE__,__LINE__,"echeance = $e_ech");    echo_debug(__FILE__,__LINE__,"echeance = $e_ech");
652    $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount,2)+round($sum_vat,2),$seq,$periode);    $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount_jrn,2)+round($sum_vat,2),$seq,$periode);
653    if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");}    if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");}
654    // Set Internal code and Comment    // Set Internal code and Comment
655    $internal=SetInternalCode($p_cn,$seq,$p_jrn);    $internal=SetInternalCode($p_cn,$seq,$p_jrn);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26