DolibarrBill.php 2.5 KB

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