noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 08/11: improve Operation detail : show Analyt


From: dwm
Subject: [Noalyss-commit] [noalyss] 08/11: improve Operation detail : show Analytic imputation for VAT Not Deductible
Date: Sun, 15 Dec 2024 09:51:26 -0500 (EST)

sparkyx pushed a commit to branch stable
in repository noalyss.

commit dc93eb1b3afdacced2d1f91825581739b6d56eee
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Dec 14 17:17:17 2024 +0100

    improve Operation detail : show Analytic imputation for VAT Not Deductible
---
 include/template/ledger_detail_ach.php | 48 +++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/include/template/ledger_detail_ach.php 
b/include/template/ledger_detail_ach.php
index 9f7397459..f623c899c 100644
--- a/include/template/ledger_detail_ach.php
+++ b/include/template/ledger_detail_ach.php
@@ -274,7 +274,53 @@ global $div,$g_parameter,$cn,$access,$jr_id,$obj;
                             $str_anc.=td($poste);
                             $str_anc.=td(nbm($htva)." {$side}");
                             $str_anc.=$anc_op->display_table(1, $htva, $div);
-                        } 
+
+                            $str_anc.='</tr>';
+                            /* check there is no other row for this one like 
TVA_ND */
+                            /**
+                             * @var $anl_extra array of rows from 
operation_analytique concerning the current record
+                             *
+                             */
+                            $anl_extra=$cn->get_array('select  distinct 
j1.f_id,
+                                        o1.j_id  j_id_anx,
+                                        j1.j_poste,
+                                        j1.j_debit,
+                                        j1.j_montant
+                                        from operation_analytique o1 
+                                        join jrnx j1 on (o1.j_id=j1.j_id)
+                                        where oa_jrnx_id_source = $1',
+                                [$q['j_id']]);
+                            if (count($anl_extra)   > 0)
+                            {
+                                foreach ($anl_extra as $item_anl_extra) {
+
+                                    $anc_op = new Anc_Operation($cn);
+                                    $anc_op->j_id =$item_anl_extra['j_id_anx'];
+                                    $anc_op->in_div=uniqid();
+                                    $side=($item_anl_extra['j_debit'] == 
'f')?'C':'D';
+                                    $n="";
+                                    if ( $item_anl_extra['f_id'] != "") {
+                                        $n=$cn->get_value('select ad_value 
from fiche_detail 
+                                                        where
+                                                            f_id =$1
+                                                          and ad_id=$2'
+                                                
,[$item_anl_extra['f_id'],ATTR_DEF_QUICKCODE]);
+                                    }
+
+                                    /* compute total price */
+                                    bcscale(2);
+                                    $str_anc.='<tr>';
+                                    $str_anc.=td($n);
+                                    $str_anc.=td($item_anl_extra['j_poste']);
+
+                                    
$str_anc.=td(nbm($item_anl_extra['j_montant'])." {$side}");
+                                    $str_anc.=$anc_op->display_table(0, $htva, 
$anc_op->in_div);
+
+                                    $str_anc.='</tr>';
+                                }
+
+                            }
+                        }
                     }
                      $class=($e%2==0)?' class="even"':'class="odd"';
                      /*



reply via email to

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