diff --git a/htdocs/compta/bank/pre.inc.php3 b/htdocs/compta/bank/pre.inc.php3 index 11a7c6d3e48..fc6fbdab8ca 100644 --- a/htdocs/compta/bank/pre.inc.php3 +++ b/htdocs/compta/bank/pre.inc.php3 @@ -34,6 +34,7 @@ function llxHeader($head = "") { $menu = new Menu(); $menu->add("index.php3","Comptes"); + $menu->add_submenu("search.php3","Recherche"); $db = new Db(); $sql = "SELECT rowid, label FROM llx_bank_account"; diff --git a/htdocs/compta/bank/search.php3 b/htdocs/compta/bank/search.php3 new file mode 100644 index 00000000000..da2d525ff8f --- /dev/null +++ b/htdocs/compta/bank/search.php3 @@ -0,0 +1,200 @@ + + * + * $Id$ + * $Source$ + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +/* + * + * $viewall + * + */ +require("./pre.inc.php3"); + +require("./bank.lib.php3"); +llxHeader(); +$db = new Db(); + + + + + + if ($action == 'add') { + $author = $GLOBALS["REMOTE_USER"]; + if ($credit > 0) { + $amount = $credit ; + } else { + $amount = - $debit ; + } + + if ($num_chq) { + $sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author, num_chq,fk_account)"; + $sql .= " VALUES (now(), $dateo, '$label', $amount,'$author',$num_chq,$account)"; + } else { + $sql = "INSERT INTO llx_bank (datec, dateo, label, amount, author,fk_account)"; + $sql .= " VALUES (now(), $dateo, '$label', $amount,'$author',$account)"; + } + + $result = $db->query($sql); + if ($result) { + $rowid = $db->last_insert_id(); + if ($cat1) { + $sql = "INSERT INTO llx_bank_class (lineid, fk_categ) VALUES ($rowid, $cat1)"; + $result = $db->query($sql); + } + } else { + print $db->error(); + print "
$sql"; + } + + } + + if ($vline) { + $viewline = $vline; + } else { + $viewline = 50; + } + + print "Bank - Reload -"; + print "Voir tout"; + + print "