diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index 9843c6a4fb0..0decb3120bd 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -106,9 +106,7 @@ elseif ($action == 'update_currency')
{
$error = 0;
- $submit = GETPOST('submit', 'alpha');
-
- if ($submit == $langs->trans('Modify'))
+ if (GETPOST('updatecurrency', 'alpha'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$rate = price2num(GETPOST('rate', 'alpha'));
@@ -127,7 +125,7 @@ elseif ($action == 'update_currency')
}
}
}
- elseif ($submit == $langs->trans('Delete'))
+ elseif (GETPOST('deletecurrency', 'alpha'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$currency = new MultiCurrency($db);
@@ -334,8 +332,8 @@ foreach ($TCurrency as &$currency)
print '';
print '1 '.$conf->currency.' = ';
print ' '.$currency->code.' ';
- print ' ';
- print '';
+ print ' ';
+ print '';
print '';
print '';
}
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index e4c8774916f..42717d5ae85 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2001-2004 Rodolphe Quiedeville
* Copyright (C) 2004-2019 Laurent Destailleur
* Copyright (C) 2008 Raphael Bertrand (Resultic)
+ * Copyright (C) 2019 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -127,6 +128,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$db->begin();
$discount->fk_facture_source=0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
+ // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
+ $discount->fk_invoice_supplier_source=0;
$res=$discount->delete($user);
$newid1=$newdiscount1->create($user);
$newid2=$newdiscount2->create($user);