Debug v24

This commit is contained in:
Laurent Destailleur 2026-02-06 21:50:44 +01:00
parent bbba60fa3f
commit fbd92432b1
2 changed files with 25 additions and 7 deletions

View file

@ -216,6 +216,7 @@ llxHeader('', $langs->trans("WithdrawalsReceipts"));
if ($id > 0 || $ref) {
$head = prelevement_prepare_head($object);
print dol_get_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
if (GETPOST('error', 'alpha') != '') {

View file

@ -183,6 +183,14 @@ if (empty($reshook)) {
}
}
if ($action == 'setcancel' && $permissiontocreditdebit) {
$savtype = $object->type;
$res = $object->setStatut(BonPrelevement::STATUS_CANCELED);
if ($res <= 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
if ($action == 'confirm_delete' && $permissiontodelete) {
$savtype = $object->type;
$res = $object->delete($user);
@ -437,6 +445,16 @@ if ($id > 0 || $ref) {
}
}
if (getDolGlobalString('BANK_CAN_REOPEN_DIRECT_DEBIT_OR_CREDIT_TRANSFER')) {
if ($object->status == BonPrelevement::STATUS_DEBITED || $object->status == BonPrelevement::STATUS_CREDITED) {
if ($object->type == 'bank-transfer') {
print dolGetButtonAction($langs->trans("ReOpen"), '', 'default', 'card.php?action=reopen&token='.newToken().'&id='.$object->id, '', $user->hasRight('paymentbybanktransfer', 'debit'));
} else {
print dolGetButtonAction($langs->trans("ReOpen"), '', 'default', 'card.php?action=reopen&token='.newToken().'&id='.$object->id, '', $user->hasRight('prelevement', 'bons', 'credit'));
}
}
}
if ($object->status == BonPrelevement::STATUS_TRANSFERED) {
if ($object->type == 'bank-transfer') {
print dolGetButtonAction($langs->trans("ClassDebited"), '', 'default', 'card.php?action=setcredited&token='.newToken().'&id='.$object->id, '', $user->hasRight('paymentbybanktransfer', 'debit'));
@ -445,13 +463,12 @@ if ($id > 0 || $ref) {
}
}
if (getDolGlobalString('BANK_CAN_REOPEN_DIRECT_DEBIT_OR_CREDIT_TRANSFER')) {
if ($object->status == BonPrelevement::STATUS_DEBITED || $object->status == BonPrelevement::STATUS_CREDITED) {
if ($object->type == 'bank-transfer') {
print dolGetButtonAction($langs->trans("ReOpen"), '', 'default', 'card.php?action=reopen&token='.newToken().'&id='.$object->id, '', $user->hasRight('paymentbybanktransfer', 'debit'));
} else {
print dolGetButtonAction($langs->trans("ReOpen"), '', 'default', 'card.php?action=reopen&token='.newToken().'&id='.$object->id, '', $user->hasRight('prelevement', 'bons', 'credit'));
}
// Cancel
if ($object->status == BonPrelevement::STATUS_TRANSFERED) {
if ($object->type == 'bank-transfer') {
print dolGetButtonAction($langs->trans("Cancel"), '', 'cancel', 'card.php?action=setcancel&token='.newToken().'&id='.$object->id, '', $user->hasRight('paymentbybanktransfer', 'debit'));
} else {
print dolGetButtonAction($langs->trans("Cancel"), '', 'cancel', 'card.php?action=setcancel&token='.newToken().'&id='.$object->id, '', $user->hasRight('prelevement', 'bons', 'credit'));
}
}