src/Entity/System/OrderDetail.php line 26

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\System;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * OrderDetail
  9. *
  10. * @ORM\Table(name="ps_order_detail", indexes={
  11. *
  12. * @ORM\Index(name="product_id", columns={"product_id"}),
  13. * @ORM\Index(name="id_order_id_order_detail", columns={"id_order", "id_order_detail"}),
  14. * @ORM\Index(name="locks", columns={"locks"}),
  15. * @ORM\Index(name="ps_order_detail_product_reference_index", columns={"product_reference"}),
  16. * @ORM\Index(name="product_attribute_id", columns={"product_attribute_id"}),
  17. * @ORM\Index(name="pedidos_transito", columns={"pedidos_transito"})
  18. * })
  19. *
  20. * @ORM\Entity(repositoryClass="App\Repository\System\OrderDetailRepository")
  21. */
  22. class OrderDetail
  23. {
  24. /**
  25. * @ORM\Id()
  26. *
  27. * @ORM\GeneratedValue()
  28. *
  29. * @ORM\Column(type="integer", name="id_order_detail")
  30. */
  31. private int $id;
  32. /**
  33. * @var Order
  34. *
  35. * @ORM\ManyToOne(targetEntity="App\Entity\System\Order", inversedBy="orderDetails", cascade={"persist"})
  36. *
  37. * @ORM\JoinColumn(name="id_order", referencedColumnName="id_order", nullable=false)
  38. */
  39. private $order;
  40. /**
  41. * @var Collection<int, OrderDetailQuantityStock>&iterable<OrderDetailQuantityStock>
  42. *
  43. * @ORM\OneToMany(targetEntity="App\Entity\System\OrderDetailQuantityStock", mappedBy="orderDetail", cascade={"all"}, orphanRemoval=true)
  44. */
  45. private $orderDetailQuantityStocks;
  46. /**
  47. * @var Collection<int, RefundLine>
  48. *
  49. * @ORM\OneToMany(targetEntity="App\Entity\System\RefundLine", mappedBy="orderDetail")
  50. */
  51. private $refundLines;
  52. /**
  53. * @var int|null
  54. *
  55. * @ORM\Column(type="integer", length=11, nullable=true)
  56. */
  57. private $idOrderInvoice;
  58. /**
  59. * @var Product
  60. *
  61. * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="orderDetails")
  62. *
  63. * @ORM\JoinColumn(name="product_id", referencedColumnName="id_product", nullable=false)
  64. */
  65. private $product;
  66. /**
  67. * @var ProductAttribute|null
  68. *
  69. * @ORM\ManyToOne(targetEntity="App\Entity\System\ProductAttribute", inversedBy="orderDetails")
  70. *
  71. * @ORM\JoinColumn(name="product_attribute_id", referencedColumnName="id_product_attribute", nullable=true)
  72. */
  73. private $productAttribute;
  74. /**
  75. * @var string
  76. *
  77. * @ORM\Column(type="string", length=255)
  78. */
  79. private $productName;
  80. /**
  81. * @var int
  82. *
  83. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  84. */
  85. private $productQuantity;
  86. /**
  87. * @var int
  88. *
  89. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  90. */
  91. private $productCatalog;
  92. /**
  93. * @var int
  94. *
  95. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  96. */
  97. private $productQuantityInStock;
  98. /**
  99. * @var int
  100. *
  101. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  102. */
  103. private $productQuantityRefunded;
  104. /**
  105. * @var int
  106. *
  107. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  108. */
  109. private $productQuantityReturn;
  110. /**
  111. * @var int
  112. *
  113. * @ORM\Column(type="integer", length=10, options={"default" : 0})
  114. */
  115. private $productQuantityReinjected;
  116. /**
  117. * @var float
  118. *
  119. * @ORM\Column(type="float", options={"default" : 0.000000})
  120. */
  121. private $productPrice;
  122. /**
  123. * @var float
  124. *
  125. * @ORM\Column(type="float", options={"default" : 0.00} )
  126. */
  127. private $reductionPercent;
  128. /**
  129. * @var float
  130. *
  131. * @ORM\Column(type="float", options={"default" : 0.000000})
  132. */
  133. private $reductionAmount;
  134. /**
  135. * @var float
  136. *
  137. * @ORM\Column(type="float", options={"default" : 0.000000})
  138. */
  139. private $reductionAmountTaxIncl;
  140. /**
  141. * @var float
  142. *
  143. * @ORM\Column(type="float", options={"default" : 0.000000})
  144. */
  145. private $reductionAmountTaxExcl;
  146. /**
  147. * @var float
  148. *
  149. * @ORM\Column(type="float", options={"default" : 0.00})
  150. */
  151. private $groupReduction;
  152. /**
  153. * @var float
  154. *
  155. * @ORM\Column(type="float", options={"default" : 0.000000})
  156. */
  157. private $productQuantityDiscount;
  158. /**
  159. * @var string|null
  160. *
  161. * @ORM\Column(type="string", length=13, nullable=true)
  162. */
  163. private $productEan13;
  164. /**
  165. * @var string|null
  166. *
  167. * @ORM\Column(type="string", length=12, nullable=true)
  168. */
  169. private $productUpc;
  170. /**
  171. * @var string|null
  172. *
  173. * @ORM\Column(type="string", length=32, nullable=true)
  174. */
  175. private $productReference;
  176. /**
  177. * @var string|null
  178. *
  179. * @ORM\Column(type="string", length=32, nullable=true)
  180. */
  181. private $productSupplierReference;
  182. /**
  183. * @var float
  184. *
  185. * @ORM\Column(type="float", precision=20, scale=6)
  186. */
  187. private $productWeight;
  188. /**
  189. * @var int
  190. *
  191. * @ORM\Column(type="integer", length=10, options={"default": 0})
  192. */
  193. private $taxComputationMethod;
  194. /**
  195. * @var string
  196. *
  197. * @ORM\Column(type="string", length=16)
  198. */
  199. private $taxName;
  200. /**
  201. * @var float
  202. *
  203. * @ORM\Column(type="float", options={"default" : 0.000})
  204. */
  205. private $taxRate;
  206. /**
  207. * @var float
  208. *
  209. * @ORM\Column(type="float", options={"default" : 0.000000})
  210. */
  211. private $ecotax;
  212. /**
  213. * @var float
  214. *
  215. * @ORM\Column(type="float", options={"default" : 0.000}, name="ecotax_tax_rate")
  216. */
  217. private $ecoTaxRate;
  218. /**
  219. * @ORM\Column(type="boolean", options={"default" : 0}, nullable=false)
  220. */
  221. private bool $discountQuantityApplied;
  222. /**
  223. * @var string|null
  224. *
  225. * @ORM\Column(type="string", length=255, nullable=true)
  226. */
  227. private $downloadHash;
  228. /**
  229. * @var int|null
  230. *
  231. * @ORM\Column(type="integer", options={"default" : 0}, nullable=true)
  232. */
  233. private $downloadNb;
  234. /**
  235. * @var \DateTime|null
  236. *
  237. * @ORM\Column(type="datetime", nullable=true)
  238. */
  239. private $downloadDeadline;
  240. /**
  241. * @var float
  242. *
  243. * @ORM\Column(type="float", options={"default" : 0.000000})
  244. */
  245. private $totalPriceTaxIncl;
  246. /**
  247. * @var float
  248. *
  249. * @ORM\Column(type="float", options={"default" : 0.000000})
  250. */
  251. private $totalPriceTaxExcl;
  252. /**
  253. * @var float
  254. *
  255. * @ORM\Column(type="float", options={"default" : 0.000000})
  256. */
  257. private $unitPriceTaxIncl;
  258. /**
  259. * @var float
  260. *
  261. * @ORM\Column(type="float", options={"default" : 0.000000})
  262. */
  263. private $unitPriceTaxExcl;
  264. /**
  265. * @var float
  266. *
  267. * @ORM\Column(type="float", options={"default" : 0.000000})
  268. */
  269. private $totalShippingPriceTaxIncl;
  270. /**
  271. * @var float
  272. *
  273. * @ORM\Column(type="float", options={"default" : 0.000000})
  274. */
  275. private $totalShippingPriceTaxExcl;
  276. /**
  277. * @var float
  278. *
  279. * @ORM\Column(type="float", options={"default" : 0.000000})
  280. */
  281. private $purchaseSupplierPrice;
  282. /**
  283. * @var float
  284. *
  285. * @ORM\Column(type="float", options={"default" : 0.000000})
  286. */
  287. private $originalProductPrice;
  288. /**
  289. * @var bool
  290. *
  291. * @ORM\Column(type="boolean", options={"default" : 0}, nullable=false)
  292. */
  293. private $re;
  294. /**
  295. * @var int|null
  296. *
  297. * @ORM\Column(type="integer", length=11, nullable=true)
  298. */
  299. private $locks;
  300. /**
  301. * @var float
  302. *
  303. * @ORM\Column(type="float", options={"default" : 0.000000})
  304. */
  305. private $width;
  306. /**
  307. * @var float
  308. *
  309. * @ORM\Column(type="float", options={"default" : 0.000000})
  310. */
  311. private $height;
  312. /**
  313. * @var float
  314. *
  315. * @ORM\Column(type="float", options={"default" : 0.000000})
  316. */
  317. private $depth;
  318. /**
  319. * @var bool
  320. *
  321. * @ORM\Column(name="pedidos_transito", type="boolean", options={"default" : 1}, nullable=false)
  322. */
  323. private $inTransit;
  324. /**
  325. * @var float
  326. *
  327. * @ORM\Column(type="float", options={"default" : 0.000000})
  328. */
  329. private $estimateCostPrice;
  330. /**
  331. * @var int|null
  332. *
  333. * @ORM\Column(type="integer", length=11 , nullable=true)
  334. */
  335. private $priceByQuantity;
  336. /**
  337. * @var string|null
  338. *
  339. * @ORM\Column(type="string", length=100 , nullable=true)
  340. */
  341. private $internalReference;
  342. /**
  343. * @var bool
  344. *
  345. * @ORM\Column(name="buybox", type="boolean", options={"default" : 0}, nullable=false)
  346. */
  347. private $buyBox;
  348. /**
  349. * @ORM\Column(type="datetime", nullable=true)
  350. */
  351. private ?\DateTime $dateUpd;
  352. /**
  353. * OrderDetail constructor.
  354. */
  355. public function __construct()
  356. {
  357. $this->productQuantity = 0;
  358. $this->productCatalog = 0;
  359. $this->productQuantityInStock = 0;
  360. $this->productQuantityRefunded = 0;
  361. $this->productQuantityReturn = 0;
  362. $this->productQuantityReinjected = 0;
  363. $this->productPrice = 0.000000;
  364. $this->reductionPercent = 0.00;
  365. $this->reductionAmount = 0.000000;
  366. $this->reductionAmountTaxIncl = 0.000000;
  367. $this->reductionAmountTaxExcl = 0.000000;
  368. $this->groupReduction = 0.00;
  369. $this->productQuantityDiscount = 0.000000;
  370. $this->taxComputationMethod = 0;
  371. $this->taxRate = 0.000;
  372. $this->ecotax = 0.000000;
  373. $this->ecoTaxRate = 0.000;
  374. $this->discountQuantityApplied = false;
  375. $this->downloadNb = 0;
  376. $this->totalPriceTaxIncl = 0.000000;
  377. $this->totalPriceTaxExcl = 0.000000;
  378. $this->unitPriceTaxIncl = 0.000000;
  379. $this->unitPriceTaxExcl = 0.000000;
  380. $this->totalShippingPriceTaxExcl = 0.000000;
  381. $this->totalShippingPriceTaxIncl = 0.000000;
  382. $this->purchaseSupplierPrice = 0.000000;
  383. $this->originalProductPrice = 0.000000;
  384. $this->re = false;
  385. $this->width = 0.000000;
  386. $this->height = 0.000000;
  387. $this->depth = 0.000000;
  388. $this->inTransit = true;
  389. $this->estimateCostPrice = 0.000000;
  390. $this->buyBox = false;
  391. }
  392. /**
  393. * @return mixed
  394. */
  395. public function getId()
  396. {
  397. return $this->id;
  398. }
  399. /**
  400. * @param mixed $id
  401. *
  402. * @return OrderDetail
  403. */
  404. public function setId($id): OrderDetail
  405. {
  406. $this->id = $id;
  407. return $this;
  408. }
  409. /**
  410. * @return Order
  411. */
  412. public function getOrder(): Order
  413. {
  414. return $this->order;
  415. }
  416. /**
  417. * @param Order $order
  418. *
  419. * @return OrderDetail
  420. */
  421. public function setOrder(Order $order): OrderDetail
  422. {
  423. $this->order = $order;
  424. return $this;
  425. }
  426. /**
  427. * @return int|null
  428. */
  429. public function getIdOrderInvoice(): ?int
  430. {
  431. return $this->idOrderInvoice;
  432. }
  433. /**
  434. * @param int|null $idOrderInvoice
  435. *
  436. * @return OrderDetail
  437. */
  438. public function setIdOrderInvoice(?int $idOrderInvoice): OrderDetail
  439. {
  440. $this->idOrderInvoice = $idOrderInvoice;
  441. return $this;
  442. }
  443. public function getProduct(): Product
  444. {
  445. return $this->product;
  446. }
  447. public function setProduct(Product $product): OrderDetail
  448. {
  449. $this->product = $product;
  450. return $this;
  451. }
  452. public function getProductAttribute(): ?ProductAttribute
  453. {
  454. return $this->productAttribute;
  455. }
  456. public function setProductAttribute(?ProductAttribute $productAttribute): OrderDetail
  457. {
  458. $this->productAttribute = $productAttribute;
  459. return $this;
  460. }
  461. /**
  462. * @return string
  463. */
  464. public function getProductName(): string
  465. {
  466. return $this->productName;
  467. }
  468. /**
  469. * @param string $productName
  470. *
  471. * @return OrderDetail
  472. */
  473. public function setProductName(string $productName): OrderDetail
  474. {
  475. $this->productName = $productName;
  476. return $this;
  477. }
  478. /**
  479. * @return int
  480. */
  481. public function getProductQuantity(): int
  482. {
  483. return $this->productQuantity;
  484. }
  485. /**
  486. * @param int $productQuantity
  487. *
  488. * @return OrderDetail
  489. */
  490. public function setProductQuantity(int $productQuantity): OrderDetail
  491. {
  492. $this->productQuantity = $productQuantity;
  493. return $this;
  494. }
  495. public function getProductCatalog(): int
  496. {
  497. return $this->productCatalog;
  498. }
  499. public function setProductCatalog(int $productCatalog): OrderDetail
  500. {
  501. $this->productCatalog = $productCatalog;
  502. return $this;
  503. }
  504. /**
  505. * @return int
  506. */
  507. public function getProductQuantityInStock(): int
  508. {
  509. return $this->productQuantityInStock;
  510. }
  511. /**
  512. * @param int $productQuantityInStock
  513. *
  514. * @return OrderDetail
  515. */
  516. public function setProductQuantityInStock(int $productQuantityInStock): OrderDetail
  517. {
  518. $this->productQuantityInStock = $productQuantityInStock;
  519. return $this;
  520. }
  521. /**
  522. * @return int
  523. */
  524. public function getProductQuantityRefunded(): int
  525. {
  526. return $this->productQuantityRefunded;
  527. }
  528. /**
  529. * @param int $productQuantityRefunded
  530. *
  531. * @return OrderDetail
  532. */
  533. public function setProductQuantityRefunded(int $productQuantityRefunded): OrderDetail
  534. {
  535. $this->productQuantityRefunded = $productQuantityRefunded;
  536. return $this;
  537. }
  538. /**
  539. * @return int
  540. */
  541. public function getProductQuantityReturn(): int
  542. {
  543. return $this->productQuantityReturn;
  544. }
  545. /**
  546. * @param int $productQuantityReturn
  547. *
  548. * @return OrderDetail
  549. */
  550. public function setProductQuantityReturn(int $productQuantityReturn): OrderDetail
  551. {
  552. $this->productQuantityReturn = $productQuantityReturn;
  553. return $this;
  554. }
  555. /**
  556. * @return int
  557. */
  558. public function getProductQuantityReinjected(): int
  559. {
  560. return $this->productQuantityReinjected;
  561. }
  562. /**
  563. * @param int $productQuantityReinjected
  564. *
  565. * @return OrderDetail
  566. */
  567. public function setProductQuantityReinjected(int $productQuantityReinjected): OrderDetail
  568. {
  569. $this->productQuantityReinjected = $productQuantityReinjected;
  570. return $this;
  571. }
  572. /**
  573. * @return float
  574. */
  575. public function getProductPrice(): float
  576. {
  577. return $this->productPrice;
  578. }
  579. /**
  580. * @param float $productPrice
  581. *
  582. * @return OrderDetail
  583. */
  584. public function setProductPrice(float $productPrice): OrderDetail
  585. {
  586. $this->productPrice = $productPrice;
  587. return $this;
  588. }
  589. /**
  590. * @return float
  591. */
  592. public function getReductionPercent(): float
  593. {
  594. return $this->reductionPercent;
  595. }
  596. /**
  597. * @param float $reductionPercent
  598. *
  599. * @return OrderDetail
  600. */
  601. public function setReductionPercent(float $reductionPercent): OrderDetail
  602. {
  603. $this->reductionPercent = $reductionPercent;
  604. return $this;
  605. }
  606. /**
  607. * @return float
  608. */
  609. public function getReductionAmount(): float
  610. {
  611. return $this->reductionAmount;
  612. }
  613. /**
  614. * @param float $reductionAmount
  615. *
  616. * @return OrderDetail
  617. */
  618. public function setReductionAmount(float $reductionAmount): OrderDetail
  619. {
  620. $this->reductionAmount = $reductionAmount;
  621. return $this;
  622. }
  623. /**
  624. * @return float
  625. */
  626. public function getReductionAmountTaxIncl(): float
  627. {
  628. return $this->reductionAmountTaxIncl;
  629. }
  630. /**
  631. * @param float $reductionAmountTaxIncl
  632. *
  633. * @return OrderDetail
  634. */
  635. public function setReductionAmountTaxIncl(float $reductionAmountTaxIncl): OrderDetail
  636. {
  637. $this->reductionAmountTaxIncl = $reductionAmountTaxIncl;
  638. return $this;
  639. }
  640. /**
  641. * @return float
  642. */
  643. public function getReductionAmountTaxExcl(): float
  644. {
  645. return $this->reductionAmountTaxExcl;
  646. }
  647. /**
  648. * @param float $reductionAmountTaxExcl
  649. *
  650. * @return OrderDetail
  651. */
  652. public function setReductionAmountTaxExcl(float $reductionAmountTaxExcl): OrderDetail
  653. {
  654. $this->reductionAmountTaxExcl = $reductionAmountTaxExcl;
  655. return $this;
  656. }
  657. /**
  658. * @return float
  659. */
  660. public function getGroupReduction(): float
  661. {
  662. return $this->groupReduction;
  663. }
  664. /**
  665. * @param float $groupReduction
  666. *
  667. * @return OrderDetail
  668. */
  669. public function setGroupReduction(float $groupReduction): OrderDetail
  670. {
  671. $this->groupReduction = $groupReduction;
  672. return $this;
  673. }
  674. /**
  675. * @return float
  676. */
  677. public function getProductQuantityDiscount(): float
  678. {
  679. return $this->productQuantityDiscount;
  680. }
  681. /**
  682. * @param float $productQuantityDiscount
  683. *
  684. * @return OrderDetail
  685. */
  686. public function setProductQuantityDiscount(float $productQuantityDiscount): OrderDetail
  687. {
  688. $this->productQuantityDiscount = $productQuantityDiscount;
  689. return $this;
  690. }
  691. /**
  692. * @return string|null
  693. */
  694. public function getProductEan13(): ?string
  695. {
  696. return $this->productEan13;
  697. }
  698. /**
  699. * @param string|null $productEan13
  700. *
  701. * @return OrderDetail
  702. */
  703. public function setProductEan13(?string $productEan13): OrderDetail
  704. {
  705. $this->productEan13 = $productEan13;
  706. return $this;
  707. }
  708. /**
  709. * @return string|null
  710. */
  711. public function getProductUpc(): ?string
  712. {
  713. return $this->productUpc;
  714. }
  715. /**
  716. * @param string|null $productUpc
  717. *
  718. * @return OrderDetail
  719. */
  720. public function setProductUpc(?string $productUpc): OrderDetail
  721. {
  722. $this->productUpc = $productUpc;
  723. return $this;
  724. }
  725. /**
  726. * @return string|null
  727. */
  728. public function getProductReference(): ?string
  729. {
  730. return $this->productReference;
  731. }
  732. /**
  733. * @param string|null $productReference
  734. *
  735. * @return OrderDetail
  736. */
  737. public function setProductReference(?string $productReference): OrderDetail
  738. {
  739. $this->productReference = $productReference;
  740. return $this;
  741. }
  742. /**
  743. * @return string|null
  744. */
  745. public function getProductSupplierReference(): ?string
  746. {
  747. return $this->productSupplierReference;
  748. }
  749. /**
  750. * @param string|null $productSupplierReference
  751. *
  752. * @return OrderDetail
  753. */
  754. public function setProductSupplierReference(?string $productSupplierReference): OrderDetail
  755. {
  756. $this->productSupplierReference = $productSupplierReference;
  757. return $this;
  758. }
  759. /**
  760. * @return float
  761. */
  762. public function getProductWeight(): float
  763. {
  764. return $this->productWeight;
  765. }
  766. /**
  767. * @param float $productWeight
  768. *
  769. * @return OrderDetail
  770. */
  771. public function setProductWeight(float $productWeight): OrderDetail
  772. {
  773. $this->productWeight = $productWeight;
  774. return $this;
  775. }
  776. public function isTaxComputationMethod(): int
  777. {
  778. return $this->taxComputationMethod;
  779. }
  780. public function setTaxComputationMethod(int $taxComputationMethod): OrderDetail
  781. {
  782. $this->taxComputationMethod = $taxComputationMethod;
  783. return $this;
  784. }
  785. /**
  786. * @return string
  787. */
  788. public function getTaxName(): string
  789. {
  790. return $this->taxName;
  791. }
  792. /**
  793. * @param string $taxName
  794. *
  795. * @return OrderDetail
  796. */
  797. public function setTaxName(string $taxName): OrderDetail
  798. {
  799. $this->taxName = $taxName;
  800. return $this;
  801. }
  802. /**
  803. * @return float
  804. */
  805. public function getTaxRate(): float
  806. {
  807. return $this->taxRate;
  808. }
  809. /**
  810. * @param float $taxRate
  811. *
  812. * @return OrderDetail
  813. */
  814. public function setTaxRate(float $taxRate): OrderDetail
  815. {
  816. $this->taxRate = $taxRate;
  817. return $this;
  818. }
  819. /**
  820. * @return float
  821. */
  822. public function getEcotax(): float
  823. {
  824. return $this->ecotax;
  825. }
  826. /**
  827. * @param float $ecotax
  828. *
  829. * @return OrderDetail
  830. */
  831. public function setEcotax(float $ecotax): OrderDetail
  832. {
  833. $this->ecotax = $ecotax;
  834. return $this;
  835. }
  836. /**
  837. * @return float
  838. */
  839. public function getEcoTaxRate(): float
  840. {
  841. return $this->ecoTaxRate;
  842. }
  843. /**
  844. * @param float $ecoTaxRate
  845. *
  846. * @return OrderDetail
  847. */
  848. public function setEcoTaxRate(float $ecoTaxRate): OrderDetail
  849. {
  850. $this->ecoTaxRate = $ecoTaxRate;
  851. return $this;
  852. }
  853. public function isDiscountQuantityApplied(): bool
  854. {
  855. return $this->discountQuantityApplied;
  856. }
  857. public function setDiscountQuantityApplied(bool $discountQuantityApplied): OrderDetail
  858. {
  859. $this->discountQuantityApplied = $discountQuantityApplied;
  860. return $this;
  861. }
  862. /**
  863. * @return string|null
  864. */
  865. public function getDownloadHash(): ?string
  866. {
  867. return $this->downloadHash;
  868. }
  869. /**
  870. * @param string|null $downloadHash
  871. *
  872. * @return OrderDetail
  873. */
  874. public function setDownloadHash(?string $downloadHash): OrderDetail
  875. {
  876. $this->downloadHash = $downloadHash;
  877. return $this;
  878. }
  879. /**
  880. * @return int|null
  881. */
  882. public function getDownloadNb(): ?int
  883. {
  884. return $this->downloadNb;
  885. }
  886. /**
  887. * @param int|null $downloadNb
  888. *
  889. * @return OrderDetail
  890. */
  891. public function setDownloadNb(?int $downloadNb): OrderDetail
  892. {
  893. $this->downloadNb = $downloadNb;
  894. return $this;
  895. }
  896. /**
  897. * @return \DateTime|null
  898. */
  899. public function getDownloadDeadline(): ?\DateTime
  900. {
  901. return $this->downloadDeadline;
  902. }
  903. /**
  904. * @param \DateTime|null $downloadDeadline
  905. *
  906. * @return OrderDetail
  907. */
  908. public function setDownloadDeadline(?\DateTime $downloadDeadline): OrderDetail
  909. {
  910. $this->downloadDeadline = $downloadDeadline;
  911. return $this;
  912. }
  913. /**
  914. * @return float
  915. */
  916. public function getTotalPriceTaxIncl(): float
  917. {
  918. return $this->totalPriceTaxIncl;
  919. }
  920. /**
  921. * @param float $totalPriceTaxIncl
  922. *
  923. * @return OrderDetail
  924. */
  925. public function setTotalPriceTaxIncl(float $totalPriceTaxIncl): OrderDetail
  926. {
  927. $this->totalPriceTaxIncl = $totalPriceTaxIncl;
  928. return $this;
  929. }
  930. /**
  931. * @return float
  932. */
  933. public function getTotalPriceTaxExcl(): float
  934. {
  935. return $this->totalPriceTaxExcl;
  936. }
  937. /**
  938. * @param float $totalPriceTaxExcl
  939. *
  940. * @return OrderDetail
  941. */
  942. public function setTotalPriceTaxExcl(float $totalPriceTaxExcl): OrderDetail
  943. {
  944. $this->totalPriceTaxExcl = $totalPriceTaxExcl;
  945. return $this;
  946. }
  947. /**
  948. * @return float
  949. */
  950. public function getUnitPriceTaxIncl(): float
  951. {
  952. return $this->unitPriceTaxIncl;
  953. }
  954. /**
  955. * @param float $unitPriceTaxIncl
  956. *
  957. * @return OrderDetail
  958. */
  959. public function setUnitPriceTaxIncl(float $unitPriceTaxIncl): OrderDetail
  960. {
  961. $this->unitPriceTaxIncl = $unitPriceTaxIncl;
  962. return $this;
  963. }
  964. /**
  965. * @return float
  966. */
  967. public function getUnitPriceTaxExcl(): float
  968. {
  969. return $this->unitPriceTaxExcl;
  970. }
  971. /**
  972. * @param float $unitPriceTaxExcl
  973. *
  974. * @return OrderDetail
  975. */
  976. public function setUnitPriceTaxExcl(float $unitPriceTaxExcl): OrderDetail
  977. {
  978. $this->unitPriceTaxExcl = $unitPriceTaxExcl;
  979. return $this;
  980. }
  981. /**
  982. * @return float
  983. */
  984. public function getTotalShippingPriceTaxIncl(): float
  985. {
  986. return $this->totalShippingPriceTaxIncl;
  987. }
  988. /**
  989. * @param float $totalShippingPriceTaxIncl
  990. *
  991. * @return OrderDetail
  992. */
  993. public function setTotalShippingPriceTaxIncl(float $totalShippingPriceTaxIncl): OrderDetail
  994. {
  995. $this->totalShippingPriceTaxIncl = $totalShippingPriceTaxIncl;
  996. return $this;
  997. }
  998. /**
  999. * @return float
  1000. */
  1001. public function getTotalShippingPriceTaxExcl(): float
  1002. {
  1003. return $this->totalShippingPriceTaxExcl;
  1004. }
  1005. /**
  1006. * @param float $totalShippingPriceTaxExcl
  1007. *
  1008. * @return OrderDetail
  1009. */
  1010. public function setTotalShippingPriceTaxExcl(float $totalShippingPriceTaxExcl): OrderDetail
  1011. {
  1012. $this->totalShippingPriceTaxExcl = $totalShippingPriceTaxExcl;
  1013. return $this;
  1014. }
  1015. /**
  1016. * @return float
  1017. */
  1018. public function getPurchaseSupplierPrice(): float
  1019. {
  1020. return $this->purchaseSupplierPrice;
  1021. }
  1022. /**
  1023. * @param float $purchaseSupplierPrice
  1024. *
  1025. * @return OrderDetail
  1026. */
  1027. public function setPurchaseSupplierPrice(float $purchaseSupplierPrice): OrderDetail
  1028. {
  1029. $this->purchaseSupplierPrice = $purchaseSupplierPrice;
  1030. return $this;
  1031. }
  1032. /**
  1033. * @return float
  1034. */
  1035. public function getOriginalProductPrice(): float
  1036. {
  1037. return $this->originalProductPrice;
  1038. }
  1039. /**
  1040. * @param float $originalProductPrice
  1041. *
  1042. * @return OrderDetail
  1043. */
  1044. public function setOriginalProductPrice(float $originalProductPrice): OrderDetail
  1045. {
  1046. $this->originalProductPrice = $originalProductPrice;
  1047. return $this;
  1048. }
  1049. /**
  1050. * @return bool
  1051. */
  1052. public function isRe(): bool
  1053. {
  1054. return $this->re;
  1055. }
  1056. /**
  1057. * @param bool $re
  1058. *
  1059. * @return OrderDetail
  1060. */
  1061. public function setRe(bool $re): OrderDetail
  1062. {
  1063. $this->re = $re;
  1064. return $this;
  1065. }
  1066. public function getLocks(): ?int
  1067. {
  1068. return $this->locks;
  1069. }
  1070. public function setLocks(?int $locks): OrderDetail
  1071. {
  1072. $this->locks = $locks;
  1073. return $this;
  1074. }
  1075. /**
  1076. * @return float
  1077. */
  1078. public function getWidth(): float
  1079. {
  1080. return $this->width;
  1081. }
  1082. /**
  1083. * @param float $width
  1084. *
  1085. * @return OrderDetail
  1086. */
  1087. public function setWidth(float $width): OrderDetail
  1088. {
  1089. $this->width = $width;
  1090. return $this;
  1091. }
  1092. /**
  1093. * @return float
  1094. */
  1095. public function getHeight(): float
  1096. {
  1097. return $this->height;
  1098. }
  1099. /**
  1100. * @param float $height
  1101. *
  1102. * @return OrderDetail
  1103. */
  1104. public function setHeight(float $height): OrderDetail
  1105. {
  1106. $this->height = $height;
  1107. return $this;
  1108. }
  1109. /**
  1110. * @return float
  1111. */
  1112. public function getDepth(): float
  1113. {
  1114. return $this->depth;
  1115. }
  1116. /**
  1117. * @param float $depth
  1118. *
  1119. * @return OrderDetail
  1120. */
  1121. public function setDepth(float $depth): OrderDetail
  1122. {
  1123. $this->depth = $depth;
  1124. return $this;
  1125. }
  1126. /**
  1127. * @return bool
  1128. */
  1129. public function isInTransit(): bool
  1130. {
  1131. return $this->inTransit;
  1132. }
  1133. /**
  1134. * @param bool $inTransit
  1135. *
  1136. * @return OrderDetail
  1137. */
  1138. public function setInTransit(bool $inTransit): OrderDetail
  1139. {
  1140. $this->inTransit = $inTransit;
  1141. return $this;
  1142. }
  1143. /**
  1144. * @return float
  1145. */
  1146. public function getEstimateCostPrice(): float
  1147. {
  1148. return $this->estimateCostPrice;
  1149. }
  1150. /**
  1151. * @param float $estimateCostPrice
  1152. *
  1153. * @return OrderDetail
  1154. */
  1155. public function setEstimateCostPrice(float $estimateCostPrice): OrderDetail
  1156. {
  1157. $this->estimateCostPrice = $estimateCostPrice;
  1158. return $this;
  1159. }
  1160. /**
  1161. * @return int|null
  1162. */
  1163. public function getPriceByQuantity(): ?int
  1164. {
  1165. return $this->priceByQuantity;
  1166. }
  1167. /**
  1168. * @param int|null $priceByQuantity
  1169. *
  1170. * @return OrderDetail
  1171. */
  1172. public function setPriceByQuantity(?int $priceByQuantity): OrderDetail
  1173. {
  1174. $this->priceByQuantity = $priceByQuantity;
  1175. return $this;
  1176. }
  1177. /**
  1178. * @return string|null
  1179. */
  1180. public function getInternalReference(): ?string
  1181. {
  1182. return $this->internalReference;
  1183. }
  1184. /**
  1185. * @param string|null $internalReference
  1186. *
  1187. * @return OrderDetail
  1188. */
  1189. public function setInternalReference(?string $internalReference): OrderDetail
  1190. {
  1191. $this->internalReference = $internalReference;
  1192. return $this;
  1193. }
  1194. public function getDateUpd(): ?\DateTime
  1195. {
  1196. return $this->dateUpd;
  1197. }
  1198. public function setDateUpd(\DateTime $dateUpd): OrderDetail
  1199. {
  1200. $this->dateUpd = $dateUpd;
  1201. return $this;
  1202. }
  1203. public function isBuyBox(): bool
  1204. {
  1205. return $this->buyBox;
  1206. }
  1207. public function setBuyBox(bool $buyBox): void
  1208. {
  1209. $this->buyBox = $buyBox;
  1210. }
  1211. /**
  1212. * @return RefundLine[]|ArrayCollection<int, RefundLine>
  1213. */
  1214. public function getRefundLines()
  1215. {
  1216. return $this->refundLines;
  1217. }
  1218. /**
  1219. * @param RefundLine[]|ArrayCollection<int, RefundLine> $refundLines
  1220. */
  1221. public function setRefundLines($refundLines): OrderDetail
  1222. {
  1223. $this->refundLines = $refundLines;
  1224. return $this;
  1225. }
  1226. public function isFullyRefunded(): bool
  1227. {
  1228. return $this->productQuantityRefunded >= $this->productQuantity;
  1229. }
  1230. public function isPartiallyRefunded(): bool
  1231. {
  1232. return $this->productQuantityRefunded > 0 && $this->productQuantityRefunded < $this->productQuantity;
  1233. }
  1234. public function getRefundedPercentage(): float
  1235. {
  1236. if ($this->productQuantity === 0) {
  1237. return 0.0;
  1238. }
  1239. return ($this->productQuantityRefunded / $this->productQuantity) * 100;
  1240. }
  1241. public function getRemainingQuantity(): int
  1242. {
  1243. return max(0, $this->productQuantity - $this->productQuantityRefunded - $this->productQuantityReturn);
  1244. }
  1245. public function hasRemainingQuantity(): bool
  1246. {
  1247. return $this->getRemainingQuantity() > 0;
  1248. }
  1249. /**
  1250. * @return OrderDetailQuantityStock[]|ArrayCollection<int, OrderDetailQuantityStock>
  1251. */
  1252. public function getOrderDetailQuantityStocks()
  1253. {
  1254. return $this->orderDetailQuantityStocks;
  1255. }
  1256. /**
  1257. * @param OrderDetailQuantityStock[]|ArrayCollection<int, OrderDetailQuantityStock> $orderDetailQuantityStocks
  1258. */
  1259. public function setOrderDetailQuantityStocks($orderDetailQuantityStocks): OrderDetail
  1260. {
  1261. $this->orderDetailQuantityStocks = $orderDetailQuantityStocks;
  1262. return $this;
  1263. }
  1264. }