. */ require_once('index.php'); require('header.php'); ?>

Welcome

= CURDATE()"))); ?>
CURDATE()"))); ?>
'1970-01-01'", "`invoice_date`<=CURDATE()", "`payment_received` <= '1970-01-01' OR `payment_received` IS NULL"))); ?>
Currently active offers
= CURDATE()")); $list = array(); foreach ($offers as $offer) { $start = BusinessAdmin::formatDate($offer->getStartDate(), false); $end = BusinessAdmin::formatDate($offer->getEndDate(), false); $since = mktime(0,0,0,date("n"),date("j"),date("Y")) - $offer->getStartDate(); $total = $offer->getEndDate() - $offer->getStartDate(); $percentage = ($total == 0) ? 100 : round($since / $total * 100); // We want to sort on percentage (DESC) and secondly end date (ASC) so start date (DESC) $list[str_pad($percentage, 3, '0', STR_PAD_LEFT) . $offer->getStartDate()] = array( 'start' => $start, 'end' => $end, 'id' => $offer->getId(), 'contactClientName' => $offer->getContact()->getClient()->getName(), 'percentage' => $percentage, 'price_excl' => constants::invoice_valuta . $offer->calculate(offer::SUBTOTAL), 'price_incl' => constants::invoice_valuta . $offer->calculate(offer::TOTAL) ); } krsort($list, SORT_STRING); foreach ($list as $item) { echo "

#{$item['id']} to {$item['contactClientName']} ({$item['start']} - {$item['end']}; {$item['price_excl']} excl. VAT, {$item['price_incl']} incl. VAT){$item['percentage']}% complete

"; } if (count($list) == 0) { echo "There are no currently active offers."; } ?>
Finished offers
CURDATE()")); foreach ($offers as $offer) { echo ""; echo ""; echo ""; echo ""; echo ""; } if (count($offers) == 0) { echo ""; } ?>
# Contact Offer ended
{$offer->getId()}{$offer->getContact()->getClient()->getName()}".BusinessAdmin::formatDate($offer->getEndDate(), false)."
There are no offers that need an invoice.
Currently open invoices
'1970-01-01'", "`invoice_date`<=CURDATE()", "`payment_received` <= '1970-01-01' OR `payment_received` IS NULL")); if (count($offers) == 0) { echo ""; } else { foreach ($offers as $offer) { echo ""; echo ""; echo ""; echo ""; echo ""; } } ?>
# Contact Invoice sent
There are no currently open invoices.
{$offer->getId()}{$offer->getContact()->getClient()->getName()}".BusinessAdmin::formatDate($offer->getInvoiceDate(), false)."
Timeline
    $offer->getId(), 'contact' => $offer->getContact()->getName(), 'assignments' => '', 'assignments_header' => '' ); foreach ($offer->getAssignments() as $assignment) { $temp['assignments'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)

    {$assignment->getDescription()}

    "; $temp['assignments_header'] .= "{$assignment->getTitle()}
    (".constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)
    "; } $list[] = array_merge($temp, array('type' => 'start', 'time' => $offer->getStartDate(), 'description' => 'Offer started')); $sort_list[] = $offer->getStartDate() . $offer->getId() . 0; $list[] = array_merge($temp, array('type' => 'end', 'time' => $offer->getEndDate(), 'description' => 'Offer ended')); $sort_list[] = $offer->getEndDate() . $offer->getId() . 1; if ($offer->getInvoiceDate() > 0) { $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $offer->getInvoiceDate(), 'description' => 'Invoice sent')); $sort_list[] = $offer->getInvoiceDate() . $offer->getId() . 2; if ($offer->getPaymentReceived() > 0) { $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $offer->getPaymentReceived(), 'description' => 'Payment received')); $sort_list[] = $offer->getPaymentReceived() . $offer->getId() . 3; } } } array_multisort($sort_list, SORT_DESC, $list); foreach ($list as $item) { if ($item['time'] > time()) { continue; } echo ""; switch ($item['type']) { case 'start': echo "
    "; break; case 'end': echo "
    "; break; case 'invoice': echo "
    "; break; case 'payment_received': echo "
    "; break; } echo "
    "; echo "

    #{$item['id']} to {$item['contact']}: {$item['description']}

    ".BusinessAdmin::formatDate($item['time'],false,true,true)."

    "; switch ($item['type']) { case 'start': echo "
    {$item['assignments']}
    "; break; default: echo "
    {$item['assignments_header']}
    "; } echo "
    "; echo ""; } if (count($list) == 0) { echo '
  • Welcome to BusinessAdmin!

    When you start adding projects, a timeline will appear here.
  • '; } ?>