phpcompta-support
[Top][All Lists]
Advanced

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

Patch: Re: [Phpcompta-support] bug: balance des comptes vide dans la ver


From: Stan Pinte
Subject: Patch: Re: [Phpcompta-support] bug: balance des comptes vide dans la version 2.0.6
Date: Fri, 15 Sep 2006 13:56:43 +0200
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Ci-joint des patches qui solucionnent les impressions postes et balance.

Stan Pinte a écrit :
> Stan Pinte a écrit :
>>> Stan Pinte a écrit :
>>>>> en fait il s'agit de toutes les impressions...(le bilan
>>>>> aussi à tous ses comptes à 0).
>>>>>
>>> la db de demo sur phpcompta fonctionne bien...le problème n'est
>>>  donc que chez moi.
>
> j'ai trouvé le problème: toutes les requêtes d'impression utilisent
> le numéro de période comme borne...
>
>>> postgres.php 100 SQL = select to_char(j_date,'DD.MM.YYYY') as
>>> j_date,case ... and (jr_tech_per >= 81 and jr_tech_per <= 66)
>>> order by j_date::date
> Or comme j'ai créé ma période 1/1/2006 -> 1/1/2006 après les autres
>  périodes, j'ai ici un truc impossible...
>
> solution: il faudrait sélectionner en fonction de la date de
> début/fin, et nom du numéro.
>
> Dany, ce genre de chose pourrait provoquer d'autres bugs, non?
>
> Stan.
>
>>> Des idées?
>>>
>>> Stan.
>>>>> Stan.
>>>>>
>>>>> Stan Pinte a écrit :
>>>>>>> la balance des comptes est vide dans la version 2.0.6.
>>>>>>>
>>>>>>> Chez vous aussi?
>>>>>>>
>>>>>>> Stan.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Phpcompta-support mailing list
>>>>>>> address@hidden
>>>>>>> http://lists.nongnu.org/mailman/listinfo/phpcompta-support
>>>>>>>
>>>>>>>
>>>>>>>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFCpT6/PmuubxPWAIRAo4NAJ0SVmXnDw2fMMYTWxSHBzUrkhgdMQCdH/Ps
Uc/EtqKsk0el20QXuunCHVc=
=mBKf
-----END PGP SIGNATURE-----

--- ../phpcompta-dev/include/class_poste.php    2006-08-04 09:18:50.719952000 
+0200
+++ include/class_poste.php     2006-09-15 13:51:55.953694400 +0200
@@ -48,11 +48,17 @@
   function GetRow($p_from,$p_to)
     {
       if ( $p_from == $p_to ) 
-       $periode=" jr_tech_per = $p_from ";
+      {
+        $periode=" jr_tech_per = $p_from ";
+      }
       else
-       $periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) ";
+      {
+        //$periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) ";     
+        $periode = "p_start >= (select p_start from parm_periode where p_id = 
$p_from) ".
+          "and p_end <= (select p_end from parm_periode where p_id = $p_to)";  
      
+      }
       
-      $Res=ExecSql($this->db,"select to_char(j_date,'DD.MM.YYYY') as j_date,".
+      /*$Res=ExecSql($this->db,"select to_char(j_date,'DD.MM.YYYY') as 
j_date,".
               "case when j_debit='t' then j_montant else 0 end as 
deb_montant,".
               "case when j_debit='f' then j_montant else 0 end as 
cred_montant,".
               " jr_comment as description,jrn_def_name as jrn_name,".
@@ -60,7 +66,18 @@
               " from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
               " left join jrn on jr_grpt_id=j_grpt".
               " where j_poste=".$this->id." and ".$periode.
-              " order by j_date::date");
+         " order by j_date::date");
+       */
+      $Res=ExecSql($this->db,"select to_char(j_date,'DD.MM.YYYY') as j_date,".
+              "case when j_debit='t' then j_montant else 0 end as 
deb_montant,".
+              "case when j_debit='f' then j_montant else 0 end as 
cred_montant,".
+              " jr_comment as description,jrn_def_name as jrn_name,".
+              "j_debit, jr_internal ".
+              " from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
+         " left join jrn on jr_grpt_id=j_grpt".
+         " left join parm_periode on j_tech_per = p_id".
+              " where j_poste=".$this->id." and ".$periode.
+         " order by j_date::date");       
       $array=array();
       $tot_cred=0.0;
       $tot_deb=0.0;
--- ../phpcompta-dev/include/class_balance.php  2006-08-04 09:18:50.018944000 
+0200
+++ include/class_balance.php   2006-09-15 13:54:34.471632000 +0200
@@ -51,14 +51,17 @@
  *         - $a['solde_cred']
  */
   function GetRow($p_from_periode,$p_to_periode) {
-    // compute periode
-    if ( $p_from_periode==$p_to_periode ) {
-      $per_sql=" j_tech_per = $p_from_periode ";
-    } else {
-      $per_sql = "j_tech_per >=  $p_from_periode and j_tech_per <= 
$p_to_periode ";
-    }
-
 
+      if ( $p_from_periode == $p_to_periode ) 
+      {
+        $per_sql=" jr_tech_per = $p_from_periode ";
+      }
+      else
+      {
+        $per_sql = "p_start >= (select p_start from parm_periode where p_id = 
$p_from_periode) ".
+          "and p_end <= (select p_end from parm_periode where p_id = 
$p_to_periode)";        
+      }
+    
     // if centralized
     $cent="";
 
@@ -69,7 +72,8 @@
           ( select j_poste,
              case when j_debit='t' then j_montant else 0 end as deb,
              case when j_debit='f' then j_montant else 0 end as cred
-          from jrnx join tmp_pcmn on j_poste=pcm_val
+             from jrnx join tmp_pcmn on j_poste=pcm_val
+                  left join parm_periode on j_tech_per = p_id
               where 
              $cent
             $per_sql ) as m group by j_poste order by j_poste::text";

reply via email to

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