From aeceea2d26d97fc88565d1b251a979c00d63c199 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 10 Oct 2018 17:30:44 +0200 Subject: [PATCH] FIX index.php --- htdocs/reception/class/reception.class.php | 2 +- htdocs/reception/index.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 86333c512e9..df21145aa2c 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2014-2015 Francis Appels * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016 Ferran Marcet - * Copyright (C) 2018 Quentin Vial-Gouteyron + * Copyright (C) 2018 Quentin Vial-Gouteyron * * 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 diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index 085356f87b3..d8fef2e7d52 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -238,8 +238,8 @@ $sql = "SELECT e.rowid, e.ref, e.ref_supplier,"; $sql.= " s.nom as name, s.rowid as socid,"; $sql.= " c.ref as commande_fournisseur_ref, c.rowid as commande_fournisseur_id"; $sql.= " FROM ".MAIN_DB_PREFIX."reception as e"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception' AND el.sourcetype IN ('commande_fournisseur')"; -$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande_fournisseur') AND el.targettype = 'reception'"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'reception' AND el.sourcetype IN ('order_supplier')"; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."commande_fournisseur as c ON el.fk_source = c.rowid AND el.sourcetype IN ('order_supplier') AND el.targettype = 'reception'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc"; $sql.= " WHERE e.entity IN (".getEntity('reception').")"; @@ -247,6 +247,7 @@ if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND sc.fk_user $sql.= " AND e.fk_statut = 1"; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $sql.= " ORDER BY e.date_delivery DESC"; + $sql.= $db->plimit(5, 0); $resql = $db->query($sql);