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

Diff of /phpcompta/include/user_form_ach.php

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

revision 1.4 by sparkyx, Fri Oct 28 12:53:55 2005 UTC revision 1.5 by sparkyx, Fri Nov 4 20:52:34 2005 UTC
# Line 356  for ($o = 0;$o < $p_number; $o++) { Line 356  for ($o = 0;$o < $p_number; $o++) {
356        echo "<SCRIPT>alert('$msg');</SCRIPT>";        echo "<SCRIPT>alert('$msg');</SCRIPT>";
357        return null;        return null;
358      }      }
359      // Periode ferm�      // Periode fermé
360      if ( PeriodeClosed ($p_cn,$p_periode)=='t' )      if ( PeriodeClosed ($p_cn,$p_periode)=='t' )
361        {        {
362                  $msg="This periode is closed please change your preference";                  $msg="This periode is closed please change your preference";
# Line 558  function RecordSell($p_cn,$p_array,$p_us Line 558  function RecordSell($p_cn,$p_array,$p_us
558    // Get the default period    // Get the default period
559    $periode=$p_user->GetPeriode();    $periode=$p_user->GetPeriode();
560    $amount=0.0;    $amount=0.0;
561      $amount_jrn=0.0;
562    // Computing total customer    // Computing total customer
563    for ($i=0;$i<$nb_item;$i++) {    for ($i=0;$i<$nb_item;$i++) {
564      // store quantity & goods in array      // store quantity & goods in array
# Line 575  function RecordSell($p_cn,$p_array,$p_us Line 576  function RecordSell($p_cn,$p_array,$p_us
576        // The price is valid        // The price is valid
577        $a_price[$i]=${"e_march$i"."_sell"};        $a_price[$i]=${"e_march$i"."_sell"};
578      }      }
579      $amount+=$a_price[$i]*$a_quant[$i];      $cost=$a_price[$i]*$a_quant[$i];
580        $amount+=$cost;
581        // if cost  < 0 => not added to jrn.jr_amount
582        $amount_jrn+=($cost<0)?0:$cost;
583    }    }
584    $comm=FormatString($e_comm);    $comm=FormatString($e_comm);
585    $a_vat=ComputeVat($p_cn,$a_good,$a_quant,$a_price,$a_vat);    $a_vat=ComputeVat($p_cn,$a_good,$a_quant,$a_price,$a_vat);
# Line 629  function RecordSell($p_cn,$p_array,$p_us Line 633  function RecordSell($p_cn,$p_array,$p_us
633        }        }
634      }      }
635    echo_debug(__FILE__,__LINE__,"echeance = $e_ech");    echo_debug(__FILE__,__LINE__,"echeance = $e_ech");
636    $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);
637    if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");}    if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");}
638    // Set Internal code and Comment    // Set Internal code and Comment
639    $internal=SetInternalCode($p_cn,$seq,$p_jrn);    $internal=SetInternalCode($p_cn,$seq,$p_jrn);

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

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