Add new card attribut card and account

This commit is contained in:
Dany De Bontridder 2011-01-20 14:53:29 +00:00
parent 0de1fd1ebf
commit c26f46fb68
3 changed files with 74 additions and 17 deletions

View file

@ -480,24 +480,48 @@ class Fiche
}
else
{
switch ($attr->ad_type)
switch ($attr->ad_type)
{
case 'text':
$w=new IText();
$w->size=$attr->ad_size;
break;
$w=new IText();
$w->size=$attr->ad_size;
break;
case 'numeric':
$w=new INum();
$w->size=$attr->ad_size;
break;
$w=new INum();
$w->size=$attr->ad_size;
break;
case 'date':
$w=new IDate();
break;
$w=new IDate();
break;
case 'zone':
$w=new ITextArea();
$w->width=$attr->ad_size;
$w->heigh=2;
break;
$w=new ITextArea();
$w->width=$attr->ad_size;
$w->heigh=2;
break;
case 'poste':
$w=new IPoste("av_text".$r->ad_id);
$w->set_attribute('ipopup','ipop_account');
$w->set_attribute('account',"av_text".$r->ad_id);
$w->table=1;
$bulle=HtmlInput::infobulle(10);
break;
case 'card':
$w=new ICard("av_text".$r->ad_id);
// filter on frd_id
$sql=' select fd_id from fiche_def ';
$filter=$this->cn->make_list($sql);
$w->extra=$filter;
$w->extra2=0;
$label=new ISpan();
$label->name="av_text".$r->ad_id."_label";
$w->set_attribute('ipopup','ipopcard');
$w->set_attribute('typecard',$filter);
$w->set_attribute('inp',"av_text".$r->ad_id);
$w->set_attribute('label',"av_text".$r->ad_id."_label");
$msg=$w->search();
$msg.=$label->input();
break;
}
$w->table=0;
@ -611,9 +635,33 @@ class Fiche
$w->width=$r->ad_size;
$w->heigh=2;
break;
case 'poste':
$w=new IPoste("av_text".$r->ad_id);
$w->set_attribute('ipopup','ipop_account');
$w->set_attribute('account',"av_text".$r->ad_id);
$w->table=1;
$bulle=HtmlInput::infobulle(10);
break;
case 'card':
$w=new ICard("av_text".$r->ad_id);
// filter on frd_id
$sql=' select fd_id from fiche_def ';
$filter=$this->cn->make_list($sql);
$w->extra=$filter;
$w->extra2=0;
$label=new ISpan();
$label->name="av_text".$r->ad_id."_label";
$w->set_attribute('ipopup','ipopcard');
$w->set_attribute('typecard',$filter);
$w->set_attribute('inp',"av_text".$r->ad_id);
$w->set_attribute('label',"av_text".$r->ad_id."_label");
$msg=$w->search();
$msg.=$label->input();
break;
default:
var_dump($r);
throw new Exception("Type invalide");
var_dump($r);
throw new Exception("Type invalide");
}
$w->table=0;
}

View file

@ -35,9 +35,9 @@ $g_captcha=false;
/* set to none for production */
/* uncomment for production */
$version_phpcompta=SVNINFO;
// $version_phpcompta=SVNINFO;
/* $version_phpcompta=3872;*/
$version_phpcompta=3872;
define ("DBVERSION",92);
define ("DBVERSIONREPO",13);
@ -112,6 +112,10 @@ define ("ATTR_DEF_TVA_NON_DEDUCTIBLE",21);
define ("ATTR_DEF_TVA_NON_DEDUCTIBLE_RECUP",22);
define ("ATTR_DEF_QUICKCODE",23);
define( 'ATTR_DEF_ACCOUNT_ND_TVA',50);
define('ATTR_DEF_ACCOUNT_ND_TVA_ND',51);
define ('ATTR_DEF_ACCOUNT_ND_PERSO',52);
define ('ATTR_DEF_ACCOUNT_ND',53);
define ("FICHE_TYPE_CLIENT",9);
define ("FICHE_TYPE_VENTE",1);

View file

@ -0,0 +1,5 @@
insert into attr_def(ad_id,ad_text,ad_type,ad_size) values (50,'Contrepartie pour TVA récup par impot',poste,22);
insert into attr_def(ad_id,ad_text,ad_type,ad_size) values (51,'Contrepartie pour TVA non Ded.',poste,22);
insert into attr_def(ad_id,ad_text,ad_type,ad_size) values (52,'Contrepartie pour Dépense personnel',poste,22);
insert into attr_def(ad_id,ad_text,ad_type,ad_size) values (53,'Contrepartie pour DNA',poste,22);