diff --git a/app/Http/Controllers/NotisController.php b/app/Http/Controllers/NotisController.php index 99e7eab1..cf09c0f4 100644 --- a/app/Http/Controllers/NotisController.php +++ b/app/Http/Controllers/NotisController.php @@ -257,7 +257,8 @@ class NotisController extends Controller $marhun = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id') ->where('lelong_id','=',$lelong_id) - ->where('lelongbid.kodcaw','=',$user->kodcaw); + ->where('lelongbid.kodcaw','=',$user->kodcaw) + ->orderBy('norujukan'); $arraynorujukan = $marhun->pluck('norujukan')->toArray(); $datalelong = $marhun->get(); @@ -288,6 +289,14 @@ class NotisController extends Controller // dd($marhuns[$index1]['nama']); } + $listsaglelong = Gadai::on($datalelong[0]['kodcaw'])->whereIn('norujukan', $arraynorujukan) + ->get(); + foreach($listsaglelong as $index2=>$sag){ + $nokp = Customer::where('kpbaru','=',$sag['nokp']) + ->orWhere('kplama','=',$sag['nokp']) + ->first(); + $listsaglelong[$index2]['nama'] = $nokp; + } if($request->type == 'excel') { @@ -295,6 +304,13 @@ class NotisController extends Controller return view('excel.listnotis_excel',compact('marhuns','lelong_id','bayaran','listsag','caw')); } + elseif($request->type == 'excelbysag') + { + + return view('excel.listnotis_excelbysag',compact('listsaglelong','lelong_id','bayaran','listsag','caw')); + + } + else { $pdf = PDF::loadView('pdf.listnotis',compact('marhuns','lelong_id','bayaran','listsag','caw')) diff --git a/resources/views/excel/listnotis_excelbysag.blade.php b/resources/views/excel/listnotis_excelbysag.blade.php new file mode 100644 index 00000000..729e0f42 --- /dev/null +++ b/resources/views/excel/listnotis_excelbysag.blade.php @@ -0,0 +1,109 @@ + + + + + + +
+ + {{$caw['caw_name']}}
+ {{$caw['alamat1']}}
+ {{$caw['alamat2']}}
+ No Tel: {{$caw['notel']}}
+ No Faks: {{$caw['nofaks']}}
+
| No | +No Rujukan | +Tempoh | +No KP | +Nama | +No.Telefon | + +Pembiayaan(RM) | +Keuntungan 6 Bulan(RM) | +Bayaran Telah Dibuat(RM) | +||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | +{{ $notis['norujukan']}} | +{{ $notis['tempoh']}} | +{{ $notis['nokp']}} | +{{ $notis['nama']['nama']}} | +6{{ $notis['nama']['telefon']}} | + +{{ $notis['bakipjm']}} | +{{ $notis['bakiupah']}} | +{{ number_format($bayaran, 2, '.', ',')}} |
+
+ @endforeach
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/jananotis/senarainotis.blade.php b/resources/views/jananotis/senarainotis.blade.php
index eba4ff31..7fe792e0 100644
--- a/resources/views/jananotis/senarainotis.blade.php
+++ b/resources/views/jananotis/senarainotis.blade.php
@@ -37,9 +37,11 @@
Alamat 3 | No Rujukan | Tempoh | -Pembiayaan | -Keuntungan 6 Bulan | -Bayaran Telah Dibuat | +Pembiayaan (RM) | +Keuntungan 6 Bulan (RM) | +Bayaran Telah Dibuat (RM) | + {{--Baki Lelong (simulasi) (RM) | --}} +{{ $notis['nama']->alamat2 }} | {{ $notis['nama']->alamat3 }} | {{--{{ $notis['nama']['nama']}} | --}} -@foreach($notis['listsag'] as $item){{ $item['norujukan']}} @endforeach |
+ @foreach($notis['listsag'] as $item){{ $item['norujukan']}} @endforeach |
@foreach($notis['listsag'] as $item){{ $item['tempoh']}} @endforeach |
@foreach($notis['listsag'] as $item){{ number_format($item['pinjaman'], 2, '.', ',')}} @endforeach |
@foreach($notis['listsag'] as $item){{ number_format($item['bakiupah'], 2, '.', ',')}} @endforeach |
- @foreach($notis['listsag'] as $index=> $bayar){{ number_format($bayar['bayaran'], 2, '.', ',')}} @endforeach |
+ @foreach($notis['listsag'] as $index=> $bayar){{ number_format($bayar['bayaran'], 2, '.', ',')}} @endforeach |
+ {{-- @foreach($notis['datalelongbid'] as $index=> $baki){{ number_format($baki['baki'], 2, '.', ',')}} @endforeach | --}}
@endforeach
@@ -100,6 +103,17 @@
// window.open("_blank");
}
},
+ {
+ className: 'btn btn-outline-info pl-4 pr-4 btn-sm export',
+ target: "_blank",
+ titleAttr: 'Export to Excel by SAG',
+ text: '