[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 146/218: Currency : history for accounting ,
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 146/218: Currency : history for accounting , correct amount in currency |
Date: |
Thu, 12 Sep 2019 15:58:57 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
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] 139/218: Translation, (continued)
- [Noalyss-commit] [noalyss] 139/218: Translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 137/218: Translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 140/218: Misc. Operation : input : Missing tag TR, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 144/218: Currency : meaning 1 EUR is worth x currency for Sales, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 141/218: Currency : for misc. operation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 159/218: Currency : because of Misc Operation, the tiers must also be saved into operation_currency. Fix also PRINTJRN for currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 166/218: Typo, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 79/218: Bug : in Purchase and Sale , the last rows disappear when we change the ledger, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 104/218: Reverse for Currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 118/218: Currency : export CSV history for card and accounting, fix bug with unneeded oc_vat_amount + add the currency rate, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 146/218: Currency : history for accounting , correct amount in currency,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 145/218: 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, 2019/09/12
- [Noalyss-commit] [noalyss] 150/218: Currency : detail operation Sale , the amount in currency were wrong in the summary, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 154/218: by default jrn is an empty array, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 164/218: Currency Show currency info for MISC, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 161/218: PHP 7.2 incomptability : sizeof of not array, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 155/218: Task #0001309: Association d'une opération avec elle-même., Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 158/218: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 160/218: Protect parameters, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 167/218: Currency : set default accounting for change difference when using currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 165/218: Database upgrade, Dany De Bontridder, 2019/09/12