[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 86/218: Currency : show the currency of the l
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 86/218: Currency : show the currency of the ledger when entering info |
Date: |
Thu, 12 Sep 2019 15:58:46 -0400 (EDT) |
sparkyx pushed a commit to branch entreprise
in repository noalyss.
commit 2b04571d0ff3cd8709531097fb3f1164ed992143
Author: Dany De Bontridder <address@hidden>
Date: Fri Nov 2 20:04:46 2018 +0100
Currency : show the currency of the ledger when entering info
---
html/ajax_misc.php | 7 ++++++-
html/do.php | 2 --
html/js/scripts.js | 15 +++++++++++++++
include/class/acc_ledger.class.php | 9 ++++++++-
include/class/acc_ledger_fin.class.php | 2 +-
include/template/form_ledger_fin.php | 9 ++++++---
6 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index bd9f124..7f5218f 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -627,7 +627,12 @@ EOF;
}
exit();
break;
-
+ case 'currencyCode':
+ $ledger_id=$http->request('ledger',"number");
+ $code=$cn->get_value("select cr_code_iso from public.currency join
jrn_def on (currency.id=jrn_def.currency_id) where jrn_def.jrn_def_id=$1",
+ [$ledger_id]);
+ echo $code;
+ break;
default:
var_dump($_REQUEST);
}
diff --git a/html/do.php b/html/do.php
index 0278416..fc04b28 100644
--- a/html/do.php
+++ b/html/do.php
@@ -33,9 +33,7 @@ require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
require_once NOALYSS_INCLUDE.'/lib/http_input.class.php';
require_once NOALYSS_INCLUDE.'/lib/icon_action.class.php';
$http=new HttpInput();
-
mb_internal_encoding("UTF-8");
-
// if gDossier is not set redirect to form to choose a folder
if ( ! isset($_REQUEST['gDossier']))
{
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 05f0bdf..a1e4fe1 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3514,3 +3514,18 @@ function
updatePeriode(p_dossier,p_exercice,p_periode_from,p_periode_to,p_last)
new
Ajax.Updater(p_periode_to,"ajax_misc.php",{method:"get",parameters:{op:"periode_change","gDossier":p_dossier,"exercice":exercice,field:p_periode_to,"type":"to","last":p_last}});
remove_waiting_box();
}
+/**
+ *
+ * @returns {undefined}
+ */
+function show_ledger_fin_currency()
+{
+ var ledger=$('p_jrn').value;
+ var dossier=$('gDossier').value;
+ // $('ledger_currency').
+ var a=new Ajax.Updater("ledger_currency",
+ "ajax_misc.php",
+ {
+ parameters:
{"op":"currencyCode","gDossier":dossier,"ledger":ledger}
+ });
+}
\ No newline at end of file
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index 51adc98..35380e9 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -2933,7 +2933,14 @@ class Acc_Ledger extends jrn_def_sql
Dossier::id(),$select->name,$p_currency_code,$p_currency_rate,$p_eur_amount);
return $select;
}
-
+ /**
+ * @brief returns the code iso of the default currency for this ledger
+ */
+ function get_currency()
+ {
+ $cr_iso_code=$this->db->get_value("select cr_code_iso from
public.currency where id=$1",[$this->currency_id]);
+ return $cr_iso_code;
+ }
}
?>
diff --git a/include/class/acc_ledger_fin.class.php
b/include/class/acc_ledger_fin.class.php
index c9ef7d9..e12008c 100644
--- a/include/class/acc_ledger_fin.class.php
+++ b/include/class/acc_ledger_fin.class.php
@@ -301,7 +301,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
// Ledger (p_jrn)
//--
-
$onchange="update_bank();ajax_saldo('first_sold');update_name();update_row('fin_item');";
+
$onchange="update_bank();ajax_saldo('first_sold');update_name();update_row('fin_item');show_ledger_fin_currency();";
if ($g_parameter->MY_DATE_SUGGEST == 'Y')
$onchange .= 'get_last_date();';
diff --git a/include/template/form_ledger_fin.php
b/include/template/form_ledger_fin.php
index ef12d18..2e34607 100644
--- a/include/template/form_ledger_fin.php
+++ b/include/template/form_ledger_fin.php
@@ -13,7 +13,7 @@
array('value'=>2,'label'=>_("Avec date opérations"))
);
$wchdate->selected=(isset($chdate))?$chdate:1;
- $wchdate->javascript='onchange="show_fin_chdate(\'chdate\')"';
+ $wchdate->javascript='onchange="show_fin_chdate(\'chdate\');"';
?>
<?php echo $wchdate->input();?>
<span id="chdate_ext">
@@ -22,8 +22,11 @@
<?php echo $f_period?><br>
<?php echo $f_jrn?><br>
-<?php echo _('Banque')?><?php echo $f_bank ?>
-
+ <?php echo _('Banque')?><?php echo $f_bank ?>
+ <?php echo _("Devise")?>
+ <span id="ledger_currency">
+ <?php echo $this->get_currency();?>
+ </span>
</fieldset>
<fieldset>
- [Noalyss-commit] [noalyss] 37/218: comment, (continued)
- [Noalyss-commit] [noalyss] 37/218: comment, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 50/218: Protect function nb , return the string if the parameter is not a float, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 52/218: Create invoice : New version of libreoffice use the numeric in another way, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 56/218: Fix todo_list : if list empty , gets an error in php 7.2, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 60/218: Security fix : f_id is a number, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 57/218: Security : direct injection, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 63/218: CFGLED : security fix : remove $_REQUEST, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 64/218: Merge master, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 72/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 83/218: adapt to 7.2 ,init, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 86/218: Currency : show the currency of the ledger when entering info,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 89/218: adapt to 7.2 ,array, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 90/218: Code cleaning : remove SQL with hardcoded value, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 109/218: Indentation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 121/218: Currency : error when displaying, add 4 due to a mistype instruction, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 126/218: Merge branch 'master' into r700-currency, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 117/218: Currency : cosmetic display history : show only the value of the card/accounting, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 116/218: Database upgrade 131, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 120/218: Currency : send the saldo for financial ledger, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 135/218: Translation, Dany De Bontridder, 2019/09/12
- [Noalyss-commit] [noalyss] 123/218: Currency = payment automatic for Sales and Purchases, Dany De Bontridder, 2019/09/12