| Conditions | 3 |
| Paths | 7 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | public function run() |
||
| 51 | { |
||
| 52 | dol_syslog('Monthly bill generation : Start'); |
||
| 53 | |||
| 54 | try { |
||
| 55 | |||
| 56 | if(date('d')>=15){ |
||
| 57 | dol_syslog('Monthly bill generation : date over'); |
||
| 58 | return -2; |
||
| 59 | } |
||
| 60 | |||
| 61 | $command = new CreateMonthBillCommand(0, '', '', date('Y'), (date('m') - 1)); |
||
| 62 | $this->handler->handle($command); |
||
| 63 | |||
| 64 | dol_syslog('Monthly bill generation : OK'); |
||
| 65 | return 0; |
||
| 66 | |||
| 67 | } catch (Exception $e) { |
||
| 68 | dol_syslog($e->getMessage(), LOG_ERR); |
||
| 69 | dol_syslog('Monthly bill generation : NOK'); |
||
| 70 | return -1; |
||
| 71 | } |
||
| 72 | } |
||
| 73 | |||
| 74 | } |