Skip to content
Snippets Groups Projects
Commit 638e90eb authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Fix: Margin tabs bad data show

parent d629c55e
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,7 @@ Fix: [ bug #1280 ] service with not end of date was tagged as expired.
Fix: [ bug #1295 ] Error when creating an agenda extrafield with a number as reference
Fix: [ bug #1306 ] Fatal error when adding an external calendar
New: Added es_CL language
Fix: Margin tabs bad data show
***** ChangeLog for 3.5 compared to 3.4.* *****
For users:
......
<?php
/* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 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
......@@ -130,11 +131,14 @@ if ($agentid > 0) {
else
$sql .= " AND sc.fk_user = ".$agentid;
}
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
if (!empty($startdate))
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate))
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
if($agentid) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, u.rowid, u.login, u.lastname, u.firstname";
else $sql.= " GROUP BY u.rowid, u.login, u.lastname, u.firstname";
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
......
<?php
/* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 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
......@@ -172,13 +173,18 @@ $sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
if ($client) $sql.= " AND f.fk_soc = ".$socid;
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
if ($client)
$sql.= " AND f.fk_soc = ".$socid;
if (!empty($startdate))
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate))
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
$sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
$sql .= " AND d.buy_price_ht <> 0";
if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client";
$sql.= " ORDER BY $sortfield $sortorder ";
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
......
<?php
/* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2014 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
......@@ -178,12 +179,19 @@ $sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND d.fk_product = p.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND d.fk_facture = f.rowid";
if ($id > 0) $sql.= " AND d.fk_product =".$id;
if (!empty($startdate)) $sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate)) $sql.= " AND f.datef <= '".$db->idate($enddate)."'";
if ($id > 0)
$sql.= " AND d.fk_product =".$id;
if (!empty($startdate))
$sql.= " AND f.datef >= '".$db->idate($startdate)."'";
if (!empty($enddate))
$sql.= " AND f.datef <= '".$db->idate($enddate)."'";
$sql .= " AND d.buy_price_ht IS NOT NULL";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) $sql .= " AND d.buy_price_ht <> 0";
$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)
$sql .= " AND d.buy_price_ht <> 0";
if ($id > 0)
$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref, d.fk_product, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut";
else
$sql.= " GROUP BY p.label, p.rowid, p.fk_product_type, p.ref";
$sql.= " ORDER BY ".$sortfield." ".$sortorder;
// TODO: calculate total to display then restore pagination
//$sql.= $db->plimit($conf->liste_limit +1, $offset);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment