forked from Wavyzz/dolibarr
Dbut intgration rgle proposition tva par dfaut
This commit is contained in:
@@ -99,9 +99,6 @@ class FactureFournisseur
|
|||||||
|
|
||||||
if (! $remise) $remise = 0 ;
|
if (! $remise) $remise = 0 ;
|
||||||
$totalht = ($amount - $remise);
|
$totalht = ($amount - $remise);
|
||||||
// NE ME SEMBLE PLUS JUSTIFIE ICI
|
|
||||||
// $tva = tva($totalht);
|
|
||||||
// $total = $totalht + $tva;
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef, note, fk_user_author, date_lim_reglement) ';
|
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn (facnumber, libelle, fk_soc, datec, datef, note, fk_user_author, date_lim_reglement) ';
|
||||||
$sql .= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',";
|
$sql .= " VALUES ('".addslashes($number)."','".addslashes($this->libelle)."',";
|
||||||
|
|||||||
@@ -1484,9 +1484,9 @@ class Form
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Selection du taux de tva
|
* \brief Selection du taux de tva appliqu<71> par vendeur
|
||||||
* \param name Nom champ html
|
* \param name Nom champ html
|
||||||
* \param defaulttx Taux tva pr<70>s<EFBFBD>lectionn<6E> (deprecated)
|
* \param defaulttx For<EFBFBD>age du taux tva pr<70>s<EFBFBD>lectionn<6E>. Mettre '' pour appliquer r<>gle par d<>faut.
|
||||||
* \param societe_vendeuse Objet soci<63>t<EFBFBD> vendeuse
|
* \param societe_vendeuse Objet soci<63>t<EFBFBD> vendeuse
|
||||||
* \param societe_acheteuse Objet soci<63>t<EFBFBD> acheteuse
|
* \param societe_acheteuse Objet soci<63>t<EFBFBD> acheteuse
|
||||||
* \param taux_produit Taux par defaut du produit vendu
|
* \param taux_produit Taux par defaut du produit vendu
|
||||||
@@ -1498,13 +1498,12 @@ class Form
|
|||||||
*/
|
*/
|
||||||
function select_tva($name='tauxtva', $defaulttx='', $societe_vendeuse='', $societe_acheteuse='', $taux_produit='')
|
function select_tva($name='tauxtva', $defaulttx='', $societe_vendeuse='', $societe_acheteuse='', $taux_produit='')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf,$mysoc;
|
||||||
|
|
||||||
// \todo Si pays vendeur non d<>fini
|
//print $societe_vendeuse."-".$societe_acheteuse;
|
||||||
if (1 == 2)
|
if (! $societe_vendeuse->pays_code)
|
||||||
{
|
{
|
||||||
// \todo si pays vendeur = soi-m<>me
|
if ($societe_vendeuse->id == $mysoc->id)
|
||||||
if (1 == 1)
|
|
||||||
{
|
{
|
||||||
print '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</div>';
|
print '<font class="error">'.$langs->trans("ErrorYourCountryIsNotDefined").'</div>';
|
||||||
}
|
}
|
||||||
@@ -1515,38 +1514,37 @@ class Form
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// \todo Ecraser defaulttx par valeur en fonction de la r<>gle de gestion TVA
|
// Recherche liste des codes TVA du pays vendeur
|
||||||
//$defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);
|
|
||||||
|
|
||||||
// \todo Initialiser code_pays avec code_pays soci<63>t<EFBFBD> vendeuse
|
|
||||||
$code_pays=$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
|
||||||
$sql = "SELECT t.taux,t.recuperableonly";
|
$sql = "SELECT t.taux,t.recuperableonly";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva AS t";
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva AS t";
|
||||||
$sql .= " WHERE t.fk_pays = '".$code_pays."'";
|
$sql .= " WHERE t.fk_pays = '".$societe_vendeuse->pays_code."'";
|
||||||
$sql .= " AND t.active = 1";
|
$sql .= " AND t.active = 1";
|
||||||
$sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC";
|
$sql .= " ORDER BY t.taux ASC, t.recuperableonly ASC";
|
||||||
|
|
||||||
if ($this->db->query($sql))
|
$resql=$this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows();
|
$num = $this->db->num_rows($resql);
|
||||||
for ($i = 0; $i < $num; $i++)
|
for ($i = 0; $i < $num; $i++)
|
||||||
{
|
{
|
||||||
$obj = $this->db->fetch_object();
|
$obj = $this->db->fetch_object($resql);
|
||||||
$txtva[ $i ] = $obj->taux;
|
$txtva[ $i ] = $obj->taux;
|
||||||
$libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':'');
|
$libtva[ $i ] = $obj->taux.'%'.($obj->recuperableonly ? ' *':'');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// D<>finition du taux <20> pr<70>s<EFBFBD>lectionner
|
||||||
|
if ($defaulttx == '') $defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$taux_produit);
|
||||||
// Si taux par defaut n'a pu etre trouv<75>, on prend dernier.
|
// Si taux par defaut n'a pu etre trouv<75>, on prend dernier.
|
||||||
// Comme ils sont tri<72>s par ordre croissant, dernier = plus <20>lev<65> = taux courant
|
// Comme ils sont tri<72>s par ordre croissant, dernier = plus <20>lev<65> = taux courant
|
||||||
if ($defaulttx == '') $defaulttx = $txtva[sizeof($txtva)-1];
|
if ($defaulttx == '') $defaulttx = $txtva[sizeof($txtva)-1];
|
||||||
|
|
||||||
$taille = sizeof($txtva);
|
$nbdetaux = sizeof($txtva);
|
||||||
|
|
||||||
print '<select class="flat" name="'.$name.'">';
|
print '<select class="flat" name="'.$name.'">';
|
||||||
if ($default) print '<option value="0">'.$langs->trans("Default").'</option>';
|
if ($default) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||||
|
|
||||||
for ($i = 0 ; $i < $taille ; $i++)
|
for ($i = 0 ; $i < $nbdetaux ; $i++)
|
||||||
{
|
{
|
||||||
print '<option value="'.$txtva[$i].'"';
|
print '<option value="'.$txtva[$i].'"';
|
||||||
if ($txtva[$i] == $defaulttx)
|
if ($txtva[$i] == $defaulttx)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ ErrorFileNotUploaded=Le fichier n'a pas
|
|||||||
ErrorInternalErrorDetected=Erreur interne d<>tect<63>e
|
ErrorInternalErrorDetected=Erreur interne d<>tect<63>e
|
||||||
ErrorNoRequestRan=Aucune requ<71>te ex<65>cut<75>e
|
ErrorNoRequestRan=Aucune requ<71>te ex<65>cut<75>e
|
||||||
ErrorWrongHostParameter=Mauvais param<61>tre Serveur
|
ErrorWrongHostParameter=Mauvais param<61>tre Serveur
|
||||||
ErrorYourCountryIsNotDefined=Votre pays n'est pas d<>fini. Aller dans Configuration-G<>n<EFBFBD>ral-Editer et resoumettez le formulaire.
|
ErrorYourCountryIsNotDefined=Votre pays n'est pas d<>fini. Corriger en allant dans Configuration-G<>n<EFBFBD>ral-Editer.
|
||||||
ErrorRecordIsUsedByChild=Impossible de supprimer cet enregistrement. Ce dernier est utilis<69> en tant que p<>re par au moins un enregistrement fils.
|
ErrorRecordIsUsedByChild=Impossible de supprimer cet enregistrement. Ce dernier est utilis<69> en tant que p<>re par au moins un enregistrement fils.
|
||||||
ErrorWrongValue=Valeur incorrecte
|
ErrorWrongValue=Valeur incorrecte
|
||||||
SeeAbove=Voir ci-dessus
|
SeeAbove=Voir ci-dessus
|
||||||
|
|||||||
@@ -1654,26 +1654,29 @@ function price2num($amount)
|
|||||||
*/
|
*/
|
||||||
function get_default_tva($societe_vendeuse='', $societe_acheteuse='', $taux_produit='')
|
function get_default_tva($societe_vendeuse='', $societe_acheteuse='', $taux_produit='')
|
||||||
{
|
{
|
||||||
$tva=$taux_produit;
|
// Si vendeur non assujeti <20> TVA
|
||||||
|
if (! $societe_vendeuse->tva_assuj) return 0;
|
||||||
|
|
||||||
// \todo fonction a ecrire
|
// Si le (pays vendeur = pays acheteur) alors la TVA par d<>faut=TVA du produit vendu. Fin de r<>gle.
|
||||||
|
if ($societe_vendeuse->pays_id == $societe_acheteuse->pays_id)
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
\brief Fonction qui calcule la tva
|
|
||||||
\param euros somme en euro
|
|
||||||
\param taux taux de tva
|
|
||||||
*/
|
|
||||||
function tva($euros, $taux=19.6)
|
|
||||||
{
|
{
|
||||||
$taux = $taux / 100 ;
|
return $taux_produit;
|
||||||
|
|
||||||
return sprintf("%01.2f",($euros * $taux));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Si vendeur et acheteur dans Communaut<75> europ<6F>enne et bien vendu = moyen de transports neuf (auto, bateau, avion), TVA par d<>faut=0 (La TVA doit <20>tre pay<61> par l'acheteur au centre d'impots de son pays et non au vendeur). Fin de r<>gle.
|
||||||
|
// Non g<>r<EFBFBD>
|
||||||
|
|
||||||
|
// Si vendeur et acheteur dans Communaut<75> europ<6F>enne et bien vendu autre que transport neuf alors la TVA par d<>faut=TVA du produit vendu. Fin de r<>gle.
|
||||||
|
if ($societe_vendeuse->isInEEC() && $societe_vendeuse->isInEEC())
|
||||||
|
{
|
||||||
|
return $taux_produit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sinon la TVA propos<6F>e par d<>faut=0. Fin de r<>gle.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Renvoie oui ou non dans la langue choisie
|
\brief Renvoie oui ou non dans la langue choisie
|
||||||
\param yesno variable pour test si oui ou non
|
\param yesno variable pour test si oui ou non
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
@@ -465,12 +465,12 @@ $mysoc->siren=$conf->global->MAIN_INFO_SIREN;
|
|||||||
$mysoc->siret=$conf->global->MAIN_INFO_SIRET;
|
$mysoc->siret=$conf->global->MAIN_INFO_SIRET;
|
||||||
$mysoc->ape=$conf->global->MAIN_INFO_APE;
|
$mysoc->ape=$conf->global->MAIN_INFO_APE;
|
||||||
$mysoc->rcs=$conf->global->MAIN_INFO_RCS;
|
$mysoc->rcs=$conf->global->MAIN_INFO_RCS;
|
||||||
$mysoc->tvaintra=$conf->global->MAIN_INFO_TVAINTRA;
|
$mysoc->tva_assuj=$conf->global->FACTURE_TVAOPTION;
|
||||||
|
$mysoc->tva_intra=$conf->global->MAIN_INFO_TVAINTRA;
|
||||||
$mysoc->capital=$conf->global->MAIN_INFO_CAPITAL;
|
$mysoc->capital=$conf->global->MAIN_INFO_CAPITAL;
|
||||||
$mysoc->forme_juridique_code=$conf->global->MAIN_INFO_FORME_JURIDIQUE;
|
$mysoc->forme_juridique_code=$conf->global->MAIN_INFO_FORME_JURIDIQUE;
|
||||||
$mysoc->email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
|
$mysoc->email=$conf->global->MAIN_INFO_SOCIETE_MAIL;
|
||||||
|
|
||||||
|
|
||||||
/* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de d<>sactiver la fonction TVA
|
/* \todo Ajouter une option Gestion de la TVA dans le module compta qui permet de d<>sactiver la fonction TVA
|
||||||
* (pour particuliers ou lib<69>raux en franchise)
|
* (pour particuliers ou lib<69>raux en franchise)
|
||||||
* En attendant, valeur forc<72>e <20> 1
|
* En attendant, valeur forc<72>e <20> 1
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<tr><td>'.$langs->trans("VATRate").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("VATRate").'</td><td colspan="2">';
|
||||||
print $html->select_tva("tva_tx", $product->tva_tx, $mysoc, '');
|
print $html->select_tva("tva_tx", $product->tva_tx, $mysoc, '', $product->tva_tx);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
|
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="2">';
|
||||||
print '<select class="flat" name="statut">';
|
print '<select class="flat" name="statut">';
|
||||||
|
|||||||
@@ -106,15 +106,17 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
|
|||||||
$soc->codeclient_modifiable = $_POST["codeclient_modifiable"];
|
$soc->codeclient_modifiable = $_POST["codeclient_modifiable"];
|
||||||
$soc->codefournisseur_modifiable = $_POST["codefournisseur_modifiable"];
|
$soc->codefournisseur_modifiable = $_POST["codefournisseur_modifiable"];
|
||||||
$soc->capital = $_POST["capital"];
|
$soc->capital = $_POST["capital"];
|
||||||
|
|
||||||
|
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||||
$soc->tva_intra_code = $_POST["tva_intra_code"];
|
$soc->tva_intra_code = $_POST["tva_intra_code"];
|
||||||
$soc->tva_intra_num = $_POST["tva_intra_num"];
|
$soc->tva_intra_num = $_POST["tva_intra_num"];
|
||||||
$soc->tva_intra = $_POST["tva_intra_code"] . $_POST["tva_intra_num"];
|
$soc->tva_intra = $_POST["tva_intra_code"] . $_POST["tva_intra_num"];
|
||||||
|
|
||||||
$soc->forme_juridique_code = $_POST["forme_juridique_code"];
|
$soc->forme_juridique_code = $_POST["forme_juridique_code"];
|
||||||
$soc->effectif_id = $_POST["effectif_id"];
|
$soc->effectif_id = $_POST["effectif_id"];
|
||||||
$soc->typent_id = $_POST["typent_id"];
|
$soc->typent_id = $_POST["typent_id"];
|
||||||
$soc->client = $_POST["client"];
|
$soc->client = $_POST["client"];
|
||||||
$soc->fournisseur = $_POST["fournisseur"];
|
$soc->fournisseur = $_POST["fournisseur"];
|
||||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
|
||||||
|
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
{
|
{
|
||||||
@@ -214,9 +216,10 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
|
|||||||
$soc->ape=$_POST["ape"];
|
$soc->ape=$_POST["ape"];
|
||||||
$soc->typent_id=$_POST["typent_id"];
|
$soc->typent_id=$_POST["typent_id"];
|
||||||
$soc->effectif_id=$_POST["effectif_id"];
|
$soc->effectif_id=$_POST["effectif_id"];
|
||||||
|
|
||||||
|
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||||
$soc->tva_intra_code=$_POST["tva_intra_code"];
|
$soc->tva_intra_code=$_POST["tva_intra_code"];
|
||||||
$soc->tva_intra_num=$_POST["tva_intra_num"];
|
$soc->tva_intra_num=$_POST["tva_intra_num"];
|
||||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// On positionne pays_id, pays_code et libelle du pays choisi
|
// On positionne pays_id, pays_code et libelle du pays choisi
|
||||||
@@ -368,15 +371,13 @@ if ($_GET["action"] == 'create' || $_POST["action"] == 'create')
|
|||||||
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
|
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
|
||||||
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
|
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// assuj TVA
|
|
||||||
if($conf->facture->enabled)
|
|
||||||
{
|
// Assujeti TVA
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
|
||||||
$html->select_assujetti_tva("1",'assujtva_value');
|
$html->select_assujetti_tva("1",'assujtva_value'); // Assujeti par d<>faut
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr><td colspan="4" align="center">';
|
print '<tr><td colspan="4" align="center">';
|
||||||
@@ -426,9 +427,10 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||||||
$soc->ape=$_POST["ape"];
|
$soc->ape=$_POST["ape"];
|
||||||
$soc->typent_id=$_POST["typent_id"];
|
$soc->typent_id=$_POST["typent_id"];
|
||||||
$soc->effectif_id=$_POST["effectif_id"];
|
$soc->effectif_id=$_POST["effectif_id"];
|
||||||
|
|
||||||
|
$soc->tva_assuj = $_POST["assujtva_value"];
|
||||||
$soc->tva_intra_code=$_POST["tva_intra_code"];
|
$soc->tva_intra_code=$_POST["tva_intra_code"];
|
||||||
$soc->tva_intra_num=$_POST["tva_intra_num"];
|
$soc->tva_intra_num=$_POST["tva_intra_num"];
|
||||||
$soc->tva_assuj = $_POST["assujtva_value"];
|
|
||||||
|
|
||||||
// On positionne pays_id, pays_code et libelle du pays choisi
|
// On positionne pays_id, pays_code et libelle du pays choisi
|
||||||
if ($soc->pays_id)
|
if ($soc->pays_id)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
|
||||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||||
@@ -36,7 +36,8 @@
|
|||||||
\brief Classe permettant la gestion des societes
|
\brief Classe permettant la gestion des societes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Societe {
|
class Societe
|
||||||
|
{
|
||||||
var $db;
|
var $db;
|
||||||
|
|
||||||
var $id;
|
var $id;
|
||||||
@@ -56,7 +57,9 @@ class Societe {
|
|||||||
|
|
||||||
var $prefix_comm;
|
var $prefix_comm;
|
||||||
|
|
||||||
|
var $tva_assuj;
|
||||||
var $tva_intra;
|
var $tva_intra;
|
||||||
|
|
||||||
var $capital;
|
var $capital;
|
||||||
var $typent_id;
|
var $typent_id;
|
||||||
var $effectif_id;
|
var $effectif_id;
|
||||||
@@ -278,11 +281,13 @@ class Societe {
|
|||||||
$this->siret=trim($this->siret);
|
$this->siret=trim($this->siret);
|
||||||
$this->ape=trim($this->ape);
|
$this->ape=trim($this->ape);
|
||||||
$this->prefix_comm=trim($this->prefix_comm);
|
$this->prefix_comm=trim($this->prefix_comm);
|
||||||
|
|
||||||
|
$this->tva_assuj=trim($this->tva_assuj);
|
||||||
$this->tva_intra=trim($this->tva_intra);
|
$this->tva_intra=trim($this->tva_intra);
|
||||||
|
|
||||||
$this->capital=trim($this->capital);
|
$this->capital=trim($this->capital);
|
||||||
$this->effectif_id=trim($this->effectif_id);
|
$this->effectif_id=trim($this->effectif_id);
|
||||||
$this->forme_juridique_code=trim($this->forme_juridique_code);
|
$this->forme_juridique_code=trim($this->forme_juridique_code);
|
||||||
$this->tva_assuj=trim($this->tva_assuj);
|
|
||||||
|
|
||||||
$result = $this->verify(); // Verifie que nom obligatoire et code client ok et unique
|
$result = $this->verify(); // Verifie que nom obligatoire et code client ok et unique
|
||||||
|
|
||||||
@@ -322,7 +327,9 @@ class Societe {
|
|||||||
$sql .= ",siret = '". addslashes($this->siret) ."'";
|
$sql .= ",siret = '". addslashes($this->siret) ."'";
|
||||||
$sql .= ",ape = '". addslashes($this->ape) ."'";
|
$sql .= ",ape = '". addslashes($this->ape) ."'";
|
||||||
|
|
||||||
|
$sql .= ",tva_assuj = ".($this->tva_assuj>=0?"'".$this->tva_assuj."'":"null");
|
||||||
$sql .= ",tva_intra = '" . addslashes($this->tva_intra) ."'";
|
$sql .= ",tva_intra = '" . addslashes($this->tva_intra) ."'";
|
||||||
|
|
||||||
$sql .= ",capital = '" . addslashes($this->capital) ."'";
|
$sql .= ",capital = '" . addslashes($this->capital) ."'";
|
||||||
|
|
||||||
$sql .= ",prefix_comm = ".($this->prefix_comm?"'".addslashes($this->prefix_comm)."'":"null");
|
$sql .= ",prefix_comm = ".($this->prefix_comm?"'".addslashes($this->prefix_comm)."'":"null");
|
||||||
@@ -335,7 +342,6 @@ class Societe {
|
|||||||
|
|
||||||
$sql .= ",client = " . $this->client;
|
$sql .= ",client = " . $this->client;
|
||||||
$sql .= ",fournisseur = " . $this->fournisseur;
|
$sql .= ",fournisseur = " . $this->fournisseur;
|
||||||
$sql .= ",tva_assuj = ".($this->tva_assuj>=0?"'".$this->tva_assuj."'":"null");
|
|
||||||
|
|
||||||
if ($this->creation_bit || $this->codeclient_modifiable)
|
if ($this->creation_bit || $this->codeclient_modifiable)
|
||||||
{
|
{
|
||||||
@@ -510,6 +516,7 @@ class Societe {
|
|||||||
$this->code_compta = $obj->code_compta;
|
$this->code_compta = $obj->code_compta;
|
||||||
$this->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
$this->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||||
|
|
||||||
|
$this->tva_assuj = $obj->tva_assuj;
|
||||||
$this->tva_intra = $obj->tva_intra;
|
$this->tva_intra = $obj->tva_intra;
|
||||||
$this->tva_intra_code = substr($obj->tva_intra,0,2);
|
$this->tva_intra_code = substr($obj->tva_intra,0,2);
|
||||||
$this->tva_intra_num = substr($obj->tva_intra,2);
|
$this->tva_intra_num = substr($obj->tva_intra,2);
|
||||||
@@ -528,7 +535,6 @@ class Societe {
|
|||||||
$this->remise_client = $obj->remise_client;
|
$this->remise_client = $obj->remise_client;
|
||||||
$this->mode_reglement = $obj->mode_reglement;
|
$this->mode_reglement = $obj->mode_reglement;
|
||||||
$this->cond_reglement = $obj->cond_reglement;
|
$this->cond_reglement = $obj->cond_reglement;
|
||||||
$this->tva_assuj = $obj->tva_assuj;
|
|
||||||
$this->client = $obj->client;
|
$this->client = $obj->client;
|
||||||
$this->fournisseur = $obj->fournisseur;
|
$this->fournisseur = $obj->fournisseur;
|
||||||
|
|
||||||
@@ -1486,6 +1492,18 @@ function set_price_level($price_level, $user)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \brief Renvoi si pays appartient <20> CEE
|
||||||
|
* \param boolean true = pays dans CEE, false, pays hors CEE
|
||||||
|
*/
|
||||||
|
function isInEEC()
|
||||||
|
{
|
||||||
|
// \todo liste pays <20> compl<70>ter
|
||||||
|
$country_code_in_EEC=array('BE','FR','LU');
|
||||||
|
//print "dd".$this->pays_code;
|
||||||
|
return in_array($this->pays_code,$country_code_in_EEC);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user