Fixed translation of product units in documents

This commit is contained in:
Tim Otte 2020-08-04 11:02:16 +02:00 committed by Laurent Destailleur
parent 96581ef1f4
commit 0e03578e91
14 changed files with 15 additions and 2 deletions

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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))
{ {

View File

@ -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';

View File

@ -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;
} }

View File

@ -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';

View File

@ -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';

View File

@ -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))

View File

@ -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';

View File

@ -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)) {

View File

@ -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';

View File

@ -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';

View File

@ -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';