Merge pull request #17781 from cfoellmann/refuse-note
ADD note to supplier order refusal
This commit is contained in:
commit
4c592401e6
@ -544,13 +544,18 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
$object->sendtoid = 0;
|
$object->sendtoid = 0;
|
||||||
} elseif ($action == 'ORDER_SUPPLIER_REFUSE') {
|
} elseif ($action == 'ORDER_SUPPLIER_REFUSE') {
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("agenda", "other", "orders"));
|
$langs->loadLangs(array("agenda", "other", "orders", "main"));
|
||||||
|
|
||||||
if (empty($object->actionmsg2)) {
|
if (empty($object->actionmsg2)) {
|
||||||
$object->actionmsg2 = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref);
|
$object->actionmsg2 = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref);
|
||||||
}
|
}
|
||||||
$object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref);
|
$object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref);
|
||||||
|
|
||||||
|
if (!empty($object->refuse_note)) {
|
||||||
|
$object->actionmsg .= '<br>';
|
||||||
|
$object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note;
|
||||||
|
}
|
||||||
|
|
||||||
$object->sendtoid = 0;
|
$object->sendtoid = 0;
|
||||||
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
|
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
|
|||||||
@ -960,6 +960,9 @@ if (empty($reshook)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) {
|
if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) {
|
||||||
|
if (GETPOST('refuse_note')) {
|
||||||
|
$object->refuse_note = GETPOST('refuse_note');
|
||||||
|
}
|
||||||
$result = $object->refuse($user);
|
$result = $object->refuse($user);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
|
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
|
||||||
@ -1875,7 +1878,16 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Confirmation de la desapprobation
|
// Confirmation de la desapprobation
|
||||||
if ($action == 'refuse') {
|
if ($action == 'refuse') {
|
||||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", '', 0, 1);
|
$formquestion = array(
|
||||||
|
array(
|
||||||
|
'type' => 'text',
|
||||||
|
'name' => 'refuse_note',
|
||||||
|
'label' => $langs->trans("MotifCP"),
|
||||||
|
'value' => '',
|
||||||
|
'morecss' => 'minwidth300'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirmation de l'annulation
|
// Confirmation de l'annulation
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user