noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 107/162: Currency : sales in listing mode


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 107/162: Currency : sales in listing mode
Date: Sat, 11 Jul 2020 13:23:53 -0400 (EDT)

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

commit 4deb34a059cce19e75891055efb29f7bd6a7324f
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Wed Dec 5 09:27:52 2018 +0100

    Currency : sales in listing mode
---
 include/class/acc_ledger_history_sale.class.php    | 34 ++++++++++++++++++++--
 .../template/acc_ledger_history_sale_oneline.php   | 14 +++++++--
 2 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/include/class/acc_ledger_history_sale.class.php 
b/include/class/acc_ledger_history_sale.class.php
index 400de99..ffb8104 100644
--- a/include/class/acc_ledger_history_sale.class.php
+++ b/include/class/acc_ledger_history_sale.class.php
@@ -126,7 +126,14 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
                 (select ad_value from fiche_detail where ad_id=32 and 
f_id=x.f_id) as first_name,
                 (select ad_value from fiche_detail where ad_id=23 and 
f_id=x.f_id) as qcode
               from 
-              fiche as x)
+              fiche as x),
+              row_currency as (
+                select sum(oc_amount) as sum_oc_amount,sum(oc_vat_amount) as 
sum_oc_vat_amount,jrnx.j_grpt
+                from 
+                    operation_currency
+                    join jrnx using (j_id)
+                group by j_grpt
+              )
             select   
                     name,
                     first_name,
@@ -142,11 +149,19 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
                     vat,
                     tva_sided,
                     novat,
-                    novat+vat-tva_sided as tvac
+                    novat+vat-tva_sided as tvac,
+                    jrn.currency_id,
+                    jrn.currency_rate,
+                    jrn.currency_rate_ref,
+                    sum_oc_amount,
+                    sum_oc_vat_amount,
+                    cr_code_iso
             from
                 jrn
                 join row_sale on (qs_internal=jr_internal)
                 join client_detail on (qs_client=f_id)
+                left join row_currency as rc on (rc.j_grpt = jrn.jr_grpt_id)
+                left join currency as c on (c.id=jrn.currency_id)
             where
                 jr_def_id in ({$ledger_list})
                 and {$periode}
@@ -249,7 +264,6 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
         $title[]=_("HTVA");
         $title[]=_("TVA");
         $title[]=_("TVA annulée");
-       
 
         if ( $own->MY_TVA_USE=='Y')
         {
@@ -260,6 +274,11 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
             }
         }
         $title[]=_("TVAC/TTC");
+        $title[]=_("Devise");
+        $title[]=_("Devise HTVA");
+        $title[]=_("Devise TVA");
+        $title[]=_("Taux ref");
+        $title[]=_("Taux utilisé");
         $title[]=_("opérations liées");
         $export->write_header($title);
         
@@ -299,6 +318,15 @@ class Acc_Ledger_History_Sale extends Acc_Ledger_History
             }
             $export->add($line['tvac'],"number");
             /**
+             * Add currency info
+             */
+            $export->add($line['cr_code_iso']);
+            $export->add($line['sum_oc_amount'],'number');
+            $export->add($line['sum_oc_vat_amount'],'number');
+            $export->add($line['currency_rate'],'number');
+            $export->add($line['currency_rate_ref'],'number');
+            
+            /**
              * Retrieve payment if any
              */
              
$ret_reconcile=$this->db->execute('reconcile_date',array($line['jr_id']));
diff --git a/include/template/acc_ledger_history_sale_oneline.php 
b/include/template/acc_ledger_history_sale_oneline.php
index a24b9ee..439c25c 100644
--- a/include/template/acc_ledger_history_sale_oneline.php
+++ b/include/template/acc_ledger_history_sale_oneline.php
@@ -46,15 +46,18 @@
         <th>
             <?=_('Description')?>
         </th>
-        <th>
+        <th class="num">
             <?=_('HTVA')?>
         </th>
-        <th>
+        <th class="num">
             <?=_('TVA')?>
         </th>
-        <th>
+        <th class="num">
             <?=_('TVAC')?>
         </th>
+        <th class="num">
+            <?=_('Devise')?>
+        </th>
     </tr>
 <?php 
 $nb_data=count($this->data);
@@ -96,6 +99,10 @@ for ($i=0;$i<$nb_data;$i++):
         <td class="num">
             <?=nbm($this->data[$i]['tvac'])?>
         </td>
+        <td class="num">
+            <?=nbm ( 
bcadd($this->data[$i]['sum_oc_amount'],$this->data[$i]['sum_oc_vat_amount']),4)?>
+            <?=$this->data[$i]['cr_code_iso']?>
+        </td>
         <td>
             
         <?php
@@ -110,6 +117,7 @@ for ($i=0;$i<$nb_data;$i++):
         }
     } ?>
         </td>
+
     </tr>
 <?php 
     endfor;



reply via email to

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