[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 08/38: Task #2128 : Comptabilité française :
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 08/38: 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, 18 Feb 2024 07:30:42 -0500 (EST) |
sparkyx pushed a commit to branch devel
in repository noalyss.
commit 0219700f4490917782a8c7fae1c2580ee1ba0e79
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';
- [Noalyss-commit] [noalyss] branch devel updated (23653dddb -> 910ae8b9f), dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 06/38: Task #2219 Suivi Cosmétique et PHP8.1 Compatibility, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 01/38: Cosmetic : Alignement, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 15/38: bug follow-up, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 12/38: Task #02326: Suivi : possibilité de charger plusieurs documents, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 04/38: Tableau de bord : position des détail, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 02/38: Correction : prevent direct access to $_REQUEST, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 03/38: version 9.2, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 08/38: 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,
dwm <=
- [Noalyss-commit] [noalyss] 05/38: SUIVI : détail , montre nom et prénom, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 19/38: version 9.2, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 33/38: CARD : add button to epxort to PDF, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 26/38: Task #2321: erreur de numérotation, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 29/38: cosmetic, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 10/38: Filtre ne fonctionne pas tva_search_id est vide, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 11/38: Sécurité : bloquer le changement de date des opérations, Renforce mode strict : change de date impossible, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 17/38: FOLLOWUP : nom contact pas affiché, dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 23/38: Merge branch 'devel', dwm, 2024/02/18
- [Noalyss-commit] [noalyss] 13/38: FOLLOWUP : Cosmetic nombre pièces, dwm, 2024/02/18