From 3a690c76436893aaacae474516c33f2db747555a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 27 May 2009 16:11:33 +0000 Subject: [PATCH] New: Add stock in product lists --- ChangeLog | 1 + htdocs/html.form.class.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bd541ad76f7..160a4c7af05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ For users: - New: Can use inline images in emails. - New: Add predefined invoices (can be use for repeated invoices). - New: Add a confirmation when cloning products. +- New: Add stock in product lists - Fix: Customer code was not correct on PDF it if contains special characters. - Fix: Can update price even with "NPR" VAT rates. diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 310d83ca5c6..14ecd61fb84 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -774,7 +774,7 @@ class Form { $sql.="DISTINCT"; } - $sql.= " p.rowid, p.label, p.ref, p.price, p.price_ttc, p.price_base_type, p.duration"; + $sql.= " p.rowid, p.label, p.ref, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.duration, p.stock"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p "; if ($conf->categorie->enabled && ! $user->rights->categorie->voir) { @@ -907,6 +907,11 @@ class Form $opt.= price($objp->price_ttc,1).' '.$langs->trans("Currency".$conf->monnaie).' '.$langs->trans("TTC"); } + if ($conf->stock->enabled && isset($objp->stock) && $objp->fk_product_type == 0) + { + $opt.= ' - '.$langs->trans("Stock").':'.$objp->stock; + } + if ($objp->duration) { $duration_value = substr($objp->duration,0,strlen($objp->duration)-1);