2
0
forked from Wavyzz/dolibarr

Compare commits

..

52 Commits
3.7.3 ... 3.7.4

Author SHA1 Message Date
Laurent Destailleur
444fce0bd9 Prepare 3.7.4 2016-03-11 18:34:05 +01:00
Laurent Destailleur
ad3bd2c339 Merge pull request #4713 from marcosgdf/bug-4414
FIX #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
2016-03-02 20:56:34 +01:00
Marcos García de La Fuente
7d336bd5d4 FIX #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
Close #4414
2016-03-02 11:43:55 +01:00
Laurent Destailleur
a9aab7545e Merge pull request #4575 from altatof/fix_ttc_display
FIX: add missing global def for ttc column
2016-02-15 00:14:34 +01:00
Laurent Destailleur
04b390f21c Merge pull request #4507 from altatof/PROPAL_CLONE_ON_CREATE_PAGE
FIX ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant
2016-02-14 21:59:04 +01:00
Laurent Destailleur
13c85516ee Doc comment 2016-02-14 21:58:54 +01:00
Christophe Battarel
7a6c7f10a6 FIX: add missing global def for ttc column 2016-02-05 19:14:40 +01:00
Laurent Destailleur
0076512d5b Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-31 21:26:52 +01:00
Laurent Destailleur
1b23ede857 Merge remote-tracking branch 'origin/3.5' into 3.6 2016-01-31 21:26:28 +01:00
Laurent Destailleur
d9e089256e Fix path to copyrighted files 2016-01-31 16:16:46 +01:00
Laurent Destailleur
c9661ee20e Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-30 15:57:09 +01:00
Laurent Destailleur
b27e31b3ae Merge pull request #4483 from marcosgdf/bug-4440-3
Corrected typo of PR #4444
2016-01-30 12:20:50 +01:00
Laurent Destailleur
2e7d88dffb Merge pull request #4499 from fmarcet/3.7
FIX: Contrat card don't consider user permissions to show active/unactive service button
2016-01-30 12:12:42 +01:00
Christophe Battarel
1baf25de3c FIX ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden
constant
2016-01-27 12:04:00 +01:00
fmarcet
c2efee8a29 FIX: Contrat card don't consider user permissions to show active/unactive service button 2016-01-26 13:02:21 +01:00
Laurent Destailleur
feb114625d Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-25 15:37:55 +01:00
Laurent Destailleur
c1b6630c16 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/main.inc.php
2016-01-25 15:37:04 +01:00
Raphaël Doursenaud
ed16699de6 FIX #4291 Correctly filter external calendar GETPOSTs 2016-01-25 15:32:08 +01:00
Laurent Destailleur
0814fa76f8 FIX CVE CVE-2015-8685 2016-01-25 15:26:52 +01:00
Marcos García de La Fuente
83263e242e Corrected typo of PR #4444 2016-01-23 20:32:22 +01:00
Laurent Destailleur
9be246baa5 Merge remote-tracking branch 'origin/3.6' into 3.7 2016-01-23 11:32:06 +01:00
Laurent Destailleur
9fd56df03f Merge pull request #4444 from marcosgdf/bug-4440-2
FIX #4440 Wrong price is filled by Product::fetch into multiprices arrays
2016-01-22 03:47:22 +01:00
Laurent Destailleur
9d63cb0156 Merge pull request #4452 from hregis/3.7_bug
Fix: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
2016-01-22 03:45:35 +01:00
Regis Houssin
535d3bc087 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2016-01-18 13:04:08 +01:00
Marcos García de La Fuente
da637db162 FIX #4440 Wrong price is filled by Product::fetch into multiprices arrays 2016-01-18 10:17:59 +01:00
Regis Houssin
6e30d5e516 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2016-01-15 13:16:40 +01:00
Regis Houssin
6aeb18ed75 Revert "Fix: for avoid division by 0"
This reverts commit c71d578931.
2016-01-15 13:14:55 +01:00
Regis Houssin
905f9d78ed Fix: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9) 2016-01-15 13:12:19 +01:00
Laurent Destailleur
947f718329 Merge pull request #4408 from fmarcet/3.7
FIX: The third dashboard don't consider user permissions
2016-01-12 23:23:49 +01:00
fmarcet
79992b4947 FIX: The third dashboard don't consider user permissions 2016-01-12 11:34:50 +01:00
Laurent Destailleur
861376e461 Merge branch '3.7' of github.com:Dolibarr/dolibarr into 3.7 2016-01-10 18:49:11 +01:00
Laurent Destailleur
801e2bca4b Fix #4239 2016-01-10 18:42:35 +01:00
Laurent Destailleur
40f0d0c9f2 Merge pull request #4321 from fmarcet/3.7
FIX: Email templates not compatible with Multicompany
2016-01-10 11:49:37 +01:00
Laurent Destailleur
e008922919 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/admin/agenda_extsites.php
2016-01-08 14:45:53 +01:00
Laurent Destailleur
5414cb6f12 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.6 2016-01-08 14:43:20 +01:00
Laurent Destailleur
a26a6c2449 Fix sql injection even when code is on several lines 2016-01-08 14:43:04 +01:00
Laurent Destailleur
c2b8be9aaf Merge pull request #4355 from GPCsolutions/3.6-4291
FIX #4291 Correctly filter external calendar GETPOSTs
2016-01-08 14:23:56 +01:00
Laurent Destailleur
36dc8b1ce7 FIX #4341 2016-01-08 13:57:53 +01:00
Raphaël Doursenaud
f2178f0369 FIX #4291 Correctly filter external calendar GETPOSTs 2016-01-08 06:42:28 +01:00
fmarcet
d8360a2a01 FIX: Email templates not compatible with Multicompany 2016-01-07 08:18:36 +01:00
fmarcet
cafe148f72 FIX: Email templates not compatible with Multicompany 2016-01-04 09:12:27 +01:00
Laurent Destailleur
e4640ca4c3 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	htdocs/install/upgrade.php
2016-01-02 12:22:00 +01:00
Laurent Destailleur
0cad938e09 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	htdocs/install/upgrade.php
2016-01-02 12:19:49 +01:00
Laurent Destailleur
b46aec8e7e Fix to allow phpunit of migration process for 3.5 to 3.6 2016-01-02 12:18:26 +01:00
Laurent Destailleur
35ce670bf2 Fix to allow phpunit of migration process for 3.4 to 3.5 2016-01-02 12:18:12 +01:00
Laurent Destailleur
a234482d08 FIX #3694 2015-12-31 14:55:53 +01:00
Laurent Destailleur
c004342976 FIX #3694 2015-12-31 14:55:10 +01:00
fmarcet
cebb996120 FIX: Email templates not compatible with Multicompany 2015-12-29 11:22:18 +01:00
fmarcet
f8e156ea30 FIX: Email templates not compatible with Multicompany 2015-12-29 10:35:10 +01:00
Laurent Destailleur
a2c8208541 Prepare 3.6.5 2015-12-27 19:17:05 +01:00
Regis Houssin
c65babf3b5 Merge remote-tracking branch 'origin/3.7' into 3.7_bug 2015-12-27 12:50:41 +01:00
Regis Houssin
c71d578931 Fix: for avoid division by 0 2015-12-16 16:39:50 +01:00
17 changed files with 84 additions and 40 deletions

