@php
use Salla\ZATCA\GenerateQrCode;
use Salla\ZATCA\Tags\InvoiceDate;
use Salla\ZATCA\Tags\InvoiceTaxAmount;
use Salla\ZATCA\Tags\InvoiceTotalAmount;
use Salla\ZATCA\Tags\Seller;
use Salla\ZATCA\Tags\TaxNumber;
@endphp
@if ($print_settings["show_qr_code"] || $print_settings["in_words"]->show)
@php
$qr_code = GenerateQrCode::fromArray([
new Seller(store_info()->name_local),
new TaxNumber(store_info()->vat_reg_no),
new InvoiceDate($invoice->date),
new InvoiceTotalAmount(round($invoice->net_total)),
new InvoiceTaxAmount($invoice->total_vat)
])->render();
@endphp
@if ($print_settings["show_qr_code"])
@endif
@if ($print_settings["in_words"]->show)
{{ $print_settings["in_words"]->label }} : @if($invoice->net_total < 0)(Minus)@endif {{ ucwords(getNumberInWords(abs($invoice->net_total))) }}.
@endif
@endif
@if ($print_settings["show_party_balance"]->show)
| {{ $print_settings["show_party_balance"]->label }} |
@php $opening_balance = ledgerWiseValue([$invoice->party_id=> $invoice->party->account_id], $invoice->date) @endphp
| {{__('obs.opening')}} |
{{ getFormatedAmount($franction_digit, $opening_balance) }} |
| {{__('obs.closing')}} |
{{ getFormatedAmount($franction_digit, ($opening_balance + (round($invoice->net_total, 2) - $invoice->total_recv_amount))) }} |
@endif
@if ($print_settings["total_summary"])
@php
$table_Settings = $print_settings->where('show', '<>', null)->where('type', 2)->sortBy('serial');
$tbody = $table_Settings->map(function($q) use($franction_digit) {
if ($q->key == 'due') {
return '
| '.$q->label.' |
{{ number_format(round($item["net_total"] - $item["total_recv_amount"], '.$franction_digit.'), '.$franction_digit.', ".", "") }} |
';
} else {
if (isset($q->fraction)) {
return '
| '.$q->label.' |
{{ number_format(round($item["'.$q->key.'"], '.$franction_digit.'), '.$franction_digit.', ".", "") }} |
';
} else {
return '
| '.$q->label.' |
{{ $item["'.$q->key.'"] }} |
';
}
}
});
$tbody = implode(' ', $tbody->toArray());
@endphp
{!! newBladeStringCompiler($tbody, $invoice->toArray()) !!}
@endif