Fix phpcs
This commit is contained in:
parent
e46fb303d0
commit
cc574852d2
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user