View File

@@ -9,6 +9,23 @@ Upgrading to any other version or database system is abolutely required BEFORE t
make a Dolibarr upgrade.
***** ChangeLog for 3.7.4 compared to 3.7.3 *****
FIX: #3694
FIX: #4239
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: #4341
FIX: #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
FIX: #4440 Wrong price is filled by Product::fetch into multiprices arrays
FIX: add missing global def for ttc column
FIX: Contrat card don't consider user permissions to show active/unactive service button
FIX: CVE CVE-2015-8685
FIX: Email templates not compatible with Multicompany
Fix: for avoid division by 0
FIX: ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant
FIX: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
FIX: sql injection even when code is on several lines
FIX: The third dashboard don't consider user permissions
***** ChangeLog for 3.7.3 compared to 3.7.2 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #3890 Expected transactions bank account page, shows negative numbers
@@ -335,6 +352,17 @@ Dolibarr better:
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.6 compared to 3.6.5 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #4081 Added missing translation
FIX: #4097 Public holiday calculation
FIX: #4242 Allow disabling dashes in documents
FIX: #4243 sql injection
FIX: Add a protection to not make release if ChangeLog was not generated. Prepare package 3.6.5
FIX: export with category contact extrafields
FIX: Not delete a product when have customer price
FIX: Not deleting contrats on element_element table
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
FIX: #2957 : missing $langs object for trigger
FIX: #2983 Load gravatar avatar images securely over HTTPS

