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