├── README.md ├── invoice.pdf ├── pdfCreator.php └── template.php /README.md: -------------------------------------------------------------------------------- 1 | tax-invoice-template 2 | ==================== 3 | Tax invoice template sample for India. 4 | 5 | Installation 6 | ============ 7 | 8 | * Needs php5, dompdf in ./ 9 | * dompdf needs to be configured with DOMPDF_ENABLE_REMOTE to true 10 | 11 | Usage 12 | ===== 13 | 14 | From the shell, invoke it as "php pdfCreator.php" 15 | 16 | Credits: 17 | ======== 18 | 19 | dompdf - https://github.com/dompdf/dompdf 20 | -------------------------------------------------------------------------------- /invoice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exotel/tax-invoice-template/bd29fc0e8137bd3e0dd29f16377acc453726fd19/invoice.pdf -------------------------------------------------------------------------------- /pdfCreator.php: -------------------------------------------------------------------------------- 1 | curDir = $cur_dir; 11 | } 12 | 13 | private function getHtml() { 14 | ob_start(); 15 | include($this->curDir . '/template.php'); 16 | $retStr = ob_get_contents(); 17 | ob_end_clean(); 18 | return $retStr; 19 | } 20 | 21 | public function getPdf() { 22 | $html = $this->getHtml(); 23 | $dompdf = new DOMPDF(); 24 | $dompdf->load_html($html); 25 | $dompdf->render(); 26 | $output = $dompdf->output(); 27 | 28 | $pdfFileName = $this->curDir.'/invoice.pdf'; 29 | file_put_contents($pdfFileName, $output); 30 | } 31 | } 32 | 33 | 34 | $pdfCreator = new pdfCreator(); 35 | $pdfCreator->getPdf(); 36 | -------------------------------------------------------------------------------- /template.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
55 | ![]() |
57 |
58 | Tax Invoice59 | Date: 60 | Billing Cycle: 01/01/2013 to 01/02/2013 61 | Invoice Number: BF123 62 | Due Date: 10/01/2013 63 | |
64 |
67 | | |
70 |
71 | Invoice To: FooBar
72 | Invoice Amount: Rs. 11,236
73 |
74 | |
75 |
79 |
Summary | 83 |||
Activity | 86 |Tax | 87 |Amount (INR) | 88 |
Summary Line item 1 | 91 |Tax percent (12.36%) | 92 |Rs. 11,236 | 93 |
96 | | Subtotal | 97 |Rs. 10,000 | 98 |
101 | | Tax | 102 |Rs. 1236 | 103 |
106 | | Total | 107 |Rs. 11,236 | 108 |
112 |
Usage Line Item 1 | 116 |||
Description | 119 |Date | 120 |Amount (INR) | 121 |
Line item 1.1 desc | 125 |Usage date | 126 |Amount | 127 |
132 | 133 |
137 | To make a payment:
143 | 138 | Your payment options 139 | ST Reg no: Your service tax number 140 | Service Category: Service tax category 141 | Service category code: Service tax code 142 | |
144 |
145 |
146 | Address 147 | Foo Baar 148 | Dubai 149 | Dubai Main Road 150 | Vivekanandar Street 151 | |
152 |
156 |
160 | No human was involved in creating this invoice, so, no signature is needed 161 | | 162 |