mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
Qual: Fix a ton of CheckStyle errors
This commit is contained in:
@@ -510,6 +510,7 @@ class Commande extends CommonObject
|
||||
* Cancel an order
|
||||
* If stock is decremented on order validation, we must reincrement it
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param int $idwarehouse Id warehouse to use for stock change.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -588,7 +589,7 @@ class Commande extends CommonObject
|
||||
* Note that this->ref can be set or empty. If empty, we will use "(PROV)"
|
||||
*
|
||||
* @param User $user Objet user that make creation
|
||||
* @param int notrigger Disable all triggers
|
||||
* @param int $notrigger Disable all triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
@@ -671,25 +672,25 @@ class Commande extends CommonObject
|
||||
}
|
||||
|
||||
$result = $this->addline(
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code,
|
||||
$fk_parent_line
|
||||
$this->id,
|
||||
$this->lines[$i]->desc,
|
||||
$this->lines[$i]->subprice,
|
||||
$this->lines[$i]->qty,
|
||||
$this->lines[$i]->tva_tx,
|
||||
$this->lines[$i]->localtax1_tx,
|
||||
$this->lines[$i]->localtax2_tx,
|
||||
$this->lines[$i]->fk_product,
|
||||
$this->lines[$i]->remise_percent,
|
||||
$this->lines[$i]->info_bits,
|
||||
$this->lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$this->lines[$i]->date_start,
|
||||
$this->lines[$i]->date_end,
|
||||
$this->lines[$i]->product_type,
|
||||
$this->lines[$i]->rang,
|
||||
$this->lines[$i]->special_code,
|
||||
$fk_parent_line
|
||||
);
|
||||
if ($result < 0)
|
||||
{
|
||||
@@ -711,7 +712,7 @@ class Commande extends CommonObject
|
||||
if ($this->id)
|
||||
{
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
|
||||
|
||||
// Add object linked
|
||||
if (is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||
{
|
||||
@@ -723,25 +724,25 @@ class Commande extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// TODO mutualiser
|
||||
if ($origin == 'propal' && $origin_id)
|
||||
{
|
||||
// On recupere les differents contact interne et externe
|
||||
$prop = new Propal($this->db, $this->socid, $origin_id);
|
||||
|
||||
|
||||
// On recupere le commercial suivi propale
|
||||
$this->userid = $prop->getIdcontact('internal', 'SALESREPFOLL');
|
||||
|
||||
|
||||
if ($this->userid)
|
||||
{
|
||||
//On passe le commercial suivi propale en commercial suivi commande
|
||||
$this->add_contact($this->userid[0], 'SALESREPFOLL', 'internal');
|
||||
}
|
||||
|
||||
|
||||
// On recupere le contact client suivi propale
|
||||
$this->contactid = $prop->getIdcontact('external', 'CUSTOMER');
|
||||
|
||||
|
||||
if ($this->contactid)
|
||||
{
|
||||
//On passe le contact client suivi propale en contact client suivi commande
|
||||
@@ -922,7 +923,7 @@ class Commande extends CommonObject
|
||||
|
||||
$this->origin = $object->element;
|
||||
$this->origin_id = $object->id;
|
||||
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects))
|
||||
@@ -985,6 +986,8 @@ class Commande extends CommonObject
|
||||
* @param timestamp $date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $special_code Special code
|
||||
* @param int $fk_parent_line Parent line
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*
|
||||
* @see add_product
|
||||
@@ -1289,7 +1292,7 @@ class Commande extends CommonObject
|
||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||
$this->fk_delivery_address = $obj->fk_adresse_livraison;
|
||||
$this->propale_id = $obj->fk_source;
|
||||
|
||||
|
||||
$this->extraparams = (array) dol_json_decode($obj->extraparams, true);
|
||||
|
||||
$this->lines = array();
|
||||
@@ -1571,6 +1574,8 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Returns a array with expeditions lines number
|
||||
*
|
||||
* @return int Nb of shipments
|
||||
*
|
||||
* TODO deprecated, move to Shipping class
|
||||
*/
|
||||
function nb_expedition()
|
||||
@@ -2035,6 +2040,7 @@ class Commande extends CommonObject
|
||||
|
||||
/**
|
||||
* Set customer ref
|
||||
*
|
||||
* @param User $user User that make change
|
||||
* @param string $ref_client Customer ref
|
||||
* @return int <0 if KO, >0 if OK
|
||||
@@ -2113,6 +2119,8 @@ class Commande extends CommonObject
|
||||
* @param timestamp $date_start Start date of the line
|
||||
* @param timestamp $date_end End date of the line
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $fk_parent_line Parent line id
|
||||
* @param int $skip_update_total Skip update of total
|
||||
* @return int < 0 if KO, > 0 if OK
|
||||
*/
|
||||
function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $txlocaltax1=0,$txlocaltax2=0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0)
|
||||
@@ -2244,7 +2252,7 @@ class Commande extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Appel des triggers
|
||||
@@ -2256,7 +2264,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
// Fin appel triggers
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Delete order details
|
||||
@@ -2267,7 +2275,7 @@ class Commande extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete error", LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Delete order
|
||||
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id;
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
|
||||
@@ -2276,15 +2284,15 @@ class Commande extends CommonObject
|
||||
dol_syslog(get_class($this)."::delete error", LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error++;
|
||||
|
||||
|
||||
// Delete linked contacts
|
||||
$res = $this->delete_linked_contact();
|
||||
if ($res < 0) $error++;
|
||||
|
||||
|
||||
// On efface le repertoire de pdf provisoire
|
||||
$comref = dol_sanitizeFileName($this->ref);
|
||||
if ($conf->commande->dir_output)
|
||||
@@ -2294,7 +2302,7 @@ class Commande extends CommonObject
|
||||
if (file_exists($file)) // We must delete all files before deleting directory
|
||||
{
|
||||
dol_delete_preview($this);
|
||||
|
||||
|
||||
if (!dol_delete_file($file))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorCanNotDeleteFile",$file);
|
||||
@@ -2313,7 +2321,7 @@ class Commande extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG);
|
||||
@@ -2421,7 +2429,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 1)
|
||||
elseif ($mode == 1)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort');
|
||||
@@ -2430,7 +2438,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return $langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return $langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 2)
|
||||
elseif ($mode == 2)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceledShort');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraftShort');
|
||||
@@ -2439,7 +2447,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBillShort');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessedShort');
|
||||
}
|
||||
if ($mode == 3)
|
||||
elseif ($mode == 3)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
@@ -2448,7 +2456,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
elseif ($mode == 4)
|
||||
{
|
||||
if ($statut==-1) return img_picto($langs->trans('StatusOrderCanceled'),'statut5').' '.$langs->trans('StatusOrderCanceled');
|
||||
if ($statut==0) return img_picto($langs->trans('StatusOrderDraft'),'statut0').' '.$langs->trans('StatusOrderDraft');
|
||||
@@ -2457,7 +2465,7 @@ class Commande extends CommonObject
|
||||
if ($statut==3 && ! $facturee) return img_picto($langs->trans('StatusOrderToBill'),'statut7').' '.$langs->trans('StatusOrderToBill');
|
||||
if ($statut==3 && $facturee) return img_picto($langs->trans('StatusOrderProcessed'),'statut6').' '.$langs->trans('StatusOrderProcessed');
|
||||
}
|
||||
if ($mode == 5)
|
||||
elseif ($mode == 5)
|
||||
{
|
||||
if ($statut==-1) return $langs->trans('StatusOrderCanceledShort').' '.img_picto($langs->trans('StatusOrderCanceled'),'statut5');
|
||||
if ($statut==0) return $langs->trans('StatusOrderDraftShort').' '.img_picto($langs->trans('StatusOrderDraft'),'statut0');
|
||||
@@ -2505,7 +2513,8 @@ class Commande extends CommonObject
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet commande
|
||||
*
|
||||
* @param int $id Id of order
|
||||
* @param int $id Id of order
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
@@ -2820,7 +2829,8 @@ class OrderLine
|
||||
/**
|
||||
* Load line order
|
||||
*
|
||||
* @param rowid id line order
|
||||
* @param int $rowid Id line order
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($rowid)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user