@extends('layouts.app') @section('title', __('Receipt Slip')) @section('content') @php $businessName = $appSettings['business_name'] ?? 'TradeERP'; $customerName = $payment->customer?->name ?? __('Walk-in Customer'); $customerPhone = $payment->customer?->phone; $receiptNo = 'RC-'.str_pad($payment->id,5,'0',STR_PAD_LEFT); $openingAmount = max(0, (float) $payment->amount - (float) $payment->allocations->sum('amount')); $invoiceLabel = $payment->allocations->count() > 1 ? __('Multiple invoices') : ($payment->invoice?->invoice_number ?? $payment->allocations->first()?->invoice?->invoice_number ?? ($openingAmount > 0 ? __('Opening Balance') : '-')); $qrEnabled = ($appSettings['qr_enabled'] ?? '1') !== '0'; $qrData = route('payments.receipts.show', $payment); $waMessage = $businessName."\n".__('Receipt Slip').': '.$receiptNo."\n".__('Received From').': '.$customerName."\n".__('Amount').': '.number_format($payment->amount,2).' '.$payment->currency_code."\n".__('Invoice').': '.$invoiceLabel."\n".($appSettings['whatsapp_footer'] ?? 'Thank you for your business.'); $waLink = \App\Support\WhatsApp::link($waMessage, $appSettings, $customerPhone, false); @endphp
{{ __('Customer Receipts') }} @if($waLink){{ __('Send WhatsApp') }}@endif
@endsection