dolibarr  19.0.0-dev
Functions
product.lib.php File Reference

Ensemble de fonctions de base pour le module produit et service. More...

Go to the source code of this file.

Functions

 product_prepare_head ($object)
 Prepare array with list of tabs. More...
 
 productlot_prepare_head ($object)
 Prepare array with list of tabs. More...
 
 product_admin_prepare_head ()
 Return array head with list of tabs to view object informations. More...
 
 product_lot_admin_prepare_head ()
 Return array head with list of tabs to view object informations. More...
 
 show_stats_for_company ($product, $socid)
 Show stats for company. More...
 
 show_stats_for_batch ($batch, $socid)
 Show stats for product batch. More...
 
 measuring_units_string ($scale='', $measuring_style='', $unit=0, $use_short_label=0, $outputlangs=null)
 Return translation label of a unit key. More...
 
 measuringUnitString ($unit, $measuring_style='', $scale='', $use_short_label=0, $outputlangs=null)
 Return translation label of a unit key. More...
 
 measuring_units_squared ($unit)
 Transform a given unit scale into the square of that unit, if known. More...
 
 measuring_units_cubed ($unit)
 Transform a given unit scale into the cube of that unit, if known. More...
 

Detailed Description

Ensemble de fonctions de base pour le module produit et service.

Definition in file product.lib.php.

Function Documentation

◆ measuring_units_cubed()

measuring_units_cubed (   $unit)

Transform a given unit scale into the cube of that unit, if known.

Parameters
int$unitUnit scale key (-3,-2,-1,0,98,99...)
Returns
int Cubed unit key (-9,-6,-3,0,88,89...)
See also
formproduct->selectMeasuringUnits

Definition at line 885 of file product.lib.php.

◆ measuring_units_squared()

measuring_units_squared (   $unit)

Transform a given unit scale into the square of that unit, if known.

Parameters
int$unitUnit scale key (-3,-2,-1,0,98,99...)
Returns
int Squared unit key (-6,-4,-2,0,98,99...)
See also
formproduct->selectMeasuringUnits

Definition at line 865 of file product.lib.php.

◆ measuring_units_string()

measuring_units_string (   $scale = '',
  $measuring_style = '',
  $unit = 0,
  $use_short_label = 0,
  $outputlangs = null 
)

Return translation label of a unit key.

Function kept for backward compatibility.

Parameters
string$scaleScale of unit: '0', '-3', '6', ...
string$measuring_styleStyle of unit: weight, volume,...
int$unitID of unit (rowid in llx_c_units table)
int$use_short_label1=Use short label ('g' instead of 'gram'). Short labels are not translated.
Translate$outputlangsLanguage object
Returns
string Unit string
See also
measuringUnitString() formproduct->selectMeasuringUnits()

Definition at line 789 of file product.lib.php.

◆ measuringUnitString()

measuringUnitString (   $unit,
  $measuring_style = '',
  $scale = '',
  $use_short_label = 0,
  $outputlangs = null 
)

Return translation label of a unit key.

Parameters
int$unitID of unit (rowid in llx_c_units table)
string$measuring_styleStyle of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE
string$scaleScale of unit: '0', '-3', '6', ...
int$use_short_label1=Use short label ('g' instead of 'gram'). Short labels are not translated.
Translate$outputlangsLanguage object
Returns
string Unit string
See also
formproduct->selectMeasuringUnits()

Definition at line 805 of file product.lib.php.

◆ product_admin_prepare_head()

product_admin_prepare_head ( )

Return array head with list of tabs to view object informations.

Returns
array head array with tabs

Definition at line 320 of file product.lib.php.

◆ product_lot_admin_prepare_head()

product_lot_admin_prepare_head ( )

Return array head with list of tabs to view object informations.

Returns
array head array with tabs

Definition at line 381 of file product.lib.php.

◆ product_prepare_head()

product_prepare_head (   $object)

Prepare array with list of tabs.

Parameters
Product$objectObject related to tabs
Returns
array Array of tabs to show

Definition at line 36 of file product.lib.php.

◆ productlot_prepare_head()

productlot_prepare_head (   $object)

Prepare array with list of tabs.

Parameters
ProductLot$objectObject related to tabs
Returns
array Array of tabs to show

Definition at line 242 of file product.lib.php.

◆ show_stats_for_batch()

show_stats_for_batch (   $batch,
  $socid 
)

Show stats for product batch.

Parameters
Productlot$batchProduct batch object
int$socidThirdparty id
Returns
integer NB of lines shown into array

Definition at line 664 of file product.lib.php.

◆ show_stats_for_company()

show_stats_for_company (   $product,
  $socid 
)

Show stats for company.

Parameters
Product$productProduct object
int$socidThirdparty id
Returns
integer NB of lines shown into array

Definition at line 425 of file product.lib.php.