| | |
| | | use Umulmrum\Holiday\Model\HolidayList; |
| | | |
| | | class HolidaySkipper { |
| | | protected $helper; |
| | | protected $skipDays = null; |
| | | protected $holidays = null; |
| | | protected UcrmHelper $helper; |
| | | protected ?array $skipDays = null; |
| | | protected ?HolidayList $holidays = null; |
| | | |
| | | function __construct(UcrmHelper $ucrmHelper) { |
| | | $this->helper = $ucrmHelper; |
| | | } |
| | | |
| | | protected function configure(array $years) { |
| | | protected function configure(array $years): void { |
| | | $config = $this->helper->getConfig(); |
| | | |
| | | if ($this->skipDays === NULL) { |
| | |
| | | } |
| | | } |
| | | |
| | | function processInvoice(string $invoiceId) { |
| | | function processInvoice(string $invoiceId): bool { |
| | | $crm = $this->helper->getApi(); |
| | | $invoiceData = $crm->get('/invoices/' . $invoiceId); |
| | | if ($invoiceData['status'] != 0) { |
| | |
| | | } else { |
| | | echo 'Invoice ' . $invoiceId . ': nothing to do' . "\n"; |
| | | } |
| | | |
| | | return $changed > 0; |
| | | } |
| | | } |