Exemplo n.º 1
0
 /**
  * @return array
  */
 public function getTasks()
 {
     $tasks = [];
     $taxDeclarationPeriod = new Period(new \DateTime('1.01.' . $this->criteria->getYear()), (new \DateTime('1.01.' . $this->criteria->getYear()))->add(new \DateInterval(sprintf('P%d%s', $this->during, $this->type))));
     if ($this->criteria->getPeriod()->isCrossWithPeriod($taxDeclarationPeriod)) {
         $tasks[] = $this->generator->generate($this->criteria->getYear(), $taxDeclarationPeriod);
     }
     return $tasks;
 }
Exemplo n.º 2
0
 /**
  * @return array
  */
 public function getTasks()
 {
     $tasks = [];
     $interval = new \DateInterval('P1M');
     $range = new \DatePeriod($this->criteria->getPeriod()->getFrom(), $interval, $this->criteria->getPeriod()->getTo());
     foreach ($range as $date) {
         $period = new Period($date, (new \DateTime($date->format('d.m.Y')))->add(new \DateInterval(sprintf('P%d%s', $this->during, $this->type))));
         $tasks[] = $this->generator->generate($this->criteria->getYear(), $period);
     }
     return $tasks;
 }
Exemplo n.º 3
0
 /**
  * @return array
  */
 public function checkTasks()
 {
     $tasks = [];
     switch ($this->criteria->getGroup()) {
         case Group::FIRST_GROUP:
         case Group::SECOND_GROUP:
             $tasks = (new MonthlyStrategy($this->criteria, new MonthlyTaskGenerator(new TaskFactory()), 19))->getTasks();
             break;
         case Group::THIRD_GROUP:
         case Group::FOURTH_GROUP:
         case Group::FIFTH_GROUP:
         case Group::SIXTH_GROUP:
             $tasks = (new QuarterlyStrategy($this->criteria, new QuarterlyTaskGenerator(new TaskFactory()), 49))->getTasks();
             break;
     }
     return $tasks;
 }
Exemplo n.º 4
0
 /**
  * @return array
  */
 public function checkTasks()
 {
     $tasks = [];
     switch ($this->criteria->getGroup()) {
         case Group::FIRST_GROUP:
         case Group::SECOND_GROUP:
         case Group::THIRD_GROUP:
         case Group::FIFTH_GROUP:
             if ($this->criteria->getType() === TypeStrategy::MONTHLY) {
                 $tasks = (new MonthlyStrategy($this->criteria, new MonthlyTaskGenerator(new TaskFactory()), 19))->getTasks();
             }
             if ($this->criteria->getType() === TypeStrategy::QUARTERLY) {
                 $tasks = (new QuarterlyStrategy($this->criteria, new QuarterlyTaskGenerator(new TaskFactory()), 40))->getTasks();
             }
             break;
     }
     return $tasks;
 }
Exemplo n.º 5
0
 /**
  * @return array
  */
 public function getTasks()
 {
     $tasks = [];
     if ($this->criteria->getPeriod()->isCrossWithPeriod($this->getFirstQuarterPaymentPeriod())) {
         $tasks[] = $this->generator->generate(1, $this->criteria->getYear(), $this->getFirstQuarterPaymentPeriod());
     }
     if ($this->criteria->getPeriod()->isCrossWithPeriod($this->getSecondQuarterPaymentPeriod())) {
         $tasks[] = $this->generator->generate(2, $this->criteria->getYear(), $this->getSecondQuarterPaymentPeriod());
     }
     if ($this->criteria->getPeriod()->isCrossWithPeriod($this->getThirdQuarterPaymentPeriod())) {
         $tasks[] = $this->generator->generate(3, $this->criteria->getYear(), $this->getThirdQuarterPaymentPeriod());
     }
     if ($this->criteria->getPeriod()->isCrossWithPeriod($this->getFourthQuarterPaymentPeriod())) {
         $tasks[] = $this->generator->generate(4, $this->criteria->getYear(), $this->getFourthQuarterPaymentPeriod());
     }
     return $tasks;
 }