mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fixed: Category of a bank transaction was not saved.
This commit is contained in:
parent
18d471041d
commit
b9412fdb26
|
|
@ -17,6 +17,7 @@ For users:
|
|||
- Can add contacts to a supplier invoice.
|
||||
- Fixed: When an invoice is changed back to status draft, warehouse is increased
|
||||
back.
|
||||
- Fixed: Category of a bank transaction was not saved.
|
||||
|
||||
For translators:
|
||||
- Added ca_ES language files
|
||||
|
|
|
|||
|
|
@ -789,16 +789,21 @@ class AccountLine
|
|||
var $error;
|
||||
var $db;
|
||||
|
||||
var $rowid;
|
||||
var $rappro;
|
||||
var $id;
|
||||
var $ref;
|
||||
var $datec;
|
||||
var $dateo;
|
||||
var $datev;
|
||||
var $amount;
|
||||
var $label;
|
||||
var $note;
|
||||
var $fk_account;
|
||||
|
||||
var $note;
|
||||
var $fk_user_author;
|
||||
var $fk_user_rappro;
|
||||
var $num_releve;
|
||||
var $num_chq;
|
||||
var $rappro;
|
||||
|
||||
var $bank_account_label;
|
||||
|
||||
|
||||
|
|
@ -837,6 +842,7 @@ class AccountLine
|
|||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $rowid;
|
||||
$this->rowid = $rowid;
|
||||
$this->ref = $rowid;
|
||||
|
||||
|
|
@ -932,7 +938,7 @@ class AccountLine
|
|||
$sql.= " dateo='".$this->db->idate($this->dateo)."'";
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
|
||||
dolibarr_syslog("AccountLine::update sql=".$sql);
|
||||
dol_syslog("AccountLine::update sql=".$sql);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
|
@ -943,12 +949,54 @@ class AccountLine
|
|||
{
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->error();
|
||||
dolibarr_syslog("AccountLine::update ".$this->error);
|
||||
dol_syslog("AccountLine::update ".$this->error);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Update conciliation field
|
||||
* \param user Objet user making update
|
||||
* \param cat Category id
|
||||
* \param int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_conciliation($user,$cat)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " set rappro=1, num_releve='".$this->num_releve."',";
|
||||
$sql.= " fk_user_rappro=".$user->id;
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog("AccountLine::update_conciliation sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (! empty($cat))
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ)";
|
||||
$sql.= " VALUES (".$this->id.", ".$cat.")";
|
||||
|
||||
dol_syslog("AccountLine::update_conciliation sql=".$sql, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
// No error check. Can fail if category already affected
|
||||
}
|
||||
|
||||
$bankline->rappro=1;
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Charge les informations d'ordre info dans l'objet facture
|
||||
* \param id Id de la facture a charger
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Xavier DUTOIT <doli@sydesy.com>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
/**
|
||||
* \file htdocs/compta/bank/ligne.php
|
||||
* \ingroup compta
|
||||
* \brief Page edition d'une ecriture bancaire
|
||||
* \brief Page to edit a bank transaction record
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ if ($_POST["action"] == 'emetteur')
|
|||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
if ($_POST["action"] == 'num_releve')
|
||||
if ($user->rights->banque->consolidate && $_POST["action"] == 'num_releve')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
|
@ -147,6 +147,7 @@ if ($_POST["action"] == 'num_releve')
|
|||
if (! $num_rel) $sql.= ", rappro = 0";
|
||||
$sql.= " WHERE rowid = ".$rowid;
|
||||
|
||||
dol_syslog("ligne.php sql=".$sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -18,11 +18,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/bank/rappro.php
|
||||
\ingroup banque
|
||||
\brief Page de rapprochement bancaire
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/compta/bank/rappro.php
|
||||
* \ingroup banque
|
||||
* \brief Page de rapprochement bancaire
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
require("./pre.inc.php");
|
||||
|
||||
|
|
@ -53,50 +53,21 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $
|
|||
if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
|
||||
{
|
||||
// Definition, nettoyage parametres
|
||||
$valrappro=1;
|
||||
$num_releve=trim($_POST["num_releve"]);
|
||||
|
||||
if ($num_releve)
|
||||
{
|
||||
$db->begin();
|
||||
$bankline=new AccountLine($db);
|
||||
$result=$bankline->fetch($_POST["rowid"]);
|
||||
$bankline->num_releve=$_POST["num_releve"];
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||
$sql.= " set rappro=".$valrappro.", num_releve='".$_POST["num_releve"]."',";
|
||||
$sql.= " fk_user_rappro=".$user->id;
|
||||
$sql.= " WHERE rowid=".$_POST["rowid"];
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($cat1 && $_POST["action"])
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_class (lineid, fk_categ)";
|
||||
$sql.= " VALUES ($rowid, $cat1)";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$result=$bankline->update_conciliation($user,$_POST["cat"]);
|
||||
if ($result < 0) $mesg=$bankline->error;
|
||||
}
|
||||
else {
|
||||
$msg="Erreur: Saisissez le relevé qui référence la transaction pour la rapprocher.";
|
||||
else
|
||||
{
|
||||
$langs->load("errors");
|
||||
$mesg='<div class="error">'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'</div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -135,6 +106,7 @@ if ($resql) {
|
|||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader();
|
||||
|
|
@ -157,9 +129,7 @@ if ($resql)
|
|||
print_titre($langs->trans("Reconciliation").': <a href="account.php?account='.$_GET["account"].'">'.$acct->label.'</a>');
|
||||
print '<br>';
|
||||
|
||||
if ($msg) {
|
||||
print "$msg<br><br>";
|
||||
}
|
||||
if ($mesg) print $mesg."<br>";
|
||||
|
||||
// Affiche nom des derniers relevés
|
||||
$nbmax=5;
|
||||
|
|
@ -183,7 +153,7 @@ if ($resql)
|
|||
$liste='<a href="releve.php?account='.$_GET["account"].'&num='.$objr->num_releve.'">'.$objr->num_releve.'</a> '.$liste;
|
||||
}
|
||||
if ($num >= $nbmax) $liste="... ".$liste;
|
||||
print "$liste";
|
||||
print $liste;
|
||||
if ($num > 0) print '<br><br>';
|
||||
else print $langs->trans("None").'<br><br>';
|
||||
}
|
||||
|
|
@ -365,15 +335,15 @@ if ($resql)
|
|||
|
||||
|
||||
// Affiche zone saisie relevé + bouton "Rapprocher"
|
||||
if ($objp->do <= mktime())
|
||||
if ($objp->do <= gmmktime())
|
||||
{
|
||||
print '<td align="center" nowrap="nowrap">';
|
||||
print "<input class=\"flat\" name=\"num_releve\" type=\"text\" value=\"\" size=\"8\">";
|
||||
print '<input class="flat" name="num_releve" type="text" value="'.$objp->num_releve.'" size="8">';
|
||||
print ' ';
|
||||
print "<input class=\"button\" type=\"submit\" value=\"".$langs->trans("Rapprocher")."\">";
|
||||
if ($options)
|
||||
{
|
||||
print "<br><select class=\"flat\" name=\"cat1\">$options";
|
||||
print "<br><select class=\"flat\" name=\"cat\">$options";
|
||||
print "</select>";
|
||||
}
|
||||
print "</td>";
|
||||
|
|
@ -381,7 +351,7 @@ if ($resql)
|
|||
else
|
||||
{
|
||||
print '<td align="left">';
|
||||
print 'Ecriture future. Ne peut pas encore être rapprochée.';
|
||||
print 'Transaction in futur. No way to conciliate.';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,4 +42,5 @@ ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
|||
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
||||
ErrorLDAPMakeManualTest=A .ldif file has been generated in directory %s. Try to load it manually from command line to have more informations on errors.
|
||||
ErrorCantSaveADoneUserWithZeroPercentage=Can't save an action with "statut not started" if field "done by" is also filled.
|
||||
ErrorBillRefAlreadyExists=Ref used for creation already exists.
|
||||
ErrorBillRefAlreadyExists=Ref used for creation already exists.
|
||||
ErrorPleaseTypeBankTransactionReportName=Please type bank receipt name where transaction is reported (Format YYYYMM or YYYYMMDD)
|
||||
|
|
|
|||
|
|
@ -42,4 +42,5 @@ ErrorExportDuplicateProfil=Ce nom de profil existe d
|
|||
ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.
|
||||
ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire %s. Essayer de charger ce fichier en manuel depuis la ligne de commande pour plus de détail sur l'erreur.
|
||||
ErrorCantSaveADoneUserWithZeroPercentage=Impossible sauver une action à l'état non commencé avec un utilisateur défini comme ayant fait l'action.
|
||||
ErrorBillRefAlreadyExists=La référence utilisée pour la création existe déjà
|
||||
ErrorBillRefAlreadyExists=La référence utilisée pour la création existe déjà
|
||||
ErrorPleaseTypeBankTransactionReportName=Veuiller saisir le nom de relevé bancaire sur lequel l'écriture est constaté (Format AAAAMM ou AAAMMJJ)
|
||||
Loading…
Reference in New Issue
Block a user