[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 146/238: Currency : history for accounting ,
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 146/238: Currency : history for accounting , correct amount in currency |
Date: |
Sat, 26 Oct 2019 04:40:54 -0400 (EDT) |
sparkyx pushed a commit to annotated tag rel7110
in repository noalyss.
commit d4d72149c3076b2a870563874d7f358af01cf348
Author: Dany De Bontridder <address@hidden>
Date: 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] 103/238: reverse for quant_fin, (continued)
- [Noalyss-commit] [noalyss] 103/238: reverse for quant_fin, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 96/238: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 106/238: Currency : adapt for bank saldo, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 102/238: Version DB 131, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 113/238: change background, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 112/238: currency : sale extended html , csv, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 110/238: Currency : All ledger's listing mode , html , csv and pdf, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 119/238: currency : adapt middle of payment, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 124/238: Currency : when we pay at the same time as we record the sale / purchase , either the bank is in euro (default currency) or the sale/purchase has the same currency than the financial ledger, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 126/238: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 146/238: Currency : history for accounting , correct amount in currency,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 139/238: Translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 133/238: Translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 142/238: Currency : Precision 6, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 156/238: Merge branch 'r700-currency' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 143/238: Currency : precision 6, display default currency , protect used currency against delete, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 134/238: use of httpInput, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 135/238: Translation, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 151/238: Task #1660 : place the button for the inventory on the top, Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 155/238: Task #0001309: Association d'une opération avec elle-même., Dany De Bontridder, 2019/10/26
- [Noalyss-commit] [noalyss] 163/238: PHP 7.2 mistyped command, Dany De Bontridder, 2019/10/26