noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 05/14: Task #2128 : Comptabilité française :


From: dwm
Subject: [Noalyss-commit] [noalyss] 05/14: Task #2128 : Comptabilité française : report, montre le solde de l'année et depuis le début pour les fiches, postes en HTML et PDF
Date: Sun, 4 Feb 2024 05:51:22 -0500 (EST)

sparkyx pushed a commit to branch devel
in repository noalyss.

commit bab6b76a67b9cb7e26c741b3b6614f60a733cb43
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Jan 31 08:48:07 2024 +0100

    Task #2128 : Comptabilité française : report, montre le solde de l'année
    et depuis le début pour les fiches, postes en HTML et PDF
---
 include/ajax/ajax_history.php              |  2 +-
 include/class/acc_account_ledger.class.php | 12 ++++++++++++
 include/class/fiche.class.php              | 14 +++++++++++++-
 include/export/export_fiche_detail_pdf.php | 15 ++++++++++++++-
 include/export/export_poste_detail_pdf.php | 15 ++++++++++++++-
 include/sql/patch/upgrade190.sql           |  2 +-
 6 files changed, 55 insertions(+), 5 deletions(-)

diff --git a/include/ajax/ajax_history.php b/include/ajax/ajax_history.php
index 56a736be1..51e2cdfb8 100644
--- a/include/ajax/ajax_history.php
+++ b/include/ajax/ajax_history.php
@@ -110,7 +110,7 @@ if ( isset($_GET['f_id']))
         
         ob_start();
         require_once NOALYSS_TEMPLATE.'/history_top.php';
