diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e2c061269d5..563ba097b19 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -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. // 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 $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 === '')) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 91a9f53de18..927e7e33b09 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -282,6 +282,7 @@ class ProductFournisseur extends Product // Multicurrency $multicurrency_buyprice = null; $multicurrency_unitBuyPrice = null; + $fk_multicurrency = null; if (!empty($conf->multicurrency->enabled)) { if (empty($multicurrency_tx)) $multicurrency_tx = 1; if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 93f1ed066af..e7856a82899 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -90,6 +90,7 @@ class Stripe extends CommonObject { global $conf; + $key = ''; if ($entity < 0) $entity = $conf->entity; $sql = "SELECT tokenstring"; @@ -103,7 +104,8 @@ class Stripe extends CommonObject } $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); if ($result) { if ($this->db->num_rows($result)) { diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php index f19e88c36a6..5b242a362c5 100644 --- a/test/phpunit/AdherentTest.php +++ b/test/phpunit/AdherentTest.php @@ -411,30 +411,30 @@ class AdherentTest extends PHPUnit\Framework\TestCase $thirdparty = new Societe($db); $thirdparty->initAsSpecimen(); $result = $thirdparty->create($user); - print __METHOD__." id=".$localobject->id." third party id=".$thirdparty->id." result=".$result."\n"; - $this->assertTrue($result > 0); + print __METHOD__." third party id=".$thirdparty->id." result=".$result."\n"; + $this->assertTrue($result > 0, 'Test to create a thirdparty specimen to use it to set as thirdparty of a member'); //Set Third Party ID $result = $localobject->setThirdPartyId($thirdparty->id); - $this->assertEquals($result, 1); + $this->assertEquals($result, 1, 'Set thirdparty'); print __METHOD__." id=".$localobject->id." result=".$result."\n"; //Adherent is updated with new data $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"; //We remove the third party association $result = $localobject->setThirdPartyId(0); - $this->assertEquals($result, 1); + $this->assertEquals($result, 1, 'Removed the link with thirdparty'); //And check if it has been updated $localobject->fetch($localobject->id); - $this->assertNull($localobject->fk_soc); + $this->assertNull($localobject->fk_soc, 'Check field is null'); //Now we remove the third party $result = $thirdparty->delete($thirdparty->id, $user); - $this->assertEquals($result, 1); + $this->assertEquals($result, 1, 'Delete thirdparty'); return $localobject; }