This repository was archived by the owner on Jan 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,14 @@ public function index()
28
28
})->with (['service.client ' ])->get ();
29
29
30
30
if ($ currentMonth + 1 <= 12 ){
31
+ $ upcomingMonth = ++$ currentMonth ;
32
+ if ($ upcomingMonth < 10 ) {
33
+ $ upcomingMonth = '0 ' . $ upcomingMonth ;
34
+ }
31
35
$ upcomingOccurrences = Occurrence::orderBy ('occurs_at ' )
32
- // Where occurs_at month and year is the same as current month and year
33
- ->where (function ($ query ) use ($ currentMonth , $ currentYear ) {
34
- $ query ->where ('occurs_at ' , 'like ' , $ currentYear . '- ' . ++ $ currentMonth . '-% ' );
36
+ // Where occurs_at month and year is the same as upcoming month and current year
37
+ ->where (function ($ query ) use ($ upcomingMonth , $ currentYear ) {
38
+ $ query ->where ('occurs_at ' , 'like ' , $ currentYear . '- ' . $ upcomingMonth . '-% ' );
35
39
})
36
40
// Return only occurrences that belong to services that are active
37
41
->whereHas ('service ' , function ($ query ) {
Original file line number Diff line number Diff line change 103
103
<td >{{ $occurrence -> service -> title } } </td >
104
104
<td >{{ $occurrence -> service -> client -> name } } </td >
105
105
<td >{{ $occurrence -> service -> formatted_cost } } </td >
106
- <td >{{ $occurrence -> offer_sent } } </td >
107
- <td >{{ $occurrence -> payment_received } } </td >
108
- <td >{{ $occurrence -> receipt_sent } } </td >
106
+ <td class =" kyle-change-boolean"
107
+ data-url =" /api/v1/occurrences/{{ $occurrence -> id } } /offer"
108
+ data-state =" {{ $occurrence -> getFutureOfferState () } }" >
109
+ {{ $occurrence -> offer_sent } }
110
+ </td >
111
+ <td class =" kyle-change-boolean"
112
+ data-url =" /api/v1/occurrences/{{ $occurrence -> id } } /payment"
113
+ data-state =" {{ $occurrence -> getFuturePaymentState () } }" >
114
+ {{ $occurrence -> payment_received } }
115
+ </td >
116
+ <td class =" kyle-change-boolean"
117
+ data-url =" /api/v1/occurrences/{{ $occurrence -> id } } /receipt"
118
+ data-state =" {{ $occurrence -> getFutureReceiptState () } }" >
119
+ {{ $occurrence -> receipt_sent } }
120
+ </td >
109
121
</tr >
110
122
@endforeach
111
123
</table >
You can’t perform that action at this time.
0 commit comments