New: Les actions sont dcrites par une date de creation, debut, fin et modif au lie d'une seule date

Fix: bug #15605
This commit is contained in:
Laurent Destailleur 2006-02-25 00:38:31 +00:00
parent a3b520b819
commit fa94aef0e5
11 changed files with 233 additions and 109 deletions

View File

@ -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-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* $Id$
* $Source$
@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
@ -42,7 +41,10 @@ class ActionComm
var $type_code;
var $type;
var $label;
var $date;
var $datec; // Date creation enregistrement
var $datep; // Date action 0%
var $date; // Date action 100% (datea)
var $datem; // Date modif (tms)
var $priority;
var $user;
var $author;
@ -82,10 +84,14 @@ class ActionComm
if (! $this->priority) $this->priority = 0;
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm";
$sql.= "(datea,fk_action,fk_soc,note,fk_contact,fk_user_author,fk_user_action,label,percent,priority,";
$sql.= "(datec,";
$sql.= "datep,";
if ($this->percent == 100) $sql.= "datea,";
$sql.= "fk_action,fk_soc,note,fk_contact,fk_user_author,fk_user_action,label,percent,priority,";
$sql.= "fk_facture,propalrowid)";
$sql.= " VALUES (";
$sql.= " VALUES (now,";
$sql.= "'".$this->db->idate($this->date)."',";
if ($this->percent == 100) $sql.= "'".$this->db->idate($this->date)."',";
$sql.= "'".$this->type_id."', '".$this->societe->id."' ,'".addslashes($this->note)."',";
$sql.= ($this->contact->id?$this->contact->id:"null").",";
$sql.= "'$author->id', '".$this->user->id ."', '".addslashes($this->label)."','".$this->percent."','".$this->priority."',";
@ -182,25 +188,31 @@ class ActionComm
}
}
/**
* \brief Met a jour l'action en base
* \return int <0 si ko, >0 si ok
*/
/**
* \brief Met a jour l'action en base.
* Si percent = 100, on met a jour date 100%
* \return int <0 si ko, >0 si ok
*/
function update()
{
if ($this->percent > 100) $this->percent = 100;
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql.= " SET percent='".$this->percent."'";
if ($this->percent == 100) $sql .= ", datea = now()";
if ($this->note) $sql .= ", note = '".addslashes($this->note)."'";
$sql.= ", fk_contact =". $this->contact->id;
if ($this->percent == 100) $sql.= ", datea = now()";
if ($this->note) $sql.= ", note = '".addslashes($this->note)."'";
if ($this->contact->id) $sql.= ", fk_contact =". $this->contact->id;
$sql.= " WHERE id=$this->id;";
if ($this->db->query($sql) )
if ($this->db->query($sql))
{
return 1;
}
else
{
$this->error=$this->db->error();
return -1;
}
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-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) 2005 Simon TOSSER <simon@kornog-computing.com>
*
* This program is free software; you can redistribute it and/or modify

View File

