/[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.39 by sparkyx, Sun Mar 6 16:00:28 2005 UTC revision 1.40 by sparkyx, Sun Mar 6 18:30:12 2005 UTC
# Line 398  function FormVente($p_cn,$p_jrn,$p_user, Line 398  function FormVente($p_cn,$p_jrn,$p_user,
398    
399    $r.="</TABLE>";    $r.="</TABLE>";
400    $r.="<hr>";    $r.="<hr>";
401    $r.="<table>";  
   $file=new widget("file");  
   $file->table=1;  
   $r.="<TR>".$file->IOValue("pj",null,"Pièce justificative")."</TR>";  
   $r.="</table>";  
   $r.="<hr>";  
402    if ($view_only == false ) {    if ($view_only == false ) {
403      $r.='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">';      $r.='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">';
404      $r.='<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';      $r.='<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">';
# Line 660  for ($o = 0;$o < $p_number; $o++) { Line 655  for ($o = 0;$o < $p_number; $o++) {
655    $r.='<DIV style="padding:30px;font-size:14px">';    $r.='<DIV style="padding:30px;font-size:14px">';
656    $r.="Total HTVA =".round( $sum_march,2)." <br>";    $r.="Total HTVA =".round( $sum_march,2)." <br>";
657    $r.="Total = ".round($sum_with_vat,2);    $r.="Total = ".round($sum_with_vat,2);
658    
659    
660    $r.="</DIV>";    $r.="</DIV>";
661    if ( $p_doc == 'form' ) {    if ( $p_doc == 'form' ) {
662            $r.='<FORM METHOD="POST" ACTION="user_jrn.php?action=record">';            $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=record">';
663              // check for upload piece
664              $file=new widget("file");
665              $file->table=1;
666              $r.="<hr>";
667              $r.= "<table>";
668              $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
669              $r.="</table>";
670              $r.="<hr>";
671    
672            $r.=$data;            $r.=$data;
           //      $r.='<INPUT TYPE="SUBMIT" name="record_invoice" value="Sauver">';  
           // If the total == 0 prevent the insert  
673            if ( $sum_with_vat != 0 ) {            if ( $sum_with_vat != 0 ) {
674              $r.='<INPUT TYPE="SUBMIT" name="record_and_print_invoice" value="Sauver" >';              $r.='<INPUT TYPE="SUBMIT" name="record_and_print_invoice" value="Sauver" >';
675            }            }
676            $r.='<INPUT TYPE="SUBMIT" name="correct_new_invoice" value="Corriger">';            $r.='<INPUT TYPE="SUBMIT" name="correct_new_invoice" value="Corriger">';
677    
678            $r.='</FORM>';            $r.='</FORM>';
679            }            }
680    return $r;    return $r;
# Line 794  function RecordInvoice($p_cn,$p_array,$p Line 799  function RecordInvoice($p_cn,$p_array,$p
799    
800    // Update and set the invoice's comment    // Update and set the invoice's comment
801    $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);    $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
802  if ( $Res == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__"); };    if ( $Res == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__"); };
803    
804      if ( isset ($_FILES))
805        save_upload_document($p_cn,$seq);
806    
807    Commit($p_cn);    Commit($p_cn);
808    
809    return $comment;    return $comment;
# Line 816  if ( $Res == false ) { Rollback($p_cn); Line 825  if ( $Res == false ) { Rollback($p_cn);
825   * return: string with the form   * return: string with the form
826   * TODO Add in parameters the infos about the company for making the invoice   * TODO Add in parameters the infos about the company for making the invoice
827   */   */
828  function FormAch($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p_article=1)  function FormAch($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p_article=3,$saved=false)
829  {  {
830    
831    if ( $p_array != null ) {    if ( $p_array != null ) {
# Line 851  function FormAch($p_cn,$p_jrn,$p_user,$p Line 860  function FormAch($p_cn,$p_jrn,$p_user,$p
860      $r.=JS_SHOW_TVA;      $r.=JS_SHOW_TVA;
861    
862    }    }
863    $r.="<FORM NAME=\"form_detail\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";  
864      $r.="<FORM NAME=\"form_detail\"  enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
865    $r.='<TABLE>';    $r.='<TABLE>';
866    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
867    $r.='<TR>'.InputType("Echeance","Text","e_ech",$e_ech,$view_only).'</TR>';    $r.='<TR>'.InputType("Echeance","Text","e_ech",$e_ech,$view_only).'</TR>';
# Line 985  function FormAch($p_cn,$p_jrn,$p_user,$p Line 995  function FormAch($p_cn,$p_jrn,$p_user,$p
995    }    }
996    
997    $r.="</TABLE>";    $r.="</TABLE>";
998    
999      if ( $view_only == true && $saved == false){
1000        // check for upload piece
1001        $file=new widget("file");
1002        $file->table=1;
1003        $r.="<hr>";
1004        $r.= "<table>";
1005        $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
1006        $r.="</table>";
1007        $r.="<hr>";
1008      }
1009    
1010    $r.=$p_submit;    $r.=$p_submit;
1011    $r.="</DIV>";    $r.="</DIV>";
1012    $r.="</FORM>";    $r.="</FORM>";
# Line 1026  function FormAch($p_cn,$p_jrn,$p_user,$p Line 1048  function FormAch($p_cn,$p_jrn,$p_user,$p
1048      $r.="<TR> <TD colspan=\"3\" align=\"center\"> Total =".round($total,2)."</TD></TR>";      $r.="<TR> <TD colspan=\"3\" align=\"center\"> Total =".round($total,2)."</TD></TR>";
1049      $r.="</TABLE>";      $r.="</TABLE>";
1050    }// if ( $view_only == true )    }// if ( $view_only == true )
1051    
1052    return $r;    return $r;
1053    
1054    
# Line 1146  function RecordAchat($p_cn,$p_array,$p_u Line 1169  function RecordAchat($p_cn,$p_array,$p_u
1169        // Update comment if comment is blank        // Update comment if comment is blank
1170        $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);        $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
1171      }      }
1172        if ( isset ($_FILES))
1173          save_upload_document($p_cn,$seq);
1174    
1175      Commit($p_cn);      Commit($p_cn);
1176      return $comment;      return $comment;
1177    }    }
# Line 1199  function FormFin($p_cn,$p_jrn,$p_user,$p Line 1225  function FormFin($p_cn,$p_jrn,$p_user,$p
1225      $r.=JS_SEARCH_CARD;      $r.=JS_SEARCH_CARD;
1226      $r.=JS_CONCERNED_OP;      $r.=JS_CONCERNED_OP;
1227    }    }
1228      //      $r.='<FORM METHOD="POST" enctype="multipart/form-data" ACTION="user_jrn.php?action=record">';
1229    $r.="<FORM NAME=\"form_detail\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";    $r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
1230    $r.='<TABLE>';    $r.='<TABLE>';
1231    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
1232    
# Line 1312  function FormFin($p_cn,$p_jrn,$p_user,$p Line 1338  function FormFin($p_cn,$p_jrn,$p_user,$p
1338   }   }
1339    
1340  $r.="</TABLE>";  $r.="</TABLE>";
1341    
1342     if ( $view_only==true && $p_saved==false) {
1343    // check for upload piece
1344       $file=new widget("file");
1345       $file->table=1;
1346       $r.="<hr>";
1347       $r.= "<table>";
1348       $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
1349       $r.="</table>";
1350       $r.="<hr>";
1351     }
1352  $r.=$p_submit;  $r.=$p_submit;
1353  $r.="</DIV>";  $r.="</DIV>";
1354  $r.="</FORM>";  $r.="</FORM>";
# Line 1418  function RecordFin($p_cn,$p_array,$p_use Line 1455  function RecordFin($p_cn,$p_array,$p_use
1455      // Update comment if comment is blank      // Update comment if comment is blank
1456      $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);      $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
1457    }    }
1458      if ( isset ($_FILES))
1459        save_upload_document($p_cn,$seq);
1460    
1461    }    }
1462    Commit($p_cn);    Commit($p_cn);
1463  }  }
# Line 1437  function RecordFin($p_cn,$p_array,$p_use Line 1477  function RecordFin($p_cn,$p_array,$p_use
1477   *      -   *      -
1478   * return: string with the form   * return: string with the form
1479   */   */
1480  function FormODS($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p_article=6)  function FormODS($p_cn,$p_jrn,$p_user,$p_submit,$p_array=null,$view_only=true,$p_article=6,$p_saved=false)
1481  {  {
1482    include_once("poste.php");    include_once("poste.php");
1483    if ( $p_array != null ) {    if ( $p_array != null ) {
# Line 1468  function FormODS($p_cn,$p_jrn,$p_user,$p Line 1508  function FormODS($p_cn,$p_jrn,$p_user,$p
1508    if ( $view_only == false) {    if ( $view_only == false) {
1509      $r.=JS_SEARCH_POSTE;      $r.=JS_SEARCH_POSTE;
1510    }    }
1511    $r.="<FORM NAME=\"form_detail\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";    $r.="<FORM NAME=\"form_detail\" enctype=\"multipart/form-data\" ACTION=\"user_jrn.php?action=new\" METHOD=\"POST\">";
1512    $r.='<TABLE>';    $r.='<TABLE>';
1513    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';    $r.='<TR>'.InputType("Date ","Text","e_date",$e_date,$view_only).'</TR>';
1514    $r.='<TR>'.InputType("Description","Text_big","e_comment",$e_comment,$view_only).'</TR>';    $r.='<TR>'.InputType("Description","Text_big","e_comment",$e_comment,$view_only).'</TR>';
# Line 1558  function FormODS($p_cn,$p_jrn,$p_user,$p Line 1598  function FormODS($p_cn,$p_jrn,$p_user,$p
1598    }    }
1599    
1600    $r.="</TABLE>";    $r.="</TABLE>";
1601    
1602     if ( $view_only==true && $p_saved==false) {
1603    // check for upload piece
1604       $file=new widget("file");
1605       $file->table=1;
1606       $r.="<hr>";
1607       $r.= "<table>";
1608       $r.="<TR>".$file->IOValue("pj","","Pièce justificative")."</TR>";
1609       $r.="</table>";
1610       $r.="<hr>";
1611     }
1612    
1613    $r.=$p_submit;    $r.=$p_submit;
1614    //  $r.="</DIV>";    //  $r.="</DIV>";
1615    $r.="</FORM>";    $r.="</FORM>";
# Line 1632  function RecordODS($p_cn,$p_array,$p_use Line 1684  function RecordODS($p_cn,$p_array,$p_use
1684      // Update comment if comment is blank      // Update comment if comment is blank
1685      $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);      $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
1686    }    }
1687      if ( isset ($_FILES))
1688        save_upload_document($p_cn,$seq);
1689    
1690    Commit($p_cn);    Commit($p_cn);
1691    return $comment;    return $comment;
1692  }  }

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

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