forked from Wavyzz/dolibarr
Merge pull request #18252 from cfoellmann/improve-receive
NEW add cancel button to `classifyreception` form on supplier_orders
This commit is contained in:
@@ -1059,32 +1059,36 @@ if (empty($reshook)) {
|
||||
|
||||
// Set status of reception (complete, partial, ...)
|
||||
if ($action == 'livraison' && $usercanreceived) {
|
||||
$db->begin();
|
||||
if ($cancel) {
|
||||
$action = '';
|
||||
} else {
|
||||
$db->begin();
|
||||
|
||||
if (GETPOST("type") != '') {
|
||||
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
|
||||
if (GETPOST("type") != '') {
|
||||
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
|
||||
|
||||
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
|
||||
if ($result > 0) {
|
||||
$langs->load("deliveries");
|
||||
setEventMessages($langs->trans("DeliveryStateSaved"), null);
|
||||
$action = '';
|
||||
} elseif ($result == -3) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
|
||||
if ($result > 0) {
|
||||
$langs->load("deliveries");
|
||||
setEventMessages($langs->trans("DeliveryStateSaved"), null);
|
||||
$action = '';
|
||||
} elseif ($result == -3) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2640,7 +2644,11 @@ if ($action == 'create') {
|
||||
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Receive").'"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2">';
|
||||
print '<input type="submit" name="receive" class="button" value="'.$langs->trans("Receive").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td></tr>';
|
||||
print "</table>\n";
|
||||
print "</form>\n";
|
||||
print "<br>";
|
||||
|
||||
Reference in New Issue
Block a user