last change request before release

pull/1/head
Aji Kamaludin 5 years ago
parent 29754d9a3b
commit be8585d62b
No known key found for this signature in database
GPG Key ID: 23E2BDC458317AF8

@ -9,6 +9,8 @@ use App\Models\Tagihan;
use App\Models\Transaksi;
use App\Exports\LaporanHarianExport;
use Maatwebsite\Excel\Facades\Excel;
use App\Models\Siswa;
use App\Models\Kelas;
class HomeController extends Controller
{
@ -21,6 +23,10 @@ class HomeController extends Controller
$transaksi = Transaksi::orderBy('siswa_id','desc')->whereDate('created_at', now()->today())->get();
$siswa = Siswa::count();
$item = Tagihan::count();
$kelas = Kelas::count();
return view('dashboard.index',[
'total_uang' => $total_uang,
'total_uang_tabungan' => $total_uang_tabungan,
@ -28,7 +34,10 @@ class HomeController extends Controller
'total_uang_masuk' => $total_uang_masuk,
'total_uang_keluar' => $total_uang_keluar,
'transaksi' => $transaksi,
'jumlah' => '0'
'jumlah' => '0',
'siswa' => $siswa,
'item' => $item,
'kelas' => $kelas,
]);
}

@ -23,6 +23,21 @@ class TabunganController extends Controller
]);
}
public function transaksiCetak($id)
{
$tabungan = Tabungan::find($id);
$siswa = $tabungan->siswa;
$input = Tabungan::where('tipe','in')->where('siswa_id',$siswa->id)->sum('jumlah');
$output = Tabungan::where('tipe','out')->where('siswa_id',$siswa->id)->sum('jumlah');
$verify = Tabungan::where('siswa_id', $siswa->id)->orderBy('created_at','desc')->first()->saldo;
return view('tabungan.tabunganprint', [
'siswa' => $siswa,
'tabungan' => $tabungan,
'saldo' => format_idr($input - $output).(($input - $output) == $verify ? '' : ' invalid'),
]);
}
//api manabung
public function menabung(Request $request, Siswa $siswa)
{

@ -108,6 +108,21 @@ class TransaksiController extends Controller
return \Excel::download(new SppExport, 'histori_spp-'.now().'.xlsx');
}
public function transaksiPrint(Request $request)
{
$ids = explode(',',$request->ids);
$total = 0;
$transaksi = Transaksi::whereIn('id', $ids)->get();
foreach($transaksi as $trans){
$total += $trans->keuangan->jumlah;
}
return view('transaksi.transaksiprint',[
'items' => $transaksi,
'total' => $total,
]);
}
//get list tagihan of siswa
public function tagihan(Siswa $siswa)
{

@ -49,6 +49,30 @@
</div>
</div>
</div>
<div class="col-6 col-sm-3 col-lg-3">
<div class="card">
<div class="card-body p-3 text-center">
<div class="h1 m-0">{{ $siswa }}</div>
<div class="text-muted mb-4">Siswa/Siswi</div>
</div>
</div>
</div>
<div class="col-6 col-sm-3 col-lg-3">
<div class="card">
<div class="card-body p-3 text-center">
<div class="h1 m-0">{{ $kelas }}</div>
<div class="text-muted mb-4">Kelas</div>
</div>
</div>
</div>
<div class="col-6 col-sm-3 col-lg-3">
<div class="card">
<div class="card-body p-3 text-center">
<div class="h1 m-0">{{ $item }}</div>
<div class="text-muted mb-4">Item Tagihan</div>
</div>
</div>
</div>
<div class="col-12">
<div class="card">
<div class="card-header">

@ -29,10 +29,12 @@
<div class="card">
<div class="card-header">
<h3 class="card-title">Tabungan</h3>
@if($saldo != '0')
<div class="card-options">
<a href="{{ route('tabungan.cetak', $siswa->id) }}" target="_blank" class="btn btn-primary mr-1">Cetak</a>
<a href="{{ route('tabungan.siswa.export', $siswa->id) }}" target="_blank" class="btn btn-primary">Export</a>
</div>
@endif
</div>
<div class="card-body">
<p><b>Saldo : </b>IDR. {{$saldo}}</p>

@ -94,7 +94,7 @@
<th>KD</th>
<th>Keterangan</th>
<th>Jumlah</th>
{{-- <th></th> --}}
<th>Cetak</th>
</tr>
</thead>
<tbody>
@ -103,9 +103,11 @@
<td><span class="text-muted">{{ $index+1 }}</span></td>
<td>{{ $item->created_at->format('d-m-Y') }}</td>
<td>
<a href="{{ route('siswa.show', $item->siswa->id) }}" target="_blank">
{{ $item->siswa->nama }} -
{{ $item->siswa->kelas->nama }} -
{{ isset($item->siswa->kelas->periode) ? $item->siswa->kelas->periode->nama : '' }}
</a>
</td>
<td>
@if($item->tipe == 'in')
@ -116,14 +118,11 @@
</td>
<td style="max-width:150px;">{{ $item->keperluan }}</td>
<td>IDR. {{ format_idr($item->jumlah) }}</td>
{{-- <td class="text-center"> --}}
{{-- <a class="icon btn-delete" href="#!" data-id="{{ $item->id }}" title="delete item">
<i class="fe fe-trash"></i>
</a> --}}
{{-- <form action="{{ route('tabungan.destroy', $item->id) }}" method="POST" id="form-{{ $item->id }}">
@csrf
</form> --}}
{{-- </td> --}}
<td>
<a class="btn btn-outline-primary btn-sm" target="_blank" href="{{ route('tabungan.transaksicetak', $item->id)}}">
Cetak
</a>
</td>
</tr>
@endforeach
</tbody>

@ -0,0 +1,50 @@
<h2 style="text-align:center"><b> {{ $sitename }} </b></h2 >
<h3 style="text-align:center">Tabungan</h3>
<br>
<p><b>Nama :</b> {{ $siswa->nama }} <b>Kelas : </b> {{ $siswa->kelas->nama }}{{ isset($siswa->kelas->periode) ? '('.$siswa->kelas->periode->nama.')' : '' }}</p>
<p><b>Saldo : </b>IDR. {{ $saldo }}</p>
<table style="border: 1px solid black; width: 100%">
<tr style="border: 1px solid black;">
<th>No</th>
<th>Tanggal</th>
<th>KD</th>
<th>Jumlah</th>
</tr>
<tr>
<td style="min-width:20px;text-align: center;">
1
</td>
<td style="min-width:200px;text-align: center;">
{{ $tabungan->created_at->format('d-m-Y') }}
</td>
<td style="min-width:20px;text-align: center;">
@if($tabungan->tipe == 'in')
Menabung
@else
Penarikan
@endif
</td>
<td style="min-width:200px;text-align: left;">
IDR. {{ format_idr($tabungan->jumlah) }}
</td>
</tr>
</table>
<style>
@media print {
tr.gray {
background-color: #ececec !important;
-webkit-print-color-adjust: exact;
}
th {
background-color: #dadada !important;
-webkit-print-color-adjust: exact;
}
}
</style>
<script>
window.print()
window.onafterprint = function(){
window.close()
}
</script>

@ -101,6 +101,7 @@
<h3 class="card-title">Histori Transaksi</h3>
<div class="card-options">
<a href="{{ route('transaksi.export') }}" class="btn btn-primary btn-sm ml-2" download="true">Export</a>
<a href="#!cetak" class="btn btn-outline-primary btn-sm ml-2" id="mass-cetak">Cetak</a>
</div>
</div>
<div class="table-responsive">
@ -114,6 +115,7 @@
<th>Diskon</th>
<th>Dibayarkan</th>
<th>Keterangan</th>
<th>Cetak</th>
</tr>
</thead>
<tbody>
@ -121,11 +123,21 @@
<tr>
<td><span class="text-muted">{{ $index+1 }}</span></td>
<td>{{ $item->created_at->format('d-m-Y') }}</td>
<td>{{ $item->siswa->nama.'('.$item->siswa->kelas->nama.')' }}</td>
<td>
<a href="{{ route('siswa.show', $item->siswa->id) }}" target="_blank">
{{ $item->siswa->nama.'('.$item->siswa->kelas->nama.')' }}
</a>
</td>
<td>{{ $item->tagihan->nama }}</td>
<td>IDR. {{ format_idr($item->diskon) }}</td>
<td>IDR. {{ format_idr($item->keuangan->jumlah) }}</td>
<td style="max-width:150px;">{{ $item->keterangan }}</td>
<td>
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input tandai" name="example-checkbox2" value="{{ $item->id }}">
<span class="custom-control-label">Tandai</span>
</label>
</td>
</tr>
@endforeach
</tbody>
@ -315,6 +327,34 @@
})
$('#mass-cetak').on('click', function(){
var ids = []
$('.tandai').each(function(){
if(this.checked){
ids.push(this.value)
}
})
var form = document.createElement("form");
form.setAttribute("style", "display: none");
form.setAttribute("method", "post");
form.setAttribute("action", "{{ route('transaksi.print') }}");
form.setAttribute("target", "_blank");
var token = document.createElement("input");
token.setAttribute("name", "_token");
token.setAttribute("value", "{{csrf_token()}}");
var idsForm = document.createElement("input");
idsForm.setAttribute("name", "ids");
idsForm.setAttribute("value", ids);
form.appendChild(token);
form.appendChild(idsForm);
document.body.appendChild(form);
form.submit();
})
});
});
</script>

