[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5009 - in phpcompta/trunk: html/admin/sql/patch include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5009 - in phpcompta/trunk: html/admin/sql/patch include |
Date: |
Mon, 25 Jun 2012 22:44:12 +0200 (CEST) |
Author: danydb
Date: 2012-06-25 22:44:12 +0200 (Mon, 25 Jun 2012)
New Revision: 5009
Modified:
phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
phpcompta/trunk/include/class_fiche.php
phpcompta/trunk/include/class_fiche_attr.php
phpcompta/trunk/include/class_inum.php
Log:
0000658: Pr?\195?\169cision d?\195?\169cimale est dans les attributs de fiche
Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
===================================================================
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql 2012-06-25 20:15:51 UTC
(rev 5008)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql 2012-06-25 20:44:12 UTC
(rev 5009)
@@ -55,7 +55,7 @@
VALUES ('BK', 'GESTION', 2, 35, 'E', 0);
-
+
update menu_ref set me_description='Grand livre analytique' where
me_code='ANCGL';
alter table action_gestion add ag_remind_date date;
@@ -491,6 +491,8 @@
update attr_def set ad_type='card', ad_extra='[sql] frd_id in (4,8,9,14)'
where ad_id=25;
+update attr_Def set ad_extra='2' where ad_type='numeric';
+update attr_Def set ad_extra='4' where ad_id=31;
update version set val=103;
Modified: phpcompta/trunk/include/class_fiche.php
===================================================================
--- phpcompta/trunk/include/class_fiche.php 2012-06-25 20:15:51 UTC (rev
5008)
+++ phpcompta/trunk/include/class_fiche.php 2012-06-25 20:44:12 UTC (rev
5009)
@@ -467,7 +467,7 @@
$w=new ITva_Popup('popup_tva');
$w->table=1;
}
-
+
else
{
switch ($attr->ad_type)
@@ -478,7 +478,7 @@
break;
case 'numeric':
$w = new INum();
-
$w->javascript='onchange="format_number(this,4);"';
+
$w->prec=($attr->ad_extra=="")?2:$attr->ad_extra;
$w->size = $attr->ad_size;
break;
case 'date':
@@ -603,7 +603,7 @@
case 'numeric':
$w = new INum('av_text'
. $r->ad_id);
$w->size = $r->ad_size;
-
$w->javascript='onchange="format_number(this,4);"';
+
$w->prec=($attr->ad_extra=="")?2:$attr->ad_extra;
$w->value = $r->av_text;
break;
case 'date':
Modified: phpcompta/trunk/include/class_fiche_attr.php
===================================================================
--- phpcompta/trunk/include/class_fiche_attr.php 2012-06-25 20:15:51 UTC
(rev 5008)
+++ phpcompta/trunk/include/class_fiche_attr.php 2012-06-25 20:44:12 UTC
(rev 5009)
@@ -87,7 +87,11 @@
$this->ad_size=22;
}
}
+ if ( $this->ad_type == 'numeric' ) {
+
$this->ad_extra=(trim($this->ad_extra)=='')?'2':$this->ad_extra;
+ if (isNumber($this->ad_extra) == 0) throw new Exception
("La précision doit être un chiffre");
+ }
if ( $this->ad_type == 'select')
{
if (trim($this->ad_extra)=="") throw new Exception ("La
requête SQL est vide ");
Modified: phpcompta/trunk/include/class_inum.php
===================================================================
--- phpcompta/trunk/include/class_inum.php 2012-06-25 20:15:51 UTC (rev
5008)
+++ phpcompta/trunk/include/class_inum.php 2012-06-25 20:44:12 UTC (rev
5009)
@@ -35,13 +35,15 @@
function __construct($name='',$value='')
{
parent::__construct($name,$value);
- $this->javascript='onchange="format_number(this);"';
+
$this->size=9;
$this->style='style="text-align:right;border:1px solid
blue;margin:2px"';
+ $this->javascript= 'onchange="format_number(this,2);"';
}
/*!\brief print in html the readonly value of the widget*/
public function display()
{
+
$readonly=" readonly ";
$style='style="border:solid 1px
blue;color:black;background:#EDEDED;text-align:right"';
$this->value=str_replace('"','',$this->value);
@@ -56,7 +58,42 @@
return $r;
}
+ /*!\brief show the html input of the widget*/
+ public function input($p_name=null,$p_value=null)
+ {
+ if ( isset ($this->prec)) {
+ $this->javascript=
'onchange="format_number(this,'.$this->prec.');"';
+ }
+ $this->name=($p_name==null)?$this->name:$p_name;
+ $this->value=($p_value==null)?$this->value:$p_value;
+ if ( $this->readOnly==true) return $this->display();
+ $t= ((isset($this->title)))?'title="'.$this->title.'" ':' ';
+
+ $extra=(isset($this->extra))?$this->extra:"";
+
+ $this->value=str_replace('"','',$this->value);
+ if ( ! isset ($this->css_size))
+ {
+ $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
+ $this->name.'"'.$t.
+ 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
+ 'SIZE="'.$this->size.'" '.$this->javascript." $this->extra >";
+ /* add tag for column if inside a table */
+ } else {
+ $r='<INPUT '.$this->style.' TYPE="TEXT" id="'.
+ $this->name.'"'.$t.
+ 'NAME="'.$this->name.'" VALUE="'.$this->value.'" '.
+ ' style="width:'.$this->css_size.';" '.$this->javascript."
$this->extra >";
+
+ }
+
+ if ( $this->table == 1 ) $r='<td>'.$r.'</td>';
+
+ return $r;
+
+ }
+
}
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r5009 - in phpcompta/trunk: html/admin/sql/patch include,
phpcompta-dev <=