noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 08/16: Currency = add a mode currency, possib


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 08/16: Currency = add a mode currency, possible to work without
Date: Mon, 7 May 2018 15:47:34 -0400 (EDT)

sparkyx pushed a commit to branch r700-currency
in repository noalyss.

commit 1a09c71eb32b48e512f9009351fd40fc364260a8
Author: Dany De Bontridder <address@hidden>
Date:   Sun Apr 22 16:29:14 2018 +0200

    Currency = add a mode currency, possible to work without
---
 include/acc_currency_cfg.inc.php                 | 7 ++++++-
 include/class/noalyss_parameter_folder.class.php | 1 +
 include/company.inc.php                          | 7 +++++++
 sql/upgrade.sql                                  | 5 ++++-
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/include/acc_currency_cfg.inc.php b/include/acc_currency_cfg.inc.php
index 1b6d391..c60bb29 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 '<div class="content">';
+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 '<div class="content">';
 $currency_table->create_js_script();
 $currency_table->display_table();
 echo '</div>';
\ 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 8f78442..31b79b8 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 c7dcc54..1dfaf3e 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 "<tr>" . td(_("Numéro de Tva"), 
'style="text-align:right"') . $all->input(
 echo "<tr>" . td(_("Utilisation de la compta. analytique"), 
'style="text-align:right"') . $compta->input("p_compta", $array) . "</tr>";
 echo "<tr>" . td(_("Utilisation des stocks"), 'style="text-align:right"') . 
$stock->input() . "</tr>";
 
+echo "<tr>" . td(_("Utilisation de devises étrangères"), 
'style="text-align:right"') . $use_currency->input("p_currency", $strict_array) 
. "</tr>";
 echo "<tr>" . td(_("Utilisation du mode strict "), 'style="text-align:right"') 
. $strict->input("p_strict", $strict_array) . "</tr>";
 echo "<tr>" . td(_("Assujetti à la tva"), 'style="text-align:right"') . 
$tva_use->input("p_tva_use", $strict_array) . "</tr>";
 echo "<tr>" . td(_("Suggérer le numéro de pièce justificative"), 
'style="text-align:right"') . $pj_suggest->input("p_pj", $strict_array) . 
"</tr>";
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index cd61331..b5d6ba8 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]