BillLine.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use AppBundle\Entity\Booking\EducationalProject;
  5. use AppBundle\Entity\Product\EquipmentLoan;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Dunglas\ApiBundle\Annotation\Iri;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. use AppBundle\Entity\Traits\TimestampableEntity;
  11. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  12. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  13. /**
  14. * Une ligne de facturation
  15. * @see BillAccounting
  16. *
  17. * @Iri("http://schema.org/BillLine")
  18. */
  19. #[ORM\Entity]
  20. class BillLine
  21. {
  22. use TimestampableEntity;
  23. use CreatorUpdaterEntity;
  24. /**
  25. * @var int
  26. */
  27. #[ORM\Column(type: 'integer')]
  28. #[ORM\Id]
  29. #[ORM\GeneratedValue(strategy: 'AUTO')]
  30. #[Groups(['billline', 'billaccounting_list', 'bill_list', 'build_bills'])]
  31. private $id;
  32. /**
  33. * @var Bill
  34. */
  35. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Billing\BillAccounting', inversedBy: 'billLines')]
  36. #[ORM\JoinColumn(nullable: false)]
  37. #[Assert\NotNull]
  38. #[Groups(['billline'])]
  39. private $bill;
  40. /**
  41. * @var Access
  42. */
  43. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'billLines')]
  44. #[Groups(['billline', 'billaccounting_list_billlines', 'bill_list_billlines', 'billpayment_list_bill', 'billaccounting_list_bill', 'billcredit_list_bill', 'build_bills_billlines'])]
  45. private $access;
  46. /**
  47. * @var EducationalProject
  48. */
  49. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Booking\EducationalProject', inversedBy: 'billLines')]
  50. #[Groups(['billline', 'build_bills_billlines'])]
  51. private $educationalProject;
  52. /**
  53. * @var EquipmentLoan
  54. */
  55. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Product\EquipmentLoan', inversedBy: 'billLines')]
  56. #[Groups(['billline'])]
  57. private $equipmentLoan;
  58. /**
  59. * @var string
  60. */
  61. #[ORM\Column(type: 'text', nullable: true)]
  62. #[Assert\Type(type: 'string')]
  63. #[Groups(['billline', 'build_bills_billlines'])]
  64. private $intangibleName;
  65. /**
  66. * @var string
  67. *
  68. * @Iri("https://schema.org/description")
  69. */
  70. #[ORM\Column(type: 'text', nullable: true)]
  71. #[Assert\Type(type: 'string')]
  72. #[Groups(['billline', 'build_bills_billlines'])]
  73. private $intangibleDescription;
  74. /**
  75. * @var string
  76. */
  77. #[ORM\Column(type: 'text', nullable: true)]
  78. #[Assert\Type(type: 'string')]
  79. #[Groups(['billline'])]
  80. private $intangibleDomain;
  81. /**
  82. * @var int
  83. */
  84. #[ORM\Column(type: 'integer', nullable: true)]
  85. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  86. #[Groups(['billline', 'build_bills_billlines'])]
  87. private $quantity;
  88. /**
  89. * @var float
  90. */
  91. #[ORM\Column(type: 'float', nullable: true)]
  92. #[Assert\Type(type: 'float')]
  93. #[Groups(['billline', 'build_bills_billlines'])]
  94. private $unitPrice;
  95. /**
  96. * @var float
  97. */
  98. #[ORM\Column(type: 'float', nullable: true)]
  99. #[Assert\Type(type: 'float')]
  100. #[Groups(['billline', 'build_bills_billlines'])]
  101. private $vat;
  102. /**
  103. * @var float
  104. */
  105. #[ORM\Column(type: 'float', nullable: true)]
  106. #[Assert\Type(type: 'float')]
  107. #[Groups(['billline', 'build_bills_billlines'])]
  108. private $totalPrice;
  109. /**
  110. * @var array
  111. */
  112. #[ORM\Column(type: 'json_array', nullable: true)]
  113. #[Groups(['billline', 'build_bills_billlines'])]
  114. private $reductions;
  115. /**
  116. * @var int
  117. */
  118. #[ORM\Column(type: 'integer', nullable: true)]
  119. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  120. #[Groups(['billline', 'build_bills_billlines'])]
  121. private $accountingCode;
  122. /**
  123. * @var string
  124. */
  125. #[ORM\Column(type: 'string', length: 200, nullable: true)]
  126. #[Assert\Type(type: 'string')]
  127. #[Groups(['billline', 'build_bills_billlines'])]
  128. private $accountingCodelabel;
  129. /**
  130. * @var int
  131. */
  132. #[ORM\Column(type: 'integer', nullable: true)]
  133. #[Assert\Type(type: 'integer', message: 'invalid-integer')]
  134. #[Groups(['billline', 'build_bills_billlines'])]
  135. private $nature;
  136. /**
  137. * @var array
  138. */
  139. #[ORM\Column(type: 'json_array', nullable: true)]
  140. #[Groups(['billline'])]
  141. private $educations;
  142. /**
  143. * @var bool
  144. */
  145. #[ORM\Column(type: 'boolean', options: ['default' => true])]
  146. #[Assert\Type(type: 'boolean')]
  147. #[Assert\NotNull]
  148. #[Groups(['billline', 'build_bills_billlines'])]
  149. private $showInBill = true;
  150. /**
  151. * Constructor
  152. */
  153. public function __construct()
  154. {
  155. }
  156. /**
  157. * Sets id.
  158. *
  159. * @param int $id
  160. *
  161. * @return $this
  162. */
  163. public function setId($id)
  164. {
  165. $this->id = $id;
  166. return $this;
  167. }
  168. /**
  169. * Gets id.
  170. *
  171. * @return int
  172. */
  173. public function getId()
  174. {
  175. return $this->id;
  176. }
  177. /**
  178. * Set intangibleName
  179. *
  180. * @param string $intangibleName
  181. *
  182. * @return BillLine
  183. */
  184. public function setIntangibleName($intangibleName)
  185. {
  186. $this->intangibleName = $intangibleName;
  187. return $this;
  188. }
  189. /**
  190. * Get intangibleName
  191. *
  192. * @return string
  193. */
  194. public function getIntangibleName()
  195. {
  196. return $this->intangibleName;
  197. }
  198. /**
  199. * Set intangibleDescription
  200. *
  201. * @param string $intangibleDescription
  202. *
  203. * @return BillLine
  204. */
  205. public function setIntangibleDescription($intangibleDescription)
  206. {
  207. $this->intangibleDescription = $intangibleDescription;
  208. return $this;
  209. }
  210. /**
  211. * Get intangibleDescription
  212. *
  213. * @return string
  214. */
  215. public function getIntangibleDescription()
  216. {
  217. return $this->intangibleDescription;
  218. }
  219. /**
  220. * Set quantity
  221. *
  222. * @param integer $quantity
  223. *
  224. * @return BillLine
  225. */
  226. public function setQuantity($quantity)
  227. {
  228. $this->quantity = $quantity;
  229. return $this;
  230. }
  231. /**
  232. * Get quantity
  233. *
  234. * @return integer
  235. */
  236. public function getQuantity()
  237. {
  238. return $this->quantity;
  239. }
  240. /**
  241. * Set unitPrice
  242. *
  243. * @param float $unitPrice
  244. *
  245. * @return BillLine
  246. */
  247. public function setUnitPrice($unitPrice)
  248. {
  249. $this->unitPrice = floatval($unitPrice);
  250. return $this;
  251. }
  252. /**
  253. * Get unitPrice
  254. *
  255. * @return float
  256. */
  257. public function getUnitPrice()
  258. {
  259. return $this->unitPrice;
  260. }
  261. /**
  262. * Set bill
  263. *
  264. * @param $bill
  265. *
  266. * @return BillLine
  267. */
  268. public function setBill($bill)
  269. {
  270. $this->bill = $bill;
  271. return $this;
  272. }
  273. /**
  274. * Get bill
  275. *
  276. * @return
  277. */
  278. public function getBill()
  279. {
  280. return $this->bill;
  281. }
  282. /**
  283. * Set access
  284. *
  285. * @param \AppBundle\Entity\AccessAndFunction\Access $access
  286. *
  287. * @return BillLine
  288. */
  289. public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access)
  290. {
  291. $this->access = $access;
  292. return $this;
  293. }
  294. /**
  295. * Get access
  296. *
  297. * @return \AppBundle\Entity\AccessAndFunction\Access
  298. */
  299. public function getAccess()
  300. {
  301. return $this->access;
  302. }
  303. /**
  304. * Set vat
  305. *
  306. * @param float $vat
  307. *
  308. * @return BillLine
  309. */
  310. public function setVat($vat)
  311. {
  312. $this->vat = floatval($vat);
  313. return $this;
  314. }
  315. /**
  316. * Get vat
  317. *
  318. * @return float
  319. */
  320. public function getVat()
  321. {
  322. return $this->vat;
  323. }
  324. /**
  325. * Set totalPrice
  326. *
  327. * @param float $totalPrice
  328. *
  329. * @return BillLine
  330. */
  331. public function setTotalPrice($totalPrice)
  332. {
  333. $this->totalPrice = floatval($totalPrice);
  334. return $this;
  335. }
  336. /**
  337. * Get totalPrice
  338. *
  339. * @return float
  340. */
  341. public function getTotalPrice()
  342. {
  343. return $this->totalPrice;
  344. }
  345. /**
  346. * Set reductions
  347. *
  348. * @param array $reductions
  349. *
  350. * @return BillLine
  351. */
  352. public function setReductions($reductions)
  353. {
  354. $this->reductions = $reductions;
  355. return $this;
  356. }
  357. /**
  358. * Get reductions
  359. *
  360. * @return array
  361. */
  362. public function getReductions()
  363. {
  364. return $this->reductions;
  365. }
  366. /**
  367. * Set accountingCode
  368. *
  369. * @param integer $accountingCode
  370. *
  371. * @return BillLine
  372. */
  373. public function setAccountingCode($accountingCode)
  374. {
  375. $this->accountingCode = $accountingCode;
  376. return $this;
  377. }
  378. /**
  379. * Get accountingCode
  380. *
  381. * @return integer
  382. */
  383. public function getAccountingCode()
  384. {
  385. return $this->accountingCode;
  386. }
  387. /**
  388. * Set nature
  389. *
  390. * @param integer $nature
  391. *
  392. * @return BillLine
  393. */
  394. public function setNature($nature)
  395. {
  396. $this->nature = $nature;
  397. return $this;
  398. }
  399. /**
  400. * Get nature
  401. *
  402. * @return integer
  403. */
  404. public function getNature()
  405. {
  406. return $this->nature;
  407. }
  408. /**
  409. * Set educationalProject
  410. *
  411. * @param \AppBundle\Entity\Booking\EducationalProject $educationalProject
  412. *
  413. * @return BillLine
  414. */
  415. public function setEducationalProject(\AppBundle\Entity\Booking\EducationalProject $educationalProject = null)
  416. {
  417. $this->educationalProject = $educationalProject;
  418. return $this;
  419. }
  420. /**
  421. * Get educationalProject
  422. *
  423. * @return \AppBundle\Entity\Booking\EducationalProject
  424. */
  425. public function getEducationalProject()
  426. {
  427. return $this->educationalProject;
  428. }
  429. /**
  430. * Set equipmentLoan
  431. *
  432. * @param \AppBundle\Entity\Product\EquipmentLoan $equipmentLoan
  433. *
  434. * @return BillLine
  435. */
  436. public function setEquipmentLoan(\AppBundle\Entity\Product\EquipmentLoan $equipmentLoan = null)
  437. {
  438. $this->equipmentLoan = $equipmentLoan;
  439. return $this;
  440. }
  441. /**
  442. * Get equipmentLoan
  443. *
  444. * @return \AppBundle\Entity\Product\EquipmentLoan
  445. */
  446. public function getEquipmentLoan()
  447. {
  448. return $this->equipmentLoan;
  449. }
  450. /**
  451. * Set educations
  452. *
  453. * @param array $educations
  454. *
  455. * @return BillLine
  456. */
  457. public function setEducations($educations)
  458. {
  459. $this->educations = $educations;
  460. return $this;
  461. }
  462. /**
  463. * Get educations
  464. *
  465. * @return array
  466. */
  467. public function getEducations()
  468. {
  469. return $this->educations;
  470. }
  471. /**
  472. * Set accountingCodelabel
  473. *
  474. * @param string $accountingCodelabel
  475. *
  476. * @return BillLine
  477. */
  478. public function setAccountingCodelabel($accountingCodelabel)
  479. {
  480. $this->accountingCodelabel = $accountingCodelabel;
  481. return $this;
  482. }
  483. /**
  484. * Get accountingCodelabel
  485. *
  486. * @return string
  487. */
  488. public function getAccountingCodelabel()
  489. {
  490. return $this->accountingCodelabel;
  491. }
  492. /**
  493. * Set intangibleDomain
  494. *
  495. * @param string $intangibleDomain
  496. *
  497. * @return BillLine
  498. */
  499. public function setIntangibleDomain($intangibleDomain)
  500. {
  501. $this->intangibleDomain = $intangibleDomain;
  502. return $this;
  503. }
  504. /**
  505. * Get intangibleDomain
  506. *
  507. * @return string
  508. */
  509. public function getIntangibleDomain()
  510. {
  511. return $this->intangibleDomain;
  512. }
  513. /**
  514. * Set showInBill
  515. *
  516. * @param boolean $showInBill
  517. *
  518. * @return BillLine
  519. */
  520. public function setShowInBill($showInBill)
  521. {
  522. $this->showInBill = $showInBill;
  523. return $this;
  524. }
  525. /**
  526. * Get showInBill
  527. *
  528. * @return boolean
  529. */
  530. public function getShowInBill()
  531. {
  532. return $this->showInBill;
  533. }
  534. }