Fix: Save of conciliate account option
This commit is contained in:
parent
aeef986cba
commit
fc01bfe0e3
@ -103,7 +103,7 @@ class Account extends CommonObject
|
|||||||
* \param line_id Id ecriture bancaire
|
* \param line_id Id ecriture bancaire
|
||||||
* \param url_id Id parametre url
|
* \param url_id Id parametre url
|
||||||
* \param url Url
|
* \param url Url
|
||||||
* \param label Libellé du lien
|
* \param label Libell<EFBFBD> du lien
|
||||||
* \param type Type de lien (payment, company, member, ...)
|
* \param type Type de lien (payment, company, member, ...)
|
||||||
* \return int <0 si ko, id line si ok
|
* \return int <0 si ko, id line si ok
|
||||||
*/
|
*/
|
||||||
@ -127,7 +127,7 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi tableau des liens
|
* \brief Renvoi tableau des liens
|
||||||
* \param line_id Id ligne écriture
|
* \param line_id Id ligne <EFBFBD>criture
|
||||||
* \retuen array Tableau des liens
|
* \retuen array Tableau des liens
|
||||||
*/
|
*/
|
||||||
function get_url($line_id)
|
function get_url($line_id)
|
||||||
@ -146,7 +146,7 @@ class Account extends CommonObject
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object($result);
|
$obj = $this->db->fetch_object($result);
|
||||||
// Anciens liens (pour compatibilité)
|
// Anciens liens (pour compatibilit<EFBFBD>)
|
||||||
$lines[$i][0] = $obj->url;
|
$lines[$i][0] = $obj->url;
|
||||||
$lines[$i][1] = $obj->url_id;
|
$lines[$i][1] = $obj->url_id;
|
||||||
$lines[$i][2] = $obj->label;
|
$lines[$i][2] = $obj->label;
|
||||||
@ -164,16 +164,16 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Ajoute une entree dans la table ".MAIN_DB_PREFIX."bank
|
\brief Ajoute une entree dans la table ".MAIN_DB_PREFIX."bank
|
||||||
\param $date Date TMS opération
|
\param $date Date TMS op<EFBFBD>ration
|
||||||
\param $oper 1,2,3,4...
|
\param $oper 1,2,3,4...
|
||||||
\param $label Descripton
|
\param $label Descripton
|
||||||
\param $amount Montant
|
\param $amount Montant
|
||||||
\param $num_chq Numero cheque ou virement
|
\param $num_chq Numero cheque ou virement
|
||||||
\param $categorie Categorie optionnelle
|
\param $categorie Categorie optionnelle
|
||||||
\param $user Utilisateur qui crée
|
\param $user Utilisateur qui cr<EFBFBD>e
|
||||||
\param $emetteur Nom emetteur
|
\param $emetteur Nom emetteur
|
||||||
\param $banque Banque emettrice
|
\param $banque Banque emettrice
|
||||||
\return int Rowid de l'entrée ajoutée, <0 si erreur
|
\return int Rowid de l'entr<EFBFBD>e ajout<EFBFBD>e, <0 si erreur
|
||||||
*/
|
*/
|
||||||
function addline($date, $oper, $label, $amount, $num_chq='', $categorie='', $user, $emetteur='',$banque='')
|
function addline($date, $oper, $label, $amount, $num_chq='', $categorie='', $user, $emetteur='',$banque='')
|
||||||
{
|
{
|
||||||
@ -279,7 +279,7 @@ class Account extends CommonObject
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/lib/bank.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/lib/bank.lib.php';
|
||||||
|
|
||||||
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ôle de la clé indique que les informations de votre compte bancaire sont incorrectes.";
|
$this->error="Le controle de la cle indique que les informations de votre compte bancaire sont incorrectes.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,14 +290,14 @@ class Account extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_account (";
|
||||||
$sql.= "datec, ref, label, account_number, currency_code,";
|
$sql.= "datec, ref, label, account_number, currency_code, ";
|
||||||
$sql.= "min_allowed, min_desired,";
|
$sql.= "rappro, min_allowed, min_desired, ";
|
||||||
$sql.= "comment";
|
$sql.= "comment";
|
||||||
$sql.= ") values (";
|
$sql.= ") values (";
|
||||||
$sql.= "now(),'" . addslashes($this->ref) . "', '" . addslashes($this->label) . "',";
|
$sql.= "now(),'" . addslashes($this->ref) . "', '" . addslashes($this->label) . "', ";
|
||||||
$sql.= "'".addslashes($this->account_number) . "','".$this->currency_code."',";
|
$sql.= "'".addslashes($this->account_number) . "', '".$this->currency_code."', ";
|
||||||
$sql.= "min_allowed=".price2num($this->min_allowed).",min_desired=".price2num($this->min_desired).",";
|
$sql.= $this->rappro.", ".price2num($this->min_allowed).", ".price2num($this->min_desired).", ";
|
||||||
$sql.= "comment='".addslashes($this->comment)."'";
|
$sql.= "'".addslashes($this->comment)."'";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dolibarr_syslog("Account::create sql=".$sql);
|
dolibarr_syslog("Account::create sql=".$sql);
|
||||||
@ -400,7 +400,7 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
// Verification parametres
|
// 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ôle de la clé indique que les informations de votre compte bancaire sont incorrectes.";
|
$this->error="Le contr<EFBFBD>le de la cl<63> indique que les informations de votre compte bancaire sont incorrectes.";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,8 +441,8 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* \brief Charge un compte en memoire depuis la base
|
* \brief Charge un compte en memoire depuis la base
|
||||||
* \param id Id du compte à récupérer
|
* \param id Id du compte <EFBFBD> r<EFBFBD>cup<EFBFBD>rer
|
||||||
* \param ref Ref du compte à récupérer
|
* \param ref Ref du compte <EFBFBD> r<EFBFBD>cup<EFBFBD>rer
|
||||||
*/
|
*/
|
||||||
function fetch($id,$ref='')
|
function fetch($id,$ref='')
|
||||||
{
|
{
|
||||||
@ -527,8 +527,8 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne le libellé du statut d'une facture (brouillon, validée, abandonnée, payée)
|
* \brief Retourne le libell<EFBFBD> du statut d'une facture (brouillon, valid<EFBFBD>e, abandonn<EFBFBD>e, pay<EFBFBD>e)
|
||||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long
|
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long
|
||||||
* \return string Libelle
|
* \return string Libelle
|
||||||
*/
|
*/
|
||||||
function getLibStatut($mode=0)
|
function getLibStatut($mode=0)
|
||||||
@ -537,10 +537,10 @@ class Account extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Renvoi le libellé d'un statut donné
|
* \brief Renvoi le libell<EFBFBD> d'un statut donn<EFBFBD>
|
||||||
* \param statut Id statut
|
* \param statut Id statut
|
||||||
* \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long, 5=Libellé court + Picto
|
* \param mode 0=libell<EFBFBD> long, 1=libell<EFBFBD> court, 2=Picto + Libell<EFBFBD> court, 3=Picto, 4=Picto + Libell<EFBFBD> long, 5=Libell<EFBFBD> court + Picto
|
||||||
* \return string Libellé du statut
|
* \return string Libell<EFBFBD> du statut
|
||||||
*/
|
*/
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
@ -582,7 +582,7 @@ class Account extends CommonObject
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* \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é, faux sinon
|
* \return boolean vrai si peut etre supprim<EFBFBD>, faux sinon
|
||||||
*/
|
*/
|
||||||
function can_be_deleted()
|
function can_be_deleted()
|
||||||
{
|
{
|
||||||
@ -779,7 +779,7 @@ class AccountLine
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Charge en memoire depuis la base, une ecriture sur le compte
|
* \brief Charge en memoire depuis la base, une ecriture sur le compte
|
||||||
* \param id Id de la ligne écriture à récupérer
|
* \param id Id de la ligne <EFBFBD>criture <EFBFBD> r<EFBFBD>cup<EFBFBD>rer
|
||||||
* \return int <0 if KO, >0 if OK
|
* \return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function fetch($rowid)
|
function fetch($rowid)
|
||||||
@ -839,7 +839,7 @@ class AccountLine
|
|||||||
|
|
||||||
if ($this->rappro)
|
if ($this->rappro)
|
||||||
{
|
{
|
||||||
// Protection pour eviter tout suppression d'une ligne consolidée
|
// Protection pour eviter tout suppression d'une ligne consolid<EFBFBD>e
|
||||||
$this->error="DeleteNotPossibleLineIsConsolidated";
|
$this->error="DeleteNotPossibleLineIsConsolidated";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -940,7 +940,7 @@ class AccountLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->date_creation = $obj->datec;
|
$this->date_creation = $obj->datec;
|
||||||
//$this->date_rappro = $obj->daterappro; // \todo pas encore gérée
|
//$this->date_rappro = $obj->daterappro; // \todo pas encore g<EFBFBD>r<EFBFBD>e
|
||||||
}
|
}
|
||||||
$this->db->free($result);
|
$this->db->free($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,15 +16,13 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
|
||||||
* $Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/compta/bank/fiche.php
|
\file htdocs/compta/bank/fiche.php
|
||||||
\ingroup banque
|
\ingroup banque
|
||||||
\brief Fiche création compte bancaire
|
\brief Fiche creation compte bancaire
|
||||||
\version $Revision$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
@ -48,7 +46,7 @@ if ($_POST["action"] == 'add')
|
|||||||
$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 = $_POST["norappro"]?1:0;
|
$account->rappro = (isset($_POST["norappro"]) && $_POST["norappro"])?0:1;
|
||||||
$account->url = $_POST["url"];
|
$account->url = $_POST["url"];
|
||||||
|
|
||||||
$account->account_number = trim($_POST["account_number"]);
|
$account->account_number = trim($_POST["account_number"]);
|
||||||
@ -90,7 +88,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
$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"])?0:1;
|
||||||
$account->url = trim($_POST["url"]);
|
$account->url = trim($_POST["url"]);
|
||||||
|
|
||||||
$account->bank = trim($_POST["bank"]);
|
$account->bank = trim($_POST["bank"]);
|
||||||
@ -150,7 +148,7 @@ $form = new Form($db);
|
|||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Affichage page en mode création */
|
/* Affichage page en mode cr<EFBFBD>ation */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -217,7 +215,7 @@ if ($_GET["action"] == 'create')
|
|||||||
// Comment
|
// Comment
|
||||||
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
// éditeur wysiwyg
|
// <EFBFBD>diteur wysiwyg
|
||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
@ -456,7 +454,7 @@ else
|
|||||||
// Comment
|
// Comment
|
||||||
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Comment").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
// éditeur wysiwyg
|
// <EFBFBD>diteur wysiwyg
|
||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user