added pdf and fix surat wakil no pdf and added pdf for resit

This commit is contained in:
hafifierahman
2025-01-21 00:07:48 +08:00
parent 8df8551f83
commit b489855d11
5 changed files with 154 additions and 13 deletions
+44 -1
View File
@@ -16,6 +16,7 @@ use Illuminate\Support\Facades\Log;
use Money\Money;
use App\Services\OnlineTransactionLoggerService;
use Illuminate\Support\Facades\Session;
use PDF;
class BayaranController extends Controller
{
@@ -215,7 +216,49 @@ class BayaranController extends Controller
->json();
$gadai = $gadai_details[0][0];
return view('pembayaran.resit.resitportal', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai'));
$company = Session::get('company');
return view('pembayaran.resit.resitportal', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai','company'));
}
public function generateResit(Request $request)
{
$this->serviceCallHttp($request->company);
$kpbaru = Auth::User()->icno;
$customer = $this->CallableHttp
->get('/api/customers/' . $kpbaru)
->json();
$customer_details = $customer;
$current = Carbon::now();
$current = new Carbon();
$date = $current->toDateTimeString();
$payment_details = $this->CallableHttp
->get('/api/transaction/online/express', ['billplz_id' => $request->billplzid])
->json();
$cawangan_info = $this->CallableHttp
->get('/api/cawangan/' . $payment_details['kodcaw'])
->json();
$cawangan = $this->CallableHttp
->get('/api/cawangan/detail/' . $payment_details['kodcaw'])
->json();
$cawangan_detail = $cawangan[0];
$nama_cawangan = $cawangan_info['details_caw'];
$gadai_details = $this->CallableHttp
->get('/api/gadai/norujukan/' . $payment_details['norujukan'])
->json();
$gadai = $gadai_details[0][0];
// Load a view and pass data to it
$pdf = PDF::loadView('pembayaran.resit.resitpdf', compact('customer_details', 'payment_details', 'cawangan_detail', 'nama_cawangan', 'gadai'));
// Return the generated PDF (inline display in browser)
return $pdf->stream('resit_pembayaran.pdf');
}
public function callback(Request $request)