diff --git a/include/class_widget.php b/include/class_widget.php
index 9351ca81e..abad9e608 100644
--- a/include/class_widget.php
+++ b/include/class_widget.php
@@ -73,7 +73,7 @@ class widget {
if (strtoupper($this->type)=="TEXT") {
if ( $this->readonly==false) {
$r="value\" SIZE=\"$this->size\" ".$disabled.">";} else {
- $r=sprintf('%s', $this->value,$this->name,$this->value);
+ $r=sprintf('%s', $this->value,$this->name,$this->value);
}
if ($this->table==1) {
diff --git a/include/form_input.php b/include/form_input.php
index c954e427c..b7ce378d4 100644
--- a/include/form_input.php
+++ b/include/form_input.php
@@ -175,309 +175,6 @@ function InputType($p_label,$p_type,$p_name,$p_value,$p_viewonly=false,$p_list=n
return $r;
}
-/* function FormFin($p_cn,$p_jrn,$p_user,$p_array=null,$pview_only=true,$p_item=1)
- * Purpose : Display the form for financial
- * Used to show detail, encode a new fin op
- * or update one
- *
- * parm :
- * - p_array which can be empty
- * - the "journal"
- * - $p_user = $g_user
- * - $p_submit contains the submit string
- * - view_only if we cannot change it (no right or centralized op)
- * - $p_item number of article
- * gen :
- * -
- * return: string with the form
- */
-function FormFin($p_cn,$p_jrn,$p_periode,$p_submit,$p_array=null,$pview_only=true,$p_item=4,$p_save=false)
-{
- include_once("poste.php");
- if ( $p_array != null ) {
- // array contains old value
- foreach ( $p_array as $a=>$v) {
- ${"$a"}=$v;
- }
- }
- // The date
- list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$p_periode);
- $flag=(isset($e_date))?1:0;
- $e_date=( ! isset($e_date) ) ? substr($l_date_start,2,8):$e_date;
-
- // Verify if valid date
- if ($flag ==1 and VerifyOperationDate($p_cn,$p_periode,$e_date) == null) {
- if ( $pview_only == true)
- return null;
- else
- $e_date=substr($l_date_start,2,8);
- }
-
-
- $e_ech=(isset($e_ech))?$e_ech:"";
- $e_comment=(isset($e_comment))?$e_comment:"";
-
- $r="";
- if ( $pview_only == false) {
- $r.=JS_SEARCH_CARD;
- $r.=JS_CONCERNED_OP;
- }
- // $r.='
";
-
-// if view_only is true
-//Put the new saldo here (old saldo - operation)
- if ( $pview_only==true) {
- // if not recorded the new amount must be recalculate
- if ( $p_save == false) {
- $r.=" Ancien Solde = ".$solde."
";
- $r.=" Nouveau Solde = ".$new_solde."
";
- }
- // if recorded the old amount is recalculated
- if ($p_save == true ) {
- $r.=" Ancien Solde = ".$new_solde."
";
- $r.=" Nouveau Solde = ".$solde."
";
- }
- }
-
-return $r;
-
-
-}
-
-/* function RecordFin
- **************************************************
- * Purpose : Record an invoice in the table jrn &
- * jrnx
- *
- * parm :
- * - $p_cn Database connection
- * - $p_array contains all the invoice data
- * e_date => e : 01.01.2003
- * e_bank_account => e : 3
- * - $p_user userid
- * - $p_jrn current folder (journal)
- * - array e_other$i, e_other$i_amount, e_other$i_label
- * gen :
- * - none
- * return:
- * true on success
- */
-function RecordFin($p_cn,$p_array,$p_user,$p_jrn) {
- echo_debug(__FILE__,__LINE__,"RecordFin");
- foreach ( $p_array as $v => $e)
- {
- ${"$v"}=$e;
- }
- // Get the default period
- $periode=$p_user->GetPeriode();
-
- // Test if the data are correct
- // Verify the date
- if ( isDate($e_date) == null ) {
- echo_error("Invalid date $e_date");
- echo_debug(__FILE__,__LINE__,"Invalid date $e_date");
- echo "";
- return null;
- }
-
- // Debit = banque
- $poste_bq=GetFicheAttribut($p_cn,$e_bank_account,ATTR_DEF_ACCOUNT);
- StartSql($p_cn);
- $amount=0.0;
- // Credit = goods
- for ( $i = 0; $i < $nb_item;$i++) {
- // if tiers is set and amount != 0 insert it into the database
- // and quit the loop ?
- if ( ${"e_other$i"."_amount"} == 0 ) continue;
- $poste=GetFicheAttribut($p_cn,${"e_other$i"},ATTR_DEF_ACCOUNT);
-
- $amount+=${"e_other$i"."_amount"};
- // Record a line for the bank
- // $type=( ${"e_other$i"."_amount"} < 0 )?'d':'c';
-
- // Compute the j_grpt
- $seq=NextSequence($p_cn,'s_grpt');
-
- if ( InsertJrnx($p_cn,'d',$p_user->id,$p_jrn,$poste_bq,$e_date,round(${"e_other$i"."_amount"},2),$seq,$periode) == false ) {
- $Rollback($p_cn);exit("error __FILE__ __LINE__");
- }
-
-
- // Record a line for the other account
- // $type=( ${"e_other$i"."_amount"} < 0 )?'c':'d';
- if ( ($j_id=InsertJrnx($p_cn,'c',$p_user->id,$p_jrn,$poste,$e_date,round(${"e_other$i"."_amount"},2),$seq,$periode)) == false )
- { $Rollback($p_cn);exit("error __FILE__ __LINE__");}
-
- echo_debug(__FILE__,__LINE__," $j_id=InsertJrnx($p_cn,'d',$p_user,$p_jrn,$poste,$e_date,".${"e_other$i"}."_amount".",$seq,$periode);");
-
- if ( ($jr_id=InsertJrn($p_cn,$e_date,'',$p_jrn,FormatString(${"e_other$i"."_comment"}),
- round(${"e_other$i"."_amount"},2),$seq,$periode))==false) {
- $Rollback($p_cn);exit("error __FILE__ __LINE__");}
-
- if ( isNumber(${"e_concerned".$i}) == 1 ) {
-
- InsertRapt($p_cn,$jr_id,${"e_concerned$i"});
- }
-
-
- // Set Internal code and Comment
- $internal_code=SetInternalCode($p_cn,$seq,$p_jrn);
- $comment=$internal_code." client : ".GetFicheName($p_cn,$e_bank_account);
- if ( FormatString(${"e_other$i"."_comment"}) == null ) {
- // Update comment if comment is blank
- $Res=ExecSql($p_cn,"update jrn set jr_comment='".$comment."' where jr_grpt_id=".$seq);
- }
-
- } // for nbitem
- if ( isset ($_FILES))
- save_upload_document($p_cn,$seq);
-
- Commit($p_cn);
-}
/* function FormODS($p_cn,$p_jrn,$p_user,$p_array=null,$pview_only=true,$p_article=1)
* Purpose : Display the miscellaneous operation
* Used to show detail, encode a new oper
diff --git a/include/user_form_ach.php b/include/user_form_ach.php
index a20cbf842..33128ff92 100644
--- a/include/user_form_ach.php
+++ b/include/user_form_ach.php
@@ -301,7 +301,9 @@ for ($o = 0;$o < $p_number; $o++) {
$p_ech=date('d.m.Y',mktime(0,0,0,$month,$day+$e_ech,$year));
echo_debug(__FILE__,__LINE__,"p_ech = $e_ech $p_ech");
$e_ech=$p_ech;
- $data.=InputType("","HIDDEN","e_ech",$e_ech);
+ $wHidden=new widget("hidden");
+ $data.=$wHidden->IOValue("e_ech",$e_ech);
+ # $data.=InputType("","HIDDEN","e_ech",$e_ech);
}
// Check if the fiche is in the jrn
diff --git a/include/user_form_ven.php b/include/user_form_ven.php
index d539a7a34..b5c7220f8 100644
--- a/include/user_form_ven.php
+++ b/include/user_form_ven.php
@@ -306,7 +306,8 @@ for ($o = 0;$o < $p_number; $o++) {
$p_ech=date('d.m.Y',mktime(0,0,0,$month,$day+$e_ech,$year));
echo_debug(__FILE__,__LINE__,"p_ech = $e_ech $p_ech");
$e_ech=$p_ech;
- $data.=InputType("","HIDDEN","e_ech",$e_ech);
+ $wHidden=new widget("hidden");
+ $data.=$wHidden->IOValue("e_ech",$e_ech);
}
// Check if the fiche is in the jrn