<?php

include_once 'User.php';
use \User as User;

require 'vendor/autoload.php';

use Konekt\PdfInvoice\InvoicePrinter;

#include_once '../src/InvoicePrinter.php';
include 'config.php';
$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, $EXCURSION;
    $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->flipflop();
    $invoice->lang['to'] = "to";
    $invoice->lang['from'] = "from";
    $invoice->setFrom(['ICLC-conference / Administration', 'Leibniz Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
    $invoice->setTo([($user->title? $user->title . ' ' : ''). $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();
    /* Adding Items in table */
    if ($user->earlybird_registration) {
        $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, false, -$STUDENT_DISCOUNT);
    if($user->conference_dinner)  {
        $net = $CONFERENCE_DINNER / (1 + $FULL_VAT);
        $vat = $CONFERENCE_DINNER - $net;
        $invoice->addItem('Conference Dinner' . ($user->vegetarian_dinner ? " (vegetarian option)" : ""), 'The conference dinner takes place on 20 July.', 1, false, $net, $vat, $CONFERENCE_DINNER);
        $vat_sum += $vat;
    }
    $lunch_count = 0;
    $lunch_details = "";
    $i = 0;
    if ($user->lunch_day_1 && $user->lunch_day_1 != "--") {
        if ($i > 0)
            $lunch_details .= ", ";
        $lunch_count++;
        $lunch_details .= "Day 1: " . $user->lunch_day_1;
        $i++;
    }
    if ($user->lunch_day_2 && $user->lunch_day_2 != "--") {
        if ($i > 0)
            $lunch_details .= ", ";
        $lunch_count++;
        $lunch_details .= "Day 2: " . $user->lunch_day_2;
        $i++;
    }
    if ($user->lunch_day_3 && $user->lunch_day_3 != "--") {
        if ($i > 0)
            $lunch_details .= ", ";
        $lunch_count++;
        $lunch_details .= "Day 3: " . $user->lunch_day_3;
        $i++;
    }

    if ($lunch_count > 0) {
        $net = $lunch_count * $LUNCH / (1 + $FULL_VAT);
        $vat = $lunch_count * $LUNCH - $net;
        $vat_sum += $vat;
        $invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $net,  $vat, $lunch_count * $LUNCH);

    }

    if ($user->excursion) {
        $net = $EXCURSION / (1 + $FULL_VAT);
        $vat = $EXCURSION - $net;
        $vat_sum += $vat;
        $invoice->addItem('Guided City Walk', 'The Guided City Walk takes place in the late afternoon of 21 July.', 1, false, $net, $vat, $EXCURSION);
    }

    /* Add totals */
    $invoice->addTotal('Net sum', $user->total_due-$vat_sum);

    if ($vat_sum > 0) {
        $invoice->addTotal('+ VAT', $vat_sum, false);
    }
    $invoice->addTotal('Total due', $user->total_due, true);

    $invoice->addTitle("Payment Details");

    $invoice->addParagraph("Please transfer the total amount due to our account: ");

    $invoice->addParagraph("Leibniz-Institute for the German Language
IBAN: DE70 6708 0050 0694 9411 00
BIC: DRESDEFF670
Commerzbank Mannheim
Reference: ICLC-10-" . $user->id . "

If you have any questions about this invoice, please contact us via buchhaltung@ids-mannheim.de.
");
    $invoice->setFooterNote("Leibniz Institute for the German Language, Civil Law Foundation, VAT ID: DE 143 845 359");

    /* Render */
    $ret = $invoice->render('example4.pdf', 'S'); /* I => Display on browser, D => Force Download, F => local path save, S => return document path */
    return $ret;
}

/*
$user = new User();
$user->id = 107;
$user->first_name = "John";
$user->last_name = "Урсула";
$user->organization = "Урсула ACME Inc.";
$user->street = "123 Main St.";
$user->zip = "12345";
$user->city = "Mannheim";
$user->country = "Germany";
$user->total_due = 285.0;
$user->student = true;
$user->lunch_day_1 = "vegan";
$user->lunch_day_2 = "non-vegetarian";
$user->conference_dinner = true;
create_invoice($user);
*/
?>