diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 5306edd6038..62d3aaed418 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2307,6 +2307,9 @@ if ($action == 'create') {
if (GETPOSTISSET('fk_account')) {
$fk_account = GETPOSTINT('fk_account');
}
+ if (GETPOSTISSET('shipping_method_id')) {
+ $shipping_method_id = GETPOSTINT('shipping_method_id');
+ }
}
// Warehouse default if null
if ($soc->fk_warehouse > 0) {
@@ -2448,7 +2451,7 @@ if ($action == 'create') {
}
print '
| '.$langs->trans('SendingMethod').' | ';
print img_picto('', 'dolly', 'class="pictofixedwidth"');
- $form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
+ $form->selectShippingMethod((string) $shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print ' |
';
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index c60b123e6ad..672ab22b589 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2245,7 +2245,7 @@ if ($action == 'create' && $usercancreate) {
$mode_reglement_id = empty($soc->mode_reglement_id) ? $mode_reglement_id : $soc->mode_reglement_id;
$fk_account = empty($soc->mode_reglement_id) ? $fk_account : $soc->fk_account;
$availability_id = 0;
- $shipping_method_id = $soc->shipping_method_id;
+ $shipping_method_id = empty($soc->shipping_method_id) ? $shipping_method_id : $soc->shipping_method_id;
$warehouse_id = $soc->fk_warehouse;
$demand_reason_id = $soc->demand_reason_id;
//$remise_percent = $soc->remise_percent;
@@ -2423,7 +2423,7 @@ if ($action == 'create' && $usercancreate) {
if (isModEnabled('shipping')) {
print '| '.$langs->trans('SendingMethod').' | ';
print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
- $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
+ $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') > 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); // -1 is the "no value" placeholder for this select, not 0, so it must not override the fresh thirdparty default after a company change
print ' |
';
}