Merge pull request #20721 from altairisfr/getsellprice
NEW : add hook to getSellPrice function
This commit is contained in:
commit
67048cd2c6
@ -1802,7 +1802,17 @@ class Product extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public function getSellPrice($thirdparty_seller, $thirdparty_buyer, $pqp = 0)
|
public function getSellPrice($thirdparty_seller, $thirdparty_buyer, $pqp = 0)
|
||||||
{
|
{
|
||||||
global $conf, $db;
|
global $conf, $db, $hookmanager;
|
||||||
|
|
||||||
|
// call hook if any
|
||||||
|
$hookmanager->initHooks(array('productdao'));
|
||||||
|
$parameters = array('thirdparty_seller'=>$thirdparty_seller, 'thirdparty_buyer' => $thirdparty_buyer, 'pqp' => $pqp);
|
||||||
|
// Note that $action and $object may have been modified by some hooks
|
||||||
|
global $action;
|
||||||
|
$reshook = $hookmanager->executeHooks('getSellPrice', $parameters, $this, $action);
|
||||||
|
if ( ! empty($hookmanager->resArray)) {
|
||||||
|
return $hookmanager->resArray;
|
||||||
|
}
|
||||||
|
|
||||||
// Update if prices fields are defined
|
// Update if prices fields are defined
|
||||||
$tva_tx = get_default_tva($thirdparty_seller, $thirdparty_buyer, $this->id);
|
$tva_tx = get_default_tva($thirdparty_seller, $thirdparty_buyer, $this->id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user