diff --git a/include/acc_currency_cfg.inc.php b/include/acc_currency_cfg.inc.php
index 1b6d39111..c60bb29f3 100644
--- a/include/acc_currency_cfg.inc.php
+++ b/include/acc_currency_cfg.inc.php
@@ -27,6 +27,12 @@ if (!defined('ALLOWED')) { die('Appel direct ne sont pas permis'); }
* @example test_currency_mtable.php
*/
+echo '
';
+global $g_parameter;
+if ( $g_parameter->MY_CURRENCY=='N'){
+ echo h2info(_("Vous n'utilisez pas les devises , vous devez le configurer dans COMPANY"));
+ return;
+}
require_once NOALYSS_INCLUDE."/class/currency_mtable.class.php";
require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
require_once NOALYSS_INCLUDE.'/database/v_currency_last_value_sql.class.php';
@@ -39,7 +45,6 @@ $currency_table=new Currency_MTable($currency);
$currency_table->set_callback("ajax_misc.php");
$currency_table->add_json_param("op", "CurrencyManage");
-echo '
';
$currency_table->create_js_script();
$currency_table->display_table();
echo '
';
\ No newline at end of file
diff --git a/include/class/noalyss_parameter_folder.class.php b/include/class/noalyss_parameter_folder.class.php
index 8f784429e..31b79b893 100644
--- a/include/class/noalyss_parameter_folder.class.php
+++ b/include/class/noalyss_parameter_folder.class.php
@@ -124,6 +124,7 @@ class Noalyss_Parameter_Folder
$this->save('MY_ALPHANUM');
$this->save('MY_UPDLAB');
$this->save('MY_STOCK');
+ $this->save('MY_CURRENCY');
}
diff --git a/include/company.inc.php b/include/company.inc.php
index c7dcc540e..1dfaf3ecb 100644
--- a/include/company.inc.php
+++ b/include/company.inc.php
@@ -48,6 +48,7 @@ if (isset($_POST['record_company']))
$m->MY_ALPHANUM = $http->post("p_alphanum");
$m->MY_UPDLAB = $http->post("p_updlab");
$m->MY_STOCK =$http->post("p_stock");
+ $m->MY_CURRENCY =$http->post("p_currency");
$m->Update();
}
@@ -111,6 +112,11 @@ $stock->value = array(
$stock->selected = $my->MY_STOCK;
$stock->table = 1;
+$use_currency= new ISelect();
+$use_currency->table = 1;
+$use_currency->value = $updlab_array;
+$use_currency->selected = $my->MY_CURRENCY;
+
// other parameters
$all = new IText();
$all->table = 1;
@@ -137,6 +143,7 @@ echo "
" . td(_("Numéro de Tva"), 'style="text-align:right"') . $all->input(
echo "
" . td(_("Utilisation de la compta. analytique"), 'style="text-align:right"') . $compta->input("p_compta", $array) . "
";
echo "
" . td(_("Utilisation des stocks"), 'style="text-align:right"') . $stock->input() . "
";
+echo "
" . td(_("Utilisation de devises étrangères"), 'style="text-align:right"') . $use_currency->input("p_currency", $strict_array) . "
";
echo "
" . td(_("Utilisation du mode strict "), 'style="text-align:right"') . $strict->input("p_strict", $strict_array) . "
";
echo "
" . td(_("Assujetti à la tva"), 'style="text-align:right"') . $tva_use->input("p_tva_use", $strict_array) . "
";
echo "
" . td(_("Suggérer le numéro de pièce justificative"), 'style="text-align:right"') . $pj_suggest->input("p_pj", $strict_array) . "
";
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index cd6133167..b5d6ba8a4 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -55,4 +55,7 @@ select
from
currency as cr1
join recent_rate on (currency_id=cr1.id)
-join currency_history as ch1 on (recent_rate.currency_id=ch1.currency_id and rc_from=ch1.ch_from);
\ No newline at end of file
+join currency_history as ch1 on (recent_rate.currency_id=ch1.currency_id and rc_from=ch1.ch_from);
+
+
+insert into "parameter" values ('MY_CURRENCY','N');
\ No newline at end of file