From c26f46fb688edb65fc44ccfef0925ecbffd9f755 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 20 Jan 2011 14:53:29 +0000 Subject: [PATCH] Add new card attribut card and account --- include/class_fiche.php | 78 +++++++++++++++++++++++++++++++++-------- include/constant.php | 8 +++-- sql/upgrade.sql | 5 +++ 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/include/class_fiche.php b/include/class_fiche.php index 0c31ab688..e40bd8fc4 100644 --- a/include/class_fiche.php +++ b/include/class_fiche.php @@ -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; } diff --git a/include/constant.php b/include/constant.php index 4205a4e3b..95783b307 100644 --- a/include/constant.php +++ b/include/constant.php @@ -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); diff --git a/sql/upgrade.sql b/sql/upgrade.sql index e69de29bb..5f55d6111 100644 --- a/sql/upgrade.sql +++ b/sql/upgrade.sql @@ -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); +