Show total VAT only if VAT > 0
Change-Id: Ic4fa0dd14b36afe7fe1fef8336b36f4cd2374833
diff --git a/invoice.php b/invoice.php
index dde7e85..6bcec79 100644
--- a/invoice.php
+++ b/invoice.php
@@ -39,8 +39,6 @@
$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;
$lunch_details = "";
$i = 0;
@@ -70,8 +68,14 @@
if ($lunch_count > 0)
$invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $LUNCH, $lunch_count * $LUNCH * $FULL_VAT, $lunch_count * $LUNCH);
// $invoice->addTotal('Discount', $STUDENT_DISCOUNT);
+
+ /* Add totals */
+ $invoice->addTotal('Gross', $user->total_due);
+
+ if ($vat_sum > 0) {
+ $invoice->addTotal('incl. VAT', $vat_sum, false);
+ }
$invoice->addTotal('Total due', $user->total_due, true);
- $invoice->addTotal('incl. VAT', $vat_sum, false);
$invoice->addTitle("Payment Details");