@extends('layouts.app') @section('title', __('Purchase').' '.$purchase->purchase_number) @section('content') @php $businessName = $appSettings['business_name'] ?? 'TradeERP'; $supplierName = $purchase->supplier?->name ?? '—'; $supplierPhone = $purchase->supplier?->phone; $qrEnabled = ($appSettings['qr_enabled'] ?? '1') !== '0'; $qrData = route('purchases.show', $purchase); $waMessage = $businessName."\n".__('Purchase').': '.$purchase->purchase_number."\n".__('Supplier').': '.$supplierName."\n".__('Total').': '.number_format($purchase->subtotal,2).' '.$purchase->currency_code."\n".__('Paid').': '.number_format($purchase->paid_amount,2).' '.$purchase->currency_code."\n".__('Due').': '.number_format($purchase->due_amount,2).' '.$purchase->currency_code."\n".($appSettings['whatsapp_footer'] ?? 'Thank you for your business.'); $waLink = \App\Support\WhatsApp::link($waMessage, $appSettings, $supplierPhone, false); @endphp
| # | {{ __('Item') }} | {{ __('Unit') }} | {{ __('Qty') }} | {{ __('Base Qty') }} | {{ __('Cost') }} | {{ __('Total') }} |
|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $item->product_name }} | {{ $item->unit }} | {{ $item->quantity }} | {{ $item->base_quantity ?: $item->quantity }} {{ $item->product?->unit }} | {{ number_format($item->unit_cost,2) }} | {{ number_format($item->line_total,2) }} |
| {{ $purchase->items->count() + 1 }} | {{ __('Previous Supplier Invoice Balance') }} | - | - | - | {{ number_format($purchase->previous_balance, 2) }} | {{ number_format($purchase->previous_balance, 2) }} |