From d967527b58b7a9c9f1b40c4f053927163c6559fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 18 Jan 2018 18:40:01 +0100 Subject: [PATCH] Fix status was not refreshed --- htdocs/compta/prelevement/card.php | 12 +++++++----- .../prelevement/class/bonprelevement.class.php | 8 +++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index a61f1fef8dc75..ed0977ebabf7b 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -240,13 +240,13 @@ print '
'; print ''; print ''; - print ''; + print '
'; print ''; print ''; - print ''; - print ''; /* print '
'.$langs->trans("NotifyTransmision").'
'.$langs->trans("TransData").''; + print '
'.$langs->trans("TransData").''; print $form->select_date('','','','','',"userfile",1,1); print '
'.$langs->trans("TransMetod").''; + print '
'.$langs->trans("TransMetod").''; print $form->selectarray("methode",$object->methodes_trans); print '
'.$langs->trans("File").''; @@ -256,6 +256,7 @@ print '

'; print '
'; print '
'; + print '
'; } if (! empty($object->date_trans) && $object->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited') @@ -263,16 +264,17 @@ print '
'; print ''; print ''; - print ''; + print '
'; print ''; print ''; - print ''; print '
'.$langs->trans("NotifyCredit").'
'.$langs->trans('CreditDate').''; + print '
'.$langs->trans('CreditDate').''; print $form->select_date('','','','','',"infocredit",1,1); print '
'; print '
'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice"); print '
'; print '
'; + print '
'; } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index ccaa01b34cc48..aaec7696bec68 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -519,6 +519,9 @@ function set_infocredit($user, $date) */ if ($error == 0) { + $this->date_credit = $date; + $this->statut = 1; + $this->db->commit(); return 0; } @@ -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