Add excursion option
Change-Id: I70133582d92c3a6385fefb46a99743d47f68cd46
diff --git a/invoice.php b/invoice.php
index 2892865..cbc45e6 100644
--- a/invoice.php
+++ b/invoice.php
@@ -12,7 +12,7 @@
$FULL_VAT=0.19;
function create_invoice(User $user)
{
- global $FULL_VAT, $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, $EXCURSION;
$vat_sum = 0;
$invoice = new InvoicePrinter("A4", "€", "en");
$invoice->lang['product'] = "Item";
@@ -36,7 +36,7 @@
$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, false, -$STUDENT_DISCOUNT);
if($user->conference_dinner) {
- $invoice->addItem('Conference Dinner' . ($user->vegetarian_dinner ? " (vegetarian option)" : ""), 'The conference dinner will take place on 20 July.', 1, false, $CONFERENCE_DINNER, $CONFERENCE_DINNER * $FULL_VAT, $CONFERENCE_DINNER);
+ $invoice->addItem('Conference Dinner' . ($user->vegetarian_dinner ? " (vegetarian option)" : ""), 'The conference dinner takes place on 20 July.', 1, false, $CONFERENCE_DINNER, $CONFERENCE_DINNER * $FULL_VAT, $CONFERENCE_DINNER);
$vat_sum += $CONFERENCE_DINNER * $FULL_VAT;
}
$lunch_count = 0;
@@ -69,6 +69,11 @@
$invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $LUNCH, $lunch_count * $LUNCH * $FULL_VAT, $lunch_count * $LUNCH);
// $invoice->addTotal('Discount', $STUDENT_DISCOUNT);
+ if ($user->excursion) {
+ $vat_sum += $EXCURSION * $FULL_VAT;
+ $invoice->addItem('Excursion', 'The excursion takes place on the afternoon 21 July.', 1, false, $EXCURSION, $EXCURSION * $FULL_VAT, $EXCURSION);
+ }
+
/* Add totals */
$invoice->addTotal('Gross', $user->total_due);