@ -0,0 +1,111 @@
@extends('layouts.app')
@section('page-name','Kuitansi')
@section('content')
<div class="page-header">
<h1 class="page-title">
Kuitansi
</h1>
</div>
<div class="row">
<div class="col-12">
<div class="card" id="print">
<div class="card-body">
<div class="row">
<div class="col-9">
<h2>{{ $sitename }}</h2>
<p>
Pembayaran Biaya SPP<br>
Invoice: <span id="invoice">01/SPP/{{ now()->format('YmdHis') }}</span>
</p>
</div>
<div class="col-3">
<div class="d-flex">
<p class="ml-auto">
Tanggal : {{ now()->format('d-m-Y') }}<br>
Nama : {{ Auth::user()->name }}
</p>
</div>
</div>
<hr class="bg-color">
<table class="table card-table table-hover table-vcenter text-wrap title" id="print">
<thead>
<tr>
<th>Tanggal</th>
<th>Nama Siswa</th>
<th>Nama Tagihan</th>
<th>Diskon</th>
<th>Dibayarkan</th>
</tr>
</thead>
<tbody>
@foreach ($items as $item)
<tr>
<td><input type="text" class="form-control" value="{{ $item->created_at->format('d-m-Y') }}"></td>
<td><input type="text" class="form-control" id="jumlah-0" value="{{ $item->siswa->nama }}"></td>
<td><input type="text" class="form-control" data-id="0" value="{{ ($item->tagihan->nama) }}"></td>
<td><input type="text" class="form-control" data-id="0" value="IDR. {{ format_idr($item->diskon) }}"></td>
<td><input type="text" class="form-control" data-id="0" value="IDR. {{ format_idr($item->keuangan->jumlah) }}"></td>
</tr>
@endforeach
<tr id="newrow"></tr>
</tbody>
</table>
<div class="btn btn-outline-primary col-12 btn-sm" title="tambah baris" id="tambah">
<span class="fe fe-plus"></span>
</div>
<table class="table card-table table-vcenter text-wrap title">
<tr>
<td style="width: 60%"></td>
<td style="width: 20%;text-align: right;"><b>TOTAL</b></td>
<td style="width: 20%;">IDR. <span id="total">{{ $total }}</span></td>
</tr>
<tr>
<td style="width: 60%"></td>
<td style="width: 20%;text-align: left;">
<b>Tanda Terima</b>
<br>
<br>
<p>............................</p>
</td>
<td style="width: 20%;text-align: left;">
<b>Hormat Kami</b>
<br>
<br>
<p>............................</p>
</td>
</tr>
</table>
</div>
</div>
<div class="card-footer">
<div class="d-flex">
<button type="submit" class="btn btn-primary ml-auto" id="cetak">Cetak</button>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('js')
<script>
require(['jquery'], function ($) {
$(document).ready(function () {
$('#cetak').hide()
$('.page-title').hide()
$('#tambah').hide()
$('.hapus').hide()
$('#histori').toggle()
window.print()
window.onafterprint = function(){
window.close()
}
});
});
</script>
@endsection

