[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 44/218: Task #448 : add info about currency i
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 44/218: Task #448 : add info about currency into History of cards and accounting |
Date: |
Thu, 12 Sep 2019 15:58:37 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit f8db1e508c8e7b513a4b3df776847c5593231fd9
Author: Dany De Bontridder <address@hidden>
Date: Wed May 16 14:20:40 2018 +0200
Task #448 : add info about currency into History
of cards and accounting
---
include/class/acc_account_ledger.class.php | 38 ++++++++++++++++++++----------
include/class/fiche.class.php | 30 +++++++++++++++++------
include/export/export_fiche_detail_csv.php | 7 ++++++
include/export/export_poste_detail_csv.php | 9 +++++++
4 files changed, 65 insertions(+), 19 deletions(-)
diff --git a/include/class/acc_account_ledger.class.php
b/include/class/acc_account_ledger.class.php
index 4d31139..f396d84 100644
--- a/include/class/acc_account_ledger.class.php
+++ b/include/class/acc_account_ledger.class.php
@@ -183,7 +183,11 @@ class Acc_Account_Ledger
from
cred
full join deb using (jl_id) where jl_id=(select distinct jl_id
from sqlletter where sqlletter.j_id=j1.j_id )) as delta_letter
- from jrnx as j1
+ ,jrn.currency_rate
+ ,jrn.currency_id
+ ,(select cr_code_iso from currency where
id=jrn.currency_id) as cr_code_iso
+ ,j_montant
+ from jrnx as j1
join jrn_def on (jrn_def_id=j_jrn_def )
join jrn on (jr_grpt_id=j_grpt)
join tmp_pcmn on (j_poste=pcm_val)
@@ -390,12 +394,14 @@ class Acc_Account_Ledger
echo '<tbody>';
echo "<TR>".
"<TH style=\"text-align:left\">"._('Date')." </TH>".
- "<TH style=\"text-align:left\">"._('n° de pièce')." </TH>".
- "<TH style=\"text-align:left\">"._('QuickCode')."</TH>".
- "<TH style=\"text-align:left\">"._('Code interne')." </TH>".
+ "<TH style=\"text-align:left\">"._('Pièce')." </TH>".
+ "<TH style=\"text-align:left\">"._('Code')."</TH>".
+ "<TH style=\"text-align:left\">"._('Interne')." </TH>".
"<TH style=\"text-align:left\">"._('Tiers')." </TH>".
"<TH style=\"text-align:left\">"._('Description')."</TH>".
"<TH style=\"text-align:left\">"._('Type')."</TH>".
+ "<TH style=\"text-align:left\">"._('ISO')."</TH>".
+ "<TH style=\"text-align:left\">"._('Dev.')."</TH>".
"<TH style=\"text-align:right\">"._('Débit')."</TH>".
"<TH style=\"text-align:right\">"._("Crédit")."</TH>".
th('Prog.','style="text-align:right"').
@@ -435,11 +441,11 @@ class Acc_Account_Ledger
$side=" ".$this->get_amount_side($progress);
echo "<TR class=\"highlight\">".
"<TD>$old_exercice</TD>".
- "<TD></TD>".td().td().td().
+ "<TD></TD>".td().td().td().td().td().
"<TD>"._("Totaux")."</TD>".td("").
- "<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
- "<TD style=\"text-align:right\">".nbm($sum_cred)."</TD>".
- td(nbm(abs($progress)).$side,'style="text-align:right"').
+ "<TD
style=\"text-align:right;padding-left:10px;\">".nbm($sum_deb)."</TD>".
+ "<TD
style=\"text-align:right;padding-left:10px;\">".nbm($sum_cred)."</TD>".
+
td(nbm(abs($progress)).$side,'style="text-align:right;padding-left:10px;"').
td('').
"</TR>";
$sum_cred=0;
@@ -462,9 +468,17 @@ class Acc_Account_Ledger
"<TD>".$vw_operation."</TD>".
"<TD>".$tiers."</TD>".
"<TD>".h($op['description'])."</TD>".
- td($op['jr_optype']).
- "<TD style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
- "<TD
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
+ td($op['jr_optype']);
+ if ( $op['cr_code_iso'] != 'EUR' && $op['cr_code_iso'] != "")
+ {
+ echo td($op['cr_code_iso']).
+
td(nbm(bcdiv($op['j_montant'],$op['currency_rate'])),'style="text-align:right;padding-left:10px;"');
+ } else{
+ echo td().td();
+ }
+ echo
+ "<TD
style=\"text-align:right;padding-left:10px;\">".nbm($op['deb_montant'])."</TD>".
+ "<TD
style=\"text-align:right;padding-left:10px;\">".nbm($op['cred_montant'])."</TD>".
td(nbm(abs($progress)).$side,'style="text-align:right"').
td($html_let, ' style="color:red;text-align:right"') .
@@ -477,7 +491,7 @@ class Acc_Account_Ledger
$side=" ".$this->get_amount_side($diff);
echo "<TR class=\"highlight\">".
td($op['p_exercice']).
- td().td().td().td().
+ td().td().td().td().td().td().
"<TD >Totaux</TD>".td("").
"<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
"<TD style=\"text-align:right\">".nbm($sum_cred)."</TD>".
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index c67ac0f..3c4d146 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -1263,8 +1263,12 @@ class Fiche
from
cred
full join deb using (jl_id) where jl_id=(select distinct jl_id
from sqlletter where sqlletter.j_id=j1.j_id )) as delta_letter,
- jrn_def_code".
- " from jrnx as j1 left join jrn_def on
jrn_def_id=j_jrn_def ".
+ jrn_def_code,
+ jrn.currency_rate,
+ jrn.currency_id,
+ (select cr_code_iso from currency where
id=jrn.currency_id) as cr_code_iso,
+ j_montant
+ from jrnx as j1 left join jrn_def on
jrn_def_id=j_jrn_def ".
" left join jrn on jr_grpt_id=j_grpt".
" left join parm_periode on (p_id=jr_tech_per)
".
" where j_qcode=$1 and ".
@@ -1453,12 +1457,14 @@ class Fiche
echo '<tbody>';
echo "<TR>".
"<TH style=\"text-align:left\">"._('Date')."</TH>".
- "<TH style=\"text-align:left\">"._('n° pièce')." </TH>".
+ "<TH style=\"text-align:left\">"._('Pièce')." </TH>".
"<TH style=\"text-align:left\">"._('Poste')." </TH>".
- "<TH style=\"text-align:left\">"._('Code interne')." </TH>".
+ "<TH style=\"text-align:left\">"._('Interne')." </TH>".
"<TH style=\"text-align:left\">"._('Tiers')." </TH>".
"<TH style=\"text-align:left\">"._('Description')." </TH>".
"<TH style=\"text-align:left\">"._('Type')." </TH>".
+ "<TH style=\"text-align:left\">"._('ISO')."</TH>".
+ "<TH style=\"text-align:left\">"._('Dev.')."</TH>".
"<TH style=\"text-align:right\">"._('Débit')." </TH>".
"<TH style=\"text-align:right\">"._('Crédit')." </TH>".
th('Prog.','style="text-align:right"').
@@ -1494,7 +1500,7 @@ class Fiche
echo "<TR class=\"highlight\">".
"<TD>$old_exercice</TD>".
td('').
- "<TD></TD>".td("").td("").
+ "<TD></TD>".td("").td("").td().td().
"<TD>Totaux</TD>".
td().
"<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
@@ -1522,8 +1528,16 @@ class Fiche
"<TD>".$vw_operation."</TD>".
td($tiers).
"<TD>".h($op['description'])."</TD>".
- td($op['jr_optype']).
- "<TD style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
+ td($op['jr_optype']);
+
+ if ( $op['cr_code_iso'] != 'EUR' && $op['cr_code_iso'] != "")
+ {
+ echo td($op['cr_code_iso']).
+
td(nbm(bcdiv($op['j_montant'],$op['currency_rate'])),'style="text-align:right;padding-left:10px;"');
+ } else{
+ echo td().td();
+ }
+ echo "<TD
style=\"text-align:right\">".nbm($op['deb_montant'])."</TD>".
"<TD
style=\"text-align:right\">".nbm($op['cred_montant'])."</TD>".
td(nbm(abs($progress)).$side,'style="text-align:right"').
td($html_let, ' style="text-align:right"') .
@@ -1539,6 +1553,8 @@ class Fiche
td($op['p_exercice']).
td().
td().
+ td().
+ td().
td(_('Totaux')).
"<TD></TD>".td("").td("").
"<TD style=\"text-align:right\">".nbm($sum_deb)."</TD>".
diff --git a/include/export/export_fiche_detail_csv.php
b/include/export/export_fiche_detail_csv.php
index 30061ac..f3e87c3 100644
--- a/include/export/export_fiche_detail_csv.php
+++ b/include/export/export_fiche_detail_csv.php
@@ -74,6 +74,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
_("Nom journal"),
_("Tiers"),
_("Description"),
+ _("Type"),
+ _("Code devise"),
+ _("Devise"),
_("Débit"),
_("Crédit"),
_("Prog."),
@@ -120,6 +123,7 @@ if ( ! isset ($_REQUEST['oper_detail']))
$progress=bcadd($progress,$diff);
$tot_deb=bcadd($tot_deb,$op['deb_montant']);
$tot_cred=bcadd($tot_cred,$op['cred_montant']);
+ $currency_amount=bcdiv($op['j_montant'],$op['currency_rate']);
$export->add($op['j_qcode']);
$export->add($op['j_poste']);
$export->add($op['j_date_fmt']);
@@ -129,6 +133,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
$export->add($op['jrn_def_name']);
$export->add($tiers);
$export->add($op['description']);
+ $export->add($op['jr_optype']);
+ $export->add($op['cr_code_iso']);
+ $export->add($currency_amount,"number");
$export->add($op['deb_montant'],"number");
$export->add($op['cred_montant'],"number");
$export->add(abs($progress),"number");
diff --git a/include/export/export_poste_detail_csv.php
b/include/export/export_poste_detail_csv.php
index a7d0198..c335366 100644
--- a/include/export/export_poste_detail_csv.php
+++ b/include/export/export_poste_detail_csv.php
@@ -85,6 +85,9 @@ if ( ! isset ($_REQUEST['oper_detail']))
$title[]=_("Interne");
$title[]=_("Tiers");
$title[]=_("Description");
+ $title[]=_("Type");
+ $title[]=_("Code devise");
+ $title[]=_("Devise");
$title[]=_("Débit");
$title[]=_("Crédit");
$title[]=_("Prog.");
@@ -134,6 +137,8 @@ if ( ! isset ($_REQUEST['oper_detail']))
$tot_cred=bcadd($tot_cred,$op['cred_montant']);
$diff=bcsub($op['deb_montant'],$op['cred_montant']);
$prog=bcadd($prog,$diff);
+ $currency_amount=bcdiv($op['j_montant'],$op['currency_rate']);
+
$export->add($op['j_date_fmt']);
$export->add($pos['pcm_val']);
$export->add($op['jr_pj_number']);
@@ -144,6 +149,10 @@ if ( ! isset ($_REQUEST['oper_detail']))
$export->add($op['jr_internal']);
$export->add($tiers);
$export->add($op['description']);
+ $export->add($op['jr_optype']);
+ $export->add($op['cr_code_iso']);
+ $export->add($currency_amount,"number");
+
$export->add($op['deb_montant'],"number");
$export->add($op['cred_montant'],"number");
$export->add(abs($prog),"number");
- [Noalyss-commit] [noalyss] 26/218: Task #448 : rounded problem add debug info, (continued)
- [Noalyss-commit] [noalyss] 26/218: Task #448 : rounded problem add debug info, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 16/218: Currency : insert operation with currency in VEN and ACH, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 33/218: Task #448 : correct bug if VAT Rate = 0 , amount was reset, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 39/218: integrate fix for bug in insert_quant_purchase which cannot save private fee, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 41/218: Fix bug quant_purchase , private fee not saved, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 66/218: Remove the default "<div class=content>" which lead to cosmetic bug in the plugins, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 84/218: Style.css Ajout de nowrap, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 91/218: PHP 7.2 : fix incomptability, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 68/218: Documentation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 43/218: Missing ob_start, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 44/218: Task #448 : add info about currency into History of cards and accounting,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 47/218: typo, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 51/218: New version of libreoffice use the numeric in another way, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 53/218: Missing class : missing class for acc_ledger, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 48/218: Task #448 : add currency to card -> history + export CSV, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 65/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 70/218: Merge tag 'rel7008' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 71/218: Check for date and number : isdate and isnumeric, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 87/218: translate, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 82/218: adapt to 7.2 , error with count, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 96/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12