diff --git a/htdocs/compta/bank/bank.lib.php3 b/htdocs/compta/bank/bank.lib.php3 new file mode 100644 index 00000000000..f63f6e30b23 --- /dev/null +++ b/htdocs/compta/bank/bank.lib.php3 @@ -0,0 +1,32 @@ + + * + * $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. + * or see http://www.gnu.org/ + */ + +Function bank_delete_line($db, $rowid) { + $sql = "DELETE FROM llx_bank WHERE rowid=$rowid"; + $result = $db->query($sql); + if ($result) { + $sql = "DELETE FROM llx_bank_class WHERE lineid=$rowid"; + $result = $db->query($sql); + } +} + +?> diff --git a/htdocs/compta/bank/index.php3 b/htdocs/compta/bank/index.php3 new file mode 100644 index 00000000000..52932208f83 --- /dev/null +++ b/htdocs/compta/bank/index.php3 @@ -0,0 +1,244 @@ + + * + * $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 ($action == 'del') { + bank_delete_line($db, $rowid); +} + +if ($vline) { + $viewline = $vline; +} else { + $viewline = 20; +} + +print "Bank - Reload -"; +print "Voir tout"; + +print "
"; + +print "Edit Categories"; +print " Budgets"; + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/mysql/tables/llx_bank_account.sql b/mysql/tables/llx_bank_account.sql index 58a60984df7..8a7797bb80a 100644 --- a/mysql/tables/llx_bank_account.sql +++ b/mysql/tables/llx_bank_account.sql @@ -1,4 +1,6 @@ -- =================================================================== +-- Copyright (C) 2000-2002 Rodolphe Quiedeville