Marc Kupietz | 9879bc2 | 2023-03-09 08:21:11 +0100 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | require '../vendor/autoload.php'; |
| 4 | |
| 5 | use Konekt\PdfInvoice\InvoicePrinter; |
| 6 | |
| 7 | include '../src/InvoicePrinter.php'; |
| 8 | $invoice = new InvoicePrinter("A4", "€", "en"); |
| 9 | $invoice->lang['product'] = "Item"; |
| 10 | /* Header Settings */ |
| 11 | $invoice->setLogo('images/iclc-logo.png'); |
| 12 | $invoice->setColor('#4bb044'); |
| 13 | $invoice->setType('Invoice'); |
| 14 | $invoice->setReference('55033645'); |
| 15 | $invoice->setDate(date('Y-m-d', time())); |
| 16 | $invoice->setFrom(['', 'Leibniz-Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']); |
| 17 | $invoice->setTo(['', 'Marc Kupietz', 'U4 4', '68161 Mannheim', 'Germany']); |
| 18 | |
| 19 | $invoice->setDue(date('Y-m-d', strtotime('+2 weeks'))); |
| 20 | // $invoice->hide_tofrom(); |
| 21 | /* Adding Items in table */ |
| 22 | $invoice->addItem('ICLC-10 Early Bird Standard Registration', '10ᵗʰ International Contrastive Linguistics Conference, 18-21 July in Mannheim (Germany)', 1, false, 280, false, 280); |
| 23 | $invoice->addItem('Conference Dinner', 'The conference dinner will take place on 20 July.', 1, false, 60, false, 60); |
| 24 | /* Add totals */ |
| 25 | $invoice->addTotal('Total', 340); |
| 26 | $invoice->addTotal('Total due', 340, true); |
| 27 | |
| 28 | $invoice->addTitle("Payment Details"); |
| 29 | |
| 30 | $invoice->addParagraph("Please make payment by Bank Transfer, quoting the above REFERENCE and INVOICE NUMBER as shown above. Bank details are given below:"); |
| 31 | |
| 32 | $invoice->addParagraph("Leibniz-Institute for the German Language |
| 33 | IBAN: DE70 6708 0050 0694 9411 00 |
| 34 | BIC: DRESDEFF670 |
| 35 | Commerzbank Mannheim |
| 36 | |
| 37 | VAT ID: DE 143845359 |
| 38 | "); |
| 39 | $invoice->setFooterNote("xx"); |
| 40 | /* Render */ |
| 41 | $invoice->render('example2.pdf', 'I'); /* I => Display on browser, D => Force Download, F => local path save, S => return document path */ |