@ -33,6 +33,12 @@ require_once("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="a.datea";
// Sécurité accés client
if ($user->societe_id > 0)
{
@ -64,18 +70,6 @@ llxHeader();
* Liste
*/
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
if ($sortorder == "")
{
$sortorder="DESC";
}
if ($sortfield == "")
{
$sortfield="a.datea";
}
$sql = "SELECT count(*) as cc, date_format(a.datea, '%m/%Y') as df";
$sql .= ", date_format(a.datea, '%m') as month";
$sql .= ", date_format(a.datea, '%Y') as year";

View File

@ -96,7 +96,7 @@ class CommActionRapport
*/
function _cover(&$pdf)
{
global $user;
global $user,$conf;
$pdf->AddPage();
$pdf->SetAutoPageBreak(false);
@ -112,11 +112,11 @@ class CommActionRapport
$pdf->SetFont('Arial','B',18);
$pdf->MultiCell(190, 15, $user->fullname, 0, 'C');
$pdf->SetFont('Arial','B',16);
$pdf->MultiCell(190, 15, "Tél : +33 (0) 6 13 79 63 41", 0, 'C');
$pdf->MultiCell(190, 15, $conf->global->SOCIETE_TEL, 0, 'C');
$pdf->SetFont('Arial','',10);
$pdf->SetXY (10, 277);
$pdf->MultiCell(190, 10, "http://www.lafrere.com/", 1, 'C', 1);
$pdf->MultiCell(190, 10, $conf->global->SOCIETE_WEB, 1, 'C', 1);
$pdf->Rect(10, 10, 190, 277);
return 1;

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2001-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) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
*
* 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
@ -41,6 +41,7 @@ require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
$langs->load("companies");
$langs->load("orders");
$langs->load("bills");
$langs->load("contracts");
if ($conf->fichinter->enabled) $langs->load("interventions");
@ -300,6 +301,29 @@ if ($_socid > 0)
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$objsoc->typent.'</td><td>'.$langs->trans("Staff").'</td><td nowrap>'.$objsoc->effectif.'</td></tr>';
}
// soumis à TVA ou pas
print '<tr>';
/* print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('VATIsUsed');
print '<td>';
if ($_GET['action'] != 'editassujtva') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editassujtva&amp;socid='.$objsoc->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editassujtva')
{
$html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'assujtva_value');
}
else
{
$html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'none');
}
print "</td>";
*/
print '<td nowrap="nowrap">'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
print yn($objsoc->tva_assuj);
print '</td>';
print '</tr>';
// Remise permanente
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
@ -388,24 +412,6 @@ if ($_socid > 0)
}
print "</td>";
print '</tr>';
// soumis à TVA ou pas
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans('VATIsUsed');
print '<td>';
if ($_GET['action'] != 'editassujtva') print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editassujtva&amp;socid='.$objsoc->id.'">'.img_edit($langs->trans('SetMode'),1).'</a></td>';
print '</tr></table>';
print '</td><td colspan="3">';
if ($_GET['action'] == 'editassujtva')
{
$html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'assujtva_value');
}
else
{
$html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'none');
}
print "</td>";
print '</tr>';
}
print "</table>";
@ -790,7 +796,7 @@ if ($_socid > 0)
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $objsoc->id ";
$sql .= " WHERE a.fk_soc = ".$objsoc->id;
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action AND a.percent < 100";
$sql .= " ORDER BY a.datea DESC, a.id DESC";
@ -835,6 +841,10 @@ if ($_socid > 0)
{
print "<td>".img_warning("Late")."</td>";
}
else
{
print '<td>&nbsp;</td>';
}
// Status/Percent
print '<td width="30">&nbsp;</td>';
@ -887,7 +897,7 @@ if ($_socid > 0)
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $objsoc->id ";
$sql .= " WHERE a.fk_soc = ".$objsoc->id;
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action AND a.percent = 100";
$sql .= " ORDER BY a.datea DESC, a.id DESC";
@ -930,10 +940,7 @@ if ($_socid > 0)
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
if (date("U",$obj->da) < time())
{
print "<td> </td>";
}
print "<td>&nbsp;</td>";
// Statut/Percent
print '<td width="30">&nbsp;</td>';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2004 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>
*
* 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
@ -522,6 +522,109 @@ if ($socid > 0)
$i++;
$tag = !$tag;
}
print "</table>";
print "<br>";
/*
* Listes des actions a faire
*
*/
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre"><td colspan="9"><a href="action/index.php?socid='.$societe->id.'">'.$langs->trans("ActionsToDo").'</a></td><td align="right">&nbsp;</td></tr>';
$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = ".$societe->id;
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action AND a.percent < 100";
$sql .= " ORDER BY a.datea DESC, a.id DESC";
$result=$db->query($sql);
if ($result)
{
$i = 0 ;
$num = $db->num_rows($result);
$var=true;
while ($i < $num)
{
$var = !$var;
$obj = $db->fetch_object($result);
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) )
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">'.strftime("%Y",$obj->da)."</td>\n";
$oldyear = strftime("%Y",$obj->da);
}
if ($oldmonth == strftime("%Y%b",$obj->da) )
{
print '<td width="30" align="center">|</td>';
}
else
{
print '<td width="30" align="center">' .strftime("%b",$obj->da)."</td>\n";
$oldmonth = strftime("%Y%b",$obj->da);
}
print '<td width="20">'.strftime("%d",$obj->da)."</td>\n";
print '<td width="30">'.strftime("%H:%M",$obj->da)."</td>\n";
if (date("U",$obj->da) < time())
{
print "<td>".img_warning("Late")."</td>";
}
else
{
print '<td>&nbsp;</td>';
}
// Status/Percent
print '<td width="30">&nbsp;</td>';
if ($obj->propalrowid)
{
print '<td><a href="propal.php?propalid='.$obj->propalrowid.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
else
{
print '<td><a href="action/fiche.php?id='.$obj->id.'">'.img_object($langs->trans("ShowAction"),"task");
$transcode=$langs->trans("Action".$obj->acode);
$libelle=($transcode!="Action".$obj->acode?$transcode:$obj->libelle);
print $libelle;
print '</a></td>';
}
print "<td>$obj->label</td>";
// Contact pour cette action
if ($obj->fk_contact) {
$contact = new Contact($db);
$contact->fetch($obj->fk_contact);
print '<td><a href="'.DOL_URL_ROOT.'/contact/fiche.php?id='.$contact->id.'">'.img_object($langs->trans("ShowContact"),"contact").' '.$contact->fullname.'</a></td>';
} else {
print '<td>&nbsp;</td>';
}
print '<td width="50"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->fk_user_author.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.'</a></td>';
print "</tr>\n";
$i++;
}
print "</table>";
$db->free($result);
} else {
dolibarr_print_error($db);
}
print "</table><br>";
/*
@ -532,9 +635,9 @@ if ($socid > 0)
$sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.code, u.rowid ";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u ";
$sql .= " WHERE a.fk_soc = $societe->id ";
$sql .= " WHERE a.fk_soc = ".$societe->id;
$sql .= " AND u.rowid = a.fk_user_author";
$sql .= " AND c.id=a.fk_action ";
$sql .= " AND c.id=a.fk_action AND a.percent = 100";
$sql .= " ORDER BY a.datea DESC, a.id DESC";
$result=$db->query($sql);

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2006 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
@ -21,21 +21,21 @@
*/
/**
\defgroup mailing Module mailing
\brief Module pour gérer les mailings
\defgroup mailing Module mailing
\brief Module pour gérer les mailings
*/
/**
\file htdocs/includes/modules/modMailing.class.php
\ingroup mailing
\brief Fichier de description et activation du module Mailing
\file htdocs/includes/modules/modMailing.class.php
\ingroup mailing
\brief Fichier de description et activation du module Mailing
*/
include_once "DolibarrModules.class.php";
/**
\class modMailing
\brief Classe de description et activation du module Mailing
\class modMailing
\brief Classe de description et activation du module Mailing
*/
class modMailing extends DolibarrModules
@ -65,6 +65,10 @@ class modMailing extends DolibarrModules
// Dépendances
$this->depends = array();
$this->requiredby = array();
$this->langfiles = array("mails");
// Config pages
$this->config_page_url = "mailing.php";
// Constantes
$this->const = array();

