diff --git a/resources/lang/de/report.php b/resources/lang/de/report.php new file mode 100644 index 0000000..89ffaca --- /dev/null +++ b/resources/lang/de/report.php @@ -0,0 +1,29 @@ + 'Report', + 'sales' => 'Earning Report', + 'view_report' => 'View Report', + 'sales_graph' => 'Earning Graph', + 'detail' => 'Report Detail', + 'profit' => 'Profit', + + // Daily + 'daily' => 'Daily Report : :date', + 'today' => 'Today', + 'view_daily' => 'View Daily', + 'view_daily_label' => 'View Daily per', + + // Monthly + 'monthly' => 'Monthly Report :year_month', + 'this_month' => 'This Month', + 'view_monthly' => 'View Monthly', + 'view_monthly_label' => 'View Monthly per', + + // Yearly + 'yearly' => 'Yearly Report :year', + 'this_year' => 'This Year', + 'view_yearly' => 'View Yearly', + 'view_yearly_label' => 'View Report per', +]; diff --git a/resources/lang/de/time.php b/resources/lang/de/time.php index 375ecad..14c811d 100644 --- a/resources/lang/de/time.php +++ b/resources/lang/de/time.php @@ -1,6 +1,9 @@ 'Datum', + 'month' => 'Monat', + 'months' => [ '01' => 'Januar', '02' => 'Februari', diff --git a/resources/lang/en/report.php b/resources/lang/en/report.php new file mode 100644 index 0000000..89ffaca --- /dev/null +++ b/resources/lang/en/report.php @@ -0,0 +1,29 @@ + 'Report', + 'sales' => 'Earning Report', + 'view_report' => 'View Report', + 'sales_graph' => 'Earning Graph', + 'detail' => 'Report Detail', + 'profit' => 'Profit', + + // Daily + 'daily' => 'Daily Report : :date', + 'today' => 'Today', + 'view_daily' => 'View Daily', + 'view_daily_label' => 'View Daily per', + + // Monthly + 'monthly' => 'Monthly Report :year_month', + 'this_month' => 'This Month', + 'view_monthly' => 'View Monthly', + 'view_monthly_label' => 'View Monthly per', + + // Yearly + 'yearly' => 'Yearly Report :year', + 'this_year' => 'This Year', + 'view_yearly' => 'View Yearly', + 'view_yearly_label' => 'View Report per', +]; diff --git a/resources/lang/en/time.php b/resources/lang/en/time.php index 37835d2..b361aab 100644 --- a/resources/lang/en/time.php +++ b/resources/lang/en/time.php @@ -1,6 +1,9 @@ 'Date', + 'month' => 'Month', + 'months' => [ '01' => 'January', '02' => 'Februari', diff --git a/resources/lang/id/report.php b/resources/lang/id/report.php new file mode 100644 index 0000000..9f4bd4d --- /dev/null +++ b/resources/lang/id/report.php @@ -0,0 +1,29 @@ + 'Laporan', + 'sales' => 'Laponan Penjualan', + 'view_report' => 'Lihat Laporan', + 'sales_graph' => 'Grafik Penjualan', + 'detail' => 'Detail Laporan', + 'profit' => 'Profit', + + // Daily + 'daily' => 'Laponan Harian: :date', + 'today' => 'Hari Ini', + 'view_daily' => 'Lihat Harian', + 'view_daily_label' => 'Lihat Harian per', + + // Monthly + 'monthly' => 'Laponan Bulan :year_month', + 'this_month' => 'Bulan Ini', + 'view_monthly' => 'Lihat Bulanan', + 'view_monthly_label' => 'Lihat Bulanan per', + + // Yearly + 'yearly' => 'Laponan Tahun :year', + 'this_year' => 'Tahun Ini', + 'view_yearly' => 'Lihat Tahunan', + 'view_yearly_label' => 'Lihat Tahunan per', +]; diff --git a/resources/lang/id/time.php b/resources/lang/id/time.php index 04ece62..d7f5a53 100644 --- a/resources/lang/id/time.php +++ b/resources/lang/id/time.php @@ -1,6 +1,9 @@ 'Tanggal', + 'month' => 'Bulan', + 'months' => [ '01' => 'Januari', '02' => 'Pebruari', diff --git a/resources/views/reports/payments/daily.blade.php b/resources/views/reports/payments/daily.blade.php index e5a8e2d..13b5619 100755 --- a/resources/views/reports/payments/daily.blade.php +++ b/resources/views/reports/payments/daily.blade.php @@ -1,9 +1,10 @@ @extends('layouts.app') -@section('title', 'Laporan Harian : ' . dateId($date)) +@section('title', __('report.daily', ['date' => dateId($date)])) @section('content') - + +@php $dt = Carbon\Carbon::parse($date); @endphp -{{ Form::open(['method' => 'get','class' => 'form-inline well well-sm']) }} -{{ Form::label('date', 'Laporan Harian per', ['class' => 'control-label']) }} -{{ Form::text('date', $date, ['class' => 'form-control','required','style' => 'width:100px']) }} -{{ Form::submit('Lihat Laporan', ['class' => 'btn btn-info btn-sm']) }} -{{ link_to_route('reports.payments.daily', 'Hari Ini', [], ['class' => 'btn btn-default btn-sm']) }} -{{ link_to_route('reports.payments.monthly', 'Lihat Bulanan', ['month' => monthNumber($dt->month), 'year' => $dt->year], ['class' => 'btn btn-default btn-sm']) }} +{{ Form::open(['method' => 'get', 'class' => 'form-inline well well-sm']) }} +{{ Form::label('date', __('report.view_daily_label'), ['class' => 'control-label']) }} +{{ Form::text('date', $date, ['required', 'class' => 'form-control', 'style' => 'width:100px']) }} +{{ Form::submit(__('report.view_report'), ['class' => 'btn btn-info btn-sm']) }} +{{ link_to_route('reports.payments.daily', __('report.today'), [], ['class' => 'btn btn-default btn-sm']) }} +{{ link_to_route( + 'reports.payments.monthly', + __('report.view_monthly'), + ['month' => monthNumber($dt->month), 'year' => $dt->year], + ['class' => 'btn btn-default btn-sm'] +) }} {{ Form::close() }} - - - - - - - - - - - - - @forelse($payments as $key => $payment) - - - - - - - - - - in_out == 0 ? $total - $payment->amount : $total + $payment->amount;?> - @empty - - @endforelse - - - - - - - - -
{{ trans('app.table_no') }}{{ trans('payment.project') }}{{ trans('app.date') }}{{ trans('payment.amount') }}{{ trans('payment.customer') }}{{ trans('payment.description') }}{{ trans('app.action') }}
{{ 1 + $key }}{{ $payment->project->present()->projectLink() }}{{ $payment->date }}{{ $payment->present()->amount }}{{ $payment->partner->name }}{{ $payment->description }} [{{ $payment->type() }}] - {{ link_to_route('payments.show','Lihat',[$payment->id],['title' => 'Lihat Detail Pembayaran','target' => '_blank','class' => 'btn btn-info btn-xs']) }} -
{{ trans('payment.not_found') }}
Jumlah{{ formatRp($total) }}
+
+ + + + + + + + + + + + + @forelse($payments as $key => $payment) + + + + + + + + + + in_out == 0 ? $total - $payment->amount : $total + $payment->amount;?> + @empty + + @endforelse + + + + + + + + +
{{ __('app.table_no') }}{{ __('payment.project') }}{{ __('app.date') }}{{ __('payment.amount') }}{{ __('payment.customer') }}{{ __('payment.description') }}{{ __('app.action') }}
{{ 1 + $key }}{{ $payment->project->present()->projectLink() }}{{ $payment->date }}{{ $payment->present()->amount }}{{ $payment->partner->name }}{{ $payment->description }} [{{ $payment->type() }}] + {{ link_to_route( + 'payments.show', + __('app.show'), + [$payment], + [ + 'title' => __('app.show_detail_title', ['name' => $payment->number, 'type' => __('payment.payment')]), + 'target' => '_blank', + 'class' => 'btn btn-info btn-xs' + ] + ) }} +
{{ __('payment.not_found') }}
{{ __('app.total') }}{{ formatRp($total) }} 
+
@endsection @section('ext_css') @@ -77,4 +94,4 @@ }); })(); -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/reports/payments/monthly.blade.php b/resources/views/reports/payments/monthly.blade.php index 76d20b6..8c3cf26 100755 --- a/resources/views/reports/payments/monthly.blade.php +++ b/resources/views/reports/payments/monthly.blade.php @@ -1,82 +1,84 @@ @extends('layouts.app') -@section('title', 'Laporan Bulanan : ' . $months[$month] . ' ' . $year) +@section('title', __('report.monthly', ['year_month' => $months[$month].' '.$year])) @section('content') {{ Form::open(['method' => 'get', 'class' => 'form-inline well well-sm']) }} -{{ Form::label('month', 'Laporan Bulanan per', ['class' => 'control-label']) }} +{{ Form::label('month', __('report.view_monthly_label'), ['class' => 'control-label']) }} {{ Form::select('month', $months, $month, ['class' => 'form-control']) }} {{ Form::select('year', $years, $year, ['class' => 'form-control']) }} -{{ Form::submit('Lihat Laporan', ['class' => 'btn btn-info btn-sm']) }} -{{ link_to_route('reports.payments.monthly', 'Bulan ini', [], ['class' => 'btn btn-default btn-sm']) }} -{{ link_to_route('reports.payments.yearly', 'Lihat Tahunan', ['year' => $year], ['class' => 'btn btn-default btn-sm']) }} +{{ Form::submit(__('report.view_report'), ['class' => 'btn btn-info btn-sm']) }} +{{ link_to_route('reports.payments.monthly', __('report.this_month'), [], ['class' => 'btn btn-default btn-sm']) }} +{{ link_to_route('reports.payments.yearly', __('report.view_yearly'), ['year' => $year], ['class' => 'btn btn-default btn-sm']) }} {{ Form::close() }}
-

