@php use App\Helpers\CommonHelper; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\DB; $companyId = $companyId ?? Session::get('run_company'); $printDate = strtoupper(date('d-M-y h:i A')); $orderDate = strtoupper(date('d-M-y', strtotime($sale_quotations->quotation_date))); $validityDate = !empty($sale_quotations->q_valid_up_to) ? strtoupper(date('d-M-y', strtotime($sale_quotations->q_valid_up_to))) : ''; $saleOrderNo = DB::connection('mysql2')->table('sales_order') ->where('purchase_order_contract', $sale_quotations->id) ->where('status', 1) ->value('so_no'); if (empty($saleOrderNo)) { $numericSo = ltrim(preg_replace('/\D/', '', (string) ($sale_quotations->quotation_no ?? '')), '0'); $saleOrderNo = $numericSo !== '' ? $numericSo : ($sale_quotations->quotation_no ?? ''); } $paymentTerm = trim($sale_quotations->delivery_term ?? ''); $preparedBy = strtoupper(trim($sale_quotations->created_by ?? '')); $printBy = strtoupper(trim(Auth::user()->name ?? '')); $customerPhone = ''; $customerEmail = ''; if (($sale_quotations->customer_type ?? '') === 'customer') { $customerRow = DB::connection('mysql2')->table('customers') ->where('id', $sale_quotations->customer_id) ->select('name', 'address', 'contact', 'email') ->first(); $customerName = strtoupper($customerRow->name ?? ''); $customerAddress = strtoupper(trim($customerRow->address ?? '')); $customerPhone = trim($customerRow->contact ?? ''); $customerEmail = trim($customerRow->email ?? ''); $kindAtt = strtoupper(trim($sale_quotations->attention ?: ($customerRow->name ?? ''))); } else { $prospect = CommonHelper::get_prospect($sale_quotations->prospect_id); $customerName = strtoupper($prospect->company_name ?? ''); $customerAddress = strtoupper(trim($prospect->company_address ?? '')); $kindAtt = strtoupper(trim($sale_quotations->attention ?? '')); if (!empty($prospect->contact_id)) { $contact = CommonHelper::get_contacts($prospect->contact_id); $customerPhone = trim($contact->phone ?? ''); $customerEmail = trim($contact->email ?? ''); } } $productCount = count($sale_quotation_data); $grossTotal = 0; $taxTotal = 0; $netTotal = 0; @endphp
|
|
| Particulars | Unit | Quantity | Rate | Gross Amt. | Tax | Tax Amt. | Net Amt. | Remarks |
|---|---|---|---|---|---|---|---|---|
| {{ $itemName }} | {{ $uomName }} | {{ number_format($qty, 4, '.', '') }} | {{ number_format($rate, 4, '.', '') }} | {{ number_format($grossAmt, 2) }} | {{ $lineTaxRate > 0 ? rtrim(rtrim(number_format($lineTaxRate, 2), '0'), '.') . '%' : '' }} | {{ $lineTaxAmt > 0 ? number_format($lineTaxAmt, 2) : '' }} | {{ number_format($lineNetAmt, 2) }} | {{ $remarksText }} |
| Amount In Words : {{ $amountWords }} Rupees Only. |
|