[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 18/218: task #448 : Currency : display curren
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 18/218: task #448 : Currency : display currency info into operation detail |
Date: |
Thu, 12 Sep 2019 15:58:31 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit 8909b0c79f12b8e136ffe7eb1e5380c7bd5224a3
Author: Dany De Bontridder <address@hidden>
Date: Thu May 10 10:06:21 2018 +0200
task #448 : Currency : display currency info into operation detail
---
include/class/acc_currency.class.php | 19 +++++++++++++++++++
include/class/acc_operation.class.php | 2 +-
include/template/ledger_detail_ach.php | 18 +++++++++++++++++-
include/template/ledger_detail_ven.php | 19 ++++++++++++++++---
4 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/include/class/acc_currency.class.php
b/include/class/acc_currency.class.php
index 0e99cd9..1581013 100644
--- a/include/class/acc_currency.class.php
+++ b/include/class/acc_currency.class.php
@@ -115,6 +115,25 @@ class Acc_Currency
return $select;
}
+ /**
+ * Return sum of the w/o VAT and VAT or an operation
+ */
+ function sum_amount($p_jr_id)
+ {
+ $sql = "
+ select sum(round(oc_amount,2)) +
+ sum(round(oc_vat_amount,2))
+ from operation_currency
+ where
+ j_id in (
+ select j_id
+ from jrnx
+ where
+ j_grpt in ( select jr_grpt_id from jrn where jr_id=$1))";
+ $sum=$this->cn->get_value($sql, [$p_jr_id]);
+ return $sum;
+
+ }
}
diff --git a/include/class/acc_operation.class.php
b/include/class/acc_operation.class.php
index cf92376..bf19a07 100644
--- a/include/class/acc_operation.class.php
+++ b/include/class/acc_operation.class.php
@@ -765,7 +765,7 @@ class Acc_Detail extends Acc_Operation
$sql="SELECT jr_id, jr_def_id, jr_montant, jr_comment, jr_date,
jr_grpt_id,
jr_internal, jr_tech_date, jr_tech_per, jrn_ech, jr_ech,
jr_rapt,jr_ech,
jr_valid, jr_opid, jr_c_opid, jr_pj, jr_pj_name, jr_pj_type,
- jr_pj_number, jr_mt,jr_rapt,jr_date_paid,jr_optype
+ jr_pj_number,
jr_mt,jr_rapt,jr_date_paid,jr_optype,currency_id,currency_rate,currency_rate_ref
FROM jrn where jr_id=$1";
$array=$this->db->get_array($sql,array($this->jr_id));
if ( count($array) == 0 ) throw new Exception('Aucune ligne trouvée');
diff --git a/include/template/ledger_detail_ach.php
b/include/template/ledger_detail_ach.php
index 67ef4bf..66a9d95 100644
--- a/include/template/ledger_detail_ach.php
+++ b/include/template/ledger_detail_ach.php
@@ -256,9 +256,25 @@ $str_anc="";
if ($owner->MY_TVA_USE == 'Y')
$row.=td("") . td("").td(nbm($total_tvac), 'class="num"
style="font-style:italic;font-weight: bolder;"');
echo tr($row);
+
?>
</table>
-
+<?php
+/*
+ * Info about currency if not in euro
+ */
+ // Add a row with currency and amount
+ if ( $obj->det->currency_id != "" && $obj->det->currency_id > 0)
+ {
+ $currency=new Acc_Currency($obj->db, $obj->det->currency_id);
+ $four_space=" "." "." "." ";
+
+ echo $currency->get_code(),$four_space;
+ echo _("Taux utilisé")," ", $obj->det->currency_rate,$four_space;
+ echo _("Taux Réf"), " ",$obj->det->currency_rate_ref.$four_space;
+ echo _("Montant en devise"),
" ",$currency->sum_amount($obj->jr_id).$four_space;
+ }
+?>
</div>
diff --git a/include/template/ledger_detail_ven.php
b/include/template/ledger_detail_ven.php
index 26047ac..11e41d9 100644
--- a/include/template/ledger_detail_ven.php
+++ b/include/template/ledger_detail_ven.php
@@ -117,7 +117,6 @@ echo $ipaid->input();
</tr>
</table>
- <div class="myfieldset">
<table class="result">
<?php
bcscale(2);
@@ -263,8 +262,22 @@ echo $ipaid->input();
</td>
</tr>
</table>
- </div>
-
+<?php
+/*
+ * Info about currency if not in euro
+ */
+ // Add a row with currency and amount
+ if ( $obj->det->currency_id != "" && $obj->det->currency_id > 0)
+ {
+ $currency=new Acc_Currency($obj->db, $obj->det->currency_id);
+ $four_space=" "." "." "." ";
+
+ echo $currency->get_code(),$four_space;
+ echo _("Taux utilisé")," ", $obj->det->currency_rate,$four_space;
+ echo _("Taux Réf"), " ",$obj->det->currency_rate_ref.$four_space;
+ echo _("Montant en devise"),
" ",$currency->sum_amount($obj->jr_id).$four_space;
+ }
+?>
<?php
require_once NOALYSS_TEMPLATE.'/ledger_detail_bottom.php';
?>
- [Noalyss-commit] [noalyss] 21/218: Task #448 : issue with reconciliation amount, (continued)
- [Noalyss-commit] [noalyss] 21/218: Task #448 : issue with reconciliation amount, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 22/218: Task #448 : identical operation with currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 24/218: Task #448 : rounded value for VEN, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 27/218: Task #448 : delete unused currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 28/218: Task #448 : currency , EUR cannot be changed and not display, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 31/218: task #448 : currency always used and remove parameter 'use_currency' from parameters, add SQL script, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 38/218: Task #448 : currency improve detail of operation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 09/218: Currency : add security for setting, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 13/218: indent, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 17/218: Currency : fix rounded bugs in detail operation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 18/218: task #448 : Currency : display currency info into operation detail,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 20/218: Task #448 : check currency rate > 0 and payment in eur, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 23/218: Display the balance difference, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 25/218: Task #448 : payment method VEN, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 30/218: remove debug info, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 32/218: Task #448 : SQL integrated into upgrade128, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 35/218: Task #448 : correct bug when saving into quant_purchase, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 36/218: Bug in QUANT_PURCHASE , dp_dep_priv is not saved, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 42/218: remove debug, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 55/218: integrate fix for bug in insert_quant_purchase which cannot save private fee Conflicts: include/sql/patch/upgrade128.sql, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 29/218: Task #448 : currency_id = 0 for the default currency + display currency rate in confirm operation, Dany De Bontridder, 2019/09/12