Files
bildirchin/views/admin/invoice.php
T

94 lines
5.0 KiB
PHP

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<title>فاکتور فروش <?= $order['order_code'] ?> - <?= \Bildirchin\Config::APP_NAME ?></title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600;700;900&display=swap" rel="stylesheet">
<style>
body { font-family: 'Vazirmatn', Tahoma, sans-serif; }
@media print {
.no-print { display: none; }
body { padding: 0; background: white; }
}
</style>
</head>
<body class="bg-stone-100 p-8 text-stone-900">
<div class="max-w-4xl mx-auto bg-white p-10 rounded-2xl shadow-sm border border-stone-200 space-y-8">
<div class="no-print flex justify-end gap-3 mb-4">
<button onclick="window.print()" class="px-4 py-2 rounded-xl bg-amber-500 font-bold text-xs hover:bg-amber-600">چاپ فاکتور</button>
<button onclick="window.close()" class="px-4 py-2 rounded-xl bg-stone-200 font-bold text-xs">بستن</button>
</div>
<!-- Header -->
<div class="flex justify-between items-center border-b pb-6">
<div>
<h1 class="text-xl font-black text-stone-900"><?= \Bildirchin\Config::APP_NAME ?></h1>
<p class="text-xs text-stone-500 mt-1">تولید و عرضه صنعتی انواع بلدرچین، تخم، دان و تجهیزات</p>
<p class="text-xs text-stone-500"><?= \Bildirchin\Config::ADDRESS ?></p>
<p class="text-xs text-stone-500">تلفن: <?= \Bildirchin\Config::PHONE ?></p>
</div>
<div class="text-left">
<span class="text-2xl font-black text-amber-700 block">پیش‌فاکتور فروش</span>
<span class="text-xs text-stone-400 block mt-1">شماره: <?= htmlspecialchars($order['order_code']) ?></span>
<span class="text-xs text-stone-400 block">تاریخ: <?= \Bildirchin\Helpers::getJalaliDate($order['created_at']) ?></span>
</div>
</div>
<!-- Buyer -->
<div class="grid grid-cols-2 gap-4 text-xs bg-stone-50 p-4 rounded-xl">
<div>
<span class="text-stone-500">خریدار:</span> <span class="font-bold"><?= htmlspecialchars($order['customer_name']) ?></span>
</div>
<div>
<span class="text-stone-500">شماره تماس:</span> <span class="font-bold"><?= htmlspecialchars($order['customer_phone']) ?></span>
</div>
<div class="col-span-2">
<span class="text-stone-500">نشانی تحویل:</span> <span class="font-bold"><?= htmlspecialchars($order['province']) ?> - <?= htmlspecialchars($order['city']) ?> - <?= htmlspecialchars($order['address']) ?></span>
</div>
</div>
<!-- Table -->
<table class="w-full text-right text-xs border border-stone-200">
<thead class="bg-stone-100 border-b">
<tr>
<th class="p-3 border-l">ردیف</th>
<th class="p-3 border-l">شرح کالا / خدمات</th>
<th class="p-3 border-l">تعداد</th>
<th class="p-3 border-l">قیمت واحد</th>
<th class="p-3">مبلغ کل (تومان)</th>
</tr>
</thead>
<tbody class="divide-y divide-stone-200">
<?php $i = 1; foreach ($order['items'] as $item): ?>
<tr>
<td class="p-3 border-l text-center"><?= $i++ ?></td>
<td class="p-3 border-l font-bold"><?= htmlspecialchars($item['product_name']) ?></td>
<td class="p-3 border-l text-center"><?= \Bildirchin\Helpers::toPersianDigits($item['quantity']) ?></td>
<td class="p-3 border-l"><?= \Bildirchin\Helpers::formatPrice($item['unit_price']) ?></td>
<td class="p-3 font-bold"><?= \Bildirchin\Helpers::formatPrice($item['total_price']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot class="bg-stone-50 font-bold border-t">
<tr>
<td colspan="4" class="p-3 text-left border-l">مبلغ نهایی قابل پرداخت:</td>
<td class="p-3 text-amber-900 text-sm font-black"><?= \Bildirchin\Helpers::formatPrice($order['final_amount']) ?></td>
</tr>
</tfoot>
</table>
<!-- Signatures -->
<div class="grid grid-cols-2 gap-10 pt-10 text-xs text-center">
<div>
<span class="block font-bold">مهر و امضای فروشنده</span>
<span class="text-stone-400 mt-1 block">مجتمع پرورشی بلدرچین زرین</span>
</div>
<div>
<span class="block font-bold">امضا و تایید خریدار</span>
</div>
</div>
</div>
</body>
</html>