Fix warnings
This commit is contained in:
parent
9cd211a79b
commit
eed14bd9af
@ -1621,7 +1621,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
// We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
|
// We use 'none' instead of $ref_supplier, because fourn_ref may not exists anymore. So we will take the first supplier price ok.
|
||||||
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
|
// If we want a dedicated supplier price, we must provide $fk_prod_fourn_price.
|
||||||
$result = $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc
|
$result = $prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', (isset($this->fk_soc) ? $this->fk_soc : $this->socid)); // Search on couple $fk_prod_fourn_price/$qty first, then on triplet $qty/$fk_product/$ref_supplier/$this->fk_soc
|
||||||
|
|
||||||
// If supplier order created from customer order, we take best supplier price
|
// If supplier order created from customer order, we take best supplier price
|
||||||
// If $pu (defined previously from pu_ht or pu_ttc) is not defined at all, we also take the best supplier price
|
// If $pu (defined previously from pu_ht or pu_ttc) is not defined at all, we also take the best supplier price
|
||||||
if ($result > 0 && ($origin == 'commande' || $pu === ''))
|
if ($result > 0 && ($origin == 'commande' || $pu === ''))
|
||||||
|
|||||||
@ -282,6 +282,7 @@ class ProductFournisseur extends Product
|
|||||||
// Multicurrency
|
// Multicurrency
|
||||||
$multicurrency_buyprice = null;
|
$multicurrency_buyprice = null;
|
||||||
$multicurrency_unitBuyPrice = null;
|
$multicurrency_unitBuyPrice = null;
|
||||||
|
$fk_multicurrency = null;
|
||||||
if (!empty($conf->multicurrency->enabled)) {
|
if (!empty($conf->multicurrency->enabled)) {
|
||||||
if (empty($multicurrency_tx)) $multicurrency_tx = 1;
|
if (empty($multicurrency_tx)) $multicurrency_tx = 1;
|
||||||
if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0;
|
if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0;
|
||||||
|
|||||||
@ -90,6 +90,7 @@ class Stripe extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
$key = '';
|
||||||
if ($entity < 0) $entity = $conf->entity;
|
if ($entity < 0) $entity = $conf->entity;
|
||||||
|
|
||||||
$sql = "SELECT tokenstring";
|
$sql = "SELECT tokenstring";
|
||||||
@ -103,7 +104,8 @@ class Stripe extends CommonObject
|
|||||||
}
|
}
|
||||||
$sql .= " AND fk_user IS NULL AND fk_adherent IS NULL";
|
$sql .= " AND fk_user IS NULL AND fk_adherent IS NULL";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::getStripeAccount", LOG_DEBUG);
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
if ($this->db->num_rows($result)) {
|
if ($this->db->num_rows($result)) {
|
||||||
|
|||||||
@ -411,30 +411,30 @@ class AdherentTest extends PHPUnit\Framework\TestCase
|
|||||||
$thirdparty = new Societe($db);
|
$thirdparty = new Societe($db);
|
||||||
$thirdparty->initAsSpecimen();
|
$thirdparty->initAsSpecimen();
|
||||||
$result = $thirdparty->create($user);
|
$result = $thirdparty->create($user);
|
||||||
print __METHOD__." id=".$localobject->id." third party id=".$thirdparty->id." result=".$result."\n";
|
print __METHOD__." third party id=".$thirdparty->id." result=".$result."\n";
|
||||||
$this->assertTrue($result > 0);
|
$this->assertTrue($result > 0, 'Test to create a thirdparty specimen to use it to set as thirdparty of a member');
|
||||||
|
|
||||||
//Set Third Party ID
|
//Set Third Party ID
|
||||||
$result = $localobject->setThirdPartyId($thirdparty->id);
|
$result = $localobject->setThirdPartyId($thirdparty->id);
|
||||||
$this->assertEquals($result, 1);
|
$this->assertEquals($result, 1, 'Set thirdparty');
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
|
|
||||||
//Adherent is updated with new data
|
//Adherent is updated with new data
|
||||||
$localobject->fetch($localobject->id);
|
$localobject->fetch($localobject->id);
|
||||||
$this->assertEquals($localobject->fk_soc, $thirdparty->id);
|
$this->assertEquals($localobject->fk_soc, $thirdparty->id, 'Fetch member');
|
||||||
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
print __METHOD__." id=".$localobject->id." result=".$result."\n";
|
||||||
|
|
||||||
//We remove the third party association
|
//We remove the third party association
|
||||||
$result = $localobject->setThirdPartyId(0);
|
$result = $localobject->setThirdPartyId(0);
|
||||||
$this->assertEquals($result, 1);
|
$this->assertEquals($result, 1, 'Removed the link with thirdparty');
|
||||||
|
|
||||||
//And check if it has been updated
|
//And check if it has been updated
|
||||||
$localobject->fetch($localobject->id);
|
$localobject->fetch($localobject->id);
|
||||||
$this->assertNull($localobject->fk_soc);
|
$this->assertNull($localobject->fk_soc, 'Check field is null');
|
||||||
|
|
||||||
//Now we remove the third party
|
//Now we remove the third party
|
||||||
$result = $thirdparty->delete($thirdparty->id, $user);
|
$result = $thirdparty->delete($thirdparty->id, $user);
|
||||||
$this->assertEquals($result, 1);
|
$this->assertEquals($result, 1, 'Delete thirdparty');
|
||||||
|
|
||||||
return $localobject;
|
return $localobject;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user