From cc574852d20a21616748d5498c7dd69ec944e47f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 Jan 2019 15:20:36 +0100 Subject: [PATCH] Fix phpcs --- htdocs/product/class/product.class.php | 6 +++--- htdocs/projet/tasks/time.php | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index dc4838a9cfd..e299921488b 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1526,10 +1526,10 @@ class Product extends CommonObject } } - + /** * Return price of sell of a product for a seller/buyer/product. - * + * * @param Societe $thirdparty_seller Seller * @param Societe $thirdparty_buyer Buyer * @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); } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 5250c48c33e..9433925d933 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -303,9 +303,9 @@ elseif (GETPOST('project_ref','alpha')) if ($massaction == 'generateinvoice') { if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); - + //->fetch_thirdparty(); - + if (! ($projectstatic->thirdparty->id > 0)) { 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.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; - + $tmpinvoice = new Facture($db); $tmptimespent=new Task($db); $tmpproduct=new Product($db); @@ -328,11 +328,11 @@ if ($massaction == 'generateinvoice') { $tmpproduct->fetch($idprod); } - + $dataforprice = $tmpproduct->getSellPrice($mysoc, $projectstatic->thirdparty, 0); $pu_ht = $dataforprice['pu_ht']; - $txtva = $dataforprice['tva_tx']; - + $txtva = $dataforprice['tva_tx']; + $tmpinvoice->fk_soc = $projectstatic->thirdparty->id; $tmpinvoice->create($user); @@ -341,7 +341,7 @@ if ($massaction == 'generateinvoice') { // Get userid, timepent $object->fetchTimeSpent($value); - + $arrayoftasks[$object->timespent_fk_user]['timespent']+=$object->timespent_duration; } foreach($arrayoftasks as $userid => $value) @@ -349,11 +349,11 @@ if ($massaction == 'generateinvoice') $fuser->fetch($userid); //$pu_ht = $value['timespent'] * $fuser->thm; $username = $fuser->getFullName($langs); - + // Add lines $tmpinvoice->addline($langs->trans("TotalOfTimeSpentBy", $username).' : '.$value['timespent'], $pu_ht, 1, $txtva); } - + setEventMessages($langs->trans("InvoiceGeneratedFromTimeSpent", $tmpinvoice->ref), null, 'mesgs'); //var_dump($tmpinvoice);