Merge remote-tracking branch 'origin/3.8' into 3.9

Conflicts:
	htdocs/compta/charges/index.php
This commit is contained in:
Laurent Destailleur 2016-02-18 23:27:57 +01:00
commit 52c82508e4
3 changed files with 18 additions and 14 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
@ -85,8 +85,7 @@ if (GETPOST("mode") != 'sconly')
print "<br>";
}
if ($conf->tax->enabled)
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
// Social contributions only
if (GETPOST("mode") != 'sconly')
@ -197,7 +196,7 @@ if ($conf->tax->enabled)
}
// VAT
if ($conf->tax->enabled)
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
@ -380,16 +379,16 @@ while($j<$numlt)
}
// Payment Salary
if ($conf->salaries->enabled)
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
{
if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly')
{
$sal = new PaymentSalary($db);
print '<br>';
print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
print "<br>";
print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', '');
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u";

View File

@ -146,10 +146,11 @@ class pdf_paiement
$num=0;
$lines=array();
// count number of ligne of payement
// count number of lines of payment
$sql = "SELECT p.rowid as prowid";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p";
$sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
$sql.= " AND p.entity = " . $conf->entity;
$result = $this->db->query($sql);
if ($result)
{
@ -160,19 +161,23 @@ class pdf_paiement
$sql = "SELECT p.datep as dp, f.facnumber";
//$sql .= ", c.libelle as paiement_type, p.num_paiement";
$sql.= ", c.code as paiement_code, p.num_paiement";
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount ";
$sql.= ", pf.amount as pf_amount , ba.ref as bankaccount ";
$sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
$sql.= ", pf.amount as pf_amount";
if (! empty($conf->banque->enabled))
$sql.= ", ba.ref as bankaccount";
$sql.= ", p.rowid as prowid";
$sql.= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
if (! empty($conf->banque->enabled))
$sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
$sql.= " ".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && ! $socid)
{
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql.= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
$sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
if (! empty($conf->banque->enabled))
$sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " AND p.fk_paiement = c.id ";
$sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";

View File

@ -1432,7 +1432,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
// Count total nb of records
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$nbtotalofrecords = $prodcustprice->fetch_all($sortfield, $sortorder, 0, 0, $filter);
$nbtotalofrecords = $prodcustprice->fetch_all($sortorder, $sortfield, 0, 0, $filter);
}
$result = $prodcustprice->fetch_all($sortorder, $sortfield, $conf->liste_limit, $offset, $filter);