View File

@@ -159,7 +159,7 @@ Comments:
Those files are not shipped in the binary package as we
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
Files: docs/images/*
Files: doc/images/*
Copyright: Laurent Destailleur
License: CC-BY-SA-3.0
You are free:
@@ -176,7 +176,7 @@ License: CC-BY-SA-3.0
.
For more information, see http://creativecommons.org/licenses/by-sa/3.0/
Files: htdocs/includes/fpdi/*
Files: htdocs/includes/fpdfi/*
Copyright: 2004-2011 Setasign - Jan Slabon
License: GPL-2+
This program is free software; you can redistribute it

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.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
@@ -91,7 +92,7 @@ if ($actionsave)
// Save nb of agenda
if (! $error)
{
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity);
$res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
@@ -205,9 +206,9 @@ while ($i <= $MAXAGENDA)
// Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>';
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha'):$conf->global->$name) . '" size="28"></td>';
// URL
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>';
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha'):$conf->global->$src) . '" size="60"></td>';
// Color (Possible colors are limited by Google)
print '<td class="nowrap" align="right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);

View File

@@ -9,6 +9,7 @@
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2014 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@@ -154,7 +155,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
// Criteria to sort dictionaries
$tabsqlsort=array();
@@ -266,7 +267,7 @@ $tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[24]= "code,label";
$tabfieldinsert[25]= "label,type_template,private,position,topic,content";
$tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity";
// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on

View File

@@ -268,7 +268,7 @@ if (empty($reshook))
{
$db->begin();
// Si on a selectionne une propal a copier, on realise la copie
// If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on)
if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal'))
{
if ($object->fetch(GETPOST('copie_propal')) > 0) {
@@ -293,7 +293,8 @@ if (empty($reshook))
$object->note = GETPOST('note');
$object->statut = 0;
$id = $object->create_from($user);
// the create is done below and further more the existing create_from function is quite hilarating
//$id = $object->create_from($user);
} else {
setEventMessage($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), 'errors');
}

View File

@@ -946,6 +946,7 @@ class Propal extends CommonObject
*/
function create_from($user)
{
// i love this function because $this->products is not used in create function...
$this->products=$this->lines;
return $this->create($user);

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -1548,9 +1548,11 @@ else
{
$tmpaction='activateline';
if ($objp->statut == 4) $tmpaction='unactivateline';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;ligne='.$object->lines[$cursorline-1]->id.'&amp;action='.$tmpaction.'">';
print img_edit();
print '</a>';
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->unactiver)) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;ligne=' . $object->lines[$cursorline - 1]->id . '&amp;action=' . $tmpaction . '">';
print img_edit();
print '</a>';
}
}
}
print '</td>';

View File

@@ -2540,7 +2540,7 @@ abstract class CommonObject
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0)
{
global $conf,$langs,$user,$object,$hookmanager;
global $conf,$langs,$user,$object,$hookmanager,$inputalsopricewithtax;
print '<tr class="liste_titre nodrag nodrop">';

View File

@@ -1733,7 +1733,7 @@ class Form
$sql.= " WHERE fk_product='".$objp->rowid."'";
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
$sql.= " AND price_level=".$price_level;
$sql.= " ORDER BY date_price";
$sql.= " ORDER BY date_price, rowid";
$sql.= " DESC LIMIT 1";
dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);

View File

@@ -308,7 +308,13 @@ if (! empty($conf->margin->enabled))
if (npRate == "np_marginRate")
price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100));
else if (npRate == "np_markRate")
price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100));
{
if (ratejs != 100) // If markRate is 100, it means buying price is 0, so it is not possible to retreive price from it and markRate. We keep it unchange
{
price = ((bpjs / (1 - (ratejs / 100))) / (1 - remisejs / 100));
}
else price=$("input[name='price_ht']:first").val();
}
}
$("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value

View File

@@ -29,7 +29,7 @@
* \brief File that include conf.php file and commons lib like functions.lib.php
*/
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.3');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.7.4');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2016 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
@@ -121,7 +121,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) dol_print_error($db, $object->error);
else $object->ref_supplier=GETPOST('ref_supplier','alpha'); // ADD : ref_supplier to object property, otherwise not visibly updated on change
@@ -615,6 +615,14 @@ if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournis
if ($result > 0)
{
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang = GETPOST('lang_id','alpha');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);

