Fix phpcs

This commit is contained in:
Laurent Destailleur 2018-12-15 15:43:30 +01:00
parent e3358b5b60
commit 39d244eeb2
2 changed files with 20 additions and 31 deletions

View File

@ -1003,9 +1003,7 @@ if ($action == 'create')
print '</td>'; print '</td>';
if (! empty($conf->stock->enabled)) if (! empty($conf->stock->enabled))
{ {
print '<td align="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>'; print '<td align="left">'.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')</td>';
} }
if (!empty($conf->productbatch->enabled)) if (!empty($conf->productbatch->enabled))
{ {
@ -1154,7 +1152,6 @@ if ($action == 'create')
{ {
print '<!-- Show warehouse selection -->'; print '<!-- Show warehouse selection -->';
print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0 , 0, $line->fk_product, '', 1); print $formproduct->selectWarehouses($tmpentrepot_id, 'entl'.$indiceAsked, '', 0 , 0, $line->fk_product, '', 1);
} }
} }
else else
@ -1164,7 +1161,8 @@ if ($action == 'create')
print '</td>'; print '</td>';
} }
if(!empty($conf->productbatch->enabled) ){ if (!empty($conf->productbatch->enabled))
{
if( !empty($product->status_batch)){ if( !empty($product->status_batch)){
print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>'; print '<td><input name="batch'.$indiceAsked.'" value="'.$dispatchLines[$indiceAsked]['lot'].'"></td>';
print '<td>'; print '<td>';
@ -1177,8 +1175,6 @@ if ($action == 'create')
print '<td colspan="3"></td>'; print '<td colspan="3"></td>';
} }
} }
print "</tr>\n"; print "</tr>\n";
} }
@ -1285,8 +1281,8 @@ else if ($id || $ref)
} }
$formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateReception'),$text,'confirm_valid','',0,1); $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateReception'),$text,'confirm_valid','',0,1);
} }
// Confirm cancelation // Confirm cancelation
if ($action == 'annuler') if ($action == 'annuler')
{ {
@ -1337,7 +1333,8 @@ else if ($id || $ref)
// Thirdparty // Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project // Project
if (! empty($conf->projet->enabled)) { if (! empty($conf->projet->enabled))
{
$langs->load("projects"); $langs->load("projects");
$morehtmlref .= '<br>' . $langs->trans('Project') . ' '; $morehtmlref .= '<br>' . $langs->trans('Project') . ' ';
if (0) { // Do not change on reception if (0) { // Do not change on reception
@ -1494,7 +1491,6 @@ else if ($id || $ref)
print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">'; print ' <input class="button" name="modify" value="'.$langs->trans("Modify").'" type="submit">';
print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">'; print ' <input class="button" name="cancel" value="'.$langs->trans("Cancel").'" type="submit">';
print '</form>'; print '</form>';
} }
else else
{ {
@ -1892,7 +1888,8 @@ else if ($id || $ref)
// Warehouse source // Warehouse source
print '<td>' . $formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). '</td>'; print '<td>' . $formproduct->selectWarehouses($lines[$i]->fk_entrepot, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1). '</td>';
// Batch number managment // Batch number managment
if($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch)){ if ($conf->productbatch->enabled && !empty($lines[$i]->product->status_batch))
{
print '<td> <input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"> </br>'; print '<td> <input name="batch'.$line_id.'" id="batch'.$line_id.'" type="text" value="'.$lines[$i]->batch.'"> </br>';
print $langs->trans('EatByDate').' : '; print $langs->trans('EatByDate').' : ';
print $form->select_date($lines[$i]->eatby,'dlc' .$line_id , '', '', 1, ""). '</br>'; print $form->select_date($lines[$i]->eatby,'dlc' .$line_id , '', '', 1, ""). '</br>';
@ -2122,7 +2119,6 @@ else if ($id || $ref)
{ {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>'; print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
} }
} }
print '</div>'; print '</div>';

View File

@ -864,7 +864,7 @@ class Reception extends CommonObject
* *
* @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO * @return int >0 if OK, 0 if deletion done but failed to delete files, <0 if KO
*/ */
function delete() function delete(User $user)
{ {
global $conf, $langs, $user; global $conf, $langs, $user;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -874,10 +874,11 @@ class Reception extends CommonObject
$this->db->begin(); $this->db->begin();
// Stock control // Stock control
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_RECEPTION && $this->statut > 0) if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_RECEPTION && $this->statut > 0)
{ {
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php"); require_once DOL_DOCUMENT_ROOT."/product/stock/class/mouvementstock.class.php";
$langs->load("agenda"); $langs->load("agenda");
@ -902,7 +903,6 @@ class Reception extends CommonObject
// we do not log origin because it will be deleted // we do not log origin because it will be deleted
$mouvS->origin = null; $mouvS->origin = null;
$result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref),'', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed $result=$mouvS->livraison($user, $obj->fk_product, $obj->fk_entrepot, $obj->qty, 0, $langs->trans("ReceptionDeletedInDolibarr", $this->ref),'', $obj->eatby, $obj->sellby, $obj->batch); // Price is set to 0, because we don't want to see WAP changed
} }
} }
@ -1014,6 +1014,7 @@ class Reception extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load lines * Load lines
@ -1066,10 +1067,10 @@ class Reception extends CommonObject
} }
return 1; return 1;
}else { }
else {
return -1; return -1;
} }
} }
/** /**
@ -1247,7 +1248,6 @@ class Reception extends CommonObject
$this->lines[]=$line; $this->lines[]=$line;
$xnbp++; $xnbp++;
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
@ -1546,7 +1546,6 @@ class Reception extends CommonObject
$this->errors = $mouvS->errors; $this->errors = $mouvS->errors;
$error++; break; $error++; break;
} }
} }
else else
{ {
@ -1561,7 +1560,6 @@ class Reception extends CommonObject
$error++; break; $error++; break;
} }
} }
} }
} }
else else
@ -1628,7 +1626,6 @@ class Reception extends CommonObject
if ($result < 0) { if ($result < 0) {
$error++; $error++;
} }
} else { } else {
$error++; $error++;
$this->errors[]=$this->db->lasterror; $this->errors[]=$this->db->lasterror;
@ -1750,7 +1747,6 @@ class Reception extends CommonObject
$commande->fetch($this->origin_id); $commande->fetch($this->origin_id);
$commande->setStatus($user,4); $commande->setStatus($user,4);
} }
} else { } else {
$error++; $error++;
$this->errors[]=$this->db->lasterror(); $this->errors[]=$this->db->lasterror();
@ -1866,7 +1862,6 @@ class Reception extends CommonObject
$error++; break; $error++; break;
} }
} }
} }
} }
else else
@ -1945,8 +1940,8 @@ class Reception extends CommonObject
$langs->load("receptions"); $langs->load("receptions");
if (! dol_strlen($modele)) { if (! dol_strlen($modele))
{
$modele = 'squille'; $modele = 'squille';
if ($this->modelpdf) { if ($this->modelpdf) {
@ -1973,9 +1968,7 @@ class Reception extends CommonObject
*/ */
public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{ {
$tables = array( $tables = array('reception');
'reception'
);
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
} }