Add weight and size in sendings
This commit is contained in:
parent
156cf92cbb
commit
5eb71a3f6b
@ -251,8 +251,18 @@ class Expedition extends CommonObject
|
|||||||
$this->modelpdf = $obj->model_pdf;
|
$this->modelpdf = $obj->model_pdf;
|
||||||
$this->expedition_method_id = $obj->fk_expedition_methode;
|
$this->expedition_method_id = $obj->fk_expedition_methode;
|
||||||
$this->tracking_number = $obj->tracking_number;
|
$this->tracking_number = $obj->tracking_number;
|
||||||
|
|
||||||
$this->trueWeight = $obj->weight;
|
$this->trueWeight = $obj->weight;
|
||||||
$this->weight_units = $obj->weight_units;
|
$this->weight_units = $obj->weight_units;
|
||||||
|
|
||||||
|
$this->trueWidth = $obj->width;
|
||||||
|
$this->width_units = $obj->size_units;
|
||||||
|
$this->trueHeight = $obj->height;
|
||||||
|
$this->height_units = $obj->size_units;
|
||||||
|
$this->trueDepth = $obj->size;
|
||||||
|
$this->depth_units = $obj->size_units;
|
||||||
|
|
||||||
|
// A denormalized value
|
||||||
$this->trueSize = $obj->size."x".$obj->width."x".$obj->height;
|
$this->trueSize = $obj->size."x".$obj->width."x".$obj->height;
|
||||||
$this->size_units = $obj->size_units;
|
$this->size_units = $obj->size_units;
|
||||||
|
|
||||||
|
|||||||
@ -29,11 +29,12 @@
|
|||||||
|
|
||||||
require("./pre.inc.php");
|
require("./pre.inc.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php");
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/html.formproduct.class.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/sendings.lib.php");
|
||||||
if ($conf->produit->enabled) require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
if ($conf->produit->enabled) require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
if ($conf->propal->enabled) require_once(DOL_DOCUMENT_ROOT."/propal.class.php");
|
||||||
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/commande.class.php");
|
||||||
if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
|
if ($conf->stock->enabled) require_once(DOL_DOCUMENT_ROOT."/product/stock/entrepot.class.php");
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@ -194,6 +195,7 @@ llxHeader('',$langs->trans('Sending'),'Expedition');
|
|||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
$formproduct = new FormProduct($db);
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
*
|
*
|
||||||
@ -295,16 +297,16 @@ if ($_GET["action"] == 'create')
|
|||||||
print '<table><tr><td>';
|
print '<table><tr><td>';
|
||||||
print $langs->trans("Weight");
|
print $langs->trans("Weight");
|
||||||
print '</td><td><input name="weight" size="4" value=""></td><td>';
|
print '</td><td><input name="weight" size="4" value=""></td><td>';
|
||||||
print $html->select_measuring_units("weight_units","weight");
|
print $formproduct->select_measuring_units("weight_units","weight");
|
||||||
print '</td></tr><tr><td>';
|
print '</td></tr><tr><td>';
|
||||||
print $langs->trans("width");
|
print $langs->trans("Width");
|
||||||
print ' </td><td><input name="sizeW" size="4" value=""></td>';
|
print ' </td><td><input name="sizeW" size="4" value=""></td>';
|
||||||
print '<td> </td></tr><tr><td>';
|
print '<td> </td></tr><tr><td>';
|
||||||
print $langs->trans("height");
|
print $langs->trans("Height");
|
||||||
print '</td><td><input name="sizeH" size="4" value=""></td><td>';
|
print '</td><td><input name="sizeH" size="4" value=""></td><td>';
|
||||||
print $html->select_measuring_units("size_units","size");
|
print $formproduct->select_measuring_units("size_units","size");
|
||||||
print '</td></tr><tr><td>';
|
print '</td></tr><tr><td>';
|
||||||
print $langs->trans("depth");
|
print $langs->trans("Depth");
|
||||||
print '</td><td><input name="sizeS" size="4" value=""></td>';
|
print '</td><td><input name="sizeS" size="4" value=""></td>';
|
||||||
print '<td> </td></tr></table>';
|
print '<td> </td></tr></table>';
|
||||||
|
|
||||||
@ -671,7 +673,7 @@ else
|
|||||||
// Taille
|
// Taille
|
||||||
print '<tr><td>'.$langs->trans("Size").'</td>';
|
print '<tr><td>'.$langs->trans("Size").'</td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
if ($expedition->trueSize != 'xx' || measuring_units_string($expedition->size_units,"size"))
|
if ($expedition->trueWidth || $expedition->trueHeight || $expedition->trueDepth)
|
||||||
{
|
{
|
||||||
// If sending size defined
|
// If sending size defined
|
||||||
print $expedition->trueSize.' '.measuring_units_string($expedition->size_units,"size");
|
print $expedition->trueSize.' '.measuring_units_string($expedition->size_units,"size");
|
||||||
|
|||||||
@ -277,7 +277,7 @@ class FormFile
|
|||||||
if (empty($noform)) print '<form action="'.$urlsource.'#builddoc" method="post">';
|
if (empty($noform)) print '<form action="'.$urlsource.'#builddoc" method="post">';
|
||||||
print '<input type="hidden" name="action" value="builddoc">';
|
print '<input type="hidden" name="action" value="builddoc">';
|
||||||
|
|
||||||
print_titre($langs->trans("Documents"));
|
print_titre($langs->trans("BuildDocuments"));
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class FormProduct
|
|||||||
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
$sql = "SELECT e.rowid, e.label FROM ".MAIN_DB_PREFIX."entrepot as e";
|
||||||
$sql .= " WHERE statut = 1";
|
$sql .= " WHERE statut = 1";
|
||||||
$sql .= " ORDER BY e.label";
|
$sql .= " ORDER BY e.label";
|
||||||
|
|
||||||
dolibarr_syslog('FormProduct::loadWarehouses sql='.$sql,LOG_DEBUG);
|
dolibarr_syslog('FormProduct::loadWarehouses sql='.$sql,LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -82,13 +82,13 @@ class FormProduct
|
|||||||
}
|
}
|
||||||
return $num;
|
return $num;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
dolibarr_print_error($this->db);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la liste des modes de paiements possibles
|
* \brief Retourne la liste des modes de paiements possibles
|
||||||
* \param selected Id du mode de paiement pré-sélectionné
|
* \param selected Id du mode de paiement pré-sélectionné
|
||||||
@ -118,7 +118,7 @@ class FormProduct
|
|||||||
print '</select>';
|
print '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Selection des unites de mesure
|
* \brief Selection des unites de mesure
|
||||||
* \param name Nom champ html
|
* \param name Nom champ html
|
||||||
@ -145,6 +145,13 @@ class FormProduct
|
|||||||
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
||||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||||
}
|
}
|
||||||
|
else if ($measuring_style == 'size')
|
||||||
|
{
|
||||||
|
$measuring_units[0] = $langs->trans("SizeUnitm");
|
||||||
|
$measuring_units[-1] = $langs->trans("SizeUnitdm");
|
||||||
|
$measuring_units[-2] = $langs->trans("SizeUnitcm");
|
||||||
|
$measuring_units[-3] = $langs->trans("SizeUnitmm");
|
||||||
|
}
|
||||||
|
|
||||||
print '<select class="flat" name="'.$name.'">';
|
print '<select class="flat" name="'.$name.'">';
|
||||||
if ($adddefault) print '<option value="0">'.$langs->trans("Default").'</option>';
|
if ($adddefault) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||||
@ -160,7 +167,7 @@ class FormProduct
|
|||||||
}
|
}
|
||||||
print '</select>';
|
print '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -438,6 +438,7 @@ YouCanChangeValuesForThisListFromDictionnarySetup=You can change values for this
|
|||||||
Color=Color
|
Color=Color
|
||||||
Documents=Linked files
|
Documents=Linked files
|
||||||
Documents2=Documents
|
Documents2=Documents
|
||||||
|
BuildDocuments=Generated documents
|
||||||
UploadDisabled=Upload disabled
|
UploadDisabled=Upload disabled
|
||||||
MenuECM=Documents
|
MenuECM=Documents
|
||||||
MenuAWStats=AWStats
|
MenuAWStats=AWStats
|
||||||
|
|||||||
@ -437,6 +437,7 @@ YouCanChangeValuesForThisListFromDictionnarySetup=Vous pouvez changer ces valeur
|
|||||||
Color=Couleur
|
Color=Couleur
|
||||||
Documents=Fichiers joints
|
Documents=Fichiers joints
|
||||||
Documents2=Documents
|
Documents2=Documents
|
||||||
|
BuildDocuments=Documents générés
|
||||||
UploadDisabled=Transfert désactivé
|
UploadDisabled=Transfert désactivé
|
||||||
MenuECM=Documents
|
MenuECM=Documents
|
||||||
MenuAWStats=AWStats
|
MenuAWStats=AWStats
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user