Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 3.9
This commit is contained in:
commit
b0b2668428
@ -343,7 +343,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$object->oldcopy = clone$object;
|
$object->oldcopy = clone $object;
|
||||||
|
|
||||||
$object->old_lastname = GETPOST("old_lastname");
|
$object->old_lastname = GETPOST("old_lastname");
|
||||||
$object->old_firstname = GETPOST("old_firstname");
|
$object->old_firstname = GETPOST("old_firstname");
|
||||||
|
|||||||
@ -5084,17 +5084,18 @@ class Form
|
|||||||
print '<tr ' . $bc [$var] . '>';
|
print '<tr ' . $bc [$var] . '>';
|
||||||
print '<td aling="left">';
|
print '<td aling="left">';
|
||||||
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
print '<td align="center">' . $objp->ref . '</td>';
|
||||||
print '<td>' . $objp->ref_client . '</td>';
|
print '<td>' . $objp->ref_client . '</td>';
|
||||||
print '<td>' . price($objp->total_ht) . '</td>';
|
print '<td>' . price($objp->total_ht) . '</td>';
|
||||||
print '<td>' . $objp->name . '</td>';
|
print '<td>' . $objp->name . '</td>';
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i ++;
|
$i ++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('ToLink') . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
$this->db->free($resqlorderlist);
|
$this->db->free($resqlorderlist);
|
||||||
} else {
|
} else {
|
||||||
@ -5150,11 +5151,11 @@ class Form
|
|||||||
print '<tr ' . $bc [$var] . '>';
|
print '<tr ' . $bc [$var] . '>';
|
||||||
print '<td aling="left">';
|
print '<td aling="left">';
|
||||||
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
print '<input type="radio" name="linkedOrder" value=' . $objp->rowid . '>';
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">' . $objp->ref . '</td>';
|
print '<td align="center">' . $objp->ref . '</td>';
|
||||||
print '<td>' . $objp->ref_supplier . '</td>';
|
print '<td>' . $objp->ref_supplier . '</td>';
|
||||||
print '<td>' . price($objp->total_ht) . '</td>';
|
print '<td>' . price($objp->total_ht) . '</td>';
|
||||||
print '<td>' . $objp->name . '</td>';
|
print '<td>' . $objp->name . '</td>';
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i ++;
|
$i ++;
|
||||||
|
|||||||
@ -101,7 +101,7 @@ function product_prepare_head($object)
|
|||||||
$head[$h][2] = 'stats';
|
$head[$h][2] = 'stats';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$object->id;
|
$head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?showmessage=1&id=".$object->id;
|
||||||
$head[$h][1] = $langs->trans('Referers');
|
$head[$h][1] = $langs->trans('Referers');
|
||||||
$head[$h][2] = 'referers';
|
$head[$h][2] = 'referers';
|
||||||
$h++;
|
$h++;
|
||||||
@ -201,22 +201,25 @@ function product_admin_prepare_head()
|
|||||||
*
|
*
|
||||||
* @param Product $product Product object
|
* @param Product $product Product object
|
||||||
* @param int $socid Thirdparty id
|
* @param int $socid Thirdparty id
|
||||||
* @return integer
|
* @return integer NB of lines shown into array
|
||||||
*/
|
*/
|
||||||
function show_stats_for_company($product,$socid)
|
function show_stats_for_company($product,$socid)
|
||||||
{
|
{
|
||||||
global $conf,$langs,$user,$db;
|
global $conf,$langs,$user,$db;
|
||||||
|
|
||||||
|
$nblines = 0;
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td align="left" width="25%" valign="top">'.$langs->trans("Referers").'</td>';
|
print '<td align="left" width="25%" valign="top">'.$langs->trans("Referers").'</td>';
|
||||||
print '<td align="right" width="25%">'.$langs->trans("NbOfThirdParties").'</td>';
|
print '<td align="right" width="25%">'.$langs->trans("NbOfThirdParties").'</td>';
|
||||||
print '<td align="right" width="25%">'.$langs->trans("NbOfReferers").'</td>';
|
print '<td align="right" width="25%">'.$langs->trans("NbOfObjectReferers").'</td>';
|
||||||
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
print '<td align="right" width="25%">'.$langs->trans("TotalQuantity").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Propals
|
// Propals
|
||||||
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_propale($socid);
|
$ret=$product->load_stats_propale($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
@ -234,6 +237,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
// Commandes clients
|
// Commandes clients
|
||||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_commande($socid);
|
$ret=$product->load_stats_commande($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@ -251,6 +255,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
// Commandes fournisseurs
|
// Commandes fournisseurs
|
||||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
|
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_commande_fournisseur($socid);
|
$ret=$product->load_stats_commande_fournisseur($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
@ -268,6 +273,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
// Contrats
|
// Contrats
|
||||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_contrat($socid);
|
$ret=$product->load_stats_contrat($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
@ -285,6 +291,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
// Factures clients
|
// Factures clients
|
||||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_facture($socid);
|
$ret=$product->load_stats_facture($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -302,6 +309,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
// Factures fournisseurs
|
// Factures fournisseurs
|
||||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||||
{
|
{
|
||||||
|
$nblines++;
|
||||||
$ret=$product->load_stats_facture_fournisseur($socid);
|
$ret=$product->load_stats_facture_fournisseur($socid);
|
||||||
if ($ret < 0) dol_print_error($db);
|
if ($ret < 0) dol_print_error($db);
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -317,7 +325,7 @@ function show_stats_for_company($product,$socid)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return $nblines++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
|
|||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
-->
|
||||||
</table>
|
</table>
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- END PHP TEMPLATE -->
|
<!-- END PHP TEMPLATE -->
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
|
||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2010-2014 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2010-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
@ -53,7 +53,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
var $id;
|
var $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supplier invoice reference
|
* Supplier order reference
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $ref;
|
var $ref;
|
||||||
@ -103,7 +103,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
var $user_approve_id;
|
var $user_approve_id;
|
||||||
var $user_approve_id2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set
|
var $user_approve_id2; // Used when SUPPLIER_ORDER_DOUBLE_APPROVAL is set
|
||||||
|
|
||||||
//Incorterms
|
//Incoterms
|
||||||
var $fk_incoterms;
|
var $fk_incoterms;
|
||||||
var $location_incoterms;
|
var $location_incoterms;
|
||||||
var $libelle_incoterms; //Used into tooltip
|
var $libelle_incoterms; //Used into tooltip
|
||||||
@ -114,7 +114,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
* @var CommandeFournisseurLigne[]
|
* @var CommandeFournisseurLigne[]
|
||||||
*/
|
*/
|
||||||
public $lines = array();
|
public $lines = array();
|
||||||
//Ajout pour supplier_proposal
|
//Add for supplier_proposal
|
||||||
var $origin;
|
var $origin;
|
||||||
var $origin_id;
|
var $origin_id;
|
||||||
var $linked_objects=array();
|
var $linked_objects=array();
|
||||||
@ -243,7 +243,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
|
|
||||||
// Retreive all extrafield
|
// Retrieve all extrafields
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
|
||||||
$extrafields=new ExtraFields($this->db);
|
$extrafields=new ExtraFields($this->db);
|
||||||
@ -390,7 +390,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Definition du nom de modele de numerotation de commande
|
// Definition of supplier order numbering model name
|
||||||
$soc = new Societe($this->db);
|
$soc = new Societe($this->db);
|
||||||
$soc->fetch($this->fourn_id);
|
$soc->fetch($this->fourn_id);
|
||||||
|
|
||||||
@ -435,7 +435,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// Rename directory if dir was a temporary ref
|
// Rename directory if dir was a temporary ref
|
||||||
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
if (preg_match('/^[\(]?PROV/i', $this->ref))
|
||||||
{
|
{
|
||||||
// On renomme repertoire ($this->ref = ancienne ref, $num = nouvelle ref)
|
// We rename directory ($this->ref = ancienne ref, $num = nouvelle ref)
|
||||||
// in order not to lose the attached files
|
// in order not to lose the attached files
|
||||||
$oldref = dol_sanitizeFileName($this->ref);
|
$oldref = dol_sanitizeFileName($this->ref);
|
||||||
$newref = dol_sanitizeFileName($num);
|
$newref = dol_sanitizeFileName($num);
|
||||||
@ -618,8 +618,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie la reference de commande suivante non utilisee en fonction du modele
|
* Returns the following order reference not used depending on the numbering model activated
|
||||||
* de numerotation actif defini dans COMMANDE_SUPPLIER_ADDON_NUMBER
|
* defined within COMMANDE_SUPPLIER_ADDON_NUMBER
|
||||||
*
|
*
|
||||||
* @param Societe $soc objet societe
|
* @param Societe $soc objet societe
|
||||||
* @return string reference libre pour la facture
|
* @return string reference libre pour la facture
|
||||||
|
|||||||
@ -537,6 +537,7 @@ NbOfCustomers=Number of customers
|
|||||||
NbOfLines=Number of lines
|
NbOfLines=Number of lines
|
||||||
NbOfObjects=Number of objects
|
NbOfObjects=Number of objects
|
||||||
NbOfReferers=Number of referrers
|
NbOfReferers=Number of referrers
|
||||||
|
NbOfObjectReferers=Number of refering objects
|
||||||
Referers=Refering objects
|
Referers=Refering objects
|
||||||
TotalQuantity=Total quantity
|
TotalQuantity=Total quantity
|
||||||
DateFromTo=From %s to %s
|
DateFromTo=From %s to %s
|
||||||
|
|||||||
@ -313,3 +313,4 @@ DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on
|
|||||||
WarningSelectOneDocument=Please select at least one document
|
WarningSelectOneDocument=Please select at least one document
|
||||||
DefaultUnitToShow=Unit
|
DefaultUnitToShow=Unit
|
||||||
NbOfQtyInProposals=Qty in proposals
|
NbOfQtyInProposals=Qty in proposals
|
||||||
|
ClinkOnALinkOfColumn=Click on a link of column %s to get a detailed view...
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
@ -48,7 +48,7 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','',
|
|||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('productstatsinvoice'));
|
$hookmanager->initHooks(array('productstatsinvoice'));
|
||||||
|
|
||||||
$mesg = '';
|
$showmessage=GETPOST('showmessage');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
@ -67,6 +67,8 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
|
|||||||
$search_year='';
|
$search_year='';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -107,7 +109,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border tableforfield" width="100%">';
|
print '<table class="border tableforfield" width="100%">';
|
||||||
|
|
||||||
show_stats_for_company($product,$socid);
|
$nboflines = show_stats_for_company($product,$socid);
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
@ -116,8 +118,11 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
if ($showmessage && $nboflines > 1)
|
||||||
if ($user->rights->facture->lire)
|
{
|
||||||
|
print $langs->trans("ClinkOnALinkOfColumn", $langs->transnoentitiesnoconv("Referers"));
|
||||||
|
}
|
||||||
|
elseif ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
|
||||||
$sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
|
$sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user