* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004 Laurent Destailleur * * 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. * * $Id$ * $Source$ */ require("./pre.inc.php"); $user->getrights('compta'); if (!$user->admin && !$user->rights->compta->bank) accessforbidden(); llxHeader(); if ($HTTP_POST_VARS["action"] == 'add') { $account = new Account($db,0); $account->bank = $HTTP_POST_VARS["bank"]; $account->label = $HTTP_POST_VARS["label"]; $account->courant = $HTTP_POST_VARS["courant"]; $account->clos = $HTTP_POST_VARS["clos"]; $account->code_banque = $HTTP_POST_VARS["code_banque"]; $account->code_guichet = $HTTP_POST_VARS["code_guichet"]; $account->number = $HTTP_POST_VARS["number"]; $account->cle_rib = $HTTP_POST_VARS["cle_rib"]; $account->bic = $HTTP_POST_VARS["bic"]; $account->iban_prefix = $HTTP_POST_VARS["iban_prefix"]; $account->domiciliation = $HTTP_POST_VARS["domiciliation"]; $account->proprio = $HTTP_POST_VARS["proprio"]; $account->adresse_proprio = $HTTP_POST_VARS["adresse_proprio"]; $account->solde = $HTTP_POST_VARS["solde"]; $account->date_solde = mktime(12,0,0,$HTTP_POST_VARS["remonth"],$HTTP_POST_VARS["reday"],$HTTP_POST_VARS["reyear"]); $id = $account->create($user->id); } if ($action == 'update') { $account = new Account($db, $id); $account->fetch($id); $account->bank = $HTTP_POST_VARS["bank"]; $account->label = $HTTP_POST_VARS["label"]; $account->courant = $HTTP_POST_VARS["courant"]; $account->clos = $HTTP_POST_VARS["clos"]; $account->code_banque = $HTTP_POST_VARS["code_banque"]; $account->code_guichet = $HTTP_POST_VARS["code_guichet"]; $account->number = $HTTP_POST_VARS["number"]; $account->cle_rib = $HTTP_POST_VARS["cle_rib"]; $account->bic = $HTTP_POST_VARS["bic"]; $account->iban_prefix = $HTTP_POST_VARS["iban_prefix"]; $account->domiciliation = $HTTP_POST_VARS["domiciliation"]; $account->proprio = $HTTP_POST_VARS["proprio"]; $account->adresse_proprio = $HTTP_POST_VARS["adresse_proprio"]; $account->update($id, $user); } /* ************************************************************************** */ /* */ /* Nouvel compte */ /* */ /* ************************************************************************** */ if ($action == 'create') { print_titre("Nouveau compte bancaire"); print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '"; print ''; print ''; print '"; print ''; print ''; print ''; print ''; print ''; print ''; print '
Banque
Libellé
Code BanqueCode GuichetNuméroClé RIB
Clé IBAN
Identifiant BIC
Compte Courant
Domiciliation'; print "
Nom propriétaire du compte
Adresse propriétaire du compte'; print "
Solde
Date Solde'; $now=time(); print '/'; print '/'; print ''; print '
'; } /* ************************************************************************** */ /* */ /* Visu et edition */ /* */ /* ************************************************************************** */ else { if ($id && $action != 'edit') { $account = new Account($db, $id); $account->fetch($id); print '
Compte bancaire

'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; /* print ''; print ''; */ print ''; print ''; print ''; print ''; print '\n"; print '\n"; print '\n"; print '
Banque'.$account->bank.'
Libellé'.$account->label.'
Code BanqueCode GuichetNuméroClé RIB
'.$account->code_banque.''.$account->code_guichet.''.$account->number.''.$account->cle_rib.'
Clé IBAN'.$account->iban_prefix.'
Identifiant BIC'.$account->bic.'
Domiciliation'.$account->domiciliation.'
Compte Courant'.$yn[$account->courant].'
Compte Clos'.$yn[$account->clos].'
Domiciliation'; print $account->domiciliation; print "
Nom propriétaire du compte'; print $account->proprio; print "
Adresse propriétaire du compte'; print $account->adresse_proprio; print "
'; print '
'; if ($user->admin) { print ''; } else { print ''; } print ''; print ''; print ''; print '
[Editer]----

'; } /* ************************************************************************** */ /* */ /* Edition */ /* */ /* ************************************************************************** */ if ($id && $action == 'edit' && $user->admin) { $account = new Account($db, $id); $account->fetch($id); $form = new Form($db); print '
Compte bancaire

'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; /* print ''; print ''; */ print ''; print ''; print ''; print ''; print '"; print ''; print ''; print "\n"; print '"; print ''; print ''; print '
Banque
Libellé
Code BanqueCode GuichetNuméroClé RIB
Clé IBAN
Identifiant BIC
Domiciliation
Compte Courant'; $form->selectyesnonum("courant",$account->courant); print '
Compte Cloturé'; $form->selectyesnonum("clos",$account->clos); print '
Domiciliation'; print "
Nom propriétaire du compte
Adresse propriétaire du compte'; print "
'; } } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>