| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function handle() |
||
| 42 | { |
||
| 43 | $expenseAlerts = Expense::where('due_date','=',Carbon::today()->addDays(1))->where('paid','=',0)->get(); |
||
| 44 | $contact = \Utilities::getSetting('primary_contact'); |
||
| 45 | $sender_id = \Utilities::getSetting('sms_sender_id'); |
||
| 46 | |||
| 47 | $sms_trigger = Sms_trigger::where('alias','=','expense_alert')->first(); |
||
| 48 | $message = $sms_trigger->message; |
||
| 49 | $sms_status = $sms_trigger->status; |
||
| 50 | |||
| 51 | foreach ($expenseAlerts as $expenseAlert) |
||
| 52 | { |
||
| 53 | $sms_text = sprintf($message,$expenseAlert->name,$expenseAlert->amount,$expenseAlert->due_date); |
||
| 54 | \Utilities::Sms($sender_id,$contact,$sms_text,$sms_status); |
||
| 55 | } |
||
| 58 |