Allow to import orderdetails and partLots of parts

This commit is contained in:
Jan Böhmer 2023-04-02 01:00:40 +02:00
parent a7ea12d07d
commit 27b43041f9
3 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ trait InstockTrait
* @ORM\OneToMany(targetEntity="PartLot", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ORM\OrderBy({"amount" = "DESC"})
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected $partLots;

View file

@ -40,7 +40,7 @@ trait OrderTrait
* @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="part", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
* @ORM\OrderBy({"supplierpartnr" = "ASC"})
* @Groups({"extended", "full"})
* @Groups({"extended", "full", "import"})
*/
protected $orderdetails;

View file

@ -344,7 +344,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
public function setSupplierProductUrl(string $new_url): self
{
//Only change the internal URL if it is not the auto generated one
if ($new_url === $this->supplier->getAutoProductUrl($this->getSupplierPartNr())) {
if ($this->supplier && $new_url === $this->supplier->getAutoProductUrl($this->getSupplierPartNr())) {
return $this;
}