invoie pdf template
This commit is contained in:
parent
8a60495a2a
commit
3b6f8c4bea
@ -129,6 +129,7 @@ class Invoice extends BaseController
|
||||
'tax' => (int)$this->request->getPost('invoice_tax'),
|
||||
'discount' => (int)$this->request->getPost('discount'),
|
||||
'total_amount' => (int)$this->request->getPost('grand_total'),
|
||||
'shipping_charge' => (int)$this->request->getPost('shippingCharges'),
|
||||
'order_number' => $this->request->getPost('order_number'),
|
||||
'payment_method' => 'Cash on Delivery', // "Credit Card," "Cash on Delivery," "PayPal","PayTm","Gpay"
|
||||
'payment_status' => 'Pending', //"Paid," "Pending," "Failed," "Refunded," "Canceled," "Authorized," and "Completed."
|
||||
@ -432,7 +433,7 @@ class Invoice extends BaseController
|
||||
|
||||
// Create an mPDF object
|
||||
$mpdf = new Mpdf();
|
||||
|
||||
$mpdf->autoLangToFont = true; $mpdf->autoScriptToLang = true;
|
||||
// Set PDF properties
|
||||
$mpdf->SetTitle('Invoice');
|
||||
$mpdf->SetAuthor('VBP');
|
||||
|
||||
@ -8,7 +8,7 @@ class InvoiceModel extends Model
|
||||
protected $table = 'invoice';
|
||||
protected $primaryKey = 'invoice_id';
|
||||
// protected $allowedFields = ['invoice_id','invoice_number','customer_id','invoice_date','event_id','business_id','created_on','business_id'];
|
||||
protected $allowedFields = ['invoice_id', 'invoice_number', 'customer_id', 'invoice_date', 'due_date', 'subtotal', 'tax', 'discount', 'total_amount', 'payment_status', 'order_number', 'payment_method', 'event_id', 'business_id', 'shipping_address_id', 'billing_address_id', 'created_on', 'created_by', 'updated_on', 'updated_by', 'isactive','billing_address','shipping_address','status'];
|
||||
protected $allowedFields = ['invoice_id', 'invoice_number', 'customer_id', 'invoice_date', 'due_date', 'subtotal', 'tax', 'discount', 'shipping_charge','total_amount', 'payment_status', 'order_number', 'payment_method', 'event_id', 'business_id', 'shipping_address_id', 'billing_address_id', 'created_on', 'created_by', 'updated_on', 'updated_by', 'isactive','billing_address','shipping_address','status'];
|
||||
|
||||
public function saveInvoiceItemDetails($data){
|
||||
$i = 0;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
/* Add your CSS styles here to format the invoice for mPDF */
|
||||
body {
|
||||
@ -261,6 +262,9 @@ if (count($invoiceDateParts) === 3) {
|
||||
<tr>
|
||||
<td colspan="5" align="right">Discount : ₹<?= number_format($value->discount, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Shipping : ₹<?= number_format($value->shipping_charge, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" align="right">Total : ₹<?= number_format($value->subtotal, 2, '.', ',') ?></td>
|
||||
</tr>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user