FIX form_confirm to delete payment on supplier invoice
This commit is contained in:
parent
f8b1d0d7ca
commit
cf5de9d0c8
@ -292,14 +292,17 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Delete payment
|
||||
elseif ($action == 'deletepaiement' && $user->rights->fournisseur->facture->creer)
|
||||
elseif ($action == 'confirm_delete_paiement' && $confirm == 'yes' && $user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->fetch($id);
|
||||
if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0)
|
||||
{
|
||||
$paiementfourn = new PaiementFourn($db);
|
||||
$result=$paiementfourn->fetch(GETPOST('paiement_id'));
|
||||
if ($result > 0) $result=$paiementfourn->delete(); // If fetch ok and found
|
||||
if ($result > 0) {
|
||||
$result=$paiementfourn->delete(); // If fetch ok and found
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
}
|
||||
if ($result < 0) {
|
||||
setEventMessages($paiementfourn->error, $paiementfourn->errors, 'errors');
|
||||
}
|
||||
@ -1725,6 +1728,12 @@ else
|
||||
{
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
|
||||
|
||||
}
|
||||
if ($action == 'deletepaiement')
|
||||
{
|
||||
$payment_id = GETPOST('paiement_id');
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1);
|
||||
|
||||
}
|
||||
|
||||
// Confirmation to delete line
|
||||
|
||||
Loading…
Reference in New Issue
Block a user