FIX - Box
This commit is contained in:
parent
67e523de20
commit
cd46f8b3b9
@ -150,6 +150,11 @@ class box_produits extends ModeleBoxes
|
|||||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
||||||
$productstatic->date_modification = $datem;
|
$productstatic->date_modification = $datem;
|
||||||
|
|
||||||
|
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
|
||||||
|
if ($productstatic->isService()) {
|
||||||
|
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
||||||
|
}
|
||||||
|
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
||||||
'text' => $productstatic->getNomUrl(1),
|
'text' => $productstatic->getNomUrl(1),
|
||||||
@ -162,22 +167,24 @@ class box_produits extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
$price = '';
|
$price = '';
|
||||||
$price_base_type = '';
|
$price_base_type = '';
|
||||||
if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) {
|
if ($usercancreadprice) {
|
||||||
$price_base_type = $langs->trans($objp->price_base_type);
|
if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) {
|
||||||
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
|
$price_base_type = $langs->trans($objp->price_base_type);
|
||||||
} else {
|
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
|
||||||
//Parse the dynamic price
|
} else {
|
||||||
$productstatic->fetch($objp->rowid, '', '', 1);
|
//Parse the dynamic price
|
||||||
$priceparser = new PriceParser($this->db);
|
$productstatic->fetch($objp->rowid, '', '', 1);
|
||||||
$price_result = $priceparser->parseProduct($productstatic);
|
$priceparser = new PriceParser($this->db);
|
||||||
if ($price_result >= 0) {
|
$price_result = $priceparser->parseProduct($productstatic);
|
||||||
if ($objp->price_base_type == 'HT') {
|
if ($price_result >= 0) {
|
||||||
$price_base_type = $langs->trans("HT");
|
if ($objp->price_base_type == 'HT') {
|
||||||
} else {
|
$price_base_type = $langs->trans("HT");
|
||||||
$price_result = $price_result * (1 + ($productstatic->tva_tx / 100));
|
} else {
|
||||||
$price_base_type = $langs->trans("TTC");
|
$price_result = $price_result * (1 + ($productstatic->tva_tx / 100));
|
||||||
|
$price_base_type = $langs->trans("TTC");
|
||||||
|
}
|
||||||
|
$price = price($price_result);
|
||||||
}
|
}
|
||||||
$price = price($price_result);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->info_box_contents[$line][] = array(
|
$this->info_box_contents[$line][] = array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user