├── 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 | Invoice 4 | 48 | 49 | 50 |
51 | 52 | 53 | 54 | 57 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 76 | 77 |
55 | 56 | 58 |

Tax Invoice


59 | Date:
60 | Billing Cycle: 01/01/2013 to 01/02/2013
61 | Invoice Number: BF123
62 | Due Date: 10/01/2013
63 |
 
70 |
71 | Invoice To: FooBar 72 | Invoice Amount: Rs. 11,236 73 |
74 |
78 |

 

79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |
Summary
ActivityTaxAmount (INR)
Summary Line item 1Tax percent (12.36%)Rs. 11,236
 SubtotalRs. 10,000
 TaxRs. 1236
 TotalRs. 11,236
111 |

 

112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 |
Usage Line Item 1
DescriptionDateAmount (INR)
Line item 1.1 descUsage dateAmount
131 |

 

132 | 133 | 134 | 135 | 136 | 144 | 152 | 153 | 154 |
137 |
To make a payment:
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 |
143 |
145 |
146 | Address
147 | Foo Baar
148 | Dubai
149 | Dubai Main Road
150 | Vivekanandar Street
151 |
155 |

 

156 | 157 | 158 | 159 | 162 | 163 | 164 |
160 | No human was involved in creating this invoice, so, no signature is needed 161 |
165 |
166 | 167 | 168 | --------------------------------------------------------------------------------