You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
6.0 KiB
145 lines
6.0 KiB
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="' . base_url('assets/bower_components/bootstrap/dist/css/bootstrap.min.css') . '">
|
|
<style>
|
|
body { font-size: 14px; font-family: Arial, sans-serif; }
|
|
.invoice-container {
|
|
max-width: 350px; /* Réduire la largeur du cadre */
|
|
margin: 20px auto;
|
|
padding: 20px;
|
|
border: 2px solid #007bff; /* Bordure plus visible */
|
|
border-radius: 10px;
|
|
background: #f0f8ff; /* Couleur de fond plus douce */
|
|
}
|
|
.invoice-header {
|
|
background: #007bff;
|
|
color: white;
|
|
text-align: center;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
padding: 10px;
|
|
border-radius: 10px 10px 0 0;
|
|
}
|
|
.invoice-footer {
|
|
background: #343a40;
|
|
color: white;
|
|
text-align: center;
|
|
font-size: 14px;
|
|
padding: 10px;
|
|
border-radius: 0 0 10px 10px;
|
|
margin-top: 12px;
|
|
}
|
|
table { width: 100%; border-collapse: collapse; }
|
|
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; }
|
|
th { background: #e9ecef; }
|
|
p, strong { color: #333; }
|
|
</style>
|
|
</head>
|
|
<body onload="window.print();">
|
|
<div class="invoice-container">
|
|
<div class="invoice-header">
|
|
' . esc($company_info['company_name']) . '
|
|
</div>
|
|
<p><strong>Facture ID:</strong> ' . esc($order_data['bill_no']) . '</p>
|
|
<p><strong>Nom:</strong> ' . esc($order_data['customer_name']) . '</p>
|
|
<p><strong>Adresse:</strong> ' . esc($order_data['customer_address']) . '</p>
|
|
<p><strong>Téléphone:</strong> ' . esc($order_data['customer_phone']) . '</p>
|
|
|
|
<div style="display: flex;align-items: center;justify-content: space-around;margin-bottom: 3%;">
|
|
<div>
|
|
<p>Signature du client</p>
|
|
</div>
|
|
<div>
|
|
<p>Signature du commercial</p>
|
|
</div>
|
|
</div>
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Produit</th>
|
|
<th>Qté</th>
|
|
<th>Prix</th>
|
|
<th>Total</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>';
|
|
|
|
foreach ($orders_items as $item) {
|
|
$product_data = $Products->getProductData($item['product_id']);
|
|
$html .= '<tr>
|
|
<td>' . esc($product_data['name']) . '</td>
|
|
<td>' . esc($item['qty']) . '</td>
|
|
<td>' . number_format((float)$item['rate'], 2, '.', ' ') . '</td>
|
|
<td>' . number_format((float)$item['amount'], 2, '.', ' ') . '</td>
|
|
</tr>';
|
|
}
|
|
|
|
$html .= ' </tbody>
|
|
</table>
|
|
<table class="table">
|
|
<tr>
|
|
<th>Total:</th>
|
|
<td>' . number_format((float)$order_data['gross_amount'], 2, '.', ' ') . '</td>
|
|
</tr>';
|
|
|
|
if (!empty($order_data['service_charge']) && (float)$order_data['service_charge'] > 0) {
|
|
$html .= '<tr>
|
|
<th>Frais de service:</th>
|
|
<td>' . number_format((float)$order_data['service_charge'], 2, '.', ' ') . '</td>
|
|
</tr>';
|
|
}
|
|
|
|
if (!empty($order_data['vat_charge']) && (float)$order_data['vat_charge'] > 0) {
|
|
$html .= '<tr>
|
|
<th>TVA:</th>
|
|
<td>' . number_format((float)$order_data['vat_charge'], 2, '.', ' ') . '</td>
|
|
</tr>';
|
|
}
|
|
|
|
$html .= '<tr>
|
|
<th>Réduction:</th>
|
|
<td>' . number_format((float)$order_data['discount'], 2, '.', ' ') . '</td>
|
|
</tr>
|
|
<tr>
|
|
<th>Total à payer:</th>
|
|
<td><strong>' . number_format((float)$order_data['net_amount'], 2, '.', ' ') . '</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<th>Statut:</th>
|
|
<td>' . $paid_status . '</td>
|
|
</tr>';
|
|
|
|
// Vérification et ajout des informations de paiement
|
|
if (!empty($order_data['order_payment_mode'])) {
|
|
$html .= '<tr>
|
|
<th>Mode de paiement:</th>
|
|
<td><strong>' . esc($order_data['order_payment_mode']) . '</strong></td>
|
|
</tr>';
|
|
}
|
|
|
|
if (!empty($order_data['tranche_1'])) {
|
|
$html .= '<tr>
|
|
<th>Tranche 1:</th>
|
|
<td><strong>' . number_format((float)$order_data['tranche_1'], 2, '.', ' ') . '</strong></td>
|
|
</tr>';
|
|
}
|
|
|
|
if (!empty($order_data['tranche_2'])) {
|
|
$html .= '<tr>
|
|
<th>Tranche 2:</th>
|
|
<td><strong>' . number_format((float)$order_data['tranche_2'], 2, '.', ' ') . '</strong></td>
|
|
</tr>';
|
|
}
|
|
|
|
$html .= '</table>
|
|
|
|
<div class="invoice-footer">
|
|
Merci pour votre achat !<br>
|
|
<strong>' . esc($company_info['company_name']) . '</strong>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|