Commit 81cd1b37 by Triyah Fatmawati

Update kuitansi email

parent c4676442
......@@ -432,13 +432,20 @@ public function addFormAnggota(Request $request)
public function getDataRegis($va)
{
$registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta', 'pkAnggota')
->where('nomor_va', $va)
->first();
$jmlAnggota = count($registrasi->pkAnggota);
$konvensi = Kegiatan::query()->find('498633a9-082c-4a4a-9dbd-e20b678ec15e');
$konv = $konvensi->toArray();
$totalHarga = $totalHarga = (int) $konvensi->harga;
if($jmlAnggota != 0){
$totalHarga = ((int) $konvensi->harga) * $jmlAnggota;
}
$kegPeserta = [];
foreach($registrasi->pkRegistrasiPeserta as $item){
......@@ -449,7 +456,7 @@ public function getDataRegis($va)
$konferensi = $item->rKonferensiPeserta;
$kegkonaspi = $item->rKegiatanPeserta;
$totalHarga += (int) $konferensi->harga;
// $totalHarga += (int) $konferensi->harga;
$kegPeserta[] = [
'idkon' => $konferensi->id,
......@@ -465,6 +472,7 @@ public function getDataRegis($va)
'konaspi' => $konv,
'hargaKonferensi' => $kegPeserta,
'totalHarga' => $totalHarga,
'jmlAnggota' => $jmlAnggota
];
return $data;
......@@ -481,7 +489,7 @@ public function updatePembayaran(Request $request, $va)
try{
$registrasi = Registrasi::query()
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta')
->with('pkKegiatan', 'pkRegistrasiPeserta.rKegiatanPeserta', 'pkRegistrasiPeserta.rKonferensiPeserta', 'pkAnggota')
->where('nomor_va', $va)
->update([
'tanggal_bayar' => Carbon::now()
......
......@@ -21,4 +21,8 @@ class Anggota extends Model
'telepon',
'nik'
];
public function rRegistrasi() {
return $this->belongsTo(Registrasi::class, 'id_registrasi', 'id');
}
}
......@@ -34,4 +34,8 @@ public function rKegiatanPeserta() {
public function rKonferensiPeserta() {
return $this->belongsTo(Konferensi::class, 'id_konferensi', 'id');
}
public function rAnggota(){
return $this->belongsTo(Anggota::class, 'id_anggota', 'id');
}
}
......@@ -45,6 +45,10 @@ public function pkKonferensi() {
}
public function pkRegistrasiPeserta() {
return $this->hasMany(KegiatanPeserta::class, 'id_registrasi', 'id');
return $this->hasMany(KegiatanPeserta::class, 'id_registrasi', 'id')->with('rAnggota');
}
public function pkAnggota(){
return $this->hasMany(Anggota::class, 'id_registrasi', 'id');
}
}
......@@ -71,18 +71,21 @@
Convention
</td>
<td class="text-center">Rp {{$konaspi['harga']??'param'}}</td>
<td class="text-center">1</td>
<td class="text-right">Rp {{$konaspi['harga']??'param'}}</td>
<td class="text-center">{{($jmlAnggota != 0) ? $jmlAnggota : 1}}</td>
<td class="text-right">Rp {{$totalHarga??'param'}}</td>
</tr>
@if (isset($hargaKonferensi))
@foreach ($hargaKonferensi as $kon)
@if (!empty($hargaKonferensi))
@foreach ($registrasi->pkRegistrasiPeserta as $kon)
@php
$subtotal = $subtotal + $kon['hargakon'];
// $subtotal = $subtotal + $kon['hargakon'];
@endphp
<tr>
<td>{{$no}}</td>
<td>
{{$kon['namakeg']}} <br> Konferensi : <b> {{$kon['namakon']??'param'}} </b>
{{$kon->rKegiatanPeserta->nama}} <br> Konferensi : <b> {{$kon->rKonferensiPeserta->nama??'param'}} </b>
@isset($kon->rAnggota)
<br>Anggota : <b>{{ $kon->rAnggota->nama }}</b>
@endisset
</td>
{{-- <td class="text-center">Rp {{$kon['hargakon']??'param'}}</td> --}}
<td class="text-center">-</td>
......@@ -111,13 +114,13 @@
<div class="invoice-detail-item">
<div class="invoice-detail-name">Subtotal</div>
{{-- <div class="invoice-detail-value">Rp {{$subtotal}}</div> --}}
<div class="invoice-detail-value">Rp {{$initialharga}}</div>
<div class="invoice-detail-value">Rp {{$totalHarga}}</div>
</div>
<hr class="mt-2 mb-2">
<div class="invoice-detail-item">
<div class="invoice-detail-name">Total</div>
{{-- <div class="invoice-detail-value invoice-detail-value-lg">Rp {{$subtotal}}</div> --}}
<div class="invoice-detail-value invoice-detail-value-lg">Rp {{$initialharga}}</div>
<div class="invoice-detail-value invoice-detail-value-lg">Rp {{$totalHarga}}</div>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment