mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New: Can link trips and expenses to a project.
This commit is contained in:
parent
0314cd72ac
commit
435922ae37
|
|
@ -3,6 +3,8 @@ English Dolibarr ChangeLog
|
|||
***** ChangeLog for 2.9 compared to 2.8 *****
|
||||
|
||||
For users:
|
||||
- New: Can link trips and fees to a project.
|
||||
- New: Add civility title in foundation module.
|
||||
- New: Can set accountancy code for product (buy and sell).
|
||||
- New: Can filter third parties lists on categories.
|
||||
- New: Can filter products and services lists on categories.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ class Deplacement extends CommonObject
|
|||
var $note;
|
||||
var $note_public;
|
||||
var $socid;
|
||||
|
||||
var $statut=1; // 0=draft, 1=validated
|
||||
var $fk_project;
|
||||
|
||||
/**
|
||||
* \brief Constructeur de la classe
|
||||
|
|
@ -95,14 +96,18 @@ class Deplacement extends CommonObject
|
|||
$sql.= ", type";
|
||||
$sql.= ", note";
|
||||
$sql.= ", note_public";
|
||||
$sql.= ", fk_projet";
|
||||
$sql.= ", fk_soc";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->db->idate(mktime());
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", ".$this->fk_user;
|
||||
$sql.= ", '".$this->type."'";
|
||||
$sql.= ", note = ".($this->note?"'".addslashes($this->note)."'":"null");
|
||||
$sql.= ", note_public = ".($this->note_public?"'".addslashes($this->note_public)."'":"null");
|
||||
$sql.= ", ".($this->note?"'".addslashes($this->note)."'":"null");
|
||||
$sql.= ", ".($this->note_public?"'".addslashes($this->note_public)."'":"null");
|
||||
$sql.= ", ".($this->fk_project > 0? $this->fk_project : 0);
|
||||
$sql.= ", ".($this->fk_soc > 0? $this->fk_soc : "null");
|
||||
$sql.= ")";
|
||||
|
||||
dol_syslog("Deplacement::create sql=".$sql, LOG_DEBUG);
|
||||
|
|
@ -154,6 +159,8 @@ class Deplacement extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."deplacement ";
|
||||
$sql .= " SET km = ".$this->km; // This is a distance or amount
|
||||
$sql .= " , dated = '".$this->db->idate($this->date)."'";
|
||||
|
|
@ -162,17 +169,20 @@ class Deplacement extends CommonObject
|
|||
$sql .= " , fk_soc = ".($this->socid > 0?$this->socid:'null');
|
||||
$sql .= " , note = ".($this->note?"'".addslashes($this->note)."'":"null");
|
||||
$sql .= " , note_public = ".($this->note_public?"'".addslashes($this->note_public)."'":"null");
|
||||
$sql .= " , fk_projet = ".($this->fk_project>0?$this->fk_project:0);
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("Deplacement::update sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
$this->error=$this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -182,7 +192,7 @@ class Deplacement extends CommonObject
|
|||
*/
|
||||
function fetch($id)
|
||||
{
|
||||
$sql = "SELECT rowid, fk_user, type, km, fk_soc, dated, note, note_public";
|
||||
$sql = "SELECT rowid, fk_user, type, km, fk_soc, dated, note, note_public, fk_projet";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
|
||||
$sql.= " WHERE rowid = ".$id;
|
||||
|
||||
|
|
@ -192,15 +202,16 @@ class Deplacement extends CommonObject
|
|||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->date = $this->db->jdate($obj->dated);
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->km = $obj->km;
|
||||
$this->type = $obj->type;
|
||||
$this->note = $obj->note;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->date = $this->db->jdate($obj->dated);
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->socid = $obj->fk_soc;
|
||||
$this->km = $obj->km;
|
||||
$this->type = $obj->type;
|
||||
$this->note = $obj->note;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->fk_project = $obj->fk_projet;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -231,6 +242,81 @@ class Deplacement extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Retourne le libelle du statut
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Libelle
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
{
|
||||
return $this->LibStatut($this->statut,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le libelle d'un statut donne
|
||||
* \param statut id statut
|
||||
* \param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* \return string Libelle
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
|
||||
}
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
|
||||
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Return clicable name (with picto eventually)
|
||||
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
|
||||
* \return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
|
||||
$lien = '<a href="'.DOL_URL_ROOT.'/deplacement/fiche.php?id='.$this->id.'">';
|
||||
$lienfin='</a>';
|
||||
|
||||
$picto='trip';
|
||||
|
||||
$label=$langs->trans("Show").': '.$this->ref;
|
||||
|
||||
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@
|
|||
* \version $Id$
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/lib/project.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/projet/project.class.php");
|
||||
}
|
||||
|
||||
$langs->load("trips");
|
||||
|
||||
|
|
@ -152,6 +158,16 @@ if ($_POST["action"] == 'update' && $user->rights->deplacement->creer)
|
|||
}
|
||||
}
|
||||
|
||||
// Set into a project
|
||||
if ($_POST['action'] == 'classin')
|
||||
{
|
||||
$trip = new Deplacement($db);
|
||||
$trip->fetch($_GET['id']);
|
||||
$result=$trip->setProject($_POST['projectid']);
|
||||
if ($result < 0) dol_print_error($db,$trip->error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
|
|
@ -170,6 +186,11 @@ if ($_GET["action"] == 'create')
|
|||
|
||||
if ($mesg) print $mesg."<br>";
|
||||
|
||||
$datec = dol_mktime(12, 0, 0,
|
||||
$_POST["remonth"],
|
||||
$_POST["reday"],
|
||||
$_POST["reyear"]);
|
||||
|
||||
print "<form name='add' action=\"fiche.php\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
|
@ -178,25 +199,25 @@ if ($_GET["action"] == 'create')
|
|||
|
||||
print "<tr>";
|
||||
print '<td width="25%" class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
print $html->select_type_fees($_GET["type"],'type',1);
|
||||
print $html->select_type_fees($_POST["type"]?$_POST["type"]:$_GET["type"],'type',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
|
||||
print $html->select_users($_GET["fk_user"],'fk_user',1);
|
||||
print $html->select_users($_POST["fk_user"]?$_POST["fk_user"]:$_GET["fk_user"],'fk_user',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print $html->select_date('','','','','','add');
|
||||
print $html->select_date($datec,'','','','','add');
|
||||
print '</td></tr>';
|
||||
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
|
||||
print $html->select_societes($_GET["socid"],'socid','',1);
|
||||
print $html->select_societes($_POST["socid"]?$_POST["socid"]:$_GET["socid"],'socid','',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value=""></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" size="10" value="'.($_POST["km"]?$_POST["km"]:'').'"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input class="button" type="submit" value="'.$langs->trans("Save").'"> ';
|
||||
|
|
@ -210,9 +231,8 @@ else
|
|||
{
|
||||
$deplacement = new Deplacement($db);
|
||||
$result = $deplacement->fetch($id);
|
||||
if ($result)
|
||||
if ($result > 0)
|
||||
{
|
||||
|
||||
if ($mesg) print $mesg."<br>";
|
||||
|
||||
$h=0;
|
||||
|
|
@ -232,8 +252,10 @@ else
|
|||
if ($_GET["action"] == 'edit')
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($deplacement->socid);
|
||||
|
||||
if ($deplacement->socid)
|
||||
{
|
||||
$soc->fetch($deplacement->socid);
|
||||
}
|
||||
|
||||
print "<form name='update' action=\"fiche.php\" method=\"post\">\n";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
|
@ -242,31 +264,36 @@ else
|
|||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||
print $deplacement->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print "<tr>";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
|
||||
print $html->select_type_fees($deplacement->type,'type',0);
|
||||
print $html->select_type_fees($_POST["type"]?$_POST["type"]:$deplacement->type,'type',0);
|
||||
print '</td></tr>';
|
||||
|
||||
// Who
|
||||
print "<tr>";
|
||||
print '<td class="fieldrequired">'.$langs->trans("Person").'</td><td>';
|
||||
print $html->select_users($deplacement->fk_user,'fk_user',0);
|
||||
print $html->select_users($_POST["fk_user"]?$_POST["fk_user"]:$deplacement->fk_user,'fk_user',0);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print $html->select_date($deplacement->date,'','','','','update');
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" class="flat" size="10" value="'.$deplacement->km.'"></td></tr>';
|
||||
|
||||
// Where
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("CompanyVisited").'</td><td>';
|
||||
print $html->select_societes($soc->id,'socid','',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
||||
print $html->select_date($deplacement->date,'','','','','update');
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td><input name="km" class="flat" size="10" value="'.$deplacement->km.'"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
|
|
@ -293,30 +320,69 @@ else
|
|||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print "<tr>";
|
||||
print '<td width="20%">'.$langs->trans("Ref").'</td><td>';
|
||||
print $deplacement->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($deplacement->type).'</td></tr>';
|
||||
|
||||
// Who
|
||||
print '<tr><td>'.$langs->trans("Person").'</td><td>';
|
||||
$userfee=new User($db,$deplacement->fk_user);
|
||||
$userfee->fetch();
|
||||
print $userfee->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||
print dol_print_date($deplacement->date);
|
||||
print '</td></tr>';
|
||||
|
||||
// Where
|
||||
print '<tr><td>'.$langs->trans("CompanyVisited").'</td>';
|
||||
print '<td>';
|
||||
if ($soc->id) print $soc->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>';
|
||||
print dol_print_date($deplacement->date);
|
||||
print '</td></tr>';
|
||||
|
||||
// Km/Price
|
||||
print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>';
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
$langs->load('projects');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Project');
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'classin')
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&id='.$deplacement->id.'">';
|
||||
print img_edit($langs->trans('SetProject'),1);
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($_GET['action'] == 'classin')
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$deplacement->id, $deplacement->socid, $deplacement->fk_project,'projectid');
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$deplacement->id, $deplacement->socid, $deplacement->fk_project,'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$deplacement->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -131,8 +131,17 @@ if ($id > 0 || ! empty($ref))
|
|||
print $html->showrefnav($trip,'ref','',1,'ref','ref',$morehtmlref);
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>'.$langs->trans($trip->type).'</td></tr>';
|
||||
|
||||
// Who
|
||||
print "<tr>";
|
||||
print '<td>'.$langs->trans("Person").'</td><td>';
|
||||
$userfee=new User($db,$trip->fk_user);
|
||||
$userfee->fetch();
|
||||
print $userfee->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">'.$langs->trans("CompanyVisited").'</td>';
|
||||
print '<td>';
|
||||
if ($soc->id) print $soc->getNomUrl(1);
|
||||
|
|
|
|||
|
|
@ -483,12 +483,13 @@ if ($_GET["action"] == 'create')
|
|||
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Ref").'</td>';
|
||||
print '<td><input name="ref" value="'.$numpr.'"></td></tr>'."\n";
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
// Projet associe
|
||||
$langs->load("project");
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td>';
|
||||
|
|
@ -595,36 +596,6 @@ elseif ($fichinterid)
|
|||
// Third party
|
||||
print "<tr><td>".$langs->trans("Company")."</td><td>".$fichinter->client->getNomUrl(1)."</td></tr>";
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
$langs->load('projects');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Project');
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'classin')
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&id='.$fichinter->id.'">';
|
||||
print img_edit($langs->trans('SetProject'),1);
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($_GET['action'] == 'classin')
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project,'projectid');
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project,'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Duration
|
||||
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
||||
//print $fichinter->duree.'-'.$conf->global->MAIN_DURATION_OF_WORKDAY;
|
||||
|
|
@ -656,6 +627,36 @@ elseif ($fichinterid)
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Project
|
||||
if ($conf->projet->enabled)
|
||||
{
|
||||
$langs->load('projects');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Project');
|
||||
print '</td>';
|
||||
if ($_GET['action'] != 'classin')
|
||||
{
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&id='.$fichinter->id.'">';
|
||||
print img_edit($langs->trans('SetProject'),1);
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
if ($_GET['action'] == 'classin')
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project,'projectid');
|
||||
}
|
||||
else
|
||||
{
|
||||
$html->form_project($_SERVER['PHP_SELF'].'?id='.$fichinter->id, $fichinter->socid, $fichinter->fk_project,'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$fichinter->getLibStatut(4).'</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -125,4 +125,6 @@ ALTER TABLE llx_facturedet_rec MODIFY total_tva double(24,8);
|
|||
ALTER TABLE llx_facturedet_rec MODIFY total_ttc double(24,8);
|
||||
|
||||
|
||||
ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity;
|
||||
ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity;
|
||||
|
||||
ALTER TABLE llx_deplacement ADD COLUMN fk_projet integer DEFAULT 0 after fk_soc;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ create table llx_deplacement
|
|||
type varchar(12) NOT NULL,
|
||||
km real,
|
||||
fk_soc integer,
|
||||
fk_projet integer DEFAULT 0,
|
||||
note text,
|
||||
note_public text
|
||||
)type=innodb;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ ListPredefinedInvoicesAssociatedProject=List of customer's predefined invoices a
|
|||
ListSupplierOrdersAssociatedProject=List of supplier's orders associated with the project
|
||||
ListSupplierInvoicesAssociatedProject=List of supplier's invoices associated with the project
|
||||
ListContractAssociatedProject=List of contracts associated with the project
|
||||
ListFichinterAssociatedProject=List of interventions associated with the project
|
||||
ListTripAssociatedProject=List of trips and expenses associated with the project
|
||||
ListActionsAssociatedProject=List of actions associated with the project
|
||||
ActivityOnProjectThisWeek=Activity on project this week
|
||||
ActivityOnProjectThisMonth=Activity on project this month
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ ListPredefinedInvoicesAssociatedProject=Liste des factures clients prédéfinies
|
|||
ListSupplierOrdersAssociatedProject=Liste des commandes fournisseurs associées au projet
|
||||
ListSupplierInvoicesAssociatedProject=Liste des factures fournisseur associées au projet
|
||||
ListContractAssociatedProject=Liste des contrats associés au projet
|
||||
ListFichinterAssociatedProject=Liste des interventions associées au projet
|
||||
ListTripAssociatedProject=Liste des notes de frais associés au projet
|
||||
ListActionsAssociatedProject=Liste des actions associées au projet
|
||||
ActivityOnProjectThisWeek=Activité sur les projets cette semaine
|
||||
ActivityOnProjectThisMonth=Activité sur les projets ce mois
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@
|
|||
CHARSET=UTF-8
|
||||
Trip=Déplacement
|
||||
Trips=Déplacements
|
||||
TripsAndExpenses=Déplacements et frais
|
||||
TripId=Id déplacement/note frais
|
||||
TripCard=Fiche déplacement/frais
|
||||
AddTrip=Ajouter déplacement/frais
|
||||
ListOfTrips=Liste des déplacements/frais
|
||||
TripsAndExpenses=Note de frais
|
||||
TripId=Id note frais
|
||||
TripCard=Fiche frais
|
||||
AddTrip=Ajouter frais
|
||||
ListOfTrips=Liste des frais
|
||||
ListOfFees=Liste des notes de frais
|
||||
NewTrip=Nouveau déplacement
|
||||
NewTrip=Nouvelle note de frais
|
||||
CompanyVisited=Société/Institution visitée
|
||||
Kilometers=Kilomètres
|
||||
FeesKilometersOrAmout=Montant ou kilomètres
|
||||
DeleteTrip=Supprimer déplacement
|
||||
ConfirmDeleteTrip=Êtes-vous sûr de vouloir supprimer ce déplacement/note de frais ?
|
||||
ConfirmDeleteTrip=Êtes-vous sûr de vouloir supprimer cette note de frais ?
|
||||
TF_OTHER=Autre
|
||||
TF_LUNCH=Repas
|
||||
TF_TRIP=Déplacement
|
||||
ListTripsAndExpenses=Liste des déplacements et frais
|
||||
ListTripsAndExpenses=Liste des notes de frais
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/comma
|
|||
if ($conf->fournisseur->enabled) require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.facture.class.php");
|
||||
if ($conf->fournisseur->enabled) require_once(DOL_DOCUMENT_ROOT."/fourn/fournisseur.commande.class.php");
|
||||
if ($conf->contrat->enabled) require_once(DOL_DOCUMENT_ROOT."/contrat/contrat.class.php");
|
||||
if ($conf->fichinter->enabled) require_once(DOL_DOCUMENT_ROOT."/fichinter/fichinter.class.php");
|
||||
if ($conf->deplacement->enabled) require_once(DOL_DOCUMENT_ROOT."/compta/deplacement/deplacement.class.php");
|
||||
if ($conf->agenda->enabled) require_once(DOL_DOCUMENT_ROOT."/actioncomm.class.php");
|
||||
|
||||
$langs->load("projects");
|
||||
|
|
@ -137,6 +139,16 @@ $listofreferent=array(
|
|||
'title'=>"ListContractAssociatedProject",
|
||||
'class'=>'Contrat',
|
||||
'test'=>$conf->contrat->enabled),
|
||||
'intervention'=>array(
|
||||
'title'=>"ListFichinterAssociatedProject",
|
||||
'class'=>'Fichinter',
|
||||
'disableamount'=>1,
|
||||
'test'=>$conf->ficheinter->enabled),
|
||||
'trip'=>array(
|
||||
'title'=>"ListTripAssociatedProject",
|
||||
'class'=>'Deplacement',
|
||||
'disableamount'=>1,
|
||||
'test'=>$conf->deplacement->enabled),
|
||||
'agenda'=>array(
|
||||
'title'=>"ListActionsAssociatedProject",
|
||||
'class'=>'ActionComm',
|
||||
|
|
@ -209,7 +221,7 @@ foreach ($listofreferent as $key => $value)
|
|||
* Barre d'action
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
if ($project->statut > 0)
|
||||
{
|
||||
if ($project->societe->prospect || $project->societe->client)
|
||||
|
|
@ -239,7 +251,7 @@ foreach ($listofreferent as $key => $value)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,8 @@ class Project extends CommonObject
|
|||
if ($type == 'order_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."commande_fournisseur WHERE fk_projet=".$this->id;
|
||||
if ($type == 'invoice_supplier') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture_fourn WHERE fk_projet=".$this->id;
|
||||
if ($type == 'contract') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."contrat WHERE fk_projet=".$this->id;
|
||||
if ($type == 'intervention') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."fichinter WHERE fk_projet=".$this->id;
|
||||
if ($type == 'trip') $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."deplacement WHERE fk_projet=".$this->id;
|
||||
if ($type == 'agenda') $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project=".$this->id;
|
||||
if (! $sql) return -1;
|
||||
|
||||
|
|
@ -350,9 +352,9 @@ class Project extends CommonObject
|
|||
function delete($user, $notrigger=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."projet";
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
|
|
@ -387,7 +389,7 @@ class Project extends CommonObject
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call triggers
|
||||
|
|
@ -397,7 +399,7 @@ class Project extends CommonObject
|
|||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
dol_syslog("Project::delete sql=".$sql, LOG_DEBUG);
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user