phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r5005 - in phpcompta/trunk: html/admin/sql/patch include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5005 - in phpcompta/trunk: html/admin/sql/patch include
Date: Mon, 25 Jun 2012 14:15:19 +0200 (CEST)

Author: danydb
Date: 2012-06-25 14:15:18 +0200 (Mon, 25 Jun 2012)
New Revision: 5005

Modified:
   phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
   phpcompta/trunk/include/class_fiche.php
Log:
Replace ATTR_DEF_COMPANY by a type card with  ad_extra='[sql] frd_id in 
(4,8,9,14)' 

Modified: phpcompta/trunk/html/admin/sql/patch/upgrade102.sql
===================================================================
--- phpcompta/trunk/html/admin/sql/patch/upgrade102.sql 2012-06-25 09:31:57 UTC 
(rev 5004)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade102.sql 2012-06-25 12:15:18 UTC 
(rev 5005)
@@ -359,7 +359,7 @@
        if NEW.ad_id=23 and NEW.ad_value != OLD.ad_value then
                RAISE NOTICE 'new qcode [%] old qcode 
[%]',NEW.ad_value,OLD.ad_value;
 
-               for i in select ad_id from attr_def where ad_type = 'card' loop
+               for i in select ad_id from attr_def where ad_type = 'card' or 
ad_id=25 loop
                        update fiche_detail set ad_value=NEW.ad_value where 
ad_value=OLD.ad_value and ad_id=i.ad_id;
                        RAISE NOTICE 'change for ad_id [%] ',i.ad_id;
                        if i.ad_id=19 then
@@ -489,6 +489,7 @@
 
 drop table user_sec_extension;
 
+update attr_def set ad_type='card', ad_extra='[sql] frd_id in (4,8,9,14)' 
where ad_id=25;
 
 
 update version set val=103;

Modified: phpcompta/trunk/include/class_fiche.php
===================================================================
--- phpcompta/trunk/include/class_fiche.php     2012-06-25 09:31:57 UTC (rev 
5004)
+++ phpcompta/trunk/include/class_fiche.php     2012-06-25 12:15:18 UTC (rev 
5005)
@@ -467,25 +467,7 @@
                 $w=new ITva_Popup('popup_tva');
                 $w->table=1;
             }
-            elseif ( $attr->ad_id == ATTR_DEF_COMPANY )
-            {
-                $w=new ICard("av_text".$attr->ad_id);
-                // filter on frd_id
-                $sql=' select fd_id from fiche_def where frd_id in 
('.FICHE_TYPE_CLIENT.','.FICHE_TYPE_FOURNISSEUR.','.FICHE_TYPE_ADM_TAX.','.FICHE_TYPE_FIN.')';
-                $filter=$this->cn->make_list($sql);
-                $w->set_attribute('ipopup','ipopcard');
-                $w->set_attribute('typecard',$filter);
-                $w->set_attribute('inp',"av_text".$attr->ad_id);
-                $w->set_attribute('label',"av_text".$attr->ad_id."_label");
-
-                $w->extra=$filter;
-                $w->extra2=0;
-                $label=new ISpan();
-                $label->name="av_text".$attr->ad_id."_label";
-                $msg.=td($w->search().$label->input());
-
-
-            }
+        
             else
             {
              switch ($attr->ad_type)
@@ -609,25 +591,6 @@
                                        $w->table = 1;
                                         $w->value = $r->av_text;
                                }
-                               elseif ($r->ad_id == ATTR_DEF_COMPANY)
-                               {
-                                       $w = new ICard("av_text" . $r->ad_id);
-                                       // filter on frd_id
-                                       $sql = ' select fd_id from fiche_def 
where frd_id in (' . FICHE_TYPE_CLIENT . ',' . FICHE_TYPE_FOURNISSEUR . ',' . 
FICHE_TYPE_ADM_TAX . '
-                                               ,'.FICHE_TYPE_FIN.')';
-                                       $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");
-                                        $w->value = $r->av_text;
-                                       $msg = $w->search();
-                                       $msg.=$label->input();
-                               }
                                else
                                {
                                        switch ($r->ad_type)
@@ -840,18 +803,6 @@
                         }
                     }
                 }
-                // The contact has a company attribut
-                if ( $id == ATTR_DEF_COMPANY )
-                {
-                    $exist=$this->cn->count_sql("select f_id from fiche join 
fiche_def using (fd_id) ".
-                                                " join fiche_detail 
using(f_id) ".
-                                                " where frd_id in (4,8,9,14) 
and ad_id=".ATTR_DEF_QUICKCODE.
-                                                " and 
ad_value='".sql_string($value)."'");
-                    if ( $exist == 0 && sql_string($value) != null )
-                    {
-                        $value="";
-                    }
-                }
                 // Normal traitement
                 $value2=sql_string($value);
 
@@ -985,21 +936,6 @@
                         }
                     }
                 }
-                if ( $id == ATTR_DEF_COMPANY )
-                {
-                    $exist=$this->cn->exec_sql("select f_id from fiche join 
fiche_def using (fd_id) ".
-                                                " join fiche_detail using 
(f_id)  ".
-                                                " where frd_id in (4,8,9,14) 
and ad_id=$1 ".
-                                                " and ad_value=upper($2)",
-                                              
array(ATTR_DEF_QUICKCODE,$value));
-
-
-                    if ( Database::num_row($exist) == 0  && sql_string($value) 
!= null )
-                    {
-                        $value="Attention : pas de société ";
-                    }
-                }
-
                 // Normal traitement
                 $sql="update fiche_detail set ad_value=$1 where jft_id=$2";
                                
$this->cn->exec_sql($sql,array(strip_tags($value),$jft_id));



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]