Indicate VAR on invoice
Change-Id: I7fcb9a9a2e68a63992d6002b1a437b68a3db8597
diff --git a/invoice.php b/invoice.php
index 8d57898..267b603 100644
--- a/invoice.php
+++ b/invoice.php
@@ -9,20 +9,21 @@
#include_once '../src/InvoicePrinter.php';
include 'config.php';
-
+$FULL_VAT=0.19;
function create_invoice(User $user)
{
- global $SERVICE_ACRONYM, $SERVICE_NAME, $SERVICE_LOGO, $REGULAR_CONFERENCE_FEE, $EARLYBIRD_CONFERENCE_FEE, $STUDENT_DISCOUNT, $CONFERENCE_DINNER, $LUNCH;
-
+ global $FULL_VAT, $SERVICE_ACRONYM, $SERVICE_NAME, $SERVICE_LOGO, $REGULAR_CONFERENCE_FEE, $EARLYBIRD_CONFERENCE_FEE, $STUDENT_DISCOUNT, $CONFERENCE_DINNER, $LUNCH;
+ $vat_sum = 0;
$invoice = new InvoicePrinter("A4", "€", "en");
$invoice->lang['product'] = "Item";
+ $invoice->lang['discount'] = "VAT " . $FULL_VAT * 100 . "%";
/* Header Settings */
$invoice->setLogo(str_replace(".svg", ".png", $SERVICE_LOGO));
$invoice->setColor('#4bb044');
$invoice->setType('Invoice');
$invoice->setReference('ICLC-10-' . $user->id);
$invoice->setDate(date('Y-m-d', time()));
- $invoice->setFrom(['', 'Leibniz-Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
+ $invoice->setFrom(['ICLC-conference / Administration', 'Leibniz-Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
$invoice->setTo([$user->first_name . ' ' . $user->last_name, $user->organization, $user->street, $user->zip . ' ' . $user->city, $user->country]);
$invoice->setDue(date('Y-m-d', strtotime('+2 weeks')));
// $invoice->hide_tofrom();
@@ -31,9 +32,11 @@
$invoice->addItem( $SERVICE_ACRONYM . ' Early Bird Registration', $SERVICE_NAME, 1, false, $EARLYBIRD_CONFERENCE_FEE, false, $EARLYBIRD_CONFERENCE_FEE);
} else
$invoice->addItem( $SERVICE_ACRONYM . ' Registration', $SERVICE_NAME, 1, false, $REGULAR_CONFERENCE_FEE, false, $REGULAR_CONFERENCE_FEE);
- if($user->student) $invoice->addItem('Student Discount', 'Student discount', 1, false, "", $STUDENT_DISCOUNT, -$STUDENT_DISCOUNT);
- if($user->conference_dinner)
- $invoice->addItem('Conference Dinner', 'The conference dinner will take place on 20 July.', 1, false, $CONFERENCE_DINNER, false, $CONFERENCE_DINNER);
+ if($user->student) $invoice->addItem('Student Discount', 'Student discount', 1, false, - $STUDENT_DISCOUNT, false, -$STUDENT_DISCOUNT);
+ if($user->conference_dinner) {
+ $invoice->addItem('Conference Dinner', 'The conference dinner will take place on 20 July.', 1, false, $CONFERENCE_DINNER, $CONFERENCE_DINNER * $FULL_VAT, $CONFERENCE_DINNER);
+ $vat_sum += $CONFERENCE_DINNER * $FULL_VAT;
+ }
/* Add totals */
$invoice->addTotal('Total', $user->total_due);
$lunch_count = 0;
@@ -60,11 +63,13 @@
$lunch_details .= "Day 3: " . $user->lunch_day_3;
$i++;
}
+ $vat_sum += $lunch_count * $LUNCH * $FULL_VAT;
if ($lunch_count > 0)
- $invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $LUNCH, false, $lunch_count * $LUNCH);
+ $invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $LUNCH, $lunch_count * $LUNCH * $FULL_VAT, $lunch_count * $LUNCH);
// $invoice->addTotal('Discount', $STUDENT_DISCOUNT);
$invoice->addTotal('Total due', $user->total_due, true);
+ $invoice->addTotal('incl. VAT', $vat_sum, false);
$invoice->addTitle("Payment Details");
@@ -74,7 +79,6 @@
IBAN: DE70 6708 0050 0694 9411 00
BIC: DRESDEFF670
Commerzbank Mannheim
-
Reference: ICLC-10-" . $user->id . "
VAT ID: DE 143 845 359
@@ -98,6 +102,8 @@
$user->country = "Germany";
$user->total_due = 260.0;
$user->student = true;
+$user->lunch_day_1 = "vegan";
+$user->lunch_day_2 = "non-vegetarian";
$user->conference_dinner = true;
create_invoice($user);
*/