@ -10,9 +10,11 @@
| contains the "web" middleware group. Now create something great!
|
*/
Auth::routes();
Route::middleware(['auth:web'])->group(function(){
// Route::prefix('spp')->group(function(){
Auth::routes();
Route::middleware(['auth:web'])->group(function(){
Route::get('/', 'HomeController@index')->name('web.index');
Route::get('pengaturan','HomeController@pengaturan')->name('pengaturan.index');
Route::get('ubah-pengaturan','HomeController@editPengaturan')->name('pengaturan.edit');
@ -67,8 +69,9 @@ Route::middleware(['auth:web'])->group(function(){
//Menabung
Route::get('tabungan', 'TabunganController@index')->name('tabungan.index');
Route::post('menabung', 'TabunganController@menabung')->name('tabungan.store');
Route::get('cetak-tabungan/{id}', 'TabunganController@transaksiCetak')->name('tabungan.transaksicetak');
Route::get('export-mutasi', 'TabunganController@export')->name('tabungan.export');
Route::get('cetak-tabungan/{siswa}', 'TabunganController@cetak')->name('tabungan.cetak');
Route::get('cetak-tabungan-siswa/{siswa}', 'TabunganController@cetak')->name('tabungan.cetak');
Route::get('export-tabungan/{siswa}', 'TabunganController@siswaexport')->name('tabungan.siswa.export');
//Keuangan
@ -78,6 +81,7 @@ Route::middleware(['auth:web'])->group(function(){
//Pembayaran SPP
Route::get('transaksi-spp','TransaksiController@index')->name('spp.index');
Route::post('print-spp', 'TransaksiController@transaksiPrint')->name('transaksi.print');
Route::get('export-spp','TransaksiController@transaksiExport')->name('transaksi.export');
Route::post('print-spp/{siswa?}','TransaksiController@print')->name('spp.print');
Route::post('export-spp/{siswa?}','TransaksiController@export')->name('spp.export');
@ -86,7 +90,9 @@ Route::middleware(['auth:web'])->group(function(){
Route::get('kuitansi', 'KuitansiController@index')->name('kuitansi.index');
Route::post('kuitansi', 'KuitansiController@store')->name('kuitansi.store');
Route::get('kuitansi/{kuitansi}', 'KuitansiController@print')->name('kuitansi.print');
});
});
// });

Loading…
Cancel
Save