noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 44/162: Task #448 : add info about currency i


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 44/162: Task #448 : add info about currency into History of cards and accounting
Date: Sat, 11 Jul 2020 13:23:31 -0400 (EDT)

sparkyx pushed a commit to annotated tag E-4
in repository noalyss.

commit f8db1e508c8e7b513a4b3df776847c5593231fd9
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Wed May 16 14:20:40 2018 +0200

    Task #448 : add info about currency into History
    of cards and accounting
---
 include/class/acc_account_ledger.class.php | 38 ++++++++++++++++++++----------
 include/class/fiche.class.php              | 30 +++++++++++++++++------
 include/export/export_fiche_detail_csv.php |  7 ++++++
 include/export/export_poste_detail_csv.php |  9 +++++++
 4 files changed, 65 insertions(+), 19 deletions(-)

diff --git a/include/class/acc_account_ledger.class.php 
b/include/class/acc_account_ledger.class.php
index 4d31139..f396d84 100644
--- a/include/class/acc_account_ledger.class.php
+++ b/include/class/acc_account_ledger.class.php
@@ -183,7 +183,11 @@ class Acc_Account_Ledger
                                                                                
                from 
                                                                                
                cred 
                                                                                
                full  join deb using (jl_id) where jl_id=(select distinct jl_id 
from sqlletter  where sqlletter.j_id=j1.j_id  )) as delta_letter
-                                  from jrnx as j1
+                                    ,jrn.currency_rate
+                                    ,jrn.currency_id
+                                    ,(select cr_code_iso from currency where 
id=jrn.currency_id) as cr_code_iso
+                                    ,j_montant
+                          from jrnx as j1
                                   join jrn_def on (jrn_def_id=j_jrn_def )
                                    join jrn on (jr_grpt_id=j_grpt)
                                    join tmp_pcmn on (j_poste=pcm_val)
@@ -390,12 +394,14 @@ class Acc_Account_Ledger
         echo '<tbody>';
         echo "<TR>".
         "<TH style=\"text-align:left\">"._('Date')." </TH>".
-        "<TH style=\"text-align:left\">"._('n° de pièce')." </TH>".
-        "<TH style=\"text-align:left\">"._('QuickCode')."</TH>".
-        "<TH style=\"text-align:left\">"._('Code interne')." </TH>".
+        "<TH style=\"text-align:left\">"._('Pièce')." </TH>".
+        "<TH style=\"text-align:left\">"._('Code')."</TH>".
+        "<TH style=\"text-align:left\">"._('Interne')." </TH>".
         "<TH style=\"text-align:left\">"._('Tiers')." </TH>".
         "<TH style=\"text-align:left\">"._('Description')."</TH>".
         "<TH style=\"text-align:left\">"._('Type')."</TH>".
+        "<TH style=\"text-align:left\">"._('ISO')."</TH>".
+        "<TH style=\"text-align:left\">"._('Dev.')."</TH>".
         "<TH style=\"text-align:right\">"._('Débit')."</TH>".
         "<TH style=\"text-align:right\">"._("Crédit")."</TH>".
         th('Prog.','style="text-align:right"').
@@ -435,11 +441,11 @@ class Acc_Account_Ledger
                        $side="&nbsp;".$this->get_amount_side($progress);
                    echo "<TR class=\"highlight\">".
                      "<TD>$old_exercice</TD>".
-                     "<TD></TD>".td().td().td().
+                     "<TD></TD>".td().td().td().td().td().
                      "<TD>"._("Totaux")."</TD>".td("").
-                     "<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
-                     "<TD style=\"text-align:right\">".nbm($sum_cred)."</TD>".
-                     td(nbm(abs($progress)).$side,'style="text-align:right"').
+                     "<TD 
style=\"text-align:right;padding-left:10px;\">".nbm($sum_deb)."</TD>".
+                     "<TD 
style=\"text-align:right;padding-left:10px;\">".nbm($sum_cred)."</TD>".
+                     
td(nbm(abs($progress)).$side,'style="text-align:right;padding-left:10px;"').
                      td('').
                      "</TR>";
                    $sum_cred=0;
