Merge pull request #18252 from cfoellmann/improve-receive

NEW add cancel button to `classifyreception` form on supplier_orders
This commit is contained in:
Laurent Destailleur 2021-07-28 15:37:14 +02:00 committed by GitHub
commit ededf43565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1059,6 +1059,9 @@ if (empty($reshook)) {
// Set status of reception (complete, partial, ...) // Set status of reception (complete, partial, ...)
if ($action == 'livraison' && $usercanreceived) { if ($action == 'livraison' && $usercanreceived) {
if ($cancel) {
$action = '';
} else {
$db->begin(); $db->begin();
if (GETPOST("type") != '') { if (GETPOST("type") != '') {
@ -1087,6 +1090,7 @@ if (empty($reshook)) {
$db->rollback(); $db->rollback();
} }
} }
}
if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder) { if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder) {
$result = $object->cancel($user); $result = $object->cancel($user);
@ -2640,7 +2644,11 @@ if ($action == 'create') {
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment"></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 ' &nbsp; &nbsp; ';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print "</table>\n"; print "</table>\n";
print "</form>\n"; print "</form>\n";
print "<br>"; print "<br>";