Grafik Profit {{ $months[$month] }} {{ $year }}

+

{{ __('report.sales_graph') }} {{ $months[$month] }} {{ $year }}

- Rp. + {{ Option::get('money_sign', 'Rp') }}
-
{{ trans('app.date') }}
+
{{ __('time.date') }}
-
-

Detail Laporan

+ +
+

{{ __('report.detail') }}

- - - - - - + + + + + + - + @php $chartData = []; @endphp @foreach(monthDateArray($year, $month) as $dateNumber) - count : 0; $profit = $any ? $reports[$dateNumber]->profit : 0; - if ($any): - ?> - - - - - - - - - $dateNumber, 'value' => ($profit)]; - ?> + @endphp + @if ($any) + + + + + + + + + @endif + @php + $chartData[] = ['date' => $dateNumber, 'value' => ($profit) ]; + @endphp @endforeach - + - +
{{ trans('app.date') }}Jumlah TransferUang MasukUang KeluarProfitPilihan{{ __('time.date') }}{{ __('payment.payment') }}{{ __('payment.cash_in') }}{{ __('payment.cash_out') }}{{ __('report.profit') }}{{ __('app.action') }}
{{ dateId($date = $year . '-' . $month . '-' . $dateNumber) }}{{ $any ? $reports[$dateNumber]->count : 0 }}{{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }}{{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }}{{ formatRp($profit) }} - {{ link_to_route( - 'reports.payments.daily', - 'Lihat Harian', - ['date' => $date], - [ - 'class' => 'btn btn-info btn-xs', - 'title' => 'Lihat laporan harian ' . $date - ] - ) }} -
{{ dateId($date = $year.'-'.$month.'-'.$dateNumber) }}{{ $count }}{{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }}{{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }}{{ formatRp($profit) }} + {{ link_to_route( + 'reports.payments.daily', + __('report.view_daily'), + ['date' => $date], + [ + 'class' => 'btn btn-info btn-xs', + 'title' => __('report.daily', ['date' => dateId($date)]), + ] + ) }} +
Jumlah{{ __('app.total') }} {{ $reports->sum('count') }} {{ formatRp($reports->sum('cashin')) }} {{ formatRp($reports->sum('cashout')) }} {{ formatRp($reports->sum('profit')) }} 
@@ -98,15 +100,14 @@ (function() { new Morris.Line({ element: 'monthly-chart', - data: {!! collect($cartData)->toJson() !!}, + data: {!! collect($chartData)->toJson() !!}, xkey: 'date', ykeys: ['value'], - labels: ['Profit Rp'], + labels: ["{{ __('report.profit') }} {{ Option::get('money_sign', 'Rp') }}"], parseTime:false, xLabelAngle: 30, goals: [0], goalLineColors : ['red'], - smooth: false, lineWidth: 2, }); })(); diff --git a/resources/views/reports/payments/yearly.blade.php b/resources/views/reports/payments/yearly.blade.php index ff2c1b1..731a173 100755 --- a/resources/views/reports/payments/yearly.blade.php +++ b/resources/views/reports/payments/yearly.blade.php @@ -1,44 +1,46 @@ @extends('layouts.app') -@section('title', 'Laporan Tahunan : ' . $year) +@section('title', __('report.yearly', ['year' => $year])) @section('content') {{ Form::open(['method' => 'get', 'class' => 'form-inline well well-sm']) }} -{{ Form::label('year', 'Laporan Tahunan per', ['class' => 'control-label']) }} +{{ Form::label('year', __('report.view_yearly_label'), ['class' => 'control-label']) }} {{ Form::select('year', $years, $year, ['class' => 'form-control']) }} -{{ Form::submit('Lihat Laporan', ['class' => 'btn btn-info btn-sm']) }} -{{ link_to_route('reports.payments.yearly', 'Tahun ini', [], ['class' => 'btn btn-default btn-sm']) }} +{{ Form::submit(__('report.view_report'), ['class' => 'btn btn-info btn-sm']) }} +{{ link_to_route('reports.payments.yearly', __('report.this_year'), [], ['class' => 'btn btn-default btn-sm']) }} {{ Form::close() }}
-