-       
$detail_card=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),$fiche->getName());
+       
$detail_card=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),$fiche->getName()."
 ".$fiche->strAttribut(ATTR_DEF_FIRST_NAME,0));
        echo h2(  
$fiche->getName().'['.$fiche->strAttribut(ATTR_DEF_QUICKCODE).']',' 
class="title" ');
        echo '<p style="text-align:center;">'.$detail_card.'</p>';
  
diff --git a/include/class/acc_account_ledger.class.php 
b/include/class/acc_account_ledger.class.php
index 61d33887e..2e3aa4079 100644
--- a/include/class/acc_account_ledger.class.php
+++ b/include/class/acc_account_ledger.class.php
@@ -448,6 +448,7 @@ class Acc_Account_Ledger
     {
         
         if ( $p_array==null)$p_array=$_REQUEST;
+        global $g_parameter;
         $this->get_name();
         list($array,$tot_deb,$tot_cred)=$this->get_row_date( 
$p_array['from_periode'],
                                                             
$p_array['to_periode'],$let
@@ -592,6 +593,17 @@ class Acc_Account_Ledger
        echo   "<tr><TD>$solde_type</TD><td></td>".
          "<TD style=\"text-align:right\">".nbm(abs($diff))."</TD>".
         "</TR>";
+        // take saldo from 1st day until last
+        if ($g_parameter->MY_REPORT=='N') {
+            $solde_until_now=$this->get_solde_detail("  j_date <= 
to_date('{$p_array['to_periode']}','DD.MM.YYYY')  ");
+            echo '<tr style="font-weight:bold;color:orangered">';
+            echo td(_("Solde global"));
+            echo td("D : ".nbm($solde_until_now['debit']),'class="num"');
+            echo td("C : ".nbm($solde_until_now['credit']),'class="num"');
+            echo td("Delta : ".nbm($solde_until_now['solde'])." 
".$this->get_amount_side($solde_until_now['debit']-$solde_until_now['credit']),'class="num"');
+            echo '</tr>';
+
+        }
         echo '</tfoot>';
         echo '</tbody>';
 
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 62e124acb..fd1028383 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -965,6 +965,7 @@ class Fiche
     {
         if ( $p_array == null)
             $p_array=$_REQUEST;
+        global $g_parameter;
         $progress=0;
         // if from_periode is greater than to periode then swap the values
         if (cmpDate($p_array['from_periode'],$p_array['to_periode']) > 0)
@@ -1085,7 +1086,7 @@ class Fiche
            $old_exercice=$op['p_exercice'];
 
         }
-        $solde_type=($sum_deb>$sum_cred)?_("solde débiteur"):_("solde 
créditeur");
+        $solde_type=_("Année ").($sum_deb>$sum_cred)?_("solde 
débiteur"):_("solde créditeur");
         $solde_side=($sum_deb>$sum_cred)?"D":"C";
         $diff=abs(bcsub($sum_deb,$sum_cred));
         echo '<tfoot>';
@@ -1109,6 +1110,17 @@ class Fiche
          "<TD style=\"text-align:right\">".nbm($diff)."</TD>".
         "<TD></TD>".
         "</TR>";
+        // take saldo from 1st day until last
+        if ($g_parameter->MY_REPORT=='N') {
+            $solde_until_now=$this->get_solde_detail("  j_date <= 
to_date('{$p_array['to_periode']}','DD.MM.YYYY')  ");
+            echo '<tr style="font-weight:bold;color:orangered">';
+            echo td(_("Solde global"));
+            echo td("D : ".nbm($solde_until_now['debit']),'class="num"');
+            echo td("C : ".nbm($solde_until_now['credit']),'class="num"');
+            echo td("Delta : ".nbm($solde_until_now['solde'])." 
".$this->get_amount_side($solde_until_now['debit']-$solde_until_now['credit']),'class="num"');
+            echo '</tr>';
+
+        }
         echo '</tfoot>';
         echo '</tbody>';
 
diff --git a/include/export/export_fiche_detail_pdf.php 
b/include/export/export_fiche_detail_pdf.php
index 7034c644a..4f623caf5 100644
--- a/include/export/export_fiche_detail_pdf.php
+++ b/include/export/export_fiche_detail_pdf.php
@@ -28,7 +28,7 @@ include_once("lib/ac_common.php");
 include_once("lib/impress.class.php");
 require_once  NOALYSS_INCLUDE.'/header_print.php';
 $http=new HttpInput();
-
+global $g_parameter;
 $f_id=$http->request("f_id", "number");
 $from_periode=$http->get("from_periode","date");
 $to_periode=$http->get("to_periode","date");
@@ -229,6 +229,19 @@ $pdf->write_cell(160,5,'Solde '.$solde,0,0,'R');
 $pdf->write_cell(30,5,$str_diff_solde,0,0,'R');
 $pdf->line_new();
 
+// take saldo from 1st day until last
+if ($g_parameter->MY_REPORT=='N') {
+
+    $solde_until_now=$Fiche->get_solde_detail("  j_date <= 
to_date('$to_periode','DD.MM.YYYY')  ");
+
+    $pdf->write_cell(40,5,"Solde global",0,0,'R');
+    $pdf->write_cell(40,5,"D : ".nbm($solde_until_now['debit']),0,0,'R');
+    $pdf->write_cell(40,5,"C : ".nbm($solde_until_now['credit']),0,0,'R');
+    $pdf->write_cell(40,5,"Delta : ".nbm($solde_until_now['solde'])." 
".$Fiche->get_amount_side($solde_until_now['debit']-$solde_until_now['credit']),0,0,'R');
+    $pdf->line_new();
+
+}
+
 $fDate=date('dmy-Hi');
 $pdf->Output('fiche-'.$fDate.'.pdf','D');
 
diff --git a/include/export/export_poste_detail_pdf.php 
b/include/export/export_poste_detail_pdf.php
index 8559aa45e..cda145a4a 100644
--- a/include/export/export_poste_detail_pdf.php
+++ b/include/export/export_poste_detail_pdf.php
@@ -25,6 +25,8 @@
 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
 require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
 require_once NOALYSS_INCLUDE.'/header_print.php';
+global $g_parameter;
+
 $http=new HttpInput();
 
 $poste_id=$http->request("poste_id");
@@ -32,7 +34,6 @@ $from_periode=$http->request("from_periode");
 $to_periode=$http->request("to_periode");
 $ople=$http->request("ople");
 $poste_fille=$http->request("poste_fille","string",-1);
-
 $gDossier=dossier::id();
 
 /* Security */
@@ -247,6 +248,18 @@ foreach ($a_poste as $poste)
     $pdf->write_cell(30,5,$str_diff_solde,0,0,'R');
     $pdf->line_new();
 
+    // take saldo from 1st day until last
+    if ($g_parameter->MY_REPORT=='N') {
+
+        $solde_until_now=$Poste->get_solde_detail("  j_date <= 
to_date('$to_periode','DD.MM.YYYY')  ");
+
+        $pdf->write_cell(40,5,"Solde global",0,0,'R');
+        $pdf->write_cell(40,5,"D : ".nbm($solde_until_now['debit']),0,0,'R');
+        $pdf->write_cell(40,5,"C : ".nbm($solde_until_now['credit']),0,0,'R');
+        $pdf->write_cell(40,5,"Delta : ".nbm($solde_until_now['solde'])." 
".$Poste->get_amount_side($solde_until_now['debit']-$solde_until_now['credit']),0,0,'R');
+        $pdf->line_new();
+
+    }
 }
 $fDate=date('dmy-Hi');
 $pdf->Output('poste-'.$fDate.'-'.$poste_id.'.pdf','D');
diff --git a/include/sql/patch/upgrade190.sql b/include/sql/patch/upgrade190.sql
index e58122b77..8ef59c4e1 100644
--- a/include/sql/patch/upgrade190.sql
+++ b/include/sql/patch/upgrade190.sql
@@ -35,7 +35,7 @@ create trigger fiche_detail_check_qcode_trg before insert
 
 update fiche_detail set ad_value=ad_value where ad_id in (select ad_id from 
attr_def where ad_type='card');
 
-insert into parameter values ('MY_REPORT','N') ON CONFLICT DO NOTHING;
+insert into parameter values ('MY_REPORT','Y') ON CONFLICT DO NOTHING;
 
 update menu_ref set me_file='payment_method.inc.php' where me_code='CFGPAY';
 



reply via email to

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