src/Entity/Commission.php line 18

  1. <?php
  2. namespace App\Entity;
  3. use App\Enum\GroupName;
  4. use App\Enum\RuleRateType;
  5. use App\Enum\RuleMultiplier;
  6. use App\Enum\CommissionResultRateType;
  7. use App\Repository\CommissionRepository;
  8. use Doctrine\DBAL\Types\Types;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Gedmo\Timestampable\Traits\TimestampableEntity;
  11. #[ORM\Entity(repositoryClassCommissionRepository::class)]
  12. #[ORM\Index(columns: ['incentive_date'], name'com_incentive_date')]
  13. #[ORM\Index(columns: ['user_id'], name'com_user_id')]
  14. class Commission
  15. {
  16.     use TimestampableEntity;
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     #[ORM\ManyToOne(fetch'EAGER'inversedBy'commissions')]
  22.     private ?User $user null;
  23.     #[ORM\ManyToOne(inversedBy'commissions')]
  24.     private ?Position $position null;
  25.     #[ORM\Column]
  26.     private ?float $amount 0;
  27.     #[ORM\ManyToOne(inversedBy'commissions'fetch'EAGER')]
  28.     private ?Order $orderItem null;
  29.     #[ORM\Column]
  30.     private ?float $creditAmount 0;
  31.     #[ORM\Column]
  32.     private ?float $appliedCredit 0;
  33.     #[ORM\ManyToOne(inversedBy'commissions')]
  34.     private ?Period $period null;
  35.     #[ORM\ManyToOne(inversedBy'commissions')]
  36.     private ?Quota $quota null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?RuleRateType $rateType null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?RuleMultiplier $multiplier null;
  41.     #[ORM\Column]
  42.     private ?float $multiplierValue 0;
  43.     #[ORM\ManyToOne(inversedBy'commissions'fetch'EAGER')]
  44.     private ?RateTable $rateTable null;
  45.     #[ORM\ManyToOne(inversedBy'commissions'fetch'EAGER')]
  46.     private ?RuleResult $ruleResult null;
  47.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  48.     private ?\DateTimeInterface $incentiveDate null;
  49.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  50.     private ?\DateTimeInterface $estReleaseDate null;
  51.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  52.     private ?\DateTimeInterface $actualReleaseDate null;
  53.     #[ORM\Column(nullabletrue)]
  54.     private ?float $measureValue null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     private ?string $rollingMeasureValue null;
  57.     #[ORM\Column(length255nullabletrue)]
  58.     private ?string $attainmentValue null;
  59.     #[ORM\Column(length255nullabletrue)]
  60.     private ?string $rollingAttainmentValue null;
  61.     #[ORM\ManyToOne(inversedBy'commissions')]
  62.     private ?EarningGroup $earningGroup null;
  63.     #[ORM\Column(length255nullabletrue)]
  64.     private ?GroupName $businessGroup GroupName::UNITED_STATES;
  65.     #[ORM\Column(length255nullabletrue)]
  66.     private ?string $paymentFX null;
  67.     #[ORM\ManyToOne(inversedBy'commissions'fetch'EAGER')]
  68.     private ?RateTableTier $rateTableTier null;
  69.     #[ORM\Column]
  70.     private ?bool $held false;
  71.     #[ORM\Column]
  72.     private ?bool $everImplied false;
  73.     #[ORM\Column]
  74.     private ?bool $isImplied false;
  75.     #[ORM\Column(nullabletrue)]
  76.     private ?float $rate null;
  77.     #[ORM\Column]
  78.     private ?bool $l6 false;
  79.     #[ORM\ManyToOne(inversedBy'commissions')]
  80.     private ?Credit $credit null;
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getUser(): ?User
  86.     {
  87.         return $this->user;
  88.     }
  89.     public function setUser(?User $user): static
  90.     {
  91.         $this->user $user;
  92.         return $this;
  93.     }
  94.     public function getPosition(): ?Position
  95.     {
  96.         return $this->position;
  97.     }
  98.     public function setPosition(?Position $position): static
  99.     {
  100.         $this->position $position;
  101.         return $this;
  102.     }
  103.     public function getAmount(): ?float
  104.     {
  105.         return $this->amount;
  106.     }
  107.     public function setAmount(float $amount): static
  108.     {
  109.         $this->amount $amount;
  110.         return $this;
  111.     }
  112.     public function getOrderItem(): ?Order
  113.     {
  114.         return $this->orderItem;
  115.     }
  116.     public function setOrderItem(?Order $orderItem): static
  117.     {
  118.         $this->orderItem $orderItem;
  119.         return $this;
  120.     }
  121.     public function getCreditAmount(): ?float
  122.     {
  123.         return $this->creditAmount;
  124.     }
  125.     public function setCreditAmount(float $creditAmount): static
  126.     {
  127.         $this->creditAmount $creditAmount;
  128.         return $this;
  129.     }
  130.     public function getAppliedCredit(): ?float
  131.     {
  132.         return $this->appliedCredit;
  133.     }
  134.     public function setAppliedCredit(float $appliedCredit): static
  135.     {
  136.         $this->appliedCredit $appliedCredit;
  137.         return $this;
  138.     }
  139.     public function getPeriod(): ?Period
  140.     {
  141.         return $this->period;
  142.     }
  143.     public function setPeriod(?Period $period): static
  144.     {
  145.         $this->period $period;
  146.         return $this;
  147.     }
  148.     public function getQuota(): ?Quota
  149.     {
  150.         return $this->quota;
  151.     }
  152.     public function setQuota(?Quota $quota): static
  153.     {
  154.         $this->quota $quota;
  155.         return $this;
  156.     }
  157.     public function getRateType(): ?RuleRateType
  158.     {
  159.         return $this->rateType;
  160.     }
  161.     public function setRateType(?RuleRateType $rateType): static
  162.     {
  163.         $this->rateType $rateType;
  164.         return $this;
  165.     }
  166.     public function getMultiplier(): ?RuleMultiplier
  167.     {
  168.         return $this->multiplier;
  169.     }
  170.     public function setMultiplier(?RuleMultiplier $multiplier): static
  171.     {
  172.         $this->multiplier $multiplier;
  173.         return $this;
  174.     }
  175.     public function getMultiplierValue(): ?float
  176.     {
  177.         return $this->multiplierValue;
  178.     }
  179.     public function setMultiplierValue(float $multiplierValue): static
  180.     {
  181.         $this->multiplierValue $multiplierValue;
  182.         return $this;
  183.     }
  184.     public function getRateTable(): ?RateTable
  185.     {
  186.         return $this->rateTable;
  187.     }
  188.     public function setRateTable(?RateTable $rateTable): static
  189.     {
  190.         $this->rateTable $rateTable;
  191.         return $this;
  192.     }
  193.     public function getRuleResult(): ?RuleResult
  194.     {
  195.         return $this->ruleResult;
  196.     }
  197.     public function setRuleResult(?RuleResult $ruleResult): static
  198.     {
  199.         $this->ruleResult $ruleResult;
  200.         return $this;
  201.     }
  202.     public function getIncentiveDate(): ?\DateTimeInterface
  203.     {
  204.         return $this->incentiveDate;
  205.     }
  206.     public function setIncentiveDate(?\DateTimeInterface $incentiveDate): static
  207.     {
  208.         $this->incentiveDate $incentiveDate;
  209.         return $this;
  210.     }
  211.     public function getEstReleaseDate(): ?\DateTimeInterface
  212.     {
  213.         return $this->estReleaseDate;
  214.     }
  215.     public function setEstReleaseDate(?\DateTimeInterface $estReleaseDate): static
  216.     {
  217.         $this->estReleaseDate $estReleaseDate;
  218.         return $this;
  219.     }
  220.     public function getActualReleaseDate(): ?\DateTimeInterface
  221.     {
  222.         return $this->actualReleaseDate;
  223.     }
  224.     public function setActualReleaseDate(?\DateTimeInterface $actualReleaseDate): static
  225.     {
  226.         $this->actualReleaseDate $actualReleaseDate;
  227.         return $this;
  228.     }
  229.     public function getMeasureValue(): ?float
  230.     {
  231.         return $this->measureValue;
  232.     }
  233.     public function setMeasureValue(?float $measureValue): static
  234.     {
  235.         $this->measureValue $measureValue;
  236.         return $this;
  237.     }
  238.     public function getRollingMeasureValue(): ?string
  239.     {
  240.         return $this->rollingMeasureValue;
  241.     }
  242.     public function setRollingMeasureValue(?string $rollingMeasureValue): static
  243.     {
  244.         $this->rollingMeasureValue $rollingMeasureValue;
  245.         return $this;
  246.     }
  247.     public function getAttainmentValue(): ?string
  248.     {
  249.         return $this->attainmentValue;
  250.     }
  251.     public function setAttainmentValue(?string $attainmentValue): static
  252.     {
  253.         $this->attainmentValue $attainmentValue;
  254.         return $this;
  255.     }
  256.     public function getRollingAttainmentValue(): ?string
  257.     {
  258.         return $this->rollingAttainmentValue;
  259.     }
  260.     public function setRollingAttainmentValue(?string $rollingAttainmentValue): static
  261.     {
  262.         $this->rollingAttainmentValue $rollingAttainmentValue;
  263.         return $this;
  264.     }
  265.     public function getEarningGroup(): ?EarningGroup
  266.     {
  267.         return $this->earningGroup;
  268.     }
  269.     public function setEarningGroup(?EarningGroup $earningGroup): static
  270.     {
  271.         $this->earningGroup $earningGroup;
  272.         return $this;
  273.     }
  274.     public function getBusinessGroup(): ?GroupName
  275.     {
  276.         return $this->businessGroup;
  277.     }
  278.     public function setBusinessGroup(?GroupName $businessGroup): static
  279.     {
  280.         $this->businessGroup $businessGroup;
  281.         return $this;
  282.     }
  283.     public function getPaymentFX(): ?string
  284.     {
  285.         return $this->paymentFX;
  286.     }
  287.     public function setPaymentFX(?string $paymentFX): static
  288.     {
  289.         $this->paymentFX $paymentFX;
  290.         return $this;
  291.     }
  292.     public function getRateTableTier(): ?RateTableTier
  293.     {
  294.         return $this->rateTableTier;
  295.     }
  296.     public function setRateTableTier(?RateTableTier $rateTableTier): static
  297.     {
  298.         $this->rateTableTier $rateTableTier;
  299.         return $this;
  300.     }
  301.     public function isHeld(): ?bool
  302.     {
  303.         return $this->held;
  304.     }
  305.     public function setHeld(bool $held): static
  306.     {
  307.         $this->held $held;
  308.         return $this;
  309.     }
  310.     public function isEverImplied(): ?bool
  311.     {
  312.         return $this->everImplied;
  313.     }
  314.     public function setEverImplied(bool $everImplied): static
  315.     {
  316.         $this->everImplied $everImplied;
  317.         return $this;
  318.     }
  319.     public function isIsImplied(): ?bool
  320.     {
  321.         return $this->isImplied;
  322.     }
  323.     public function setIsImplied(bool $isImplied): static
  324.     {
  325.         $this->isImplied $isImplied;
  326.         return $this;
  327.     }
  328.     public function getRate(): ?float
  329.     {
  330.         return $this->rate;
  331.     }
  332.     public function setRate(?float $rate): static
  333.     {
  334.         $this->rate $rate;
  335.         return $this;
  336.     }
  337.     public function isL6(): ?bool
  338.     {
  339.         return $this->l6;
  340.     }
  341.     public function setL6(bool $l6): static
  342.     {
  343.         $this->l6 $l6;
  344.         return $this;
  345.     }
  346.     public function getCredit(): ?Credit
  347.     {
  348.         return $this->credit;
  349.     }
  350.     public function setCredit(?Credit $credit): static
  351.     {
  352.         $this->credit $credit;
  353.         return $this;
  354.     }
  355.     public function __toString()
  356.     {
  357.         return sprintf('%s - $%s'$this->getUser(), $this->getAmount());
  358.     }
  359. }