Fix phpcs

This commit is contained in:
Laurent Destailleur 2019-01-26 15:20:36 +01:00
parent e46fb303d0
commit cc574852d2
2 changed files with 12 additions and 12 deletions

View File

@ -1526,10 +1526,10 @@ class Product extends CommonObject
} }
} }
/** /**
* Return price of sell of a product for a seller/buyer/product. * Return price of sell of a product for a seller/buyer/product.
* *
* @param Societe $thirdparty_seller Seller * @param Societe $thirdparty_seller Seller
* @param Societe $thirdparty_buyer Buyer * @param Societe $thirdparty_buyer Buyer
* @param int $pqp Id of product per price if a selection was done of such a price * @param int $pqp Id of product per price if a selection was done of such a price
@ -1630,7 +1630,7 @@ class Product extends CommonObject
} }
} }
} }
return array('pu_ht'=>$pu_ht, 'pu_ttc'=>$pu_ttc, 'price_min'=>$price_min, 'price_base_type'=>$price_base_type, 'tva_tx'=>$tva_tx, 'tva_npr'=>$tva_npr); return array('pu_ht'=>$pu_ht, 'pu_ttc'=>$pu_ttc, 'price_min'=>$price_min, 'price_base_type'=>$price_base_type, 'tva_tx'=>$tva_tx, 'tva_npr'=>$tva_npr);
} }

View File

@ -303,9 +303,9 @@ elseif (GETPOST('project_ref','alpha'))
if ($massaction == 'generateinvoice') if ($massaction == 'generateinvoice')
{ {
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
//->fetch_thirdparty(); //->fetch_thirdparty();
if (! ($projectstatic->thirdparty->id > 0)) if (! ($projectstatic->thirdparty->id > 0))
{ {
setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors'); setEventMessages($langs->trans("ThirdPartyRequiredToGenerateInvoice"), null, 'errors');
@ -315,7 +315,7 @@ if ($massaction == 'generateinvoice')
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$tmpinvoice = new Facture($db); $tmpinvoice = new Facture($db);
$tmptimespent=new Task($db); $tmptimespent=new Task($db);
$tmpproduct=new Product($db); $tmpproduct=new Product($db);
@ -328,11 +328,11 @@ if ($massaction == 'generateinvoice')
{ {
$tmpproduct->fetch($idprod); $tmpproduct->fetch($idprod);
} }
$dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0); $dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0);
$pu_ht = $dataforprice['pu_ht']; $pu_ht = $dataforprice['pu_ht'];
$txtva = $dataforprice['tva_tx']; $txtva = $dataforprice['tva_tx'];
$tmpinvoice->fk_soc = $projectstatic->thirdparty->id; $tmpinvoice->fk_soc = $projectstatic->thirdparty->id;
$tmpinvoice->create($user); $tmpinvoice->create($user);
@ -341,7 +341,7 @@ if ($massaction == 'generateinvoice')
{ {
// Get userid, timepent // Get userid, timepent
$object->fetchTimeSpent($value); $object->fetchTimeSpent($value);
$arrayoftasks[$object->timespent_fk_user]['timespent']+=$object->timespent_duration; $arrayoftasks[$object->timespent_fk_user]['timespent']+=$object->timespent_duration;
} }
foreach($arrayoftasks as $userid => $value) foreach($arrayoftasks as $userid => $value)
@ -349,11 +349,11 @@ if ($massaction == 'generateinvoice')
$fuser->fetch($userid); $fuser->fetch($userid);
//$pu_ht = $value['timespent'] * $fuser->thm; //$pu_ht = $value['timespent'] * $fuser->thm;
$username = $fuser->getFullName($langs); $username = $fuser->getFullName($langs);
// Add lines // Add lines
$tmpinvoice->addline($langs->trans("TotalOfTimeSpentBy", $username).' : '.$value['timespent'], $pu_ht, 1, $txtva); $tmpinvoice->addline($langs->trans("TotalOfTimeSpentBy", $username).' : '.$value['timespent'], $pu_ht, 1, $txtva);
} }
setEventMessages($langs->trans("InvoiceGeneratedFromTimeSpent", $tmpinvoice->ref), null, 'mesgs'); setEventMessages($langs->trans("InvoiceGeneratedFromTimeSpent", $tmpinvoice->ref), null, 'mesgs');
//var_dump($tmpinvoice); //var_dump($tmpinvoice);