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