<?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';

function create_invoice(User $user)
{
    global $SERVICE_ACRONYM, $SERVICE_NAME, $SERVICE_LOGO, $REGULAR_CONFERENCE_FEE, $EARLYBIRD_CONFERENCE_FEE, $STUDENT_DISCOUNT, $CONFERENCE_DINNER, $LUNCH;

    $invoice = new InvoicePrinter("A4", "€", "en");
    $invoice->lang['product'] = "Item";
    /* 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->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();
    /* 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, -$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);
    /* Add totals */
    $invoice->addTotal('Total', $user->total_due);
    $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++;
    }

    if ($lunch_count > 0)
        $invoice->addItem('Lunch', $lunch_details, $lunch_count, false, $LUNCH, false, $lunch_count * $LUNCH);
    // $invoice->addTotal('Discount', $STUDENT_DISCOUNT);
    $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 . "
");
    //$invoice->setFooterNote("xx");

    /* 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 = 260.0;
$user->student = true;
$user->conference_dinner = true;
create_invoice($user);
*/
?>