From 0a1f483fd116b947aabffc0c8a65114bb6578e92 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 21 Jul 2013 10:10:49 +0200 Subject: [PATCH] Update fiche.php Add feature to change refnumber of bank bordereau --- htdocs/compta/paiement/cheque/fiche.php | 45 ++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 7cf5d15f3a2..fa3386449a2 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -89,6 +89,25 @@ if ($action == 'setdate' && $user->rights->banque->cheque) } } +if ($action == 'setref' && $user->rights->banque->cheque) +{ + $result = $object->fetch(GETPOST('id','int')); + if ($result > 0) + { + $number=GETPOST('number'); + + $result=$object->set_number($user,$number); + if ($result < 0) + { + $mesg='
'.$object->error.'
'; + } + } + else + { + $mesg='
'.$object->error.'
'; + } +} + if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->cheque) { if (is_array($_POST['toRemise'])) @@ -460,12 +479,30 @@ else $accountstatic->label=$object->account_label; print ''; - print '"; - print "\n"; + print ''; + print ''; print '
'.$langs->trans('Ref').''; + print '
'; - print $form->showrefnav($object,'ref',$linkback, 1, 'number'); + print ''; + if ($action != 'editref') print ''; + print '
'; + print $langs->trans('Ref'); + print 'id.'">'.img_edit($langs->trans('SetRef'),1).'
'; + print '
'; + if ($action == 'editref') + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + } + else + { + print $form->showrefnav($object,'ref',$linkback, 1, 'number'); + } - print "
';