Invoice system working

This commit is contained in:
twotalesanimation
2025-12-30 22:10:30 +02:00
parent e8e9b1f03c
commit 94b90f603d
36 changed files with 6523 additions and 53 deletions
@@ -0,0 +1,366 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Invoice #<?php echo e($order->order_number); ?></title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Montserrat', sans-serif;
color: #333;
line-height: 1.6;
background: white;
}
.invoice-container {
max-width: 800px;
margin: 0 auto;
padding: 40px;
background: white;
}
.invoice-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 20px;
border-bottom: 1px solid #1a1a1a;
padding-bottom: 20px;
}
.company-info h1 {
font-family: Abril Fatface;
font-size: 36px;
color: #1a1a1a;
margin-bottom: 10px;
font-weight: normal;
}
.company-details {
font-size: 10px;
color: #666;
line-height: 1.5;
}
.invoice-details {
text-align: right;
/* line-height: 1.5; */
}
.invoice-details h2 {
font-size: 28px;
color: #1a1a1a;
font-weight: normal;
/* margin-bottom: 20px; */
font-family: 'AbrilFatface', Georgia, serif;
}
.detail-row {
display: flex;
justify-content: flex-end;
/* margin-bottom: 8px; */
font-size: 10px;
}
.detail-row strong {
margin-right: 20px;
color: #666;
width: 120px;
}
.detail-row span {
color: #1a1a1a;
width: 150px;
}
.section-title {
font-size: 20px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1px;
color: #666;
margin-top: 20px;
/* margin-bottom: 20px; */
/* border-bottom: 1px solid #e0e0e0; */
padding-bottom: 12px;
}
.customer-info {
display: flex;
/* gap: 80px; */
/* margin-bottom: 40px; */
font-size: 12px;
}
.customer-info div {
flex: 1;
}
.customer-info h3 {
font-size: 16px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #666;
/* margin-bottom: 8px; */
}
.customer-info p {
color: #1a1a1a;
/* margin-bottom: 4px; */
line-height: 1.5;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 40px;
}
thead {
background-color: #f5f5f5;
}
th {
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #666;
padding: 12px 16px;
text-align: left;
/* border: 1px solid #e0e0e0; */
}
td {
padding: 10px 10px;
/* border: 1px solid #e0e0e0; */
font-size: 13px;
color: #1a1a1a;
}
tr:nth-child(even) {
background-color: #fafafa;
}
.item-name {
font-weight: 500;
}
.item-label {
font-size: 11px;
color: #999;
text-transform: uppercase;
letter-spacing: 0.5px;
/* margin-top: 2px; */
}
.qty {
text-align: center;
}
.price {
text-align: right;
}
.totals-section {
margin-bottom: 40px;
}
.totals-box {
margin-left: auto;
width: 350px;
}
.total-row {
display: flex;
padding: 12px 16px;
font-size: 13px;
}
.total-row strong {
color: #1a1a1a;
}
.total-row span {
color: #666;
text-align: right;
flex: 1;
}
.total-row.subtotal strong {
font-weight: 500;
}
.total-row.shipping strong {
font-weight: 500;
}
.total-row.grand-total {
/* background-color: #f5f5f5; */
/* border: 1px solid #e0e0e0; */
font-size: 15px;
font-weight: 700;
padding: 12px 16px;
}
.total-row.grand-total strong {
color: #1a1a1a;
font-family: 'AbrilFatface', Georgia, serif;
font-weight: normal;
}
.total-row.grand-total span {
color: #1a1a1a;
font-size: 16px;
}
.footer-section {
margin-top: 60px;
padding-top: 30px;
border-top: 1px solid #e0e0e0;
font-size: 12px;
color: #999;
text-align: center;
}
.thank-you {
color: #666;
margin-bottom: 20px;
}
.page-break {
page-break-after: always;
}
</style>
</head>
<body>
<div class="invoice-container">
<!-- Header -->
<div class="invoice-header">
<div class="company-info">
<h1>INVOICE</h1>
<div class="company-details">
<h2>ADDITIONAL DESIGN</h2>
<p>registered trading name of</p>
<p>TWO TALES & CO. (PTY) LTD</p>
<p>REG: 2014/260746/07</p>
<p>VAT: NA</p>
<p>info@additional.co.za</p>
<p>additional.co.za</p>
</div>
</div>
<div class="invoice-details">
<h3>#<?php echo e($order->order_number); ?></h3>
<div class="detail-row">
<strong>Date:</strong>
<span><?php echo e($order->created_at->format('d M Y')); ?></span>
</div>
<div class="detail-row">
<strong>Invoice Date:</strong>
<span><?php echo e(now()->format('d M Y')); ?></span>
</div>
<div class="detail-row">
<strong>Order Status:</strong>
<span style="text-transform: capitalize;"><?php echo e($order->status); ?></span>
</div>
</div>
</div>
<!-- Customer Info -->
<div class="customer-info">
<div>
<h3>Bill To</h3>
<p><?php echo e($order->customer_name); ?></p>
<p><?php echo e($order->customer_email); ?></p>
<p><?php echo e($order->customer_phone); ?></p>
</div>
<div>
<h3>Ship To</h3>
<p><?php echo e($order->shipping_address); ?></p>
</div>
</div>
<!-- Items Table -->
<div class="section-title">Order Items</div>
<table>
<thead>
<tr>
<th>Description</th>
<th class="qty">Quantity</th>
<th class="price">Unit Price</th>
<th class="price">Total</th>
</tr>
</thead>
<tbody>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $order->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td>
<div class="item-name"><?php echo e($item->product->name); ?></div>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item->type === 'wallpaper' && $item->length): ?>
<div class="item-label"><?php echo e($item->length); ?>m length</div>
<?php elseif($item->type === 'mural' && $item->width && $item->height): ?>
<div class="item-label"><?php echo e($item->width); ?>m × <?php echo e($item->height); ?>m (<?php echo e($item->width * $item->height); ?>m²)</div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item->is_sample): ?>
<div class="item-label">Sample</div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($item->specification): ?>
<div class="item-label">Specification: <?php echo e($item->specification); ?></div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
</td>
<td class="qty"><?php echo e($item->quantity); ?></td>
<td class="price">R <?php echo e(number_format($item->price, 2)); ?></td>
<td class="price">R <?php echo e(number_format($item->quantity * $item->price, 2)); ?></td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
</tbody>
</table>
<!-- Totals -->
<div class="totals-section" style="text-align: right;">
<div class="totals-box">
<div class="total-row subtotal">
<strong>Subtotal</strong>
<span>R <?php echo e(number_format($order->items->sum(fn($item) => $item->quantity * $item->price), 2)); ?></span>
</div>
<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($order->shipping_fee): ?>
<div class="total-row shipping">
<strong>Shipping</strong>
<span>R <?php echo e(number_format($order->shipping_fee, 2)); ?></span>
</div>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
<div class="total-row grand-total">
<strong>Total</strong>
<span>R <?php echo e(number_format($order->total, 2)); ?></span>
</div>
</div>
</div>
<div style="text-align: center;">
<strong>PAID VIA YOCO</strong>
</div>
<!-- Footer -->
<div class="footer-section">
<div class="thank-you">
<p>ADDITIONAL DESIGN is a registered trading name of TWO TALES & CO. (PTY) LTD</p>
</div>
<!-- <p>This is an automatically generated invoice. No signature is required.</p> -->
<!-- <p style="margin-top: 10px; color: #ccc;">Generated on <?php echo e(now()->format('d M Y H:i')); ?></p> -->
</div>
</div>
</body>
</html><?php /**PATH /var/www/additional_design/resources/views/invoices/order-invoice.blade.php ENDPATH**/ ?>