DolibarrBill.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Dolibarr;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8. * Bill of a society, retrieved from dolibarr
  9. */
  10. #[ApiResource]
  11. class DolibarrBill
  12. {
  13. /**
  14. * Id of the dolibarr bill ( = invoice)
  15. */
  16. #[ApiProperty(identifier: true)]
  17. #[Groups('dolibarr_get')]
  18. private int $id;
  19. /**
  20. * Bill reference
  21. */
  22. #[Groups('dolibarr_get')]
  23. private string $ref;
  24. /**
  25. * Date of the bill
  26. */
  27. #[Groups('dolibarr_get')]
  28. private \DateTime $date;
  29. /**
  30. * Amount (tax excluded)
  31. */
  32. #[Groups('dolibarr_get')]
  33. private float $taxExcludedAmount;
  34. /**
  35. * Amount (tax included)
  36. */
  37. #[Groups('dolibarr_get')]
  38. private float $taxIncludedAmount;
  39. /**
  40. * Is the bill paid or not
  41. */
  42. #[Groups('dolibarr_get')]
  43. private bool $paid;
  44. public function getId(): int
  45. {
  46. return $this->id;
  47. }
  48. public function setId(int $id): self
  49. {
  50. $this->id = $id;
  51. return $this;
  52. }
  53. public function getRef(): string
  54. {
  55. return $this->ref;
  56. }
  57. public function setRef(string $ref): self
  58. {
  59. $this->ref = $ref;
  60. return $this;
  61. }
  62. public function getDate(): \DateTime
  63. {
  64. return $this->date;
  65. }
  66. public function setDate(\DateTime $date): self
  67. {
  68. $this->date = $date;
  69. return $this;
  70. }
  71. /**
  72. * @return float
  73. */
  74. public function getTaxExcludedAmount(): float
  75. {
  76. return $this->taxExcludedAmount;
  77. }
  78. /**
  79. * @param float $taxExcludedAmount
  80. */
  81. public function setTaxExcludedAmount(float $taxExcludedAmount): self
  82. {
  83. $this->taxExcludedAmount = $taxExcludedAmount;
  84. return $this;
  85. }
  86. /**
  87. * @return float
  88. */
  89. public function getTaxIncludedAmount(): float
  90. {
  91. return $this->taxIncludedAmount;
  92. }
  93. /**
  94. * @param float $taxIncludedAmount
  95. */
  96. public function setTaxIncludedAmount(float $taxIncludedAmount): self
  97. {
  98. $this->taxIncludedAmount = $taxIncludedAmount;
  99. return $this;
  100. }
  101. public function getPaid(): bool
  102. {
  103. return $this->paid;
  104. }
  105. public function setPaid(bool $paid): self
  106. {
  107. $this->paid = $paid;
  108. return $this;
  109. }
  110. }