Browse Source

Update report views to use lang

pull/7/head
Nafies Luthfi 8 years ago
parent
commit
3ef80c2999
  1. 29
      resources/lang/de/report.php
  2. 3
      resources/lang/de/time.php
  3. 29
      resources/lang/en/report.php
  4. 3
      resources/lang/en/time.php
  5. 29
      resources/lang/id/report.php
  6. 3
      resources/lang/id/time.php
  7. 109
      resources/views/reports/payments/daily.blade.php
  8. 97
      resources/views/reports/payments/monthly.blade.php
  9. 57
      resources/views/reports/payments/yearly.blade.php

29
resources/lang/de/report.php

@ -0,0 +1,29 @@
<?php
return [
// Labels
'report' => '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',
];

3
resources/lang/de/time.php

@ -1,6 +1,9 @@
<?php
return [
'date' => 'Datum',
'month' => 'Monat',
'months' => [
'01' => 'Januar',
'02' => 'Februari',

29
resources/lang/en/report.php

@ -0,0 +1,29 @@
<?php
return [
// Labels
'report' => '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',
];

3
resources/lang/en/time.php

@ -1,6 +1,9 @@
<?php
return [
'date' => 'Date',
'month' => 'Month',
'months' => [
'01' => 'January',
'02' => 'Februari',

29
resources/lang/id/report.php

@ -0,0 +1,29 @@
<?php
return [
// Labels
'report' => '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',
];

3
resources/lang/id/time.php

@ -1,6 +1,9 @@
<?php
return [
'date' => 'Tanggal',
'month' => 'Bulan',
'months' => [
'01' => 'Januari',
'02' => 'Pebruari',

109
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::parse($date);?>
@php $dt = Carbon\Carbon::parse($date); @endphp
<ul class="breadcrumb hidden-print">
<li>{{ link_to_route('reports.payments.yearly', 'Laporan Tahun ' . $dt->year, ['year' => $dt->year]) }}</li>
@ -11,51 +12,67 @@
<li class="active">{{ $dt->format('d') }}</li>
</ul>
{{ 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() }}
<table class="table table-condensed table-hover">
<thead>
<th>{{ trans('app.table_no') }}</th>
<th class="col-md-2">{{ trans('payment.project') }}</th>
<th class="col-md-1 text-center">{{ trans('app.date') }}</th>
<th class="col-md-2 text-right">{{ trans('payment.amount') }}</th>
<th class="col-md-2 text-center">{{ trans('payment.customer') }}</th>
<th class="col-md-5">{{ trans('payment.description') }}</th>
<th class="col-md-1">{{ trans('app.action') }}</th>
</thead>
<tbody>
<?php $total = 0;?>
@forelse($payments as $key => $payment)
<tr>
<td>{{ 1 + $key }}</td>
<td>{{ $payment->project->present()->projectLink() }}</td>
<td class="text-center">{{ $payment->date }}</td>
<td class="text-right">{{ $payment->present()->amount }}</td>
<td class="text-center">{{ $payment->partner->name }}</td>
<td>{{ $payment->description }} [{{ $payment->type() }}]</td>
<td>
{{ link_to_route('payments.show','Lihat',[$payment->id],['title' => 'Lihat Detail Pembayaran','target' => '_blank','class' => 'btn btn-info btn-xs']) }}
</td>
</tr>
<?php $total = $payment->in_out == 0 ? $total - $payment->amount : $total + $payment->amount;?>
@empty
<tr><td colspan="7">{{ trans('payment.not_found') }}</td></tr>
@endforelse
</tbody>
<tfoot>
<tr>
<th class="text-right" colspan="3">Jumlah</th>
<th class="text-right">{{ formatRp($total) }}</th>
<th colspan="3"></th>
</tr>
</tfoot>
</table>
<div class="panel panel-default table-responsive">
<table class="table table-condensed table-hover">
<thead>
<th>{{ __('app.table_no') }}</th>
<th class="col-md-2">{{ __('payment.project') }}</th>
<th class="col-md-1 text-center">{{ __('app.date') }}</th>
<th class="col-md-2 text-right">{{ __('payment.amount') }}</th>
<th class="col-md-2 text-center">{{ __('payment.customer') }}</th>
<th class="col-md-5">{{ __('payment.description') }}</th>
<th class="col-md-1 text-center">{{ __('app.action') }}</th>
</thead>
<tbody>
<?php $total = 0;?>
@forelse($payments as $key => $payment)
<tr>
<td class="text-center">{{ 1 + $key }}</td>
<td>{{ $payment->project->present()->projectLink() }}</td>
<td class="text-center">{{ $payment->date }}</td>
<td class="text-right">{{ $payment->present()->amount }}</td>
<td class="text-center">{{ $payment->partner->name }}</td>
<td>{{ $payment->description }} [{{ $payment->type() }}]</td>
<td class="text-center">
{{ 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'
]
) }}
</td>
</tr>
<?php $total = $payment->in_out == 0 ? $total - $payment->amount : $total + $payment->amount;?>
@empty
<tr><td colspan="7">{{ __('payment.not_found') }}</td></tr>
@endforelse
</tbody>
<tfoot>
<tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($total) }}</th>
<th colspan="3">&nbsp;</th>
</tr>
</tfoot>
</table>
</div>
@endsection
@section('ext_css')
@ -77,4 +94,4 @@
});
})();
</script>
@endsection
@endsection