@@ -462,9 +468,17 @@ class Acc_Account_Ledger
              "<TD>".$vw_operation."</TD>".
                 "<TD>".$tiers."</TD>".
              "<TD>".h($op['description'])."</TD>".
-                    td($op['jr_optype']).
-             "<TD style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
-             "<TD 
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
+                    td($op['jr_optype']);
+            if ( $op['cr_code_iso'] != 'EUR' && $op['cr_code_iso'] != "")
+            {
+             echo        td($op['cr_code_iso']).
+                    
td(nbm(bcdiv($op['j_montant'],$op['currency_rate'])),'style="text-align:right;padding-left:10px;"');
+            } else{
+                echo td().td();
+            }
+            echo 
+             "<TD 
style=\"text-align:right;padding-left:10px;\">".nbm($op['deb_montant'])."</TD>".
+             "<TD 
style=\"text-align:right;padding-left:10px;\">".nbm($op['cred_montant'])."</TD>".
              td(nbm(abs($progress)).$side,'style="text-align:right"').
 
              td($html_let, ' style="color:red;text-align:right"') .
@@ -477,7 +491,7 @@ class Acc_Account_Ledger
                $side="&nbsp;".$this->get_amount_side($diff);
         echo "<TR class=\"highlight\">".
                 td($op['p_exercice']).
-                td().td().td().td().
+                td().td().td().td().td().td().
         "<TD >Totaux</TD>".td("").
          "<TD  style=\"text-align:right\">".nbm($sum_deb)."</TD>".
          "<TD  style=\"text-align:right\">".nbm($sum_cred)."</TD>".
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index c67ac0f..3c4d146 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -1263,8 +1263,12 @@ class Fiche
                                                                                
                from 
                                                                                
                cred 
                                                                                
                full  join deb using (jl_id) where jl_id=(select distinct jl_id 
from sqlletter  where sqlletter.j_id=j1.j_id  )) as delta_letter,
-                                                                 jrn_def_code".
-                                 " from jrnx as j1 left join jrn_def on 
jrn_def_id=j_jrn_def ".
+                                                                 jrn_def_code,
+                                  jrn.currency_rate,
+                                    jrn.currency_id,
+                                    (select cr_code_iso from currency where 
id=jrn.currency_id) as cr_code_iso,
+                                    j_montant
+                                  from jrnx as j1 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 (p_id=jr_tech_per) 
".
                                  " where j_qcode=$1 and ".
@@ -1453,12 +1457,14 @@ class Fiche
         echo '<tbody>';
         echo "<TR>".
         "<TH style=\"text-align:left\">"._('Date')."</TH>".
-        "<TH style=\"text-align:left\">"._('n° pièce')." </TH>".
+        "<TH style=\"text-align:left\">"._('Pièce')." </TH>".
         "<TH style=\"text-align:left\">"._('Poste')." </TH>".
-        "<TH style=\"text-align:left\">"._('Code interne')." </TH>".
+        "<TH style=\"text-align:left\">"._('Interne')." </TH>".
         "<TH style=\"text-align:left\">"._('Tiers')." </TH>".
         "<TH style=\"text-align:left\">"._('Description')." </TH>".
         "<TH style=\"text-align:left\">"._('Type')." </TH>".
+        "<TH style=\"text-align:left\">"._('ISO')."</TH>".
+        "<TH style=\"text-align:left\">"._('Dev.')."</TH>".
         "<TH style=\"text-align:right\">"._('Débit')."  </TH>".
         "<TH style=\"text-align:right\">"._('Crédit')." </TH>".
         th('Prog.','style="text-align:right"').
@@ -1494,7 +1500,7 @@ class Fiche
                    echo "<TR class=\"highlight\">".
                       "<TD>$old_exercice</TD>".
                      td('').
-                     "<TD></TD>".td("").td("").
+                     "<TD></TD>".td("").td("").td().td().
                      "<TD>Totaux</TD>".
                             td().
                      "<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
@@ -1522,8 +1528,16 @@ class Fiche
             "<TD>".$vw_operation."</TD>".
             td($tiers).
             "<TD>".h($op['description'])."</TD>".
