[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 26/173: Currency : history for accounting , c
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 26/173: Currency : history for accounting , correct amount in currency |
Date: |
Mon, 22 Mar 2021 12:58:29 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit d4d72149c3076b2a870563874d7f358af01cf348
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Sun Jan 6 13:08:17 2019 +0100
Currency : history for accounting , correct amount in currency
---
include/class/acc_account_ledger.class.php | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/include/class/acc_account_ledger.class.php
b/include/class/acc_account_ledger.class.php
index 640a4b1..b381a9f 100644
--- a/include/class/acc_account_ledger.class.php
+++ b/include/class/acc_account_ledger.class.php
@@ -190,10 +190,10 @@ class Acc_Account_Ledger
,jrn.currency_id
,(select cr_code_iso from currency where id=jrn.currency_id) as
cr_code_iso
,j_montant
- ,sum_oc_amount as oc_amount
- ,sum_oc_vat_amount as oc_vat_amount
+ ,oc_amount
+ ,oc_vat_amount
from jrnx as j1
- left join v_all_account_currency as va on (j1.j_id = va.j_id and
j1.j_poste=va.j_poste)
+ left join operation_currency as va on (j1.j_id = va.j_id )
join jrn_def on (jrn_def_id=j_jrn_def )
join jrn on (jr_grpt_id=j_grpt)
join tmp_pcmn on (j1.j_poste=pcm_val)
@@ -407,7 +407,7 @@ class Acc_Account_Ledger
"<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\">"._('Dev.')."</TH>".
"<TH style=\"text-align:right\">"._('Débit')."</TH>".
"<TH style=\"text-align:right\">"._("Crédit")."</TH>".
th('Prog.','style="text-align:right"').
@@ -464,8 +464,8 @@ class Acc_Account_Ledger
$side=" ".$this->get_amount_side($progress);
$sum_cred=bcadd($sum_cred,$op['cred_montant']);
$sum_deb=bcadd($sum_deb,$op['deb_montant']);
- if ($idx%2 == 0) $class='class="odd"'; else $class='
class="even"';
- $idx++;
+ $class=($idx%2 == 0)?'class="odd"':$class=' class="even"';
+ $idx++;
echo "<TR $class name=\"tr_" . $let . "_" . $from_div . "\">" .
"<TD>".smaller_date(format_date($op['j_date']))."</TD>".
@@ -476,10 +476,13 @@ class Acc_Account_Ledger
"<TD>".h($op['description'])."</TD>".
td($op['jr_optype']);
/// If the currency is not the default one , then show
the amount
- if ( $op['currency_id'] > 0 && $op['oc_amount'] != 0)
+ if ( $op['currency_id'] > 0 )
{
- echo td($op['cr_code_iso']).
-
td(nbm($op['oc_amount'],4),'style="text-align:right;padding-left:10px;"');
+ // some amount are not directly recorded into
operation_currency, like VAT
+ $currency_val=($op['oc_amount'] == 0)?round(bcmul
($op['j_montant'],$op['currency_rate']),2):$op['oc_amount'] ;
+
+ echo td($op['cr_code_iso']).
+
td(nbm($currency_val,2),'style="text-align:right;padding-left:10px;"');
} else {
echo td().td();
}
- [Noalyss-commit] [noalyss] 74/173: TEST : fix some little bugs, (continued)
- [Noalyss-commit] [noalyss] 74/173: TEST : fix some little bugs, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 75/173: mantis #1690: Bug : impossible d'utiliser < dans Inplace_Edit Replace strip_tags , add a space before the "<", Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 21/173: Currency : for misc. operation, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 76/173: Mantis #1693: CA - problème avec la balance croisée double, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 79/173: Merge with dev7109, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 72/173: Mantis #0001618: Journaux - choix du type en premier, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 77/173: translation, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 80/173: Merge branch 'master' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 82/173: Merge branch 'dev7109' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 88/173: Merge branch 'dev7109' into entreprise, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 26/173: Currency : history for accounting , correct amount in currency,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 28/173: remove commented code, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 34/173: by default jrn is an empty array, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 40/173: Protect parameters, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 43/173: PHP 7.2 mistyped command, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 47/173: Currency : set default accounting for change difference when using currency, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 16/173: Translation, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 17/173: Translation, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 23/173: Currency : precision 6, display default currency , protect used currency against delete, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 27/173: Currency : detail operation Purchase , the amount in currency were wrong in the summary, Dany De Bontridder, 2021/03/22
- [Noalyss-commit] [noalyss] 37/173: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2021/03/22