diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index b03872a8fbd..9ae20ac06d7 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -61,7 +61,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
dol_print_error($db);
}
}
-
+
if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
@@ -79,7 +79,7 @@ if (preg_match('/del_(.*)/',$action,$reg))
if ($action == 'add_currency')
{
$langs->loadCacheCurrencies('');
-
+
$code = GETPOST('code', 'alpha');
$rate = GETPOST('rate', 'alpha');
$currency = new MultiCurrency($db);
@@ -96,23 +96,23 @@ if ($action == 'add_currency')
elseif ($action == 'update_currency')
{
$submit = GETPOST('submit', 'alpha');
-
+
if ($submit == $langs->trans('Modify'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
- $rate = GETPOST('rate', 'float');
+ $rate = price2num(GETPOST('rate', 'alpha'));
$currency = new MultiCurrency($db);
-
+
if ($currency->fetch($fk_multicurrency) > 0)
{
$currency->updateRate($rate);
- }
+ }
}
elseif ($submit == $langs->trans('Delete'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$currency = new MultiCurrency($db);
-
+
if ($currency->fetch($fk_multicurrency) > 0)
{
if ($currency->delete() > 0) setEventMessages($langs->trans('RecordDeleted'), array());
@@ -120,14 +120,14 @@ elseif ($action == 'update_currency')
}
}
}
-elseif ($action == 'synchronize')
+elseif ($action == 'synchronize')
{
$response = GETPOST('response');
$response = json_decode($response);
-
+
if ($response->success)
{
- MultiCurrency::syncRates($response);
+ MultiCurrency::syncRates($response);
}
else
{
@@ -226,7 +226,7 @@ print '';
print '';
*/
-/* TODO uncomment when the functionality will integrated
+/* TODO uncomment when the functionality will integrated
$var=!$var;
print '
';
print ''.$langs->transnoentitiesnoconv("multicurrency_modifyRateApplication").' ';
@@ -259,8 +259,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print $langs->trans("Value").' ';
print '';
print ' ';
-
-
+
+
$var=!$var;
print '';
print ''.$langs->transnoentitiesnoconv("multicurrency_appId").' ';
@@ -273,7 +273,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print ' ';
print '';
print ' ';
-
+
$var=!$var;
print '';
print ''.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").' ';
@@ -286,7 +286,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print ' ';
print '';
print ' ';
-
+
$var=!$var;
print '';
print ''.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").' ';
@@ -299,7 +299,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
print ' ';
print '';
print ' ';
-
+
print '';
print ' ';
}
@@ -334,7 +334,7 @@ print '';
foreach ($TCurrency as &$currency)
{
if($currency->code == $conf->currency) continue;
-
+
$var=!$var;
print '';
print ''.$currency->code.' - '.$currency->name.' ';
@@ -363,7 +363,7 @@ print '
{
$("#bt_sync").attr("disabled", true);
var url_sync = "http://apilayer.net/api/live?access_key='.$conf->global->MULTICURRENCY_APP_ID.'&format=1'.(!empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '&source='.$conf->global->MULTICURRENCY_APP_SOURCE : '').'";
-
+
$.ajax({
url: url_sync,
dataType: "jsonp"
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 4d8bc4335e5..9de9ffed222 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2541,7 +2541,7 @@ if ($action == 'create' && $user->rights->commande->creer)
if (! empty($conf->expedition->enabled)) {
$numshipping = $object->nb_expedition();
- if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfProductsLines() > 0) {
+ if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
if ($user->rights->expedition->creer) {
print '';
diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index cd535c5c119..42389a5c2dd 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -4,6 +4,7 @@
-- when current version is 4.0.0 or higher.
--
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
+-- -- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_table_rowid_seq RENAME TO llx_table_new_rowid_seq;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
@@ -120,6 +121,8 @@ create table llx_expensereport_extrafields
ALTER TABLE llx_expensereport_extrafields ADD INDEX idx_expensereport_extrafields (fk_object);
ALTER TABLE llx_cotisation RENAME TO llx_subscription;
+-- VPGSQL8.2 ALTER SEQUENCE IF EXISTS llx_cotisation_rowid_seq RENAME TO llx_subscription_rowid_seq;
+
ALTER TABLE llx_subscription ADD UNIQUE INDEX uk_subscription (fk_adherent,dateadh);
ALTER TABLE llx_subscription CHANGE COLUMN cotisation subscription real;
ALTER TABLE llx_adherent_type CHANGE COLUMN cotisation subscription varchar(3) NOT NULL DEFAULT '1';