noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 07/29: 0001827: Delta des opérations liées ba


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 07/29: 0001827: Delta des opérations liées basé sur le montant d'une seule opération
Date: Wed, 4 Nov 2020 11:08:39 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit d8c068cc091f5de793f5a0891ccbf28c4a660b5a
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Wed Oct 28 21:31:09 2020 +0100

    0001827: Delta des opérations liées basé sur le montant d'une seule 
opération
---
 include/template/ledger_detail_bottom.php | 20 +++++++++++++++++---
 include/template/ledger_detail_fin.php    |  2 +-
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/include/template/ledger_detail_bottom.php 
b/include/template/ledger_detail_bottom.php
index 2eb2113..f62975a 100644
--- a/include/template/ledger_detail_bottom.php
+++ b/include/template/ledger_detail_bottom.php
@@ -173,13 +173,13 @@ endif;
  <?php 
           // display title only in popup
           if ($div == 'popup') :
-          ?> 
+          ?> er
                 <h1 class="legend"><?php echo 
$a_tab['linked_operation_div']['label']?></h1>
           <?php endif; ?>
 <?php 
 
 if ($aRap  != null ) {
-    $amount_tva_include=(isset($tvac))?$tvac:$detail->det->jr_montant;
+    
$amount_tva_include=(isset($total_tvac))?$total_tvac:$detail->det->jr_montant;
   $tableid="tb".$div;
   $total_rec=0;
   echo '<table id="'.$tableid.'">';
@@ -187,8 +187,22 @@ if ($aRap  != null ) {
     $opRap=new Acc_Operation($cn);
     $opRap->jr_id=$aRap[$e];
     $internal=$opRap->get_internal();
-    $array_jr=$cn->get_array('select 
jr_date,jr_pj_number,jr_montant,jr_comment from jrn where 
jr_id=$1',array($aRap[$e]));
+    $array_jr=$cn->get_array('select 
jr_date,jr_pj_number,jr_montant,jr_comment , jr_internal 
+                                from jrn where jr_id=$1',
+        array($aRap[$e]));
     $amount=$array_jr[0]['jr_montant'];
+    switch (substr($array_jr[0]['jr_internal'],0,1)) {
+        case 'A':
+            $amount = $cn->get_value("select sum(qp_price+qp_vat-qp_vat_sided) 
from quant_purchase qp 
+                                            where qp_internal=$1",
+                array($internal));
+            break;
+        case 'V':
+            $amount=$cn->get_value("select sum(qs_price+qs_vat-qs_vat_sided) 
from quant_sold qs  
+                                        where qs_internal=$1",
+                array($internal));
+            break;
+    }
     $total_rec=bcadd($total_rec,$amount);
     $str="modifyOperation(".$aRap[$e].",".$gDossier.")";
     
diff --git a/include/template/ledger_detail_fin.php 
b/include/template/ledger_detail_fin.php
index 291a125..50ea04f 100644
--- a/include/template/ledger_detail_fin.php
+++ b/include/template/ledger_detail_fin.php
@@ -32,7 +32,7 @@ $date->value=format_date($obj->det->jr_date);
 <?php 
 $bk=new Fiche($cn,$obj->det->array[0]['qf_bank']);
 
$view_card_detail=HtmlInput::card_detail($bk->get_quick_code(),h($bk->getName()),
 ' class="line" ');
-echo td(_('Compte en banque')).td($view_card_detail).td();;
+echo td(_('Compte en banque')).td($view_card_detail).td();
 
 ?>
 </tr>



reply via email to

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