BillingSettingRent.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use AppBundle\Entity\Organization\Organization;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Dunglas\ApiBundle\Annotation\Iri;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use AppBundle\Entity\Traits\TimestampableEntity;
  10. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  11. use AppBundle\Annotation\DefaultField;
  12. /**
  13. * Paramètres globaux d'une Organization concernant la facturation liée à la location
  14. *
  15. * @Iri("http://schema.org/BillingSettingRent")
  16. */
  17. #[ORM\Entity]
  18. class BillingSettingRent
  19. {
  20. use TimestampableEntity;
  21. use CreatorUpdaterEntity;
  22. /**
  23. * @var int
  24. */
  25. #[ORM\Column(type: 'integer')]
  26. #[ORM\Id]
  27. #[ORM\GeneratedValue(strategy: 'AUTO')]
  28. #[Groups(['billingsettingrent'])]
  29. private $id;
  30. /**
  31. * @var BillingSetting
  32. */
  33. #[ORM\OneToOne(targetEntity: 'BillingSetting', inversedBy: 'billingSettingRent', fetch: 'EAGER')]
  34. #[ORM\JoinColumn(nullable: false)]
  35. #[Assert\NotNull]
  36. #[Groups(['billingsettingrent'])]
  37. private $billingSetting;
  38. /**
  39. * @var string
  40. */
  41. #[ORM\Column(type: 'string', nullable: true)]
  42. #[Assert\Type(type: 'string')]
  43. #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\ReductionTypeEnum', 'toArray'])]
  44. #[Groups(['billingsettingrent'])]
  45. private $reductionType;
  46. /**
  47. * @var float
  48. */
  49. #[ORM\Column(type: 'float', nullable: true)]
  50. #[Assert\Type(type: 'float')]
  51. #[Groups(['billingsettingrent'])]
  52. private $thresholdFirstAmount;
  53. /**
  54. * @var float
  55. */
  56. #[ORM\Column(type: 'float', nullable: true)]
  57. #[Assert\Type(type: 'float')]
  58. #[Groups(['billingsettingrent'])]
  59. private $thresholdSecondAmount;
  60. /**
  61. * @var float
  62. */
  63. #[ORM\Column(type: 'integer', nullable: true)]
  64. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  65. #[Groups(['billingsettingrent'])]
  66. private $thresholdNumberYear;
  67. /**
  68. * @var array
  69. */
  70. #[ORM\Column(type: 'json_array', nullable: true)]
  71. #[Groups(['billingsettingrent'])]
  72. private $instrumentFamilyReduction;
  73. /**
  74. * @var array
  75. */
  76. #[ORM\Column(type: 'json_array', nullable: true)]
  77. #[Groups(['billingsettingrent'])]
  78. private $purchaseDateReduction;
  79. /**
  80. * @var array
  81. */
  82. #[ORM\Column(type: 'json_array', nullable: true)]
  83. #[Groups(['billingsettingrent'])]
  84. private $purchaseAmountReduction;
  85. /**
  86. * @var array
  87. */
  88. #[ORM\Column(type: 'json_array', nullable: true)]
  89. #[Groups(['billingsettingrent'])]
  90. private $rentalYearsReduction;
  91. /**
  92. * @var array
  93. */
  94. #[ORM\Column(type: 'json_array', nullable: true)]
  95. #[Groups(['billingsettingrent'])]
  96. private $instrumentFamilyAndRentalYearsReduction;
  97. /**
  98. * @var float
  99. */
  100. #[ORM\Column(type: 'float', nullable: true)]
  101. #[Assert\Type(type: 'float')]
  102. #[Groups(['billingsettingrent'])]
  103. private $singleAmount;
  104. /**
  105. * @var string
  106. */
  107. #[ORM\Column(type: 'string', nullable: true)]
  108. #[Assert\Type(type: 'string')]
  109. #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PeriodicityEnum', 'toArray'])]
  110. #[Groups(['billingsettingrent'])]
  111. private $periodicity;
  112. /**
  113. * @var string
  114. */
  115. #[ORM\Column(type: 'string', length: 7, nullable: true)]
  116. #[Assert\Length(max: 7, maxMessage: 'invalid-max-length')]
  117. #[Assert\Type(type: 'string')]
  118. #[Groups(['billingsettingrent'])]
  119. private $accountingCode;
  120. /**
  121. * @var int
  122. */
  123. #[ORM\Column(type: 'integer', nullable: true)]
  124. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  125. #[Groups(['billingsettingrent'])]
  126. private $nature;
  127. /**
  128. * @var string
  129. */
  130. #[ORM\Column(type: 'string', length: 200, nullable: true)]
  131. #[Assert\Type(type: 'string')]
  132. #[Groups(['billingsettingrent'])]
  133. private $accountingCodelabel;
  134. /**
  135. * Constructor
  136. */
  137. public function __construct()
  138. {
  139. }
  140. /**
  141. * Sets id.
  142. *
  143. * @param int $id
  144. *
  145. * @return $this
  146. */
  147. public function setId($id)
  148. {
  149. $this->id = $id;
  150. return $this;
  151. }
  152. /**
  153. * Gets id.
  154. *
  155. * @return int
  156. */
  157. public function getId()
  158. {
  159. return $this->id;
  160. }
  161. /**
  162. * Set reductionType
  163. *
  164. * @param string $reductionType
  165. *
  166. * @return BillingSettingRent
  167. */
  168. public function setReductionType($reductionType)
  169. {
  170. $this->reductionType = $reductionType;
  171. return $this;
  172. }
  173. /**
  174. * Get reductionType
  175. *
  176. * @return string
  177. */
  178. public function getReductionType()
  179. {
  180. return $this->reductionType;
  181. }
  182. /**
  183. * Set instrumentFamilyReduction
  184. *
  185. * @param array $instrumentFamilyReduction
  186. *
  187. * @return BillingSettingRent
  188. */
  189. public function setInstrumentFamilyReduction($instrumentFamilyReduction)
  190. {
  191. $this->instrumentFamilyReduction = $instrumentFamilyReduction;
  192. return $this;
  193. }
  194. /**
  195. * Get instrumentFamilyReduction
  196. *
  197. * @return array
  198. */
  199. public function getInstrumentFamilyReduction()
  200. {
  201. return $this->instrumentFamilyReduction;
  202. }
  203. /**
  204. * Set purchaseDateReduction
  205. *
  206. * @param array $purchaseDateReduction
  207. *
  208. * @return BillingSettingRent
  209. */
  210. public function setPurchaseDateReduction($purchaseDateReduction)
  211. {
  212. $this->purchaseDateReduction = $purchaseDateReduction;
  213. return $this;
  214. }
  215. /**
  216. * Get purchaseDateReduction
  217. *
  218. * @return array
  219. */
  220. public function getPurchaseDateReduction()
  221. {
  222. return $this->purchaseDateReduction;
  223. }
  224. /**
  225. * Set purchaseAmountReduction
  226. *
  227. * @param array $purchaseAmountReduction
  228. *
  229. * @return BillingSettingRent
  230. */
  231. public function setPurchaseAmountReduction($purchaseAmountReduction)
  232. {
  233. $this->purchaseAmountReduction = $purchaseAmountReduction;
  234. return $this;
  235. }
  236. /**
  237. * Get purchaseAmountReduction
  238. *
  239. * @return array
  240. */
  241. public function getPurchaseAmountReduction()
  242. {
  243. return $this->purchaseAmountReduction;
  244. }
  245. /**
  246. * Set rentalYearsReduction
  247. *
  248. * @param array $rentalYearsReduction
  249. *
  250. * @return BillingSettingRent
  251. */
  252. public function setRentalYearsReduction($rentalYearsReduction)
  253. {
  254. $this->rentalYearsReduction = $rentalYearsReduction;
  255. return $this;
  256. }
  257. /**
  258. * Get rentalYearsReduction
  259. *
  260. * @return array
  261. */
  262. public function getRentalYearsReduction()
  263. {
  264. return $this->rentalYearsReduction;
  265. }
  266. /**
  267. * Set billingSetting
  268. *
  269. * @param \AppBundle\Entity\Billing\BillingSetting $billingSetting
  270. *
  271. * @return BillingSettingRent
  272. */
  273. public function setBillingSetting(\AppBundle\Entity\Billing\BillingSetting $billingSetting)
  274. {
  275. $this->billingSetting = $billingSetting;
  276. return $this;
  277. }
  278. /**
  279. * Get billingSetting
  280. *
  281. * @return \AppBundle\Entity\Billing\BillingSetting
  282. */
  283. public function getBillingSetting()
  284. {
  285. return $this->billingSetting;
  286. }
  287. /**
  288. * Set thresholdFirstAmount
  289. *
  290. * @param float $thresholdFirstAmount
  291. *
  292. * @return BillingSettingRent
  293. */
  294. public function setThresholdFirstAmount($thresholdFirstAmount)
  295. {
  296. $this->thresholdFirstAmount = floatval($thresholdFirstAmount);
  297. return $this;
  298. }
  299. /**
  300. * Get thresholdFirstAmount
  301. *
  302. * @return float
  303. */
  304. public function getThresholdFirstAmount()
  305. {
  306. return $this->thresholdFirstAmount;
  307. }
  308. /**
  309. * Set thresholdSecondAmount
  310. *
  311. * @param float $thresholdSecondAmount
  312. *
  313. * @return BillingSettingRent
  314. */
  315. public function setThresholdSecondAmount($thresholdSecondAmount)
  316. {
  317. $this->thresholdSecondAmount = floatval($thresholdSecondAmount);
  318. return $this;
  319. }
  320. /**
  321. * Get thresholdSecondAmount
  322. *
  323. * @return float
  324. */
  325. public function getThresholdSecondAmount()
  326. {
  327. return $this->thresholdSecondAmount;
  328. }
  329. /**
  330. * Set thresholdNumberYear
  331. *
  332. * @param \Integer $thresholdNumberYear
  333. *
  334. * @return BillingSettingRent
  335. */
  336. public function setThresholdNumberYear($thresholdNumberYear)
  337. {
  338. $this->thresholdNumberYear = $thresholdNumberYear;
  339. return $this;
  340. }
  341. /**
  342. * Get thresholdNumberYear
  343. *
  344. * @return \Integer
  345. */
  346. public function getThresholdNumberYear()
  347. {
  348. return $this->thresholdNumberYear;
  349. }
  350. /**
  351. * Set instrumentFamilyAndRentalYearsReduction
  352. *
  353. * @param array $instrumentFamilyAndRentalYearsReduction
  354. *
  355. * @return BillingSettingRent
  356. */
  357. public function setInstrumentFamilyAndRentalYearsReduction($instrumentFamilyAndRentalYearsReduction)
  358. {
  359. $this->instrumentFamilyAndRentalYearsReduction = $instrumentFamilyAndRentalYearsReduction;
  360. return $this;
  361. }
  362. /**
  363. * Get instrumentFamilyAndRentalYearsReduction
  364. *
  365. * @return array
  366. */
  367. public function getInstrumentFamilyAndRentalYearsReduction()
  368. {
  369. return $this->instrumentFamilyAndRentalYearsReduction;
  370. }
  371. /**
  372. * Set singleAmount
  373. *
  374. * @param float $singleAmount
  375. *
  376. * @return BillingSettingRent
  377. */
  378. public function setSingleAmount($singleAmount)
  379. {
  380. $this->singleAmount = floatval($singleAmount);
  381. return $this;
  382. }
  383. /**
  384. * Get singleAmount
  385. *
  386. * @return float
  387. */
  388. public function getSingleAmount()
  389. {
  390. return $this->singleAmount;
  391. }
  392. /**
  393. * Set periodicity
  394. *
  395. * @param string $periodicity
  396. *
  397. * @return BillingSettingRent
  398. */
  399. public function setPeriodicity($periodicity)
  400. {
  401. $this->periodicity = $periodicity;
  402. return $this;
  403. }
  404. /**
  405. * Get periodicity
  406. *
  407. * @return string
  408. */
  409. public function getPeriodicity()
  410. {
  411. return $this->periodicity;
  412. }
  413. /**
  414. * Set accountingCode
  415. *
  416. * @param integer $accountingCode
  417. *
  418. * @return BillingSettingRent
  419. */
  420. public function setAccountingCode($accountingCode)
  421. {
  422. $this->accountingCode = $accountingCode;
  423. return $this;
  424. }
  425. /**
  426. * Get accountingCode
  427. *
  428. * @return integer
  429. */
  430. public function getAccountingCode()
  431. {
  432. return $this->accountingCode;
  433. }
  434. /**
  435. * Set nature
  436. *
  437. * @param integer $nature
  438. *
  439. * @return BillingSettingRent
  440. */
  441. public function setNature($nature)
  442. {
  443. $this->nature = $nature;
  444. return $this;
  445. }
  446. /**
  447. * Get nature
  448. *
  449. * @return integer
  450. */
  451. public function getNature()
  452. {
  453. return $this->nature;
  454. }
  455. /**
  456. * Set accountingCodelabel
  457. *
  458. * @param string $accountingCodelabel
  459. *
  460. * @return BillingSettingRent
  461. */
  462. public function setAccountingCodelabel($accountingCodelabel)
  463. {
  464. $this->accountingCodelabel = $accountingCodelabel;
  465. return $this;
  466. }
  467. /**
  468. * Get accountingCodelabel
  469. *
  470. * @return string
  471. */
  472. public function getAccountingCodelabel()
  473. {
  474. return $this->accountingCodelabel;
  475. }
  476. }