diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 6cb0a633627..1e03e416621 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2010,7 +2010,7 @@ if ($action == 'create') { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; - print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency($currency_code, 'multicurrency_code', 0); + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0); print ''; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1deb5861348..96f33c8ffaa 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1988,7 +1988,7 @@ if ($action == 'create' && $usercancreate) { print ''; print ''.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).''; print ''; - print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency((GETPOSTISSET('multicurrency_code')?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); + print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx'); print ''; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e3c2f8f6c5c..2f3765720a2 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3165,6 +3165,7 @@ if ($action == 'create') { print '
'; print ''; print ''; + print ''; // will be set to 1 by javascript so we know post is done after a company change if ($soc->id > 0) { print ''."\n"; } @@ -3234,6 +3235,7 @@ if ($action == 'create') { // For company change, we must submit page with action=create instead of action=add console.log("We have changed the company - Resubmit page"); + jQuery("input[name=changecompany]").val("1"); jQuery("#formtocreateaction").val("create"); jQuery("#formtocreate").submit(); }); @@ -3827,7 +3829,7 @@ if ($action == 'create') { print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; print img_picto('', 'currency', 'class="pictofixedwidth"'); - print $form->selectMultiCurrency($currency_code, 'multicurrency_code'); + print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code'); print ''; }