Grafik Profit {{ $year }}

+

{{ __('report.sales_graph') }} {{ $year }}

- Rp. + {{ Option::get('money_sign', 'Rp') }}
-
Bulan
+
{{ __('time.month') }}
-
-

Detail Laporan

+ +
+

{{ __('report.detail') }}

- - - - - - + + + + + + - + @php $chartData = []; @endphp @foreach(getMonths() as $monthNumber => $monthName) - + @php + $any = isset($reports[$monthNumber]); + @endphp @@ -48,26 +50,27 @@ - monthId($monthNumber), 'value' => $profit];?> + @php + $chartData[] = ['month' => monthId($monthNumber), 'value' => $profit]; + @endphp @endforeach - - - +
BulanJumlah TransferUang MasukUang KeluarProfitPilihan{{ __('time.month') }}{{ __('payment.payment') }}{{ __('payment.cash_in') }}{{ __('payment.cash_out') }}{{ __('report.profit') }}{{ __('app.action') }}
{{ monthId($monthNumber) }} {{ $any ? $reports[$monthNumber]->count : 0 }} {{ link_to_route( 'reports.payments.monthly', - 'Lihat Bulanan', + __('report.view_monthly'), ['month' => $monthNumber, 'year' => $year], [ 'class' => 'btn btn-info btn-xs', - 'title' => 'Lihat laporan bulanan ' . monthId($monthNumber) + 'title' => __('report.monthly', ['year_month' => monthId($monthNumber)]), + 'title' => __('report.monthly', ['year_month' => monthId($monthNumber).' '.$year]), ] ) }}
{{ trans('app.total') }} {{ $reports->sum('count') }}{{ formatRp($reports->sum('cashin')) }}{{ formatRp($reports->sum('cashout')) }} {{ formatRp($reports->sum('profit')) }} 
@@ -92,11 +95,11 @@ data: {!! collect($chartData)->toJson() !!}, xkey: 'month', ykeys: ['value'], - labels: ['Profit Rp'], + labels: ["{{ __('report.profit') }} {{ Option::get('money_sign', 'Rp') }}"], parseTime:false, goals: [0], goalLineColors : ['red'], - smooth: false, + smooth: true, lineWidth: 2, }); })();