forked from Wavyzz/dolibarr
New: Ajout rfrence et code compta sur comptes financiers (bancaires ou caisses). Requis pour faire de la compta double partie.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -39,6 +39,7 @@ class Account
|
|||||||
{
|
{
|
||||||
var $rowid;
|
var $rowid;
|
||||||
|
|
||||||
|
var $ref;
|
||||||
var $label;
|
var $label;
|
||||||
var $type;
|
var $type;
|
||||||
var $bank;
|
var $bank;
|
||||||
@@ -55,6 +56,9 @@ class Account
|
|||||||
var $adresse_proprio;
|
var $adresse_proprio;
|
||||||
var $type_lib=array();
|
var $type_lib=array();
|
||||||
|
|
||||||
|
var $account_number;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructeur
|
* Constructeur
|
||||||
*/
|
*/
|
||||||
@@ -264,9 +268,13 @@ class Account
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $pcgnumber) $pcgnumber="51";
|
if (! $this->ref)
|
||||||
|
{
|
||||||
|
$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Ref"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account (datec, label, account_number) values (now(),'" . addslashes($this->label) . "','$pcgnumber');";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account (datec, ref, label, account_number) values (now(),'" . addslashes($this->ref) . "', '" . addslashes($this->label) . "','" . addslashes($this->account_number) . "');";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@@ -296,24 +304,36 @@ class Account
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Mise a jour compte
|
* \brief Mise a jour compte
|
||||||
* \param user Object utilisateur qui modifie
|
* \param user Object utilisateur qui modifie
|
||||||
|
* \return int <0 si ko, >0 si ok
|
||||||
*/
|
*/
|
||||||
function update($user='')
|
function update($user='')
|
||||||
{
|
{
|
||||||
// Chargement librairie pour acces fonction controle RIB
|
global $langs;
|
||||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/bank.lib.php';
|
|
||||||
|
|
||||||
|
// Chargement librairie pour acces fonction controle RIB
|
||||||
|
require_once(DOL_DOCUMENT_ROOT . '/compta/bank/bank.lib.php');
|
||||||
|
|
||||||
|
// Verification parametres
|
||||||
if (! verif_rib($this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix)) {
|
if (! verif_rib($this->code_banque,$this->code_guichet,$this->number,$this->cle_rib,$this->iban_prefix)) {
|
||||||
$this->error="Le contr<74>le de la cl<63> indique que les informations de votre compte bancaire sont incorrectes.";
|
$this->error="Le contr<74>le de la cl<63> indique que les informations de votre compte bancaire sont incorrectes.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (! $this->ref)
|
||||||
|
{
|
||||||
|
$this->error=$langs->trans("ErrorFieldRequired",$langs->trans("Ref"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (! $this->label) $this->label = "???";
|
if (! $this->label) $this->label = "???";
|
||||||
|
$this->account_number=trim($this->account_number);
|
||||||
|
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_account SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_account SET ";
|
||||||
|
|
||||||
$sql .= " bank = '" .addslashes($this->bank)."'";
|
$sql .= " bank = '".addslashes($this->bank)."'";
|
||||||
|
$sql .= ",ref = '".addslashes($this->ref)."'";
|
||||||
$sql .= ",label = '".addslashes($this->label)."'";
|
$sql .= ",label = '".addslashes($this->label)."'";
|
||||||
|
|
||||||
$sql .= ",code_banque='".$this->code_banque."'";
|
$sql .= ",code_banque='".$this->code_banque."'";
|
||||||
@@ -328,6 +348,7 @@ class Account
|
|||||||
$sql .= ",courant = ".$this->courant;
|
$sql .= ",courant = ".$this->courant;
|
||||||
$sql .= ",clos = ".$this->clos;
|
$sql .= ",clos = ".$this->clos;
|
||||||
$sql .= ",rappro = ".$this->rappro;
|
$sql .= ",rappro = ".$this->rappro;
|
||||||
|
$sql .= ",account_number = '".$this->account_number."'";
|
||||||
|
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
@@ -351,8 +372,11 @@ class Account
|
|||||||
function fetch($id)
|
function fetch($id)
|
||||||
{
|
{
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$sql = "SELECT rowid, label, bank, number, courant, clos, rappro,";
|
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro,";
|
||||||
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix, domiciliation, proprio, adresse_proprio FROM ".MAIN_DB_PREFIX."bank_account";
|
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix,";
|
||||||
|
$sql.= " domiciliation, proprio, adresse_proprio,";
|
||||||
|
$sql.= " account_number";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
|
||||||
$sql.= " WHERE rowid = ".$id;
|
$sql.= " WHERE rowid = ".$id;
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
@@ -363,6 +387,7 @@ class Account
|
|||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
$this->ref = $obj->ref;
|
||||||
$this->label = $obj->label;
|
$this->label = $obj->label;
|
||||||
$this->type = $obj->courant;
|
$this->type = $obj->courant;
|
||||||
$this->courant = $obj->courant;
|
$this->courant = $obj->courant;
|
||||||
@@ -379,6 +404,8 @@ class Account
|
|||||||
$this->domiciliation = $obj->domiciliation;
|
$this->domiciliation = $obj->domiciliation;
|
||||||
$this->proprio = $obj->proprio;
|
$this->proprio = $obj->proprio;
|
||||||
$this->adresse_proprio = $obj->adresse_proprio;
|
$this->adresse_proprio = $obj->adresse_proprio;
|
||||||
|
|
||||||
|
$this->account_number = $obj->account_number;
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
}
|
}
|
||||||
@@ -407,7 +434,61 @@ class Account
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* \brief Retourne le libell<6C> du statut d'une facture (brouillon, valid<69>e, abandonn<6E>e, pay<61>e)
|
||||||
|
* \param mode 0=libell<6C> long, 1=libell<6C> court, 2=Picto + Libell<6C> court, 3=Picto, 4=Picto + Libell<6C> long
|
||||||
|
* \return string Libelle
|
||||||
|
*/
|
||||||
|
function getLibStatut($mode=0)
|
||||||
|
{
|
||||||
|
return $this->LibStatut($this->clos,$mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Renvoi le libell<6C> d'un statut donn<6E>
|
||||||
|
* \param statut Id statut
|
||||||
|
* \param mode 0=libell<6C> long, 1=libell<6C> court, 2=Picto + Libell<6C> court, 3=Picto, 4=Picto + Libell<6C> long, 5=Libell<6C> court + Picto
|
||||||
|
* \return string Libell<6C> du statut
|
||||||
|
*/
|
||||||
|
function LibStatut($statut,$mode=0)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
$langs->load('banks');
|
||||||
|
|
||||||
|
if ($mode == 0)
|
||||||
|
{
|
||||||
|
if ($statut==0) return $langs->trans("StatusAccountOpened");
|
||||||
|
if ($statut==1) return $langs->trans("StatusAccountClosed");
|
||||||
|
}
|
||||||
|
if ($mode == 1)
|
||||||
|
{
|
||||||
|
if ($statut==0) return $langs->trans("StatusAccountOpened");
|
||||||
|
if ($statut==1) return $langs->trans("StatusAccountClosed");
|
||||||
|
}
|
||||||
|
if ($mode == 2)
|
||||||
|
{
|
||||||
|
if ($statut==0) return img_picto($langs->trans("StatusAccountOpened"),'statut4').' '.$langs->trans("StatusAccountOpened");
|
||||||
|
if ($statut==1) return img_picto($langs->trans("StatusAccountClosed"),'statut5').' '.$langs->trans("StatusAccountClosed");
|
||||||
|
}
|
||||||
|
if ($mode == 3)
|
||||||
|
{
|
||||||
|
if ($statut==0) return img_picto($langs->trans("StatusAccountOpened"),'statut4');
|
||||||
|
if ($statut==1) return img_picto($langs->trans("StatusAccountClosed"),'statut5');
|
||||||
|
}
|
||||||
|
if ($mode == 4)
|
||||||
|
{
|
||||||
|
if ($statut==0) return img_picto($langs->trans("StatusAccountOpened"),'statut4').' '.$langs->trans("StatusAccountOpened");
|
||||||
|
if ($statut==1) return img_picto($langs->trans("StatusAccountClosed"),'statut5').' '.$langs->trans("StatusAccountClosed");
|
||||||
|
}
|
||||||
|
if ($mode == 5)
|
||||||
|
{
|
||||||
|
if ($statut==0) return $langs->trans("StatusAccountOpened").' '.img_picto($langs->trans("StatusAccountOpened"),'statut4');
|
||||||
|
if ($statut==1) return $langs->trans("StatusAccountClosed").' '.img_picto($langs->trans("StatusAccountClosed"),'statut5');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
* \brief Renvoi si un compte peut etre supprimer ou non (sans mouvements)
|
* \brief Renvoi si un compte peut etre supprimer ou non (sans mouvements)
|
||||||
* \return boolean vrai si peut etre supprim<69>, faux sinon
|
* \return boolean vrai si peut etre supprim<69>, faux sinon
|
||||||
*/
|
*/
|
||||||
@@ -443,7 +524,8 @@ class Account
|
|||||||
*/
|
*/
|
||||||
function solde()
|
function solde()
|
||||||
{
|
{
|
||||||
$sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."bank WHERE fk_account=$this->id AND dateo <=" . $this->db->idate(time() );
|
$sql = "SELECT sum(amount) FROM ".MAIN_DB_PREFIX."bank";
|
||||||
|
$sql.= " WHERE fk_account=$this->id AND dateo <=" . $this->db->idate(time() );
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -46,6 +46,7 @@ if ($_POST["action"] == 'add')
|
|||||||
// Creation compte
|
// Creation compte
|
||||||
$account = new Account($db,0);
|
$account = new Account($db,0);
|
||||||
|
|
||||||
|
$account->ref = ereg_replace(' ','',trim($_POST["ref"]));
|
||||||
$account->label = trim($_POST["label"]);
|
$account->label = trim($_POST["label"]);
|
||||||
$account->courant = $_POST["type"];
|
$account->courant = $_POST["type"];
|
||||||
$account->clos = $_POST["clos"];
|
$account->clos = $_POST["clos"];
|
||||||
@@ -58,10 +59,12 @@ if ($_POST["action"] == 'add')
|
|||||||
$account->cle_rib = $_POST["cle_rib"];
|
$account->cle_rib = $_POST["cle_rib"];
|
||||||
$account->bic = $_POST["bic"];
|
$account->bic = $_POST["bic"];
|
||||||
$account->iban_prefix = $_POST["iban_prefix"];
|
$account->iban_prefix = $_POST["iban_prefix"];
|
||||||
$account->domiciliation = $_POST["domiciliation"];
|
$account->domiciliation = trim($_POST["domiciliation"]);
|
||||||
|
|
||||||
$account->proprio = $_POST["proprio"];
|
$account->proprio = trim($_POST["proprio"]);
|
||||||
$account->adresse_proprio = $_POST["adresse_proprio"];
|
$account->adresse_proprio = trim($_POST["adresse_proprio"]);
|
||||||
|
|
||||||
|
$account->account_number = trim($_POST["account_number"]);
|
||||||
|
|
||||||
$account->solde = $_POST["solde"];
|
$account->solde = $_POST["solde"];
|
||||||
$account->date_solde = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
|
$account->date_solde = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
|
||||||
@@ -87,12 +90,13 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
$account = new Account($db, $_POST["id"]);
|
$account = new Account($db, $_POST["id"]);
|
||||||
$account->fetch($_POST["id"]);
|
$account->fetch($_POST["id"]);
|
||||||
|
|
||||||
|
$account->ref = ereg_replace(' ','',trim($_POST["ref"]));
|
||||||
$account->label = trim($_POST["label"]);
|
$account->label = trim($_POST["label"]);
|
||||||
$account->courant = $_POST["type"];
|
$account->courant = $_POST["type"];
|
||||||
$account->clos = $_POST["clos"];
|
$account->clos = $_POST["clos"];
|
||||||
$account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"]=='on')?0:1;
|
$account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"]=='on')?0:1;
|
||||||
|
|
||||||
$account->bank = $_POST["bank"];
|
$account->bank = trim($_POST["bank"]);
|
||||||
$account->code_banque = $_POST["code_banque"];
|
$account->code_banque = $_POST["code_banque"];
|
||||||
$account->code_guichet = $_POST["code_guichet"];
|
$account->code_guichet = $_POST["code_guichet"];
|
||||||
$account->number = $_POST["number"];
|
$account->number = $_POST["number"];
|
||||||
@@ -100,9 +104,12 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
$account->bic = $_POST["bic"];
|
$account->bic = $_POST["bic"];
|
||||||
$account->iban_prefix = $_POST["iban_prefix"];
|
$account->iban_prefix = $_POST["iban_prefix"];
|
||||||
$account->domiciliation = $_POST["domiciliation"];
|
$account->domiciliation = $_POST["domiciliation"];
|
||||||
|
|
||||||
$account->proprio = $_POST["proprio"];
|
$account->proprio = $_POST["proprio"];
|
||||||
$account->adresse_proprio = $_POST["adresse_proprio"];
|
$account->adresse_proprio = $_POST["adresse_proprio"];
|
||||||
|
|
||||||
|
$account->account_number = trim($_POST["account_number"]);
|
||||||
|
|
||||||
if ($account->label)
|
if ($account->label)
|
||||||
{
|
{
|
||||||
$result = $account->update($user);
|
$result = $account->update($user);
|
||||||
@@ -144,70 +151,81 @@ $form = new Form($db);
|
|||||||
|
|
||||||
if ($_GET["action"] == 'create')
|
if ($_GET["action"] == 'create')
|
||||||
{
|
{
|
||||||
print_titre($langs->trans("NewFinancialAccount"));
|
print_titre($langs->trans("NewFinancialAccount"));
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ($message) { print "$message<br>\n"; }
|
if ($message) { print "$message<br>\n"; }
|
||||||
|
|
||||||
print '<form action="fiche.php" method="post">';
|
print '<form action="fiche.php" method="post">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
print '<input type="hidden" name="clos" value="0">';
|
print '<input type="hidden" name="clos" value="0">';
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("LabelBankCashAccount").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
|
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$_POST["label"].'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
$form=new Form($db);
|
$form=new Form($db);
|
||||||
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
print $form->select_type_comptes_financiers(isset($_POST["type"])?$_POST["type"]:1,"type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("InitialBankBalance").'</td>';
|
// Code compta
|
||||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="0.00"></td></tr>';
|
if ($conf->comptaexpert->enabled)
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="account_number" value="'.$account->account_number.'">';
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("InitialBankBalance").'</td>';
|
||||||
print '<td colspan="3">'; $now=time();
|
print '<td colspan="3"><input size="12" type="text" class="flat" name="solde" value="0.00"></td></tr>';
|
||||||
print '<input type="text" size="2" maxlength="2" name="reday" value="'.strftime("%d",$now).'">/';
|
|
||||||
print '<input type="text" size="2" maxlength="2" name="remonth" value="'.strftime("%m",$now).'">/';
|
|
||||||
print '<input type="text" size="4" maxlength="4" name="reyear" value="'.strftime("%Y",$now).'">';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td colspan="4"><b>'.$langs->trans("IfBankAccount").'...</b></td></tr>';
|
print '<tr><td valign="top">'.$langs->trans("Date").'</td>';
|
||||||
|
print '<td colspan="3">'; $now=time();
|
||||||
|
print '<input type="text" size="2" maxlength="2" name="reday" value="'.strftime("%d",$now).'">/';
|
||||||
|
print '<input type="text" size="2" maxlength="2" name="remonth" value="'.strftime("%m",$now).'">/';
|
||||||
|
print '<input type="text" size="4" maxlength="4" name="reyear" value="'.strftime("%Y",$now).'">';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Conciliation").'</td>';
|
print '<tr><td colspan="4"><b>'.$langs->trans("IfBankAccount").'...</b></td></tr>';
|
||||||
print '<td colspan="3"><input type="checkbox" name="norappro" value="'.$_POST["norappro"].'"> '.$langs->trans("DisableConciliation").'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Conciliation").'</td>';
|
||||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$_POST["bank"].'"></td></tr>';
|
print '<td colspan="3"><input type="checkbox" name="norappro" value="'.$_POST["norappro"].'"> '.$langs->trans("DisableConciliation").'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
|
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||||
print '<tr><td><input size="8" type="text" class="flat" name="code_banque" value="'.$_POST["code_banque"].'"></td>';
|
print '<td colspan="3"><input size="30" type="text" class="flat" name="bank" value="'.$_POST["bank"].'"></td></tr>';
|
||||||
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$_POST["code_guichet"].'"></td>';
|
|
||||||
print '<td><input size="15" type="text" class="flat" name="number" value="'.$_POST["number"].'"></td>';
|
|
||||||
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$_POST["cle_rib"].'"></td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
|
||||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="iban_prefix" value="'.$_POST["iban_prefix"].'"></td></tr>';
|
print '<tr><td><input size="8" type="text" class="flat" name="code_banque" value="'.$_POST["code_banque"].'"></td>';
|
||||||
|
print '<td><input size="8" type="text" class="flat" name="code_guichet" value="'.$_POST["code_guichet"].'"></td>';
|
||||||
|
print '<td><input size="15" type="text" class="flat" name="number" value="'.$_POST["number"].'"></td>';
|
||||||
|
print '<td><input size="3" type="text" class="flat" name="cle_rib" value="'.$_POST["cle_rib"].'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||||
print '<td colspan="3"><input size="24" type="text" class="flat" name="bic" value="'.$_POST["bic"].'"></td></tr>';
|
print '<td colspan="3"><input size="24" type="text" class="flat" name="iban_prefix" value="'.$_POST["iban_prefix"].'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||||
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">".$_POST["domiciliation"];
|
print '<td colspan="3"><input size="24" type="text" class="flat" name="bic" value="'.$_POST["bic"].'"></td></tr>';
|
||||||
print "</textarea></td></tr>";
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||||
print '<td colspan="3"><input size="12" type="text" class="flat" name="proprio" value="'.$_POST["proprio"].'"></td></tr>';
|
print "<textarea class=\"flat\" name=\"domiciliation\" rows=\"2\" cols=\"40\">".$_POST["domiciliation"];
|
||||||
|
print "</textarea></td></tr>";
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td>';
|
||||||
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">".$_POST["adresse_proprio"];
|
print '<td colspan="3"><input size="12" type="text" class="flat" name="proprio" value="'.$_POST["proprio"].'"></td></tr>';
|
||||||
print "</textarea></td></tr>";
|
|
||||||
|
|
||||||
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></td></tr>';
|
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||||
print '</form>';
|
print "<textarea class=\"flat\" name=\"adresse_proprio\" rows=\"2\" cols=\"40\">".$_POST["adresse_proprio"];
|
||||||
print '</table>';
|
print "</textarea></td></tr>";
|
||||||
|
|
||||||
|
print '<tr><td align="center" colspan="4"><input value="'.$langs->trans("CreateAccount").'" type="submit" class="button"></td></tr>';
|
||||||
|
print '</form>';
|
||||||
|
print '</table>';
|
||||||
}
|
}
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
@@ -217,103 +235,114 @@ if ($_GET["action"] == 'create')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($_GET["id"] && $_GET["action"] != 'edit')
|
if ($_GET["id"] && $_GET["action"] != 'edit')
|
||||||
{
|
|
||||||
$account = new Account($db, $_GET["id"]);
|
|
||||||
$account->fetch($_GET["id"]);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Affichage onglets
|
|
||||||
*/
|
|
||||||
$h = 0;
|
|
||||||
|
|
||||||
$head[$h][0] = "fiche.php?id=$account->id";
|
|
||||||
$head[$h][1] = $langs->trans("AccountCard");
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
dolibarr_fiche_head($head, $hselected, $langs->trans("FinancialAccount")." ".($account->number?$account->number:$account->label));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Confirmation de la suppression
|
|
||||||
*/
|
|
||||||
if ($_GET["action"] == 'delete')
|
|
||||||
{
|
|
||||||
$form->form_confirm($_SERVER["PHP_SELF"]."?id=$account->id",$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
|
||||||
print '<br />';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->label.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->status[$account->clos].'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
|
||||||
print '<td colspan="3">';
|
|
||||||
if ($account->type == 0 || $account->type == 1) print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
|
|
||||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
if ($account->type == 0 || $account->type == 1)
|
|
||||||
{
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
|
|
||||||
print '<tr><td>'.$account->code_banque.'</td>';
|
|
||||||
print '<td>'.$account->code_guichet.'</td>';
|
|
||||||
print '<td>'.$account->number.'</td>';
|
|
||||||
print '<td>'.$account->cle_rib.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
|
||||||
print '<td colspan="3">'.$account->bic.'</td></tr>';
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
|
||||||
print nl2br($account->domiciliation);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td><td colspan="3">';
|
|
||||||
print $account->proprio;
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
|
||||||
print nl2br($account->adresse_proprio);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Barre d'actions
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
print '<div class="tabsAction">';
|
|
||||||
|
|
||||||
if ($user->rights->banque->configurer)
|
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?action=edit&id='.$account->id.'">'.$langs->trans("Edit").'</a>';
|
$account = new Account($db, $_GET["id"]);
|
||||||
|
$account->fetch($_GET["id"]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Affichage onglets
|
||||||
|
*/
|
||||||
|
$h = 0;
|
||||||
|
|
||||||
|
$head[$h][0] = "fiche.php?id=$account->id";
|
||||||
|
$head[$h][1] = $langs->trans("AccountCard");
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
dolibarr_fiche_head($head, $hselected, $langs->trans("FinancialAccount"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Confirmation de la suppression
|
||||||
|
*/
|
||||||
|
if ($_GET["action"] == 'delete')
|
||||||
|
{
|
||||||
|
$form->form_confirm($_SERVER["PHP_SELF"]."?id=$account->id",$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
|
||||||
|
print '<br />';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Ref").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->ref.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->label.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountType").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->type_lib[$account->type].'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->getLibStatut(4).'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Conciliable").'</td>';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
if ($account->type == 0 || $account->type == 1) print ($account->rappro==1 ? $langs->trans("Yes") : ($langs->trans("No").' ('.$langs->trans("ConciliationDisabled").')'));
|
||||||
|
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Code compta
|
||||||
|
if ($conf->comptaexpert->enabled)
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->account_number.'</td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($account->type == 0 || $account->type == 1)
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->bank.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td>Code Banque</td><td>Code Guichet</td><td>Num<75>ro</td><td>Cl<43> RIB</td></tr>';
|
||||||
|
print '<tr><td>'.$account->code_banque.'</td>';
|
||||||
|
print '<td>'.$account->code_guichet.'</td>';
|
||||||
|
print '<td>'.$account->number.'</td>';
|
||||||
|
print '<td>'.$account->cle_rib.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("IBAN").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->iban_prefix.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("BIC").'</td>';
|
||||||
|
print '<td colspan="3">'.$account->bic.'</td></tr>';
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="3">';
|
||||||
|
print nl2br($account->domiciliation);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("BankAccountOwner").'</td><td colspan="3">';
|
||||||
|
print $account->proprio;
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("BankAccountOwnerAddress").'</td><td colspan="3">';
|
||||||
|
print nl2br($account->adresse_proprio);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Barre d'actions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
if ($user->rights->banque->configurer)
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="fiche.php?action=edit&id='.$account->id.'">'.$langs->trans("Edit").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$canbedeleted=$account->can_be_deleted(); // Renvoi vrai si compte sans mouvements
|
||||||
|
if ($user->rights->banque->configurer && $canbedeleted)
|
||||||
|
{
|
||||||
|
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$account->id.'">'.$langs->trans("Delete").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$canbedeleted=$account->can_be_deleted(); // Renvoi vrai si compte sans mouvements
|
|
||||||
if ($user->rights->banque->configurer && $canbedeleted)
|
|
||||||
{
|
|
||||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$account->id.'">'.$langs->trans("Delete").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Edition */
|
/* Edition */
|
||||||
@@ -336,6 +365,10 @@ else
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("Ref").'</td>';
|
||||||
|
print '<td colspan="3"><input size="8" type="text" class="flat" name="ref" value="'.$account->ref.'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Label").'</td>';
|
||||||
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$account->label.'"></td></tr>';
|
print '<td colspan="3"><input size="30" type="text" class="flat" name="label" value="'.$account->label.'"></td></tr>';
|
||||||
|
|
||||||
@@ -355,6 +388,17 @@ else
|
|||||||
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
if ($account->type == 2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Code compta
|
||||||
|
if ($conf->comptaexpert->enabled)
|
||||||
|
{
|
||||||
|
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
|
||||||
|
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<input type="hidden" name="account_number" value="'.$account->account_number.'">';
|
||||||
|
}
|
||||||
|
|
||||||
if ($account->type == 0 || $account->type == 1)
|
if ($account->type == 0 || $account->type == 1)
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Bank").'</td>';
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ update llx_const set name='SOCIETE_FISCAL_MONTH_START' where name='FISCAL_MONTH_
|
|||||||
update llx_const set visible=0 where name='FACTURE_DISABLE_RECUR';
|
update llx_const set visible=0 where name='FACTURE_DISABLE_RECUR';
|
||||||
update llx_const set visible=0 where name='MAILING_EMAIL_FROM';
|
update llx_const set visible=0 where name='MAILING_EMAIL_FROM';
|
||||||
|
|
||||||
|
insert into llx_const(name,value,type,visible,note) values('MAIN_SHOW_DEVELOPMENT_MODULES','0','yesno',1,'Make development modules visible');
|
||||||
|
|
||||||
|
|
||||||
alter table llx_paiementfourn add statut smallint(6) NOT NULL DEFAULT 0;
|
alter table llx_paiementfourn add statut smallint(6) NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
|
||||||
@@ -225,3 +228,6 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v
|
|||||||
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101, 'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1);
|
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101, 'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1);
|
||||||
|
|
||||||
insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure');
|
insert into llx_c_pays (rowid,code,libelle) values (30, 'SG', 'Singapoure');
|
||||||
|
|
||||||
|
|
||||||
|
alter table llx_bank_account add column ref varchar(12) NOT NULL;
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ create table llx_bank_account
|
|||||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||||
datec datetime,
|
datec datetime,
|
||||||
tms timestamp,
|
tms timestamp,
|
||||||
label varchar(30),
|
ref varchar(12) NOT NULL,
|
||||||
|
label varchar(30) NOT NULL,
|
||||||
bank varchar(60),
|
bank varchar(60),
|
||||||
code_banque varchar(7),
|
code_banque varchar(7),
|
||||||
code_guichet varchar(6),
|
code_guichet varchar(6),
|
||||||
|
|||||||
Reference in New Issue
Block a user