97
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')
<ul class="breadcrumb hidden-print">
<li>{{ link_to_route('reports.payments.yearly', 'Laporan Tahun ' . $year, ['year' => $year]) }}</li>
<li>{{ link_to_route('reports.payments.yearly', __('report.yearly', ['year' => $year])) }}</li>
<li class="active">{{ $months[$month] }}</li>
</ul>
{{ 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() }}
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">Grafik Profit {{ $months[$month] }} {{ $year }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('report.sales_graph') }} {{ $months[$month] }} {{ $year }}</h3></div>
<div class="panel-body">
<strong>Rp.</strong>
<strong>{{ Option::get('money_sign', 'Rp') }}</strong>
<div id="monthly-chart" style="height: 250px;"></div>
<div class="text-center"><strong>{{ trans('app.date') }}</strong></div>
<div class="text-center"><strong>{{ __('time.date') }}</strong></div>
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading"><h3 class="panel-title">Detail Laporan</h3></div>
<div class="panel panel-success table-responsive">
<div class="panel-heading"><h3 class="panel-title">{{ __('report.detail') }}</h3></div>
<div class="panel-body">
<table class="table table-condensed">
<thead>
<th class="text-center">{{ trans('app.date') }}</th>
<th class="text-center">Jumlah Transfer</th>
<th class="text-right">Uang Masuk</th>
<th class="text-right">Uang Keluar</th>
<th class="text-right">Profit</th>
<th class="text-center">Pilihan</th>
<th class="text-center">{{ __('time.date') }}</th>
<th class="text-center">{{ __('payment.payment') }}</th>
<th class="text-right">{{ __('payment.cash_in') }}</th>
<th class="text-right">{{ __('payment.cash_out') }}</th>
<th class="text-right">{{ __('report.profit') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead>
<tbody>
<?php $cartData = [];?>
@php $chartData = []; @endphp
@foreach(monthDateArray($year, $month) as $dateNumber)
<?php
@php
$any = isset($reports[$dateNumber]);
$count = $any ? $reports[$dateNumber]->count : 0;
$profit = $any ? $reports[$dateNumber]->profit : 0;
if ($any):
?>
<tr>
<td class="text-center">{{ dateId($date = $year . '-' . $month . '-' . $dateNumber) }}</td>
<td class="text-center">{{ $any ? $reports[$dateNumber]->count : 0 }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }}</td>
<td class="text-right">{{ formatRp($profit) }}</td>
<td class="text-center">
{{ link_to_route(
'reports.payments.daily',
'Lihat Harian',
['date' => $date],
[
'class' => 'btn btn-info btn-xs',
'title' => 'Lihat laporan harian ' . $date
]
) }}
</td>
</tr>
<?php
endif;
$cartData[] = ['date' => $dateNumber, 'value' => ($profit)];
?>
@endphp
@if ($any)
<tr>
<td class="text-center">{{ dateId($date = $year.'-'.$month.'-'.$dateNumber) }}</td>
<td class="text-center">{{ $count }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashin : 0) }}</td>
<td class="text-right">{{ formatRp($any ? $reports[$dateNumber]->cashout : 0) }}</td>
<td class="text-right">{{ formatRp($profit) }}</td>
<td class="text-center">
{{ link_to_route(
'reports.payments.daily',
__('report.view_daily'),
['date' => $date],
[
'class' => 'btn btn-info btn-xs',
'title' => __('report.daily', ['date' => dateId($date)]),
]
) }}
</td>
</tr>
@endif
@php
$chartData[] = ['date' => $dateNumber, 'value' => ($profit) ];
@endphp
@endforeach
</tbody>
<tfoot>
<tr>
<th class="text-right">Jumlah</th>
<th class="text-right">{{ __('app.total') }}</th>
<th class="text-center">{{ $reports->sum('count') }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashin')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashout')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('profit')) }}</th>
<td></td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
@ -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,
});
})();

