DolibarrBill.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Dolibarr;
  4. use ApiPlatform\Metadata\ApiProperty;
  5. use ApiPlatform\Metadata\ApiResource;
  6. use ApiPlatform\Metadata\Get;
  7. use App\ApiResources\ApiResourcesInterface;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10. * Bill of a society, retrieved from dolibarr.
  11. */
  12. #[ApiResource(
  13. operations: [
  14. new 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. public function getTaxExcludedAmount(): float
  78. {
  79. return $this->taxExcludedAmount;
  80. }
  81. public function setTaxExcludedAmount(float $taxExcludedAmount): self
  82. {
  83. $this->taxExcludedAmount = $taxExcludedAmount;
  84. return $this;
  85. }
  86. public function getTaxIncludedAmount(): float
  87. {
  88. return $this->taxIncludedAmount;
  89. }
  90. public function setTaxIncludedAmount(float $taxIncludedAmount): self
  91. {
  92. $this->taxIncludedAmount = $taxIncludedAmount;
  93. return $this;
  94. }
  95. public function getPaid(): bool
  96. {
  97. return $this->paid;
  98. }
  99. public function setPaid(bool $paid): self
  100. {
  101. $this->paid = $paid;
  102. return $this;
  103. }
  104. }