View File

@@ -1577,12 +1577,6 @@ else
if ($objectref == 'PROV')
{
$savdate=$object->date;
if (! empty($conf->global->FAC_FORCE_DATE_VALIDATION))
{
$object->date=dol_now();
//TODO: Possibly will have to control payment information into suppliers
//$object->date_lim_reglement=$object->calculate_date_lim_reglement();
}
$numref = $object->getNextNumRef($societe);
}
else

View File

@@ -97,7 +97,8 @@ function test_sql_and_script_inject($val, $type)
// All examples on page: http://ha.ckers.org/xss.html#XSScalc
$sql_inj += preg_match('/<script/i', $val);
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
$sql_inj += preg_match('/base[\s]+href/i', $val);
$sql_inj += preg_match('/base[\s]+href/si', $val);
$sql_inj += preg_match('/<.*onmouse/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
if ($type == 1)
{
$sql_inj += preg_match('/javascript:/i', $val);

View File

@@ -1515,7 +1515,7 @@ class Product extends CommonObject
$sql.= " WHERE entity IN (".getEntity('productprice', 1).")";
$sql.= " AND price_level=".$i;
$sql.= " AND fk_product = '".$this->id."'";
$sql.= " ORDER BY date_price DESC";
$sql.= " ORDER BY date_price DESC, rowid DESC";
$sql.= " LIMIT 1";
$resql = $this->db->query($sql);
if ($resql)
@@ -1576,7 +1576,7 @@ class Product extends CommonObject
$sql.= " price_base_type, tva_tx, tosell, price_by_qty, rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product_price";
$sql.= " WHERE fk_product = '".$this->id."'";
$sql.= " ORDER BY date_price DESC";
$sql.= " ORDER BY date_price DESC, rowid DESC";
$sql.= " LIMIT 1";
$resql = $this->db->query($sql);
if ($resql)

View File

@@ -749,7 +749,7 @@ $sql .= " WHERE fk_product = " . $object->id;
$sql .= " AND p.entity IN (" . getEntity('productprice', 1) . ")";
$sql .= " AND p.fk_user_author = u.rowid";
if (! empty($socid) && ! empty($conf->global->PRODUIT_MULTIPRICES)) $sql .= " AND p.price_level = " . $soc->price_level;
$sql .= " ORDER BY p.date_price DESC, p.price_level ASC, p.rowid DESC";
$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
// $sql .= $db->plimit();
$result = $db->query($sql);

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@@ -125,9 +126,9 @@ if ($result)
while ($objp = $db->fetch_object($result))
{
$found=0;
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $objp->fournisseur) { $found=1; $third['supplier']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire && ($objp->client == 1 || $objp->client == 3)) { $found=1; $third['customer']++; }
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire && ($objp->client == 2 || $objp->client == 3)) { $found=1; $third['prospect']++; }
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire && $objp->fournisseur) { $found=1; $third['supplier']++; }
if (! empty($conf->societe->enabled) && $objp->client == 0 && $objp->fournisseur == 0) { $found=1; $third['other']++; }
if ($found) $total++;
}
@@ -140,9 +141,9 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
{
print '<tr '.$bc[0].'><td align="center" colspan="2">';
$dataseries=array();
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other']));
$data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',0);
@@ -150,19 +151,19 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
}
else
{
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS))
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS) && $user->rights->societe->lire)
{
$statstring = "<tr ".$bc[0].">";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/list.php">'.$langs->trans("Prospects").'</a></td><td align="right">'.round($third['prospect']).'</td>';
$statstring.= "</tr>";
}
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS))
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS) && $user->rights->societe->lire)
{
$statstring.= "<tr ".$bc[1].">";
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/list.php">'.$langs->trans("Customers").'</a></td><td align="right">'.round($third['customer']).'</td>';
$statstring.= "</tr>";
}
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS))
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS) && $user->rights->fournisseur->lire)
{
$statstring2 = "<tr ".$bc[0].">";
$statstring2.= '<td><a href="'.DOL_URL_ROOT.'/fourn/list.php">'.$langs->trans("Suppliers").'</a></td><td align="right">'.round($third['supplier']).'</td>';