From 70f6c3fdbb13134a3f2ead471a8b829e789d60fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Mar 2015 12:59:37 +0100 Subject: [PATCH] NEW: List of recent modified supplier product prices in Supplier card --- htdocs/fourn/card.php | 46 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index b9957c12134..c88dae2e8f3 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -5,6 +5,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2014 Jean Heimburger + * Copyright (C) 2015 Marcos GarcĂ­a * * 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 @@ -313,9 +314,50 @@ if ($object->id > 0) $langs->load("products"); print ''; print ''; - print '
'.$langs->trans("ProductsAndServices").''; + print ''.$langs->trans("ProductsAndServices").''; print ''.$langs->trans("All").' '.$object->nbOfProductRefs().''; - print '
'; + print ''; + + //Query from product/liste.php + $sql = 'SELECT p.rowid, p.ref, p.label, pfp.tms,'; + $sql.= ' p.fk_product_type'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp'; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product"; + $sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')'; + $sql.= ' AND pfp.fk_soc = '.$object->id; + $sql .= $db->order('pfp.tms', 'desc'); + $sql.= $db->plimit($MAXLIST); + + $query = $db->query($sql); + + $return = array(); + + if ($db->num_rows($query)) { + + $productstatic = new Product($db); + + while ($objp = $db->fetch_object($query)) { + + $var=!$var; + + $productstatic->id = $objp->rowid; + $productstatic->ref = $objp->ref; + $productstatic->label = $objp->label; + $productstatic->type = $objp->fk_product_type; + + print ""; + print ''; + print $productstatic->getNomUrl(1); + print ''; + print ''; + print dol_trunc(dol_htmlentities($objp->label), 30); + print ''; + print ''.dol_print_date($objp->tms).''; + print ''; + } + } + + print ''; }