Fixed translation of product units in documents
This commit is contained in:
parent
96581ef1f4
commit
0e03578e91
@ -945,6 +945,7 @@ class BOM extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("mrp");
|
$langs->load("mrp");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'standard';
|
$modele = 'standard';
|
||||||
|
|||||||
@ -3787,6 +3787,7 @@ class Propal extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("propale");
|
$langs->load("propale");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'azur';
|
$modele = 'azur';
|
||||||
|
|||||||
@ -3990,6 +3990,7 @@ class Commande extends CommonOrder
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'einstein';
|
$modele = 'einstein';
|
||||||
|
|||||||
@ -4402,6 +4402,7 @@ class Facture extends CommonInvoice
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele))
|
if (!dol_strlen($modele))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2468,6 +2468,7 @@ class Contrat extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'strato';
|
$modele = 'strato';
|
||||||
|
|||||||
@ -74,12 +74,12 @@ abstract class CommonObjectLine extends CommonObject
|
|||||||
$label_type = 'short_label';
|
$label_type = 'short_label';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
|
$sql = 'select '.$label_type.',code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql && $this->db->num_rows($resql) > 0)
|
if ($resql && $this->db->num_rows($resql) > 0)
|
||||||
{
|
{
|
||||||
$res = $this->db->fetch_array($resql);
|
$res = $this->db->fetch_array($resql);
|
||||||
$label = $res[$label_type];
|
$label = ($label_type == 'short' ? $res[$label_type] : 'unit'.$res['code']);
|
||||||
$this->db->free($resql);
|
$this->db->free($resql);
|
||||||
return $label;
|
return $label;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2567,6 +2567,7 @@ class Expedition extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("sendings");
|
$langs->load("sendings");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'rouget';
|
$modele = 'rouget';
|
||||||
|
|||||||
@ -3084,6 +3084,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'muscadet';
|
$modele = 'muscadet';
|
||||||
|
|||||||
@ -2721,6 +2721,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
// Set the model on the model name to use
|
// Set the model on the model name to use
|
||||||
if (empty($modele))
|
if (empty($modele))
|
||||||
|
|||||||
@ -1068,6 +1068,7 @@ class Livraison extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("deliveries");
|
$langs->load("deliveries");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'typhon';
|
$modele = 'typhon';
|
||||||
|
|||||||
@ -4568,6 +4568,7 @@ class Product extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
// Positionne le modele sur le nom du modele a utiliser
|
// Positionne le modele sur le nom du modele a utiliser
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
|
|||||||
@ -878,6 +878,7 @@ class Entrepot extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'standard';
|
$modele = 'standard';
|
||||||
|
|||||||
@ -1164,6 +1164,7 @@ class MouvementStock extends CommonObject
|
|||||||
global $conf, $user, $langs;
|
global $conf, $user, $langs;
|
||||||
|
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'stdmovement';
|
$modele = 'stdmovement';
|
||||||
|
|||||||
@ -2722,6 +2722,7 @@ class SupplierProposal extends CommonObject
|
|||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
$langs->load("supplier_proposal");
|
$langs->load("supplier_proposal");
|
||||||
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
$modele = 'aurore';
|
$modele = 'aurore';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user