Skip to content

Commit

Permalink
Fix status was not refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 18, 2018
1 parent 768c93a commit d967527
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 7 additions & 5 deletions htdocs/compta/prelevement/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@
print '<form method="post" name="userfile" action="card.php?id='.$object->id.'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infotrans">';
print '<table class="border" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
print '<tr '.$bc[false].'><td width="20%">'.$langs->trans("TransData").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("TransData").'</td><td>';
print $form->select_date('','','','','',"userfile",1,1);
print '</td></tr>';
print '<tr '.$bc[false].'><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans("TransMetod").'</td><td>';
print $form->selectarray("methode",$object->methodes_trans);
print '</td></tr>';
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
Expand All @@ -256,23 +256,25 @@
print '</table><br>';
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("SetToStatusSent")).'"></div>';
print '</form>';
print '<br>';
}

if (! empty($object->date_trans) && $object->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited')
{
print '<form name="infocredit" method="post" action="card.php?id='.$object->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="infocredit">';
print '<table class="border" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
print '<tr '.$bc[false].'><td>'.$langs->trans('CreditDate').'</td><td>';
print '<tr class="oddeven"><td>'.$langs->trans('CreditDate').'</td><td>';
print $form->select_date('','','','','',"infocredit",1,1);
print '</td></tr>';
print '</table>';
print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
print '<div class="center"><input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("ClassCredited")).'"></div>';
print '</form>';
print '<br>';
}


Expand Down
8 changes: 7 additions & 1 deletion htdocs/compta/prelevement/class/bonprelevement.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ function set_infocredit($user, $date)
*/
if ($error == 0)
{
$this->date_credit = $date;
$this->statut = 1;

$this->db->commit();
return 0;
}
Expand Down Expand Up @@ -584,13 +587,16 @@ function set_infotrans($user, $date, $method)
// TODO Call trigger to create a notification using notification module
}
else
{
{
$error++;
}

if ($error == 0)
{
$this->date_trans = $date;
$this->statut = 1;
$this->db->commit();

return 0;
}
else
Expand Down

0 comments on commit d967527

Please sign in to comment.