src/Entity/CashJournalEntry.php line 11

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass'App\Repository\CashJournalEntryRepository')]
  6. #[ORM\Table(name'cash_journal_entries')]
  7. class CashJournalEntry
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column(type'integer')]
  12.     private $id;
  13.     #[ORM\Column(type'decimal'precision13scale2nullabletrue)]
  14.     private $incomes;
  15.     #[ORM\Column(type'decimal'precision13scale2nullabletrue)]
  16.     private $expenses;
  17.     #[ORM\Column(type'decimal'precision13scale2nullabletrue)]
  18.     private $inventory;
  19.     #[ORM\Column(type'string'length50nullabletrue)]
  20.     private $counterAccount;
  21.     #[ORM\Column(type'string'length50nullabletrue)]
  22.     private $invoiceNumber;
  23.     #[ORM\Column(type'integer')]
  24.     private $documentNumber;
  25.     #[ORM\Column(type'date')]
  26.     private $date;
  27.     #[ORM\Column(type'text'length255nullabletrue)]
  28.     private $remark;
  29.     #[ORM\ManyToOne(targetEntity'CashJournal'inversedBy'cashJournalEntries')]
  30.     private $cashJournal;
  31.     #[ORM\ManyToOne(inversedBy'cashJournalEntries')]
  32.     private ?Entreprise $marchand null;
  33.     /**
  34.      * Get id.
  35.      *
  36.      * @return int
  37.      */
  38.     public function getId()
  39.     {
  40.         return $this->id;
  41.     }
  42.     /**
  43.      * Set incomes.
  44.      *
  45.      * @param string $incomes
  46.      *
  47.      * @return CashJournalEntry
  48.      */
  49.     public function setIncomes($incomes): static
  50.     {
  51.         $this->incomes $incomes;
  52.         return $this;
  53.     }
  54.     /**
  55.      * Get incomes.
  56.      *
  57.      * @return string
  58.      */
  59.     public function getIncomes()
  60.     {
  61.         return $this->incomes;
  62.     }
  63.     /**
  64.      * Set expenses.
  65.      *
  66.      * @param string $expenses
  67.      *
  68.      * @return CashJournalEntry
  69.      */
  70.     public function setExpenses($expenses): static
  71.     {
  72.         $this->expenses $expenses;
  73.         return $this;
  74.     }
  75.     /**
  76.      * Get expenses.
  77.      *
  78.      * @return string
  79.      */
  80.     public function getExpenses()
  81.     {
  82.         return $this->expenses;
  83.     }
  84.     /**
  85.      * Set counterAccount.
  86.      *
  87.      * @return CashJournalEntry
  88.      */
  89.     public function setCounterAccount(string $counterAccount): static
  90.     {
  91.         $this->counterAccount $counterAccount;
  92.         return $this;
  93.     }
  94.     /**
  95.      * Get counterAccount.
  96.      */
  97.     public function getCounterAccount(): ?string
  98.     {
  99.         return $this->counterAccount;
  100.     }
  101.     /**
  102.      * Set invoiceNumber.
  103.      *
  104.      * @return CashJournalEntry
  105.      */
  106.     public function setInvoiceNumber(string $invoiceNumber): static
  107.     {
  108.         $this->invoiceNumber $invoiceNumber;
  109.         return $this;
  110.     }
  111.     /**
  112.      * Get invoiceNumber.
  113.      */
  114.     public function getInvoiceNumber(): ?string
  115.     {
  116.         return $this->invoiceNumber;
  117.     }
  118.     /**
  119.      * Set documentNumber.
  120.      *
  121.      * @return CashJournalEntry
  122.      */
  123.     public function setDocumentNumber(int $documentNumber): static
  124.     {
  125.         $this->documentNumber $documentNumber;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Get documentNumber.
  130.      */
  131.     public function getDocumentNumber(): int
  132.     {
  133.         return $this->documentNumber;
  134.     }
  135.     /**
  136.      * Set date.
  137.      *
  138.      * @return CashJournalEntry
  139.      */
  140.     public function setDate(\DateTime $date): static
  141.     {
  142.         $this->date $date;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Get date.
  147.      */
  148.     public function getDate(): \DateTime
  149.     {
  150.         return $this->date;
  151.     }
  152.     /**
  153.      * Set remark.
  154.      *
  155.      * @return CashJournalEntry
  156.      */
  157.     public function setRemark(string $remark): static
  158.     {
  159.         $this->remark $remark;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get remark.
  164.      */
  165.     public function getRemark(): ?string
  166.     {
  167.         return $this->remark;
  168.     }
  169.     /**
  170.      * Set cashJournal.
  171.      *
  172.      * @return CashJournalEntry
  173.      */
  174.     public function setCashJournal(CashJournal $cashJournal null): static
  175.     {
  176.         $this->cashJournal $cashJournal;
  177.         return $this;
  178.     }
  179.     /**
  180.      * Get cashJournal.
  181.      */
  182.     public function getCashJournal(): CashJournal
  183.     {
  184.         return $this->cashJournal;
  185.     }
  186.     /**
  187.      * Set inventory.
  188.      *
  189.      * @param string $inventory
  190.      *
  191.      * @return CashJournalEntry
  192.      */
  193.     public function setInventory($inventory): static
  194.     {
  195.         $this->inventory $inventory;
  196.         return $this;
  197.     }
  198.     /**
  199.      * Get incomes formatted.
  200.      */
  201.     public function getIncomesF(): string
  202.     {
  203.         return number_format((float) $this->incomes2',''.');
  204.     }
  205.     /**
  206.      * Get expenses formatted.
  207.      */
  208.     public function getExpensesF(): string
  209.     {
  210.         return number_format((float) $this->expenses2',''.');
  211.     }
  212.     /**
  213.      * Get inventory formatted.
  214.      *
  215.      * @return string
  216.      */
  217.     public function getInventory()
  218.     {
  219.         return $this->inventory;
  220.     }
  221.     public function getInventoryF(): string
  222.     {
  223.         return number_format((float) $this->inventory2',''.');
  224.     }
  225.     /**
  226.      * Get documentNumber formatted.
  227.      */
  228.     public function getDocumentNumberF(): string
  229.     {
  230.         return sprintf('%04d'$this->documentNumber);
  231.     }
  232.     public function getMarchand(): ?Entreprise
  233.     {
  234.         return $this->marchand;
  235.     }
  236.     public function setMarchand(?Entreprise $marchand): static
  237.     {
  238.         $this->marchand $marchand;
  239.         return $this;
  240.     }
  241. }