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()
2828 })->with (['service.client ' ])->get ();
2929
3030 if ($ currentMonth + 1 <= 12 ){
31+ $ upcomingMonth = ++$ currentMonth ;
32+ if ($ upcomingMonth < 10 ) {
33+ $ upcomingMonth = '0 ' . $ upcomingMonth ;
34+ }
3135 $ 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 . '-% ' );
3539 })
3640 // Return only occurrences that belong to services that are active
3741 ->whereHas ('service ' , function ($ query ) {
Original file line number Diff line number Diff line change 103103 <td >{{ $occurrence -> service -> title } } </td >
104104 <td >{{ $occurrence -> service -> client -> name } } </td >
105105 <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 >
109121 </tr >
110122 @endforeach
111123 </table >
You can’t perform that action at this time.
0 commit comments