From db092c4928b2c9fc7e3c06fee5fc5ecc74d76e79 Mon Sep 17 00:00:00 2001 From: saravanakumar_kandasami Date: Fri, 28 Apr 2017 14:33:00 +0530 Subject: [PATCH] alternatepopdf code --- application/controllers/purchaseorderform.php | 28 + application/logs/log-2017-04-28.php | 4 + .../third_party/dompdf/lib/fonts/log.htm | 20 +- application/views/alterpurchaseorder.php | 1408 ++++++++++++++++- application/views/alterpurchaseorderprint.php | 67 + application/views/purchaseorder.php | 4 +- application/views/requisitionlist.php | 12 +- 7 files changed, 1514 insertions(+), 29 deletions(-) create mode 100644 application/logs/log-2017-04-28.php create mode 100644 application/views/alterpurchaseorderprint.php diff --git a/application/controllers/purchaseorderform.php b/application/controllers/purchaseorderform.php index 81eaa40c..061125ce 100644 --- a/application/controllers/purchaseorderform.php +++ b/application/controllers/purchaseorderform.php @@ -51,6 +51,34 @@ class purchaseorderform extends BaseController $this->loadViews("alterpurchaseorder", $this->global, NULL); + } + function alternatepoprint() + { + $this->global['pageTitle'] = 'Siddharth : Alternate PO print'; + + $this->load->View("alterpurchaseorderprint", $this->global, NULL); + $php = $this->output->get_output(); + + // Load library + $this->load->library('dompdf_gen'); + + + require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); + $dompdf = new DOMPDF(); + $dompdf->set_paper('A4', 'portrait'); + $dompdf->load_html($php); + + $dompdf->render(); + + // add the header + $canvas = $dompdf->get_canvas(); + $font = Font_Metrics::get_font("helvetica", "bold"); + + // the same call as in my previous example + $canvas->page_text(72, 18, "Page: {PAGE_NUM} of {PAGE_COUNT}", + $font, 6, array(0,0,0)); + + $dompdf->stream($filename); } function pageNotFound() diff --git a/application/logs/log-2017-04-28.php b/application/logs/log-2017-04-28.php new file mode 100644 index 00000000..03154443 --- /dev/null +++ b/application/logs/log-2017-04-28.php @@ -0,0 +1,4 @@ + + +ERROR - 2017-04-28 11:01:14 --> Severity: Warning --> explode() expects parameter 2 to be string, array given C:\xampp\htdocs\siddharth_application\application\third_party\dompdf\include\style.cls.php 948 +ERROR - 2017-04-28 11:01:17 --> Severity: Notice --> Undefined variable: filename C:\xampp\htdocs\siddharth_application\application\controllers\purchaseorderform.php 81 diff --git a/application/third_party/dompdf/lib/fonts/log.htm b/application/third_party/dompdf/lib/fonts/log.htm index 09d431cf..073d9033 100644 --- a/application/third_party/dompdf/lib/fonts/log.htm +++ b/application/third_party/dompdf/lib/fonts/log.htm @@ -1 +1,19 @@ -2,048 KB 505.0690 ms
\ No newline at end of file +6,144 KB 3,717.6330 ms
+ +

A PHP Error was encountered

+ +

Severity: Warning

+

Message: explode() expects parameter 2 to be string, array given

+

Filename: include/style.cls.php

+

Line Number: 948

+ +
+ +

A PHP Error was encountered

+ +

Severity: Notice

+

Message: Undefined variable: filename

+

Filename: controllers/purchaseorderform.php

+

Line Number: 81

+ +
\ No newline at end of file diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 79053462..c7a3b676 100644 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -1,14 +1,21 @@ - + .table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {border: 1px solid #333;} + +
-
- -
-

Alternate Purchase Order

+
+

Emergency Purchase Order

@@ -16,7 +23,7 @@
-
+ +
@@ -95,7 +109,7 @@
'SupplierName'); + $options = array("0"=>'Supplier Name'); //print_r( $options); if(!empty($POType)) @@ -150,26 +164,78 @@
- + + -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Item and DescriptionQtyRate per unitExcide DutyVatGSTCSTOther TaxesAmount (Rs)
1Resin - (A grade)100120500100013007002001,23,800
2Dry Sand - (A grade)10001200500010000130007000200012,38,000
+
+ +

Sub Total (Rs):13,61,800

+
+

Excise Duty (Rs):5500

+

Vat (Rs):11000

+

GST (Rs):14300

+

CST (Rs) :7700

+

Other Taxes (Rs) :2200

+
+

Total Amount (Rs):13,61,800

+
\ No newline at end of file diff --git a/application/views/purchaseorder.php b/application/views/purchaseorder.php index 7e8d4a19..665b6e4f 100644 --- a/application/views/purchaseorder.php +++ b/application/views/purchaseorder.php @@ -606,7 +606,7 @@ function myFunction() {