forked from Wavyzz/dolibarr
Merge pull request #2466 from marcosgdf/implemented-supplier-prod-list
NEW: List of recent modified supplier product prices in Supplier card
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* 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 '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("ProductsAndServices").'</td><td align="right">';
|
||||
print '<td colspan="2">'.$langs->trans("ProductsAndServices").'</td><td align="right">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/fourn/product/list.php?fourn_id='.$object->id.'">'.$langs->trans("All").' <span class="badge">'.$object->nbOfProductRefs().'</span>';
|
||||
print '</a></td></tr></table>';
|
||||
print '</a></td></tr>';
|
||||
|
||||
//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 "<tr ".$bc[$var].">";
|
||||
print '<td class="nowrap">';
|
||||
print $productstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="center" width="80">';
|
||||
print dol_trunc(dol_htmlentities($objp->label), 30);
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.dol_print_date($objp->tms).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user