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

Diff of /phpcompta/include/form_input.php

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

revision 1.57 by sparkyx, Sun Sep 4 16:08:07 2005 UTC revision 1.58 by sparkyx, Wed Sep 7 14:37:53 2005 UTC
# Line 770  function FormAch($p_cn,$p_jrn,$p_user,$p Line 770  function FormAch($p_cn,$p_jrn,$p_user,$p
770  {  {
771    
772    if ( $p_array != null ) {    if ( $p_array != null ) {
773    // TODO utilisation de la fonction extract
774      // array contains old value      // array contains old value
775      foreach ( $p_array as $a=>$v) {      foreach ( $p_array as $a=>$v) {
776        ${"$a"}=$v;        ${"$a"}=$v;
777      }      }
778    }    }
779    // The date    // The date
780    // TODO Utilisation de la classe User
781     $userPref=GetUserPeriode($p_cn,$p_user);     $userPref=GetUserPeriode($p_cn,$p_user);
782     list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$userPref);     list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$userPref);
783     // default date     // default date
# Line 783  function FormAch($p_cn,$p_jrn,$p_user,$p Line 785  function FormAch($p_cn,$p_jrn,$p_user,$p
785    
786    $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;    $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;
787    // Verify if valid date    // Verify if valid date
788    // TODO
789    // Verif seulement lorsque doit etre enregistrer
790    // donc apres confirmation
791    // Procedure separee
792    if ( $flag==1 and VerifyOperationDate($p_cn,$p_user,$e_date)   == null) {    if ( $flag==1 and VerifyOperationDate($p_cn,$p_user,$e_date)   == null) {
793      if ( $pview_only == true)      if ( $pview_only == true)
794        return null;        return null;
# Line 875  function FormAch($p_cn,$p_jrn,$p_user,$p Line 881  function FormAch($p_cn,$p_jrn,$p_user,$p
881    
882      $march=(isset(${"e_march$i"}))?${"e_march$i"}:"";      $march=(isset(${"e_march$i"}))?${"e_march$i"}:"";
883      $march_buy=(isset(${"e_march".$i."_buy"}))?${"e_march".$i."_buy"}:"0";      $march_buy=(isset(${"e_march".$i."_buy"}))?${"e_march".$i."_buy"}:"0";
884    // TODO
885    // Separer les tests de validite : seulement qd confirmation
886    //
887      if ( $pview_only== true && $march == "" ) continue;      if ( $pview_only== true && $march == "" ) continue;
888      if ( isNumber($march_buy) == 0 and $march != "" ) {      if ( isNumber($march_buy) == 0 and $march != "" ) {
889        $msg="Montant invalide !!! ";        $msg="Montant invalide !!! ";
# Line 937  function FormAch($p_cn,$p_jrn,$p_user,$p Line 946  function FormAch($p_cn,$p_jrn,$p_user,$p
946      //vat      //vat
947      $r.=InputType("","span","e_march".$i."_tva_label",$march_tva_label,$pview_only);      $r.=InputType("","span","e_march".$i."_tva_label",$march_tva_label,$pview_only);
948      // Tva id      // Tva id
949    // TODO
950    // Remplacer TVA par liste deroulante au lieu de boite de dialogue
951      $r.=InputType("","js_tva","e_march$i"."_tva_id",$march_tva_id,$pview_only,"e_march".$i."_tva_label");      $r.=InputType("","js_tva","e_march$i"."_tva_id",$march_tva_id,$pview_only,"e_march".$i."_tva_label");
952    
953      $quant=(isset(${"e_quant$i"}))?${"e_quant$i"}:"1";      $quant=(isset(${"e_quant$i"}))?${"e_quant$i"}:"1";
954    // TODO
955    // Verification separee voir plus haut
956      if ( isNumber($quant) == 0) {      if ( isNumber($quant) == 0) {
957        $msg="Montant invalide !!! ";        $msg="Montant invalide !!! ";
958        echo_error($msg); echo_error($msg);              echo_error($msg); echo_error($msg);      
# Line 953  function FormAch($p_cn,$p_jrn,$p_user,$p Line 966  function FormAch($p_cn,$p_jrn,$p_user,$p
966    }    }
967    
968    $r.="</TABLE>";    $r.="</TABLE>";
969    // If confirmed then document can be uploaded
970    //
971    if ( $pview_only == true && $saved == false){    if ( $pview_only == true && $saved == false){
972      // check for upload piece      // check for upload piece
973      $file=new widget("file");      $file=new widget("file");
# Line 1043  V : record_invoice => e : Sauver Line 1057  V : record_invoice => e : Sauver
1057   */   */
1058  function RecordAchat($p_cn,$p_array,$p_user,$p_jrn)  function RecordAchat($p_cn,$p_array,$p_user,$p_jrn)
1059  {  {
1060    // TODO utilisation d'extract
1061    //
1062    foreach ( $p_array as $v => $e)    foreach ( $p_array as $v => $e)
1063    {    {
1064      echo_debug ("Record Achat $v ==> $e");      echo_debug ("Record Achat $v ==> $e");

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

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