@php $profile = 'Home'; $start_date = date('Y-m-1'); $year_start_date = date('Y-01-1',strtotime("-1 year")); $end_date = date('Y-m-t'); // dd(App\Models\User::where('IsActive',1)->whereNotIn('RoleID',[16,17])->pluck('UserID','fullname')); $petty_cash_amounts = App\Models\PettyCashAmount::OrderBy('Sno', 'desc') ->whereYear('Month', date('Y')) ->get(); $this_month_petty_cash_amount = App\Models\PettyCashAmount::whereDate('Month', '>=', $start_date) ->whereDate('Month', '<=', $end_date) ->sum('Amount'); $petty_cash_expenses_count = App\Models\PettyCashExpense::whereDate('Date', '>=', $start_date) ->whereDate('Date', '<=', $end_date) ->count(); // dd( $petty_cash_expenses_count); $petty_cash_expenses = App\Models\PettyCashExpense::whereDate('Date', '>=', $start_date) ->whereDate('Date', '<=', $end_date) ->orderBy('Date', 'desc') ->get(); $attendances = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', '>=', $start_date) ->whereDate('AttendanceDate', '<=', $end_date) ->get(); $monday = date('Y-m-d', strtotime('monday this week')); $currentDate = date('Y-m-d'); $attendace_datas = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->where('AttendanceDate', '>=', $monday) ->where('AttendanceDate', '<=', $currentDate) ->orderBy('AttendanceDate') ->get(); $today_attendance_count = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d')) ->count(); $today_attendance_check = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d')) ->first(); $yesterday_attendance_check = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d', strtotime('-1 day'))) ->first(); $yesterday_attendance_count = App\Models\Attendance::where('UserID', Auth::user()->UserID) ->whereDate('AttendanceDate', date('Y-m-d', strtotime('-1 day'))) ->count(); $leaves = App\Models\LeaveRequest::where('Date', '>=', $start_date) ->where('Date', '<=', $currentDate) ->where('UserID', Auth::user()->UserID) ->orderBy('id', 'desc') ->take(10) ->get(); @endphp
Sales Report
@php $sources= App\Models\ProjectSource::where('IsActive',1)->get(); @endphp {{-- --}}
@php $report_start= date('Y-m-1',strtotime($month)); $report_end= date('Y-m-t',strtotime($month)); $agency_gw_report_count=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',2)->where('account',1)->count(); $agency_gw_reports=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',2)->where('account',1)->latest()->get(); @endphp @if($agency_gw_report_count>0) @foreach ($agency_gw_reports as $report)
@php $path= get_path().'SalesReportData\\'.date('Y-m-d',strtotime($report->Date)).'-GW\\Agency\\'.$report->image; $image=''; if (file_exists($path)) { $image = file_get_contents($path); $image = base64_encode($image); } @endphp
Work in progress ${{$report->wip}}
In review (work completed and invoice submitted) ${{$report->inReview}}
Pending (payment cleared but in pending review) ${{$report->pending}}
Cleared (cash account) ${{$report->cleared}}
Withdrawn (from cash account) ${{$report->withdrawn}}
@endforeach @endif
@php $freelance_gw_report_count=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',1)->where('account',1)->count(); $freelance_gw_report=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',1)->where('account',1)->latest()->get(); @endphp @if($freelance_gw_report_count>0) @foreach ($freelance_gw_report as $report)
@php $path= get_path().'SalesReportData\\'.date('Y-m-d',strtotime($report->Date)).'-GW\\Freelancer\\'.$report->image; $image=''; if (file_exists($path)) { $image = file_get_contents($path); $image = base64_encode($image); } @endphp
Work in progress ${{$report->wip}}
In review (work completed and invoice submitted) ${{$report->inReview}}
Pending (payment cleared but in pending review) ${{$report->pending}}
Cleared (cash account) ${{$report->cleared}}
Withdrawn (from cash account) ${{$report->withdrawn}}
@endforeach @endif
@php $agency_tsw_report_count=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',2)->where('account',2)->count(); $agency_tsw_report=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',2)->where('account',2)->latest()->get(); @endphp @if($agency_tsw_report_count>0) @foreach ($agency_tsw_report as $report)
@php $account_type=$report->account==1?'-GW':'-TSW'; $path= get_path().'SalesReportData\\'.date('Y-m-d',strtotime($report->Date)).'-TSW\\Agency\\'.$report->image; $image=''; if (file_exists($path)) { echo "pass"; $image = file_get_contents($path); $image = base64_encode($image); } dd('reasd'); @endphp
Work in progress ${{$report->wip}}
In review (work completed and invoice submitted) ${{$report->inReview}}
Pending (payment cleared but in pending review) ${{$report->pending}}
Cleared (cash account) ${{$report->cleared}}
Withdrawn (from cash account) ${{$report->withdrawn}}
@endforeach @endif
@php $freelance_tsw_report_count=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',1)->where('account',2)->count(); $freelance_tsw_report=App\Models\SalesReport::whereDate('created_at','>=',$report_start)->whereDate('created_at','<=',$report_end)->where('type',1)->where('account',2)->latest()->get(); @endphp @if($freelance_tsw_report_count>0) @foreach ($freelance_tsw_report as $report)
@php $account_type=$report->account==1?'-GW':'-TSW'; $path= get_path().'SalesReportData\\'.date('Y-m-d',strtotime($report->Date)).'-TSW\\Freelancer\\'.$report->image; $image=''; if (file_exists($path)) { $image = file_get_contents($path); $image = base64_encode($image); } @endphp
Work in progress ${{$report->wip}}
In review (work completed and invoice submitted) ${{$report->inReview}}
Pending (payment cleared but in pending review) ${{$report->pending}}
Cleared (cash account) ${{$report->cleared}}
Withdrawn (from cash account) ${{$report->withdrawn}}
@endforeach @endif