Merge pull request #3780 from frederic34/patch-16
Fix some action has no effect in shipment
This commit is contained in:
commit
c682065ca4
@ -88,9 +88,7 @@ if ($action == 'setdatedelivery' && $user->rights->commande->creer)
|
|||||||
$commande->fetch($id);
|
$commande->fetch($id);
|
||||||
$result=$commande->set_date_livraison($user,$datelivraison);
|
$result=$commande->set_date_livraison($user,$datelivraison);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
$mesg='<div class="error">'.$commande->error.'</div>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
|
if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
|
||||||
@ -98,6 +96,8 @@ if ($action == 'setdeliveryaddress' && $user->rights->commande->creer)
|
|||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($id);
|
$commande->fetch($id);
|
||||||
$commande->setDeliveryAddress(GETPOST('delivery_address_id','int'));
|
$commande->setDeliveryAddress(GETPOST('delivery_address_id','int'));
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setmode' && $user->rights->commande->creer)
|
if ($action == 'setmode' && $user->rights->commande->creer)
|
||||||
@ -105,7 +105,24 @@ if ($action == 'setmode' && $user->rights->commande->creer)
|
|||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($id);
|
$commande->fetch($id);
|
||||||
$result = $commande->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
$result = $commande->setPaymentMethods(GETPOST('mode_reglement_id','int'));
|
||||||
if ($result < 0) dol_print_error($db,$commande->error);
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'setavailability' && $user->rights->commande->creer) {
|
||||||
|
$commande = new Commande($db);
|
||||||
|
$commande->fetch($id);
|
||||||
|
$result=$commande->availability(GETPOST('availability_id'));
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'setdemandreason' && $user->rights->commande->creer) {
|
||||||
|
$commande = new Commande($db);
|
||||||
|
$commande->fetch($id);
|
||||||
|
$result=$commande->demand_reason(GETPOST('demand_reason_id'));
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'setconditions' && $user->rights->commande->creer)
|
if ($action == 'setconditions' && $user->rights->commande->creer)
|
||||||
@ -113,7 +130,8 @@ if ($action == 'setconditions' && $user->rights->commande->creer)
|
|||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($id);
|
$commande->fetch($id);
|
||||||
$result=$commande->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
$result=$commande->setPaymentTerms(GETPOST('cond_reglement_id','int'));
|
||||||
if ($result < 0) dol_print_error($db,$commande->error);
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
// shipping method
|
// shipping method
|
||||||
@ -121,6 +139,8 @@ if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
|
|||||||
$commande = new Commande($db);
|
$commande = new Commande($db);
|
||||||
$commande->fetch($id);
|
$commande->fetch($id);
|
||||||
$result=$commande->setShippingMethod(GETPOST('shipping_method_id', 'int'));
|
$result=$commande->setShippingMethod(GETPOST('shipping_method_id', 'int'));
|
||||||
|
if ($result < 0)
|
||||||
|
setEventMessages($commande->error, $commande->errors, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user