[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 142/162: Currency : history for accounting ,
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 142/162: Currency : history for accounting , correct amount in currency |
Date: |
Sat, 11 Jul 2020 13:24:06 -0400 (EDT) |
sparkyx pushed a commit to annotated tag E-4
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] 130/162: use of httpInput, (continued)
- [Noalyss-commit] [noalyss] 130/162: use of httpInput, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 134/162: Translation, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 137/162: Currency : for misc. operation, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 135/162: Translation, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 136/162: Misc. Operation : input : Missing tag TR, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 140/162: Currency : meaning 1 EUR is worth x currency for Sales, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 141/162: Currency : the meaning is : 1 euro is worth xxx Currency , so we divide the amount with the currency rate to compute the EUR value, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 143/162: Currency : detail operation Purchase , the amount in currency were wrong in the summary, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 132/162: Translation, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 138/162: Currency : Precision 6, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 142/162: Currency : history for accounting , correct amount in currency,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 144/162: remove commented code, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 145/162: Currency : purchase, save all detail also in currency, fix problem with the advance payment, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 146/162: Currency : detail operation Sale , the amount in currency were wrong in the summary, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 139/162: Currency : precision 6, display default currency , protect used currency against delete, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 147/162: Task #1660 : place the button for the inventory on the top, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 148/162: New function findSide return D if number is <0, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 155/162: Protect parameters, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 156/162: PHP 7.2 incomptability : sizeof of not array, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 158/162: PHP 7.2 mistyped command, Dany De Bontridder, 2020/07/11
- [Noalyss-commit] [noalyss] 159/162: Currency Show currency info for MISC, Dany De Bontridder, 2020/07/11