diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 818fb394837..d9c5c9a3b78 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007-2011 Laurent Destailleur * Copyright (C) 2009 Regis Houssin + * Copyright (C) 2011 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -85,8 +86,16 @@ if ($_POST['action'] == 'setdate' && $user->rights->banque->cheque) if ($_GET['action'] == 'create' && $_GET["accountid"] > 0 && $user->rights->banque->cheque) { + + if (is_array($_POST['toRemise'])) + $result = $remisecheque->create($user, $_GET["accountid"], 0); // $result = $remisecheque->create($user, $_GET["accountid"], 0, $_POST['toRemise']); + + else + $result = $remisecheque->create($user, $_GET["accountid"], 0); + $remisecheque = new RemiseCheque($db); - $result = $remisecheque->create($user, $_GET["accountid"], 0); + //$result = $remisecheque->create($user, $_GET["accountid"], 0); + if ($result > 0) { if ($remisecheque->statut == 1) // If statut is validated, we build doc @@ -216,6 +225,23 @@ llxHeader(); $html = new Form($db); $formfile = new FormFile($db); + +?> + +'.$langs->trans('Date').''.dol_print_date($now,'day').''; print '
'; - $sql = "SELECT ba.rowid as bid, b.dateo as date,"; + $sql = "SELECT ba.rowid as bid, b.dateo as date, b.rowid as chqid, "; $sql.= " b.amount, ba.label, b.emetteur, b.num_chq, b.banque"; $sql.= " FROM ".MAIN_DB_PREFIX."bank as b "; $sql.= ",".MAIN_DB_PREFIX."bank_account as ba "; @@ -304,6 +330,7 @@ if ($_GET['action'] == 'new') $lines[$obj->bid][$i]["emetteur"] = $obj->emetteur; $lines[$obj->bid][$i]["numero"] = $obj->num_chq; $lines[$obj->bid][$i]["banque"] = $obj->banque; + $lines[$obj->bid][$i]["id"] = $obj->chqid; $i++; } @@ -324,6 +351,10 @@ if ($_GET['action'] == 'new') print ''.$langs->trans("CheckTransmitter")."\n"; print ''.$langs->trans("Bank")."\n"; print ''.$langs->trans("Amount")."\n"; + print ''.$langs->trans("Select")."
"; + if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; + print ''; + print "\n"; $var=true; @@ -340,8 +371,12 @@ if ($_GET['action'] == 'new') print ''.$value["numero"]."\n"; print ''.$value["emetteur"]."\n"; print ''.$value["banque"]."\n"; - print ''.price($value["amount"]).''; + print ''.price($value["amount"]).''; + print ''; + print ''; + print '' ; print ''; + $i++; } print "";