src/Entity/System/OrderDetail.php line 23

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