View File

@ -102,7 +102,8 @@ Capital=Capital
CapitalOf=Capital of %s
EditCompany=Edit company
ThisUserIsNot=This user is not a prospect, customer nor supplier
VATIntraCheckableOnEUSite=Intracomunnautary VAT can be checked on European commision <a href="http://europa.eu.int/comm/taxation_customs/vies/en/vieshome.htm" target="_blank">site</a>
VATIntraCheckURL=http://europa.eu.int/comm/taxation_customs/vies/fr/vieshome.htm
VATIntraCheckableOnEUSite=Check Intracomunnautary VAT on European commision site
NorProspectNorCustomer=Nor prospect, nor customer
JuridicalStatus=Juridical status
Staff=Staff

View File

@ -102,7 +102,8 @@ Capital=Capital
CapitalOf=Capital de %s
EditCompany=Modification société
ThisUserIsNot=Cet utilisateur n'est ni un prospect, ni un client, ni un fournisseur
VATIntraCheckableOnEUSite=(Vérifiable sur le <a href="http://europa.eu.int/comm/taxation_customs/vies/fr/vieshome.htm" target="_blank">site</a> de la Commission Européenne)
VATIntraCheckURL=http://europa.eu.int/comm/taxation_customs/vies/fr/vieshome.htm
VATIntraCheckableOnEUSite=Vérifier sur le site de la Commission Européenne
NorProspectNorCustomer=Ni client, ni prospect
JuridicalStatus=Forme juridique
Staff=Effectif

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Regis Houssin <regis.houssin@cap-networks.com>
*
@ -34,6 +34,7 @@ require("pre.inc.php");
$user->getrights('societe');
$langs->load("companies");
$langs->load("commercial");
$langs->load("bills");
if (! $user->rights->societe->creer)
{
@ -58,12 +59,14 @@ $soc = new Societe($db);
/*
* Actions
*/
// assujétissement à la TVA
if ($_POST["action"] == 'setassujtva')
{
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET tva_assuj='".$_POST['assujtva_value']."' WHERE idp='".$socid."'";
$result = $db->query($sql);
}
if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
{
$soc->nom = $_POST["nom"];
@ -92,7 +95,7 @@ if ($_POST["action"] == 'add' || $_POST["action"] == 'update')
$soc->typent_id = $_POST["typent_id"];
$soc->client = $_POST["client"];
$soc->fournisseur = $_POST["fournisseur"];
$soc->tva_assuj = $_POST["assujtva_value"];
$soc->tva_assuj = $_POST["assujtva_value"];
if ($_POST["action"] == 'update')
{
@ -444,7 +447,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<tr><td>'.$langs->trans('Name').'</td><td colspan="3"><input type="text" size="40" name="nom" value="'.$soc->nom.'"></td></tr>';
print '<td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print '<tr><td>'.$langs->trans("Prefix").'</td><td colspan="3">';
print '<input type="text" size="5" name="prefix_comm" value="'.$soc->prefix_comm.'">';
print '</td>';
@ -548,10 +551,15 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
else print '<td>&nbsp;</td><td>&nbsp;</td>';
print '</tr>';
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">';
// Assujeti TVA
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td>';
$form->select_assujetti_tva($soc->tva_assuj,'assujtva_value');
print '</td>';
print '<td nowrap="nowrap">'.$langs->trans('VATIntraShort').'</td><td>';
print '<input type="text" name="tva_intra_code" size="3" maxlength="2" value="'.$soc->tva_intra_code.'">';
print '<input type="text" name="tva_intra_num" size="18" maxlength="18" value="'.$soc->tva_intra_num.'">';
print ' '.$langs->trans("VATIntraCheckableOnEUSite");
print ' <a href="'.$langs->transcountry("VATIntraCheckURL",$soc->id_pays).'" target="_blank" alt="'.$langs->trans("VATIntraCheckableOnEUSite").'">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
print '</td></tr>';
print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$soc->capital.'"> '.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
@ -566,13 +574,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<td>'.$langs->trans("Staff").'</td><td>';
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
print '</td></tr>';
// assuj TVA
if($conf->facture->enabled)
{
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td colspan="3">';
$form->select_assujetti_tva($soc->tva_assuj,'assujtva_value');
print '</td></tr>'."\n";
}
print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
print '</table>';
@ -762,8 +764,33 @@ else
}
else print '<td>&nbsp;</td><td>&nbsp;</td></tr>';
// TVA
print '<tr><td nowrap>'.$langs->trans('VATIntraShort').'</td><td colspan="3">';
// Assujeti TVA
$html = new Form($db);
print '<tr><td>';
/* Pas besoin de gérer l'icone "Modifier" car le champ est déja editable quand société en mode "Edit"
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('VATIsUsed');
print '<td><td align="right">';
if ($user->rights->societe->creer && $_GET['action'] != 'editassujtva')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editassujtva&amp;socid='.$soc->id.'">'.img_edit($langs->trans('SetMode')).'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
if($_GET['action'] == 'editassujtva')
print $html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$soc->id,$soc->tva_assuj,'assujtva_value');
else if($soc->tva_assuj == 1)
print 'oui';
else
print 'non';
print '';
*/
print $langs->trans('VATIsUsed');
print '</td><td>';
print yn($soc->tva_assuj);
print '</td>';
print '<td nowrap="nowrpa">'.$langs->trans('VATIntraShort').'</td><td colspan="3">';
print $soc->tva_intra;
print '</td></tr>';
@ -843,31 +870,6 @@ else
dolibarr_print_error($db);
}
print '</td></tr>';
// assuj TVA
if($conf->facture->enabled)
{
$html = new Form($db);
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('VATIsUsed');
print '<td><td align="right">';
if ($user->rights->societe->creer && $_GET['action'] != 'editassujtva')
print '<a href="'.$_SERVER["PHP_SELF"].'?action=editassujtva&amp;socid='.$soc->id.'">'.img_edit($langs->trans('SetMode')).'</a>';
else
print '&nbsp;';
print '</td></tr></table>';
print '</td>';
print '<td colspan="3">';
if($_GET['action'] == 'editassujtva')
print $html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$soc->id,$soc->tva_assuj,'assujtva_value');
else if($soc->tva_assuj == 1)
print 'oui';
else
print 'non';
print '';
print '</td></tr>';
}
print '</table>';
print "</div>\n";

View File

@ -326,7 +326,7 @@ class Societe {
$sql .= ",client = " . $this->client;
$sql .= ",fournisseur = " . $this->fournisseur;
$sql .= ",tva_assuj = " . $this->tva_assuj;
$sql .= ",tva_assuj = ".($this->tva_assuj>=0?"'".$this->tva_assuj."'":"null");
if ($this->creation_bit || $this->codeclient_modifiable)
{