@if(CommonHelper::getBranchSettings($extra['branch']->id, 'QR_code_on_statement'))
@php
$total_sale_amount = 0;
$total_received = 0;
$total_outstanding = 0;
foreach ($schedules as $schedule) {
$total_sale_amount += $schedule->payable_amount;
$total_received += $schedule->payment_received_amount;
}
$total_outstanding = $total_sale_amount - $total_received;
$payable_amount_till_month = $sell->till_month_due->sum('payable_amount');
$payment_received_amount_till_month = $sell->till_month_due->sum('payment_received_amount');
$till_month_due = $payable_amount_till_month - $payment_received_amount_till_month;
$data = '
Customer Name = "' . $sell->customer->name . '"
Registration No = "' . $sell->registration_no . '"
Total sale amount = "' . $total_sale_amount . '"
Total Due = "' . $total_outstanding . '"
Received Amount = "' . $total_received . '"
Till Month Due = "' . $till_month_due . '"
';
// Generate QR code
$QR = QrCode::size(70)->generate($data);
echo '
 . ')
';
@endphp
@endif