-                    td($op['jr_optype']).
-            "<TD style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
+                    td($op['jr_optype']);
+            
+            if ( $op['cr_code_iso'] != 'EUR' && $op['cr_code_iso'] != "")
+            {
+             echo   td($op['cr_code_iso']).
+                    
td(nbm(bcdiv($op['j_montant'],$op['currency_rate'])),'style="text-align:right;padding-left:10px;"');
+            } else{
+                echo td().td();
+            }
+            echo "<TD 
style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
              "<TD 
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
              td(nbm(abs($progress)).$side,'style="text-align:right"').
             td($html_let, ' style="text-align:right"') .
@@ -1539,6 +1553,8 @@ class Fiche
                td($op['p_exercice']).
                td().
                td().
+               td().
+               td().
         td(_('Totaux')).
         "<TD></TD>".td("").td("").
         "<TD  style=\"text-align:right\">".nbm($sum_deb)."</TD>".
diff --git a/include/export/export_fiche_detail_csv.php 
b/include/export/export_fiche_detail_csv.php
index 30061ac..f3e87c3 100644
--- a/include/export/export_fiche_detail_csv.php
+++ b/include/export/export_fiche_detail_csv.php
@@ -74,6 +74,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
                 _("Nom journal"),
                 _("Tiers"),
                 _("Description"),
+                _("Type"),
+                _("Code devise"),
+                _("Devise"),
                 _("Débit"),
                 _("Crédit"),
                 _("Prog."),
@@ -120,6 +123,7 @@ if ( ! isset ($_REQUEST['oper_detail']))
         $progress=bcadd($progress,$diff);
         $tot_deb=bcadd($tot_deb,$op['deb_montant']);
         $tot_cred=bcadd($tot_cred,$op['cred_montant']);
+        $currency_amount=bcdiv($op['j_montant'],$op['currency_rate']);
         $export->add($op['j_qcode']);
         $export->add($op['j_poste']);
         $export->add($op['j_date_fmt']);
@@ -129,6 +133,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
         $export->add($op['jrn_def_name']);
         $export->add($tiers);
         $export->add($op['description']);
+        $export->add($op['jr_optype']);
+        $export->add($op['cr_code_iso']);
+        $export->add($currency_amount,"number");
         $export->add($op['deb_montant'],"number");
         $export->add($op['cred_montant'],"number");
         $export->add(abs($progress),"number");
diff --git a/include/export/export_poste_detail_csv.php 
b/include/export/export_poste_detail_csv.php
index a7d0198..c335366 100644
--- a/include/export/export_poste_detail_csv.php
+++ b/include/export/export_poste_detail_csv.php
@@ -85,6 +85,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
         $title[]=_("Interne");
         $title[]=_("Tiers");
         $title[]=_("Description");
+        $title[]=_("Type");
+        $title[]=_("Code devise");
+        $title[]=_("Devise");
         $title[]=_("Débit");
         $title[]=_("Crédit");
         $title[]=_("Prog.");
@@ -134,6 +137,8 @@ if ( ! isset ($_REQUEST['oper_detail']))
             $tot_cred=bcadd($tot_cred,$op['cred_montant']);
             $diff=bcsub($op['deb_montant'],$op['cred_montant']);
             $prog=bcadd($prog,$diff);
+            $currency_amount=bcdiv($op['j_montant'],$op['currency_rate']);
+
             $export->add($op['j_date_fmt']);
             $export->add($pos['pcm_val']);
            $export->add($op['jr_pj_number']);
@@ -144,6 +149,10 @@ if ( ! isset ($_REQUEST['oper_detail']))
             $export->add($op['jr_internal']);
             $export->add($tiers);
             $export->add($op['description']);
+            $export->add($op['jr_optype']);
+            $export->add($op['cr_code_iso']);
+            $export->add($currency_amount,"number");
+            
             $export->add($op['deb_montant'],"number");
             $export->add($op['cred_montant'],"number");
             $export->add(abs($prog),"number");



reply via email to

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