57
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')
<ul class="breadcrumb hidden-print">
<li>{{ link_to_route('reports.payments.yearly', 'Laporan Tahun ' . $year, ['year' => $year]) }}</li>
<li class="active">Laporan Tahunan</li>
<li>{{ __('report.yearly', ['year' => $year]) }}</li>
</ul>
{{ 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() }}
<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title">Grafik Profit {{ $year }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('report.sales_graph') }} {{ $year }}</h3></div>
<div class="panel-body">
<strong>Rp.</strong>
<strong>{{ Option::get('money_sign', 'Rp') }}</strong>
<div id="yearly-chart" style="height: 250px;"></div>
<div class="text-center"><strong>Bulan</strong></div>
<div class="text-center"><strong>{{ __('time.month') }}</strong></div>
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading"><h3 class="panel-title">Detail Laporan</h3></div>
<div class="panel panel-success table-responsive">
<div class="panel-heading"><h3 class="panel-title">{{ __('report.detail') }}</h3></div>
<div class="panel-body table-responsive">
<table class="table table-condensed">
<thead>
<th class="text-center">Bulan</th>
<th class="text-center">Jumlah Transfer</th>
<th class="text-right">Uang Masuk</th>
<th class="text-right">Uang Keluar</th>
<th class="text-right">Profit</th>
<th class="text-center">Pilihan</th>
<th class="text-center">{{ __('time.month') }}</th>
<th class="text-center">{{ __('payment.payment') }}</th>
<th class="text-right">{{ __('payment.cash_in') }}</th>
<th class="text-right">{{ __('payment.cash_out') }}</th>
<th class="text-right">{{ __('report.profit') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead>
<tbody>
<?php $chartData = [];?>
@php $chartData = []; @endphp
@foreach(getMonths() as $monthNumber => $monthName)
<?php $any = isset($reports[$monthNumber]);?>
@php
$any = isset($reports[$monthNumber]);
@endphp
<tr>
<td class="text-center">{{ monthId($monthNumber) }}</td>
<td class="text-center">{{ $any ? $reports[$monthNumber]->count : 0 }}</td>
@ -48,26 +50,27 @@
<td class="text-center">
{{ 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]),
]
) }}
</td>
</tr>
<?php $chartData[] = ['month' => monthId($monthNumber), 'value' => $profit];?>
@php
$chartData[] = ['month' => monthId($monthNumber), 'value' => $profit];
@endphp
@endforeach
</tbody>
<tfoot>
<tr>
<th class="text-center">{{ trans('app.total') }}</th>
<th class="text-center">{{ $reports->sum('count') }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashin')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('cashout')) }}</th>
<th class="text-right">{{ formatRp($reports->sum('profit')) }}</th>
<td></td>
<td>&nbsp;</td>
</tr>
</tfoot>
</table>
@ -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,
});
})();

Loading…
Cancel
Save