Skip to content

Commit

Permalink
Debug v20
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 14, 2024
1 parent a765760 commit 467e96e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,10 @@
if ($object->statut == $object::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $object->statut == $object::STATUS_DRAFT)) {
$db->begin();

$result = $object->closeProposal($user, GETPOSTINT('statut'), GETPOSTINT('note_private'));
$oldstatus = $object->status;

$result = $object->closeProposal($user, GETPOSTINT('statut'), GETPOST('note_private'));

if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
Expand All @@ -758,7 +761,7 @@
$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);

if (
!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOSTINT('generate_deposit') == 'on'
!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
) {
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
Expand All @@ -777,7 +780,7 @@
$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
}
}

Expand Down Expand Up @@ -806,6 +809,9 @@
exit;
}
} else {
$object->status = $oldstatus;
$object->statut = $oldstatus;

$db->rollback();
$action = '';
}
Expand Down

0 comments on commit 467e96e

Please sign in to comment.