|
@@ -2545,7 +2545,7 @@ class Form
|
|
|
$outarray = array();
|
|
|
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$langs->load('other');
|
|
|
}
|
|
|
|
|
@@ -2589,7 +2589,7 @@ class Form
|
|
|
$selectFields .= ", idprodcustprice, custprice, custprice_ttc, custprice_base_type, custtva_tx, custdefault_vat_code, custref";
|
|
|
}
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
|
|
|
$selectFields .= ', unit_long, unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units';
|
|
|
}
|
|
@@ -2634,7 +2634,7 @@ class Form
|
|
|
$sql .= " LEFT JOIN ".$this->db->prefix()."product_customer_price as pcp ON pcp.fk_soc=".((int) $socid)." AND pcp.fk_product=p.rowid";
|
|
|
}
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
|
|
|
}
|
|
|
// Multilang : we add translation
|
|
@@ -2941,7 +2941,7 @@ class Form
|
|
|
|
|
|
// Units
|
|
|
$outvalUnits = '';
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
if (!empty($objp->unit_short)) {
|
|
|
$outvalUnits .= ' - '.$objp->unit_short;
|
|
|
}
|
|
@@ -3277,7 +3277,7 @@ class Form
|
|
|
|
|
|
$langs->load('stocks');
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$langs->load('other');
|
|
|
}
|
|
|
|
|
@@ -3292,7 +3292,7 @@ class Form
|
|
|
$sql .= ", p.description";
|
|
|
}
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$sql .= ", u.label as unit_long, u.short_label as unit_short, p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units";
|
|
|
}
|
|
|
if (isModEnabled('barcode')) {
|
|
@@ -3305,7 +3305,7 @@ class Form
|
|
|
}
|
|
|
$sql .= " LEFT JOIN ".$this->db->prefix()."societe as s ON pfp.fk_soc = s.rowid";
|
|
|
// Units
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
$sql .= " LEFT JOIN ".$this->db->prefix()."c_units u ON u.rowid = p.fk_unit";
|
|
|
}
|
|
|
$sql .= " WHERE p.entity IN (".getEntity('product').")";
|
|
@@ -3398,7 +3398,7 @@ class Form
|
|
|
|
|
|
// Units
|
|
|
$outvalUnits = '';
|
|
|
- if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
|
|
+ if (getDolGlobalInt('PRODUCT_USE_UNITS')) {
|
|
|
if (!empty($objp->unit_short)) {
|
|
|
$outvalUnits .= ' - '.$objp->unit_short;
|
|
|
}
|