Fix look and feel v16

This commit is contained in:
Laurent Destailleur 2022-05-28 12:50:25 +02:00
parent 59fcd9de13
commit 7ddf4ef315
2 changed files with 25 additions and 19 deletions

View File

@ -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 .= '<br>';
$label .= '<br><b>'.$langs->trans('ProductAccountancySellCode').':</b> '.length_accountg($this->accountancy_code_sell);
$label .= '<br><b>'.$langs->trans('ProductAccountancySellIntraCode').':</b> '.length_accountg($this->accountancy_code_sell_intra);
$label .= '<br><b>'.$langs->trans('ProductAccountancySellExportCode').':</b> '.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 .= '<br>';

View File

@ -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 "<tr>";
print '<td><a href="'.DOL_URL_ROOT.'/product/stats/card.php?id='.$prodid.'">';
if ($vals['type'] == 1) {
print img_object($langs->trans("ShowService"), "service");
} else {
print img_object($langs->trans("ShowProduct"), "product");
}
print " ";
print $vals['ref'].'</a></td>';
print '<td>';
if ($vals['type'] == 1) {
print $langs->trans("Service");
} else {
print $langs->trans("Product");
}
print $tmpproduct->getNomUrl(1);
print '</td>';
print '<td>'.$vals['label'].'</td>';
print '<td>';
$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 '</td>';
print '<td>'.dol_escape_htmltag($vals['label']).'</td>';
print '<td class="right">'.$vals['nbline'].'</td>';
print "</tr>\n";
$i++;