@php $companyLogo = $companyLogo ?? setting('setting.logo') ?? ''; $companyName = $companyName ?? 'CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ'; $companyAddress = $companyAddress ?? 'Số 128/38 đường Tân Hương, Phường Phú Thọ Hòa, Thành phố Hồ Chí Minh, Việt Nam'; $companyTaxCode = $companyTaxCode ?? '0318443116'; $cfg = array_merge([ 'show_logo' => true, 'show_company_info' => true, 'show_customer_info' => true, 'show_items_table' => true, 'show_summary' => true, 'footer_text' => '', 'footer_note' => '', ], $cfg ?? []); $invoiceDate = $invoice->vat_issued_at ?? $invoice->created_at ?? now(); $taxBase = ($invoice->total ?? 0) - ($invoice->tax ?? 0); $taxRate = ($taxBase > 0 && ($invoice->tax ?? 0) > 0) ? round($invoice->tax / $taxBase * 100) : 0; @endphp