From 8b13f2ab81f93771ad3a7a07f1734426c14ce3f3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Sep 2012 12:11:16 +0200 Subject: [PATCH] Fix: no way to change the payment term date --- htdocs/compta/facture.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index c76d12423fa..41e9c6abf01 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -265,6 +265,15 @@ else if ($action == 'setinvoicedate' && $user->rights->facture->creer) if ($result < 0) dol_print_error($db,$object->error); } +else if ($action == 'setpaymentterm' && $user->rights->facture->creer) +{ + $object->fetch($id); + $object->date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']); + if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date; + $result=$object->update($user); + if ($result < 0) dol_print_error($db,$object->error); +} + else if ($action == 'setconditions' && $user->rights->facture->creer) { $object->fetch($id);