Trad
This commit is contained in:
parent
d930a0dd32
commit
8a12e715dd
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-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
|
||||
@ -17,17 +17,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/accountancy/accountancyaccount.class.php
|
||||
\ingroup comptaexpert
|
||||
\brief Fichier de la classe des comptes comptables
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/accountancy/accountancyaccount.class.php
|
||||
* \ingroup comptaexpert
|
||||
* \brief Fichier de la classe des comptes comptables
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/** \class AccountancyAccount
|
||||
\brief Classe permettant la gestion des comptes
|
||||
*/
|
||||
|
||||
class AccountancyAccount
|
||||
{
|
||||
var $db;
|
||||
@ -63,7 +62,7 @@ class AccountancyAccount
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount";
|
||||
$sql.= " (date_creation, fk_user_author, numero,intitule)";
|
||||
$sql.= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
$sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -79,18 +78,18 @@ class AccountancyAccount
|
||||
{
|
||||
$result = -2;
|
||||
$this->error="AccountancyAccount::Create Erreur $result";
|
||||
dol_syslog($this->error);
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = -1;
|
||||
$this->error="AccountancyAccount::Create Erreur $result";
|
||||
dol_syslog($this->error);
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2006-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
|
||||
@ -17,17 +17,16 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/accountancy/accountancysystem.class.php
|
||||
\ingroup comptaexpert
|
||||
\brief Fichier de la classe des plans de comptes comptables
|
||||
\version $Id$
|
||||
*/
|
||||
* \file htdocs/accountancy/accountancysystem.class.php
|
||||
* \ingroup comptaexpert
|
||||
* \brief Fichier de la classe des plans de comptes comptables
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/** \class AccountancySystem
|
||||
\brief Classe permettant la gestion des plans de comptes
|
||||
*/
|
||||
|
||||
* \brief Classe permettant la gestion des plans de comptes
|
||||
*/
|
||||
class AccountancySystem
|
||||
{
|
||||
var $db;
|
||||
@ -79,14 +78,14 @@ class AccountancySystem
|
||||
{
|
||||
$result = -2;
|
||||
$this->error="AccountancySystem::Create Erreur $result";
|
||||
dol_syslog($this->error);
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = -1;
|
||||
$this->error="AccountancySystem::Create Erreur $result";
|
||||
dol_syslog($this->error);
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
@ -2973,14 +2973,14 @@ else
|
||||
}
|
||||
|
||||
/*
|
||||
* Ajouter une ligne
|
||||
* Form to add new line
|
||||
*/
|
||||
if ($fac->statut == 0 && $user->rights->facture->creer && $_GET['action'] <> 'valid' && $_GET['action'] <> 'editline')
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>';
|
||||
print '<a name="add"></a>'; // ancre
|
||||
print $langs->trans('Description').'</td>';
|
||||
print $langs->trans('AddNewLine').'</td>';
|
||||
print '<td align="right">'.$langs->trans('VAT').'</td>';
|
||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||
@ -3036,6 +3036,7 @@ else
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3">';
|
||||
print $langs->trans("AddNewLine").' - ';
|
||||
if ($conf->service->enabled)
|
||||
{
|
||||
print $langs->trans('RecordedProductsAndServices');
|
||||
|
||||
@ -2964,7 +2964,7 @@ class FactureLigne
|
||||
if ($discount->fk_facture)
|
||||
{
|
||||
$this->error=$langs->trans("ErrorDiscountAlreadyUsed",$discount->id);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERROR);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -2974,7 +2974,7 @@ class FactureLigne
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$discount->error;
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERROR);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -2983,7 +2983,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded");
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERROR);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -2991,7 +2991,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$discount->error;
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERROR);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@ -3014,7 +3014,7 @@ class FactureLigne
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERROR);
|
||||
dol_syslog("FactureLigne::insert Error ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||
@ -69,6 +69,7 @@ class FactureFournisseur extends Facture
|
||||
var $note;
|
||||
var $note_public;
|
||||
var $propalid;
|
||||
|
||||
var $lignes;
|
||||
var $fournisseur;
|
||||
|
||||
@ -516,7 +517,7 @@ class FactureFournisseur extends Facture
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("Error sql=$sql, error=".$this->error);
|
||||
dol_syslog("Error sql=$sql, error=".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -530,26 +531,28 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Update line
|
||||
* \param id Id de la ligne de facture
|
||||
* \param label Description de la ligne
|
||||
* \param pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* \param tauxtva Taux tva
|
||||
* \param qty Quantity
|
||||
* \param idproduct Id produit
|
||||
* \param price_base_type HT ou TTC
|
||||
* \param info_bits Miscellanous informations of line
|
||||
* \return int <0 si ko, >0 si ok
|
||||
* \brief Update line
|
||||
* \param id Id of line invoice
|
||||
* \param label Description of line
|
||||
* \param pu Prix unitaire (HT ou TTC selon price_base_type)
|
||||
* \param tauxtva VAT Rate
|
||||
* \param qty Quantity
|
||||
* \param idproduct Id produit
|
||||
* \param price_base_type HT or TTC
|
||||
* \param info_bits Miscellanous informations of line
|
||||
* \param type Type of line (0=product, 1=service)
|
||||
* \return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function updateline($id, $label, $pu, $tauxtva, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0)
|
||||
function updateline($id, $label, $pu, $tauxtva, $qty=1, $idproduct=0, $price_base_type='HT', $info_bits=0, $type=0)
|
||||
{
|
||||
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
|
||||
|
||||
$pu = price2num($pu);
|
||||
$qty = price2num($qty);
|
||||
|
||||
// Validation
|
||||
// Check parameters
|
||||
if (! is_numeric($pu) || ! is_numeric($qty)) return -1;
|
||||
if ($type < 0) return -1;
|
||||
|
||||
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||
// qty, pu, remise_percent et txtva
|
||||
@ -562,13 +565,17 @@ class FactureFournisseur extends Facture
|
||||
$pu_ht = $tabprice[3];
|
||||
$pu_tva = $tabprice[4];
|
||||
$pu_ttc = $tabprice[5];
|
||||
$product_type = 0;
|
||||
|
||||
if ($idproduct)
|
||||
{
|
||||
$product=new Product($this->db);
|
||||
$result=$product->fetch($idproduct);
|
||||
$product_type=$product->type;
|
||||
}
|
||||
else
|
||||
{
|
||||
$product_type = $type;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det ';
|
||||
$sql.= 'SET ';
|
||||
@ -733,7 +740,7 @@ class FactureFournisseur extends Facture
|
||||
{
|
||||
global $user,$langs;
|
||||
|
||||
// Charge tableau des id de soci<EFBFBD>t<EFBFBD> socids
|
||||
// Charge tableau des id de societe socids
|
||||
$socids = array();
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe WHERE fournisseur=1 LIMIT 10";
|
||||
$resql = $this->db->query($sql);
|
||||
@ -766,7 +773,7 @@ class FactureFournisseur extends Facture
|
||||
}
|
||||
}
|
||||
|
||||
// Initialise param<EFBFBD>tres
|
||||
// Initialise parametres
|
||||
$this->id=0;
|
||||
$this->ref = 'SPECIMEN';
|
||||
$this->specimen=1;
|
||||
@ -789,6 +796,8 @@ class FactureFournisseur extends Facture
|
||||
$ligne->tva_tx=19.6;
|
||||
$prodid = rand(1, $num_prods);
|
||||
$ligne->produit_id=$prodids[$prodid];
|
||||
$ligne->product_type=0;
|
||||
|
||||
$this->lignes[$xnbp]=$ligne;
|
||||
$xnbp++;
|
||||
}
|
||||
@ -799,7 +808,7 @@ class FactureFournisseur extends Facture
|
||||
$this->total_ttc = $xnbp*119.6;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* \brief Load an object from its id and create a new one in database
|
||||
* \param fromid Id of object to clone
|
||||
* \param invertdetail Reverse sign of amounts for lines
|
||||
|
||||
@ -500,6 +500,7 @@ Root=Root
|
||||
Informations=Informations
|
||||
Page=Page
|
||||
Notes=Notes
|
||||
AddNewLine=Add new line
|
||||
# Week day
|
||||
Day1=Monday
|
||||
Day2=Tuesday
|
||||
|
||||
@ -499,6 +499,7 @@ Root=Racine
|
||||
Informations=Informations
|
||||
Page=Page
|
||||
Notes=Notes
|
||||
AddNewLine=Ajout nouvelle ligne
|
||||
# Week day
|
||||
Day1=Lundi
|
||||
Day2=Mardi
|
||||
|
||||
@ -922,7 +922,7 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("Propal::set_date Erreur SQL".$this->error, LOG_ERROR);
|
||||
dol_syslog("Propal::set_date Erreur SQL".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -948,7 +948,7 @@ class Propal extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
dol_syslog("Propal::set_echeance Erreur SQL".$this->error, LOG_ERROR);
|
||||
dol_syslog("Propal::set_echeance Erreur SQL".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user