';
+ print '';
}
/* A delivery note should be just more properties of a shipment, so notes are on shipment
@@ -690,9 +690,9 @@ if ($action == 'create') // Create. Seems to no be used
$shipment = new Expedition($db);
$shipment->fetch($object->origin_id);
- // Show links to link elements
- //$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
- $somethingshown = $form->showLinkedObjectBlock($object, '');
+ // Show links to link elements
+ //$linktoelem = $form->showLinkToObjectBlock($object, null, array('order'));
+ $somethingshown = $form->showLinkedObjectBlock($object, '');
}
diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php
index c5b62d4233d..74ba0f86de0 100644
--- a/htdocs/delivery/class/delivery.class.php
+++ b/htdocs/delivery/class/delivery.class.php
@@ -88,8 +88,8 @@ class Delivery extends CommonObject
public $date_delivery;
/**
- * @var integer|string date_creation
- */
+ * @var integer|string date_creation
+ */
public $date_creation;
/**
@@ -108,7 +108,7 @@ class Delivery extends CommonObject
*
* @param DoliDB $db Database handler
*/
- public function __construct($db)
+ public function __construct($db)
{
$this->db = $db;
$this->lines = array();
@@ -126,7 +126,7 @@ class Delivery extends CommonObject
* @param User $user Objet du user qui cree
* @return int <0 si erreur, id delivery cree si ok
*/
- public function create($user)
+ public function create($user)
{
global $conf;
@@ -136,7 +136,7 @@ class Delivery extends CommonObject
$error = 0;
- $now = dol_now();
+ $now = dol_now();
/* Delivery note as draft On positionne en mode draft le bon de livraison */
$this->draft = 1;
@@ -170,8 +170,8 @@ class Delivery extends CommonObject
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
$sql .= ", ".(!empty($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null");
$sql .= ", ".(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null");
- $sql .= ", ".(int) $this->fk_incoterms;
- $sql .= ", '".$this->db->escape($this->location_incoterms)."'";
+ $sql .= ", ".(int) $this->fk_incoterms;
+ $sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ")";
dol_syslog("Delivery::create", LOG_DEBUG);
@@ -256,7 +256,7 @@ class Delivery extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create a line
*
@@ -266,9 +266,9 @@ class Delivery extends CommonObject
* @param string $description Description
* @return int <0 if KO, >0 if OK
*/
- public function create_line($origin_id, $qty, $fk_product, $description)
- {
- // phpcs:enable
+ public function create_line($origin_id, $qty, $fk_product, $description)
+ {
+ // phpcs:enable
$error = 0;
$idprod = $fk_product;
$j = 0;
@@ -298,7 +298,7 @@ class Delivery extends CommonObject
* @param int $id Id of object to load
* @return integer
*/
- public function fetch($id)
+ public function fetch($id)
{
global $conf;
@@ -306,8 +306,8 @@ class Delivery extends CommonObject
$sql .= " l.total_ht, l.fk_statut, l.fk_user_valid, l.note_private, l.note_public";
$sql .= ", l.date_delivery, l.fk_address, l.model_pdf";
$sql .= ", el.fk_source as origin_id, el.sourcetype as origin";
- $sql .= ', l.fk_incoterms, l.location_incoterms';
- $sql .= ", i.libelle as label_incoterms";
+ $sql .= ', l.fk_incoterms, l.location_incoterms';
+ $sql .= ", i.libelle as label_incoterms";
$sql .= " FROM ".MAIN_DB_PREFIX."delivery as l";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = l.rowid AND el.targettype = '".$this->db->escape($this->element)."'";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON l.fk_incoterms = i.rowid';
@@ -374,14 +374,14 @@ class Delivery extends CommonObject
/**
* Validate object and update stock if option enabled
*
- * @param User $user Object user that validate
- * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
- * @return int
+ * @param User $user Object user that validate
+ * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
+ * @return int
*/
- public function valid($user, $notrigger = 0)
+ public function valid($user, $notrigger = 0)
{
global $conf, $langs;
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
dol_syslog(get_class($this)."::valid begin");
@@ -389,8 +389,8 @@ class Delivery extends CommonObject
$error = 0;
- if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
+ || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
{
if (!empty($conf->global->DELIVERY_ADDON_NUMBER))
{
@@ -409,12 +409,12 @@ class Delivery extends CommonObject
$soc->fetch($this->socid);
if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life
- {
- $numref = $objMod->delivery_get_num($soc, $this);
- } else {
- $numref = $this->ref;
- }
- $this->newref = dol_sanitizeFileName($numref);
+ {
+ $numref = $objMod->delivery_get_num($soc, $this);
+ } else {
+ $numref = $this->ref;
+ }
+ $this->newref = dol_sanitizeFileName($numref);
// Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice.
$sql = "SELECT ref";
@@ -442,24 +442,24 @@ class Delivery extends CommonObject
$sql .= " AND fk_statut = 0";
$resql = $this->db->query($sql);
- if (!$resql)
- {
- dol_print_error($this->db);
- $this->error = $this->db->lasterror();
- $error++;
- }
+ if (!$resql)
+ {
+ dol_print_error($this->db);
+ $this->error = $this->db->lasterror();
+ $error++;
+ }
- if (!$error && !$notrigger)
- {
- // Call trigger
- $result = $this->call_trigger('DELIVERY_VALIDATE', $user);
- if ($result < 0) $error++;
- // End call triggers
- }
+ if (!$error && !$notrigger)
+ {
+ // Call trigger
+ $result = $this->call_trigger('DELIVERY_VALIDATE', $user);
+ if ($result < 0) $error++;
+ // End call triggers
+ }
if (!$error)
{
- $this->oldref = $this->ref;
+ $this->oldref = $this->ref;
// Rename directory if dir was a temporary ref
if (preg_match('/^[\(]?PROV/i', $this->ref))
@@ -481,17 +481,17 @@ class Delivery extends CommonObject
if (@rename($dirsource, $dirdest))
{
- dol_syslog("Rename ok");
- // Rename docs starting with $oldref with $newref
- $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
- foreach ($listoffiles as $fileentry)
- {
- $dirsource = $fileentry['name'];
- $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
- $dirsource = $fileentry['path'].'/'.$dirsource;
- $dirdest = $fileentry['path'].'/'.$dirdest;
- @rename($dirsource, $dirdest);
- }
+ dol_syslog("Rename ok");
+ // Rename docs starting with $oldref with $newref
+ $listoffiles = dol_dir_list($conf->expedition->dir_output.'/receipt/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
+ foreach ($listoffiles as $fileentry)
+ {
+ $dirsource = $fileentry['name'];
+ $dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
+ $dirsource = $fileentry['path'].'/'.$dirsource;
+ $dirdest = $fileentry['path'].'/'.$dirdest;
+ @rename($dirsource, $dirdest);
+ }
}
}
}
@@ -506,14 +506,14 @@ class Delivery extends CommonObject
dol_syslog(get_class($this)."::valid ok");
}
- if (!$error)
- {
- $this->db->commit();
- return 1;
- } else {
- $this->db->rollback();
- return -1;
- }
+ if (!$error)
+ {
+ $this->db->commit();
+ return 1;
+ } else {
+ $this->db->rollback();
+ return -1;
+ }
}
}
} else {
@@ -523,7 +523,7 @@ class Delivery extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Creating the delivery slip from an existing shipment
*
@@ -531,9 +531,9 @@ class Delivery extends CommonObject
* @param int $sending_id Id of the expedition that serves as a model
* @return integer
*/
- public function create_from_sending($user, $sending_id)
+ public function create_from_sending($user, $sending_id)
{
- // phpcs:enable
+ // phpcs:enable
$expedition = new Expedition($this->db);
$result = $expedition->fetch($sending_id);
@@ -569,7 +569,7 @@ class Delivery extends CommonObject
return $this->create($user);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Update a livraison line (only extrafields)
*
@@ -577,9 +577,9 @@ class Delivery extends CommonObject
* @param array $array_options extrafields array
* @return int <0 if KO, >0 if OK
*/
- public function update_line($id, $array_options = 0)
+ public function update_line($id, $array_options = 0)
{
- // phpcs:enable
+ // phpcs:enable
global $conf;
$error = 0;
@@ -609,7 +609,7 @@ class Delivery extends CommonObject
* @param int $qty Qty
* @return void
*/
- public function addline($origin_id, $qty)
+ public function addline($origin_id, $qty)
{
$num = count($this->lines);
$line = new DeliveryLine($this->db);
@@ -626,7 +626,7 @@ class Delivery extends CommonObject
* @param int $lineid Line id
* @return integer|null
*/
- public function deleteline($lineid)
+ public function deleteline($lineid)
{
if ($this->statut == 0)
{
@@ -649,11 +649,11 @@ class Delivery extends CommonObject
*
* @return integer
*/
- public function delete()
+ public function delete()
{
global $conf, $langs, $user;
- require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$this->db->begin();
$error = 0;
@@ -697,14 +697,14 @@ class Delivery extends CommonObject
}
}
- // Call trigger
- $result = $this->call_trigger('DELIVERY_DELETE', $user);
- if ($result < 0)
- {
- $this->db->rollback();
- return -4;
- }
- // End call triggers
+ // Call trigger
+ $result = $this->call_trigger('DELIVERY_DELETE', $user);
+ if ($result < 0)
+ {
+ $this->db->rollback();
+ return -4;
+ }
+ // End call triggers
return 1;
} else {
@@ -728,10 +728,10 @@ class Delivery extends CommonObject
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
- * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string Chaine avec URL
*/
- public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1)
+ public function getNomUrl($withpicto = 0, $save_lastsearch_value = -1)
{
global $langs;
@@ -742,16 +742,16 @@ class Delivery extends CommonObject
$url = DOL_URL_ROOT.'/delivery/card.php?id='.$this->id;
- //if ($option !== 'nolink')
- //{
- // Add param to save lastsearch_values or not
- $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
- if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
- if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
- //}
+ //if ($option !== 'nolink')
+ //{
+ // Add param to save lastsearch_values or not
+ $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
+ if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
+ //}
- $linkstart = '';
+ $linkstart = '';
$linkend = '';
if ($withpicto) $result .= ($linkstart.img_object($label, $this->picto, 'class="classfortooltip"').$linkend);
@@ -760,15 +760,15 @@ class Delivery extends CommonObject
return $result;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load lines
*
* @return void
*/
- public function fetch_lines()
+ public function fetch_lines()
{
- // phpcs:enable
+ // phpcs:enable
$this->lines = array();
$sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, ";
@@ -844,12 +844,12 @@ class Delivery extends CommonObject
* @param int $mode Mode
* @return string Label
*/
- public function getLibStatut($mode = 0)
+ public function getLibStatut($mode = 0)
{
return $this->LibStatut($this->statut, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Renvoi le libelle d'un statut donne
*
@@ -857,9 +857,9 @@ class Delivery extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
* @return string Label
*/
- public function LibStatut($status, $mode)
+ public function LibStatut($status, $mode)
{
- // phpcs:enable
+ // phpcs:enable
global $langs;
if (empty($this->labelStatus) || empty($this->labelStatusShort))
@@ -883,19 +883,19 @@ class Delivery extends CommonObject
/**
- * Initialise an instance with random values.
- * Used to build previews or test instances.
- * id must be 0 if object instance is a specimen.
- *
- * @return void
+ * Initialise an instance with random values.
+ * Used to build previews or test instances.
+ * id must be 0 if object instance is a specimen.
+ *
+ * @return void
*/
- public function initAsSpecimen()
+ public function initAsSpecimen()
{
global $user, $langs, $conf;
$now = dol_now();
- // Load array of products prodids
+ // Load array of products prodids
$num_prods = 0;
$prodids = array();
$sql = "SELECT rowid";
@@ -946,7 +946,7 @@ class Delivery extends CommonObject
* @return array Product remaining to be delivered
* TODO use new function
*/
- public function getRemainingDelivered()
+ public function getRemainingDelivered()
{
global $langs;
@@ -1148,13 +1148,13 @@ class DeliveryLine extends CommonObjectLine
public $product_ref;
public $product_label;
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
- public function __construct($db)
- {
- $this->db = $db;
- }
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ public function __construct($db)
+ {
+ $this->db = $db;
+ }
}
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index d86e177034e..229031ff56a 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -159,8 +159,8 @@ class Expedition extends CommonObject
public $date_shipping;
/**
- * @var integer|string date_creation
- */
+ * @var integer|string date_creation
+ */
public $date_creation;
/**
@@ -171,7 +171,7 @@ class Expedition extends CommonObject
public $meths;
public $listmeths; // List of carriers
- /**
+ /**
* Draft status
*/
const STATUS_DRAFT = 0;
@@ -441,7 +441,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create a expedition line
*
@@ -473,7 +473,7 @@ class Expedition extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create the detail (eat-by date) of the expedition line
*
@@ -483,7 +483,7 @@ class Expedition extends CommonObject
*/
public function create_line_batch($line_ext, $array_options = 0)
{
- // phpcs:enable
+ // phpcs:enable
$error = 0;
$stockLocationQty = array(); // associated array with batch qty in stock location
@@ -537,7 +537,7 @@ class Expedition extends CommonObject
if (empty($id) && empty($ref) && empty($ref_ext)) return -1;
$sql = "SELECT e.rowid, e.entity, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
- $sql .= ", e.date_valid";
+ $sql .= ", e.date_valid";
$sql .= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql .= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
$sql .= ", e.fk_shipping_method, e.tracking_number";
@@ -574,7 +574,7 @@ class Expedition extends CommonObject
$this->statut = $obj->fk_statut;
$this->user_author_id = $obj->fk_user_author;
$this->date_creation = $this->db->jdate($obj->date_creation);
- $this->date_valid = $this->db->jdate($obj->date_valid);
+ $this->date_valid = $this->db->jdate($obj->date_valid);
$this->date = $this->db->jdate($obj->date_expedition); // TODO deprecated
$this->date_expedition = $this->db->jdate($obj->date_expedition); // TODO deprecated
$this->date_shipping = $this->db->jdate($obj->date_expedition); // Date real
@@ -868,7 +868,7 @@ class Expedition extends CommonObject
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Create a delivery receipt from a shipment
*
@@ -877,7 +877,7 @@ class Expedition extends CommonObject
*/
public function create_delivery($user)
{
- // phpcs:enable
+ // phpcs:enable
global $conf;
if ($conf->delivery_note->enabled)
@@ -974,7 +974,7 @@ class Expedition extends CommonObject
$this->lines[$num] = $line;
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Add a shipment line with batch record
*
@@ -984,7 +984,7 @@ class Expedition extends CommonObject
*/
public function addline_batch($dbatch, $array_options = 0)
{
- // phpcs:enable
+ // phpcs:enable
global $conf, $langs;
$num = count($this->lines);
@@ -1154,7 +1154,7 @@ class Expedition extends CommonObject
* Cancel shipment.
*
* @param int $notrigger Disable triggers
- * @param bool $also_update_stock true if the stock should be increased back (false by default)
+ * @param bool $also_update_stock true if the stock should be increased back (false by default)
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
*/
public function cancel($notrigger = 0, $also_update_stock = false)
@@ -1360,7 +1360,7 @@ class Expedition extends CommonObject
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)
*
* @param int $notrigger Disable triggers
- * @param bool $also_update_stock true if the stock should be increased back (false by default)
+ * @param bool $also_update_stock true if the stock should be increased back (false by default)
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
*/
public function delete($notrigger = 0, $also_update_stock = false)
@@ -1474,9 +1474,9 @@ class Expedition extends CommonObject
if (!$error)
{
- $main = MAIN_DB_PREFIX.'expeditiondet';
- $ef = $main."_extrafields";
- $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_expedition = ".$this->id.")";
+ $main = MAIN_DB_PREFIX.'expeditiondet';
+ $ef = $main."_extrafields";
+ $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_expedition = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
$sql .= " WHERE fk_expedition = ".$this->id;
@@ -1487,9 +1487,9 @@ class Expedition extends CommonObject
$res = $this->deleteObjectLinked();
if ($res < 0) $error++;
- // delete extrafields
- $res = $this->deleteExtraFields();
- if ($res < 0) $error++;
+ // delete extrafields
+ $res = $this->deleteExtraFields();
+ if ($res < 0) $error++;
if (!$error)
{
@@ -1570,7 +1570,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load lines
*
@@ -1578,7 +1578,7 @@ class Expedition extends CommonObject
*/
public function fetch_lines()
{
- // phpcs:enable
+ // phpcs:enable
global $conf, $mysoc;
// TODO: recuperer les champs du document associe a part
$this->lines = array();
@@ -1854,7 +1854,7 @@ class Expedition extends CommonObject
return $this->LibStatut($this->statut, $mode);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return label of a status
*
@@ -1864,8 +1864,8 @@ class Expedition extends CommonObject
*/
public function LibStatut($status, $mode)
{
- // phpcs:enable
- global $langs;
+ // phpcs:enable
+ global $langs;
$labelStatus = $langs->trans($this->statuts[$status]);
$labelStatusShort = $langs->trans($this->statutshorts[$status]);
@@ -2002,7 +2002,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fetch deliveries method and return an array. Load array this->meths(rowid=>label).
*
@@ -2030,7 +2030,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Fetch all deliveries method and return an array. Load array this->listmeths.
*
@@ -2039,7 +2039,7 @@ class Expedition extends CommonObject
*/
public function list_delivery_methods($id = '')
{
- // phpcs:enable
+ // phpcs:enable
global $langs;
$this->listmeths = array();
@@ -2066,7 +2066,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Update/create delivery method.
*
@@ -2110,7 +2110,7 @@ class Expedition extends CommonObject
$resql = $this->db->query($sql);
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* DesActivate delivery method.
*
@@ -2308,7 +2308,7 @@ class Expedition extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on)
*
@@ -2316,7 +2316,7 @@ class Expedition extends CommonObject
*/
public function set_billed()
{
- // phpcs:enable
+ // phpcs:enable
global $user;
$error = 0;
@@ -2450,13 +2450,13 @@ class Expedition extends CommonObject
}
}
- if (!$error) {
+ if (!$error) {
// Call trigger
$result = $this->call_trigger('SHIPPING_REOPEN', $user);
if ($result < 0) {
$error++;
}
- }
+ }
} else {
$error++;
$this->errors[] = $this->db->lasterror();
@@ -2482,7 +2482,7 @@ class Expedition extends CommonObject
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
- * @param null|array $moreparams Array to provide more information
+ * @param null|array $moreparams Array to provide more information
* @return int 0 if KO, 1 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
@@ -2550,8 +2550,8 @@ class ExpeditionLigne extends CommonObjectLine
public $origin_line_id;
/**
- * @var int ID
- */
+ * @var int ID
+ */
public $fk_origin_line;
/**
@@ -2560,42 +2560,42 @@ class ExpeditionLigne extends CommonObjectLine
public $fk_expedition;
/**
- * @var DoliDB Database handler.
- */
- public $db;
+ * @var DoliDB Database handler.
+ */
+ public $db;
- /**
- * @var float qty asked From llx_expeditiondet
- */
- public $qty;
+ /**
+ * @var float qty asked From llx_expeditiondet
+ */
+ public $qty;
- /**
- * @var float qty shipped
- */
- public $qty_shipped;
+ /**
+ * @var float qty shipped
+ */
+ public $qty_shipped;
- /**
- * @var int Id of product
- */
- public $fk_product;
- public $detail_batch;
+ /**
+ * @var int Id of product
+ */
+ public $fk_product;
+ public $detail_batch;
- /**
- * @var int Id of warehouse
- */
+ /**
+ * @var int Id of warehouse
+ */
public $entrepot_id;
- /**
- * @var float qty asked From llx_commandedet or llx_propaldet
- */
+ /**
+ * @var float qty asked From llx_commandedet or llx_propaldet
+ */
public $qty_asked;
- /**
- * @deprecated
- * @see $product_ref
- */
- public $ref;
+ /**
+ * @deprecated
+ * @see $product_ref
+ */
+ public $ref;
/**
* @var string product ref
@@ -2608,87 +2608,87 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $libelle;
- /**
- * @var string product label
- */
+ /**
+ * @var string product label
+ */
public $product_label;
- /**
- * @var string product description
- * @deprecated
- * @see $product_desc
- */
- public $desc;
+ /**
+ * @var string product description
+ * @deprecated
+ * @see $product_desc
+ */
+ public $desc;
- /**
- * @var string product description
- */
+ /**
+ * @var string product description
+ */
public $product_desc;
- /**
- * @var int rang of line
- */
- public $rang;
+ /**
+ * @var int rang of line
+ */
+ public $rang;
- /**
- * @var float weight
- */
- public $weight;
- public $weight_units;
+ /**
+ * @var float weight
+ */
+ public $weight;
+ public $weight_units;
- /**
- * @var float weight
- */
- public $length;
- public $length_units;
+ /**
+ * @var float weight
+ */
+ public $length;
+ public $length_units;
- /**
- * @var float weight
- */
- public $surface;
- public $surface_units;
+ /**
+ * @var float weight
+ */
+ public $surface;
+ public $surface_units;
- /**
- * @var float weight
- */
- public $volume;
- public $volume_units;
+ /**
+ * @var float weight
+ */
+ public $volume;
+ public $volume_units;
// Invoicing
public $remise_percent;
- public $tva_tx;
+ public $tva_tx;
- /**
- * @var float total without tax
- */
- public $total_ht;
+ /**
+ * @var float total without tax
+ */
+ public $total_ht;
- /**
- * @var float total with tax
- */
- public $total_ttc;
+ /**
+ * @var float total with tax
+ */
+ public $total_ttc;
- /**
- * @var float total vat
- */
- public $total_tva;
+ /**
+ * @var float total vat
+ */
+ public $total_tva;
- /**
- * @var float total localtax 1
- */
- public $total_localtax1;
+ /**
+ * @var float total localtax 1
+ */
+ public $total_localtax1;
- /**
- * @var float total localtax 2
- */
- public $total_localtax2;
+ /**
+ * @var float total localtax 2
+ */
+ public $total_localtax2;
- /**
- * Constructor
- *
- * @param DoliDB $db Database handler
- */
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
public function __construct($db)
{
$this->db = $db;
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 4d4dd365c5f..b487202e26a 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -124,100 +124,100 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
*/
- if ($action == 'setmode' && $user->rights->commande->creer)
- {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ if ($action == 'setmode' && $user->rights->commande->creer)
+ {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- if ($action == 'setavailability' && $user->rights->commande->creer) {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->availability(GETPOST('availability_id'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ if ($action == 'setavailability' && $user->rights->commande->creer) {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->availability(GETPOST('availability_id'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- if ($action == 'setdemandreason' && $user->rights->commande->creer) {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->demand_reason(GETPOST('demand_reason_id'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ if ($action == 'setdemandreason' && $user->rights->commande->creer) {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->demand_reason(GETPOST('demand_reason_id'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- if ($action == 'setconditions' && $user->rights->commande->creer)
- {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ if ($action == 'setconditions' && $user->rights->commande->creer)
+ {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- // Set incoterm
- elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
- {
- $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
- if ($result < 0) {
- setEventMessages($object->error, $object->errors, 'errors');
- }
- }
+ // Set incoterm
+ elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
+ {
+ $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
- // shipping method
- if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ // shipping method
+ if ($action == 'setshippingmethod' && $user->rights->commande->creer) {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- // warehouse
- if ($action == 'setwarehouse' && $user->rights->commande->creer) {
- $object = new Commande($db);
- $object->fetch($id);
- $result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
- if ($result < 0)
- setEventMessages($object->error, $object->errors, 'errors');
- }
+ // warehouse
+ if ($action == 'setwarehouse' && $user->rights->commande->creer) {
+ $object = new Commande($db);
+ $object->fetch($id);
+ $result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
+ if ($result < 0)
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
- if ($action == 'update_extras')
- {
- $object->oldcopy = dol_clone($object);
+ if ($action == 'update_extras')
+ {
+ $object->oldcopy = dol_clone($object);
- // Fill array 'array_options' with data from update form
- $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
- if ($ret < 0) $error++;
+ // Fill array 'array_options' with data from update form
+ $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
+ if ($ret < 0) $error++;
- if (!$error)
- {
- // Actions on extra fields
- $result = $object->insertExtraFields('SHIPMENT_MODIFY');
+ if (!$error)
+ {
+ // Actions on extra fields
+ $result = $object->insertExtraFields('SHIPMENT_MODIFY');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
- }
+ }
- if ($error)
- $action = 'edit_extras';
- }
+ if ($error)
+ $action = 'edit_extras';
+ }
- if ($action == 'set_thirdparty' && $user->rights->commande->creer)
- {
- $object->fetch($id);
- $object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY');
+ if ($action == 'set_thirdparty' && $user->rights->commande->creer)
+ {
+ $object->fetch($id);
+ $object->setValueFrom('fk_soc', $socid, '', '', 'date', '', $user, 'ORDER_MODIFY');
- header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
- exit();
- }
+ header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
+ exit();
+ }
- include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
+ include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
}
/*
@@ -280,61 +280,61 @@ if ($id > 0 || !empty($ref))
// Ref customer
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
- // Thirdparty
- $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1);
- // Project
- if (!empty($conf->projet->enabled))
- {
- $langs->load("projects");
- $morehtmlref .= ' '.$langs->trans('Project').' ';
- if ($user->rights->commande->creer)
- {
- if ($action != 'classify') {
+ // Thirdparty
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1);
+ // Project
+ if (!empty($conf->projet->enabled))
+ {
+ $langs->load("projects");
+ $morehtmlref .= ' '.$langs->trans('Project').' ';
+ if ($user->rights->commande->creer)
+ {
+ if ($action != 'classify') {
$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
- }
- if ($action == 'classify') {
- //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref .= '';
- } else {
- $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
- }
- } else {
- if (!empty($object->fk_project)) {
- $proj = new Project($db);
- $proj->fetch($object->fk_project);
- $morehtmlref .= '';
- $morehtmlref .= $proj->ref;
- $morehtmlref .= '';
- } else {
- $morehtmlref .= '';
- }
- }
- }
- $morehtmlref .= '';
+ }
+ if ($action == 'classify') {
+ //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
+ $morehtmlref .= '';
+ } else {
+ $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
+ }
+ } else {
+ if (!empty($object->fk_project)) {
+ $proj = new Project($db);
+ $proj->fetch($object->fk_project);
+ $morehtmlref .= '';
+ $morehtmlref .= $proj->ref;
+ $morehtmlref .= '';
+ } else {
+ $morehtmlref .= '';
+ }
+ }
+ }
+ $morehtmlref .= '';
- dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
- print '
';
- print '
';
- print '';
+ print '
';
+ print '
';
+ print '';
- print '
';
+ print '
';
// Discounts for third party
- if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
- $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
- $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
- } else {
- $filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')";
- $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
- }
+ if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
+ $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
+ $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
+ } else {
+ $filterabsolutediscount = "fk_facture_source IS NULL OR (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%')";
+ $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
+ }
print '
';
}
// TODO How record was recorded OrderMode (llx_c_input_method)
@@ -517,22 +517,22 @@ if ($id > 0 || !empty($ref))
// Incoterms
if (!empty($conf->incoterm->enabled))
{
- print '