diff --git a/htdocs/admin/carrier.php b/htdocs/admin/carrier.php
deleted file mode 100644
index edb995d3fe7..00000000000
--- a/htdocs/admin/carrier.php
+++ /dev/null
@@ -1,222 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/admin/carrier.php
- * \ingroup expedition
- * \brief Page to setup carriers. TODO Delete this page. We mut use dictionnary instead.
- */
-
-require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
-
-$langs->load("admin");
-$langs->load("sendings");
-$langs->load("deliveries");
-$langs->load('other');
-
-if (! $user->admin)
- accessforbidden();
-
-$action=GETPOST('action','alpha');
-$carrier=GETPOST('carrier','int');
-
-$object = new Expedition($db);
-
-
-/*
- * Actions
- */
-//if ($action==setvalue AND $carrier)
-if ($action=='setvalue')
-{
- // need to add check on values
- $object->update['code']=GETPOST('code','alpha');
- $object->update['libelle']=GETPOST('libelle','alpha');
- $object->update['description']=GETPOST('description','alpha');
- $object->update['tracking']=GETPOST('tracking','alpha');
- $object->update_delivery_method($carrier);
- header("Location: carrier.php");
- exit;
-}
-
-if ($action=='activate_carrier' && $carrier!='')
-{
- $object->activ_delivery_method($carrier);
-}
-
-if ($action=='disable_carrier' && $carrier!='')
-{
- $object->disable_delivery_method($carrier);
-}
-
-/*
- * View
- */
-
-$form=new Form($db);
-
-llxHeader("","");
-
-$linkback=''.$langs->trans("BackToModuleList").'';
-print_fiche_titre($langs->trans("SendingsSetup"),$linkback,'setup');
-print '
';
-
-
-//if ($mesg) print $mesg.'
';
-
-
-$h = 0;
-
-$head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
-$head[$h][1] = $langs->trans("Setup");
-$h++;
-
-$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
-$head[$h][1] = $langs->trans("Carriers");
-$hselected=$h;
-$h++;
-
-if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
-{
- $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
- $head[$h][1] = $langs->trans("Sending");
- $h++;
-}
-
-if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
-{
- $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
- $head[$h][1] = $langs->trans("Receivings");
- $h++;
-}
-
-dol_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
-
-/*
- * Carrier List
- */
-if ($action=='edit_carrier' || $action=='setvalue')
-{
- // Carrier Edit
- if ($carrier!='') $object->list_delivery_methods($carrier);
- print_titre($langs->trans("CarrierEdit"));
-
- print '
';
-
-}
-else
-{
- // Display List
- $object->list_delivery_methods();
- $var=true;
- print_titre($langs->trans("CarrierList"));
-
- print '';
- print '';
- print '| '.$langs->trans("Code").' | ';
- print ''.$langs->trans("Name").' | ';
- print ''.$langs->trans("Description").' | ';
- print ''.$langs->trans("TrackingUrl").' | ';
- print ''.$langs->trans("Status").' | ';
- print ''.$langs->trans("Edit").' | ';
- print "
\n";
- $numlistmeths=count($object->listmeths);
- for ($i=0; $i<$numlistmeths; $i++)
- {
- $var=!$var;
- print "";
- print '| '.$object->listmeths[$i]['code'].' | ';
- print ''.$object->listmeths[$i]['libelle'].' | ';
- print ''.$object->listmeths[$i]['description'].' | ';
- print ''.dol_trunc($object->listmeths[$i]['tracking'],92,'middle').' | ';
- print '';
- if($object->listmeths[$i]['active'] == 0)
- {
- print ''.img_picto($langs->trans("Disabled"),'switch_off').'';
- }
- else
- {
- print ''.img_picto($langs->trans("Enabled"),'switch_on').'';
- }
- print ' | ';
- print ''.img_picto($langs->trans("Edit"),'edit').'';
- print ' | ';
- print "
\n";
- }
- print ' '.$langs->trans("Add").' |
';
-
- print '
';
-
- print '';
-}
-
-llxFooter();
-
-$db->close();
-?>
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index 6653badfb36..d9be768461f 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -84,10 +84,6 @@ $head[$h][1] = $langs->trans("Setup");
$hselected=$h;
$h++;
-$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
-$head[$h][1] = $langs->trans("Carriers");
-$h++;
-
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index ac69dc90d8a..6405e8ac8a8 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -147,7 +147,7 @@ $tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.org
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
-$tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
+$tabsql[18]= "SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
@@ -203,7 +203,7 @@ $tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
$tabfield[17]= "code,libelle";
-$tabfield[18]= "code,libelle";
+$tabfield[18]= "code,libelle,tracking";
$tabfield[19]= "code,libelle";
$tabfield[20]= "code,libelle";
$tabfield[21]= "code,label";
@@ -231,7 +231,7 @@ $tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle";
$tabfieldvalue[17]= "code,libelle";
-$tabfieldvalue[18]= "code,libelle";
+$tabfieldvalue[18]= "code,libelle,tracking";
$tabfieldvalue[19]= "code,libelle";
$tabfieldvalue[20]= "code,libelle";
$tabfieldvalue[21]= "code,label";
@@ -259,7 +259,7 @@ $tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label";
$tabfieldinsert[17]= "code,libelle";
-$tabfieldinsert[18]= "code,libelle";
+$tabfieldinsert[18]= "code,libelle,tracking";
$tabfieldinsert[19]= "code,libelle";
$tabfieldinsert[20]= "code,libelle";
$tabfieldinsert[21]= "code,label";
@@ -1307,6 +1307,7 @@ function fieldList($fieldlist,$obj='',$tabname='')
print '';
$size='';
if ($fieldlist[$field]=='libelle') $size='size="32" ';
+ if ($fieldlist[$field]=='tracking') $size='size="92" ';
if ($fieldlist[$field]=='accountancy_code') $size='size="15" ';
if ($fieldlist[$field]=='accountancy_code_sell') $size='size="15" ';
if ($fieldlist[$field]=='accountancy_code_buy') $size='size="15" ';
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index 34535b1d321..28e5b912de2 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -201,10 +201,6 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
-$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
-$head[$h][1] = $langs->trans("Carriers");
-$h++;
-
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending");
$hselected=$h;
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index 49cbeee9026..677e2b3773b 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -189,10 +189,6 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup");
$h++;
-$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
-$head[$h][1] = $langs->trans("Carriers");
-$h++;
-
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
diff --git a/htdocs/core/modules/expedition/methode_expedition.modules.php b/htdocs/core/modules/expedition/methode_expedition.modules.php
deleted file mode 100644
index 3ea7ba97ce9..00000000000
--- a/htdocs/core/modules/expedition/methode_expedition.modules.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- * Copyright (C) 2007 Laurent Destailleur
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- * or see http://www.gnu.org/
- */
-
-/**
- * \file htdocs/core/modules/expedition/methode_expedition.modules.php
- * \ingroup expedition
- * \brief Fichier contenant la classe mere de generation de bon de livraison en PDF
- * et la classe mere de numerotation des bons de livraisons
- */
-require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
-
-
-/**
- * Parent class for shipping method classes
- */
-class ModeleShippingMethod
-{
- /**
- * Constructo
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db)
- {
- $this->db = $db;
- $this->name = "NOT DEFINED";
- $this->description = "ERROR IN MODULE DESCRIPTION";
- }
-
-
- /**
- * Return list of active generation modules
- *
- * @param DoliDB $db Database handler
- * @param string $maxfilenamelength Max length of value to show
- * @return array List of templates
- */
- static function liste_modeles($db,$maxfilenamelength=0)
- {
- global $conf;
-
- $type='???';
- $liste=array();
-
- include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $liste=getListOfModels($db,$type,$maxfilenamelength);
-
- return $liste;
- }
-}
-
-?>
diff --git a/htdocs/core/modules/expedition/methode_expedition_colsui.modules.php b/htdocs/core/modules/expedition/methode_expedition_colsui.modules.php
deleted file mode 100644
index fca7ffc38ff..00000000000
--- a/htdocs/core/modules/expedition/methode_expedition_colsui.modules.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- * Copyright (C) 2008 Bearstech - http://bearstech.com/
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/core/modules/expedition/methode_expedition_colsui.modules.php
- * \ingroup expedition
- */
-include_once 'methode_expedition.modules.php';
-
-/**
- * Class to manage shipment Colsui
- */
-class methode_expedition_colsui extends ModeleShippingMethod
-{
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db=0)
- {
- $this->db = $db;
- $this->id = 3; // Do not change this value
- $this->code = "COLSUI"; // Do not change this value
- $this->name = "Colissimo Suivi";
- $this->description = "Colissimo Suivi";
- }
-
- /**
- * Return URL of provider
- *
- * @param string $tracking_number Tracking number
- * @return string URL for tracking
- */
- function provider_url_status($tracking_number)
- {
- return sprintf("http://www.coliposte.net/particulier/suivi_particulier.jsp?colispart=%s",$tracking_number);
- }
-}
-
-?>
diff --git a/htdocs/core/modules/expedition/methode_expedition_enl.modules.php b/htdocs/core/modules/expedition/methode_expedition_enl.modules.php
deleted file mode 100644
index 17e5cf35be9..00000000000
--- a/htdocs/core/modules/expedition/methode_expedition_enl.modules.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/core/modules/expedition/methode_expedition_enl.modules.php
- * \ingroup expedition
- */
-include_once 'methode_expedition.modules.php';
-
-
-/**
- * Class to manage shipment Enl
- */
-class methode_expedition_enl extends ModeleShippingMethod
-{
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db=0)
- {
- global $langs;
- $this->db = $db;
- $this->id = 1; // Do not change this value
- $this->name = "Enlevement";
- $this->code = "ENL";
- $this->description = $langs->trans("Enlevement");
- }
-
- /**
- * Return URL of provider
- *
- * @param string $tracking_number Tracking number
- * @return string URL for tracking
- */
- function provider_url_status($tracking_number)
- {
- return '';
- }
-}
-
-?>
diff --git a/htdocs/core/modules/expedition/methode_expedition_lettremax.modules.php b/htdocs/core/modules/expedition/methode_expedition_lettremax.modules.php
deleted file mode 100644
index c8150af9497..00000000000
--- a/htdocs/core/modules/expedition/methode_expedition_lettremax.modules.php
+++ /dev/null
@@ -1,57 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/core/modules/expedition/methode_expedition_lettremax.modules.php
- * \ingroup expedition
- */
-
-include_once 'methode_expedition.modules.php';
-
-
-/**
- * Class to manage shipment lettremax
- */
-class methode_expedition_lettremax extends ModeleShippingMethod
-{
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db=0)
- {
- $this->db = $db;
- $this->id = 4; // Do not change this value
- $this->code = "LETTREMAX"; // Do not change this value
- $this->name = "Lettre max";
- $this->description = "Courrier suivi et lettre max";
- }
-
- /**
- * Return URL of provider
- *
- * @param string $tracking_number Tracking number
- * @return string URL for tracking
- */
- function provider_url_status($tracking_number)
- {
- return sprintf("http://www.csuivi.courrier.laposte.fr/default.asp?EZ_ACTION=rechercheRapide&numObjet=%s",$tracking_number);
- }
-}
-
-?>
diff --git a/htdocs/core/modules/expedition/methode_expedition_trans.modules.php b/htdocs/core/modules/expedition/methode_expedition_trans.modules.php
deleted file mode 100644
index d974b7c161a..00000000000
--- a/htdocs/core/modules/expedition/methode_expedition_trans.modules.php
+++ /dev/null
@@ -1,59 +0,0 @@
-
- *
- * 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
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/core/modules/expedition/methode_expedition_trans.modules.php
- * \ingroup expedition
- */
-include_once 'methode_expedition.modules.php';
-
-
-/**
- * Class to manage shipment Trans
- */
-class methode_expedition_trans extends ModeleShippingMethod
-{
-
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- function __construct($db=0)
- {
- global $langs;
-
- $this->db = $db;
- $this->id = 2; // Ne pas changer cette valeur
- $this->code = "TRANS";
- $this->name = "Transporteur";
- $this->description = $langs->trans("GenericTransport");
- }
-
- /**
- * Return URL of provider
- *
- * @param string $tracking_number Tracking number
- * @return string URL for tracking
- */
- function provider_url_status($tracking_number)
- {
- return '';
- }
-}
-
-?>
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index f3db4dafc8b..95b18e1d814 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -1199,7 +1199,7 @@ class Expedition extends CommonObject
{
global $langs;
- $listmeths = array();
+ $this->listmeths = array();
$i=0;
$sql = "SELECT em.rowid, em.code, em.libelle, em.description, em.tracking, em.active";
@@ -1216,29 +1216,11 @@ class Expedition extends CommonObject
$label=$langs->trans('SendingMethod'.$obj->code);
$this->listmeths[$i]['libelle'] = ($label != 'SendingMethod'.$obj->code?$label:$obj->libelle);
$this->listmeths[$i]['description'] = $obj->description;
- if ($obj->tracking)
- {
- $this->listmeths[$i]['tracking'] = $obj->tracking;
- }
- else
- {
- if ($obj->code)
- {
- $classname = "methode_expedition_".strtolower($obj->code);
-
- if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).".modules.php") )
- {
- require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($obj->code).'.modules.php';
- $shipmethod = new $classname();
- $this->listmeths[$i]['tracking'] = $shipmethod->provider_url_status('{TRACKID}');
- }
- }
- }
+ $this->listmeths[$i]['tracking'] = $obj->tracking;
$this->listmeths[$i]['active'] = $obj->active;
$i++;
}
}
- else dol_print_error($this->db,'');
}
/**
@@ -1309,8 +1291,6 @@ class Expedition extends CommonObject
*/
function GetUrlTrackingStatus($value='')
{
- $code='';
-
if (! empty($this->shipping_method_id))
{
$sql = "SELECT em.code, em.tracking";
@@ -1322,46 +1302,21 @@ class Expedition extends CommonObject
{
if ($obj = $this->db->fetch_object($resql))
{
- $code = $obj->code;
- $tracking = $obj->tracking;
+ $tracking = $obj->tracking;
}
}
}
- if ($tracking)
- {
- $url = str_replace('{TRACKID}', $value, $tracking);
- $this->tracking_url = sprintf(''.($value?$value:'url').'',$url,$url);
- }
- else
- {
- if ($code)
- {
- $classname = "methode_expedition_".strtolower($code);
-
- $url='';
- if (file_exists(DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).".modules.php") && ! empty($this->tracking_number))
- {
- require_once DOL_DOCUMENT_ROOT."/core/modules/expedition/methode_expedition_".strtolower($code).'.modules.php';
- $shipmethod = new $classname();
- $url = $shipmethod->provider_url_status($this->tracking_number);
- }
-
- if ($url)
- {
- $this->tracking_url = sprintf(''.($value?$value:'url').'',$url,$url);
- }
- else
- {
- $this->tracking_url = $value;
- }
- }
- else
- {
- $this->tracking_url = $value;
- }
- }
- }
+ if (!empty($tracking) && !empty($value))
+ {
+ $url = str_replace('{TRACKID}', $value, $tracking);
+ $this->tracking_url = sprintf(''.($value?$value:'url').'',$url,$url);
+ }
+ else
+ {
+ $this->tracking_url = $value;
+ }
+ }
/**
* Classify the shipping as invoiced
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 759258888cf..ac138636b08 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -141,6 +141,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", fk_soc";
$sql.= ", datec";
$sql.= ", datef";
+ $sql.= ", fk_projet";
$sql.= ", note_private";
$sql.= ", note_public";
$sql.= ", fk_user_author";
@@ -154,6 +155,7 @@ class FactureFournisseur extends CommonInvoice
$sql.= ", ".$this->socid;
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ", '".$this->db->idate($this->date)."'";
+ $sql.= ", ".$this->fk_project;
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
$sql.= ", ".$user->id.",";
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index 6ed624b82fa..23ed291c681 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -41,6 +41,8 @@ if (!empty($conf->produit->enabled))
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!empty($conf->projet->enabled))
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+if (! empty($conf->projet->enabled))
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('bills');
@@ -271,6 +273,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
// Creation facture
$object->ref = $_POST['ref'];
$object->ref_supplier = $_POST['ref_supplier'];
+ $object->fk_project = GETPOST('projectid');
$object->socid = $_POST['socid'];
$object->libelle = $_POST['libelle'];
$object->date = $datefacture;
@@ -1153,6 +1156,15 @@ if ($action == 'create')
print '| '.$langs->trans('DateMaxPayment').' | ';
$form->select_date($datedue,'ech','','','',"add",1,1);
print ' | ';
+
+ // Project
+ if (! empty($conf->projet->enabled))
+ {
+ $langs->load('projects');
+ print '| '.$langs->trans('Project').' | ';
+ select_projects(-1, $projectid, 'projectid');
+ print ' | ';
+ }
print '| '.$langs->trans('NotePublic').' | ';
print '';
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 7c0a4c0332f..aff1fded6d3 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -295,14 +295,13 @@ if ($sql_select)
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
{
- $this->fetch_thirdparty();
$prod = new Product($db);
$prod->fetch($objp->fk_product);
$outputlangs = $langs;
$newlang='';
if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
- if (empty($newlang)) $newlang=$this->client->default_lang;
+ if (empty($newlang)) $newlang=$object->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
| |