From 7ddf4ef315dafb578aa0763e9915889f99f1b1e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 May 2022 12:50:25 +0200 Subject: [PATCH] Fix look and feel v16 --- htdocs/product/class/product.class.php | 4 +-- htdocs/product/popuprop.php | 40 +++++++++++++++----------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 7df8e437272..9358eb9c60d 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4896,14 +4896,14 @@ class Product extends CommonObject } if (!empty($conf->accounting->enabled)) { - if ($this->status) { + if ($this->status && isset($this->accountancy_code_sell)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; $label .= '
'; $label .= '
'.$langs->trans('ProductAccountancySellCode').': '.length_accountg($this->accountancy_code_sell); $label .= '
'.$langs->trans('ProductAccountancySellIntraCode').': '.length_accountg($this->accountancy_code_sell_intra); $label .= '
'.$langs->trans('ProductAccountancySellExportCode').': '.length_accountg($this->accountancy_code_sell_export); } - if ($this->status_buy) { + if ($this->status_buy && isset($this->accountancy_code_buy)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; if (empty($this->status)) { $label .= '
'; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index cfa2f8fc2f6..b921f16d02e 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -68,6 +68,7 @@ restrictedArea($user, 'produit|service', 0, 'product&product', '', ''); */ $form = new Form($db); +$tmpproduct = new Product($db); $helpurl = ''; if ($type == '0') { @@ -124,7 +125,7 @@ $infoprod = array(); // Add lines for object -$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, SUM(pd.qty) as c"; +$sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type as type, p.tobuy, p.tosell, p.tobatch, p.barcode, SUM(pd.qty) as c"; $textforqty = 'Qty'; if ($mode == 'facture') { $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as pd"; @@ -141,7 +142,7 @@ $sql .= " AND p.rowid = pd.fk_product"; if ($type !== '') { $sql .= " AND fk_product_type = ".((int) $type); } -$sql .= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type"; +$sql .= " GROUP BY p.rowid, p.label, p.ref, p.fk_product_type, p.tobuy, p.tosell, p.tobatch, p.barcode"; $num = 0; $totalnboflines = 0; @@ -163,7 +164,7 @@ if (!empty($mode) && $mode != '-1') { while ($i < $num) { $objp = $db->fetch_object($resql); - $infoprod[$objp->rowid] = array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label); + $infoprod[$objp->rowid] = array('type'=>$objp->type, 'ref'=>$objp->ref, 'label'=>$objp->label, 'tobuy'=>$objp->tobuy, 'tosell'=>$objp->tobuy, 'tobatch'=>$objp->tobatch, 'barcode'=>$objp->barcode); $infoprod[$objp->rowid]['nbline'] = $objp->c; $i++; @@ -228,23 +229,28 @@ if ($mode && $mode != '-1') { } } + $tmpproduct->ref = $vals['ref']; + $tmpproduct->label = $vals['label']; + $tmpproduct->type = $vals['type']; + $tmpproduct->status = $vals['tosell']; + $tmpproduct->status_buy = $vals['tobuy']; + $tmpproduct->status_batch = $vals['tobatch']; + $tmpproduct->barcode = $vals['barcode']; + print ""; - print ''; - if ($vals['type'] == 1) { - print img_object($langs->trans("ShowService"), "service"); - } else { - print img_object($langs->trans("ShowProduct"), "product"); - } - print " "; - print $vals['ref'].''; print ''; - if ($vals['type'] == 1) { - print $langs->trans("Service"); - } else { - print $langs->trans("Product"); - } + print $tmpproduct->getNomUrl(1); print ''; - print ''.$vals['label'].''; + print ''; + $s = ''; + if ($vals['type'] == 1) { + $s .= img_picto($langs->trans("Service"), 'service', 'class="paddingleftonly paddingrightonly colorgrey"'); + } else { + $s .= img_picto($langs->trans("Product"), 'product', 'class="paddingleftonly paddingrightonly colorgrey"'); + } + print $s; + print ''; + print ''.dol_escape_htmltag($vals['label']).''; print ''.$vals['nbline'].''; print "\n"; $i++;