<?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;
    $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->lang['to'] = "billing from";
    $invoice->lang['from'] = "billing to";
    $invoice->setTo(['ICLC-conference / Administration', 'Leibniz Institute for the German Language', 'R5 6-13', '68181 Mannheim', 'Germany']);
    $invoice->setFrom([($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)  {
        $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);
        $vat_sum += $CONFERENCE_DINNER * $FULL_VAT;
    }
    $lunch_count = 0;
    $lunch_details = "";
    $i = 0;
    if ($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) {
        if ($i > 0)
            $lunch_details .= ", ";
        $lunch_count++;
        $lunch_details .= "Day 2: " . $user->lunch_day_2;
        $i++;
    }
    if ($user->lunch_day_3) {
        if ($i > 0)
            $lunch_details .= ", ";
        $lunch_count++;
        $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, $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->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);
*/
?>