From 1ec8d12a7b125d41ecb723c5d83f2afef95408e9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 31 Jul 2016 09:40:25 +0200 Subject: 0.5.2 emails --- include/offers-view.php | 148 +++++++++++++++++++++++++++--------------------- 1 file changed, 84 insertions(+), 64 deletions(-) (limited to 'include/offers-view.php') diff --git a/include/offers-view.php b/include/offers-view.php index 802f42f..d96e9ed 100644 --- a/include/offers-view.php +++ b/include/offers-view.php @@ -21,70 +21,6 @@ require_once('./login.php'); $_offer = new Offer($_pdo, $_id); ?> -
-
-
- Timeline -
- -
-
    - $_offer->id, - 'contact' => $_offer->getContact()->name, - 'assignments' => '', - 'assignments_header' => '' - ); - foreach ($_offer->getAssignments() as $assignment) { - $temp['assignments'] .= "{$assignment->title}
    (".Constants::invoice_valuta."{$assignment->calculate(Calculatable::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$assignment->calculate(Calculatable::TOTAL)} incl. VAT)

    {$assignment->getHTMLDescription()}

    "; - $temp['assignments_header'] .= "{$assignment->title}
    (".Constants::invoice_valuta."{$assignment->calculate(Calculatable::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$assignment->calculate(Calculatable::TOTAL)} incl. VAT)
    "; - } - $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->start_date, 'description' => 'Offer started')); - $sort_list[] = $_offer->start_date . $_offer->id . 0; - $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->end_date, 'description' => 'Offer ended')); - $sort_list[] = $_offer->end_date . $_offer->id . 1; - if ($_offer->invoice_date > 0) { - $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->invoice_date, 'description' => 'Invoice sent')); - $sort_list[] = $_offer->invoice_date . $_offer->id . 2; - if ($_offer->getPaymentReceived() > 0) { - $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received')); - $sort_list[] = $_offer->getPaymentReceived() . $_offer->id . 3; - } - } - - array_multisort($sort_list, SORT_DESC, $list); - $i = 0; - 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 ""; - } - ?> -
-
- -
- -
Assignments
@@ -171,3 +107,87 @@ $_offer = new Offer($_pdo, $_id);
+
+
+
+
Tools
+
+ accepted ? + ['Accepted', 'btn-success'] : + ['Not accepted', 'btn-default']; + $eligible = $_offer->getPaymentEligibility() ? + ['Eligible for online payment', 'btn-success'] : + ['Not eligible for online payment', 'btn-default']; + ?> + + + Send invoice to contact + Delete +
+
+
+
+
+
+ Timeline +
+ +
+
    + $_offer->id, + 'contact' => $_offer->getContact()->name, + 'assignments' => '', + 'assignments_header' => '' + ); + foreach ($_offer->getAssignments() as $assignment) { + $temp['assignments'] .= "{$assignment->title}
    (".Constants::invoice_valuta."{$assignment->calculate(Calculatable::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$assignment->calculate(Calculatable::TOTAL)} incl. VAT)

    {$assignment->getHTMLDescription()}

    "; + $temp['assignments_header'] .= "{$assignment->title}
    (".Constants::invoice_valuta."{$assignment->calculate(Calculatable::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$assignment->calculate(Calculatable::TOTAL)} incl. VAT)
    "; + } + $list[] = array_merge($temp, array('type' => 'start', 'time' => $_offer->start_date, 'description' => 'Offer started')); + $sort_list[] = $_offer->start_date . $_offer->id . 0; + $list[] = array_merge($temp, array('type' => 'end', 'time' => $_offer->end_date, 'description' => 'Offer ended')); + $sort_list[] = $_offer->end_date . $_offer->id . 1; + if ($_offer->invoice_date > 0) { + $list[] = array_merge($temp, array('type' => 'invoice', 'time' => $_offer->invoice_date, 'description' => 'Invoice sent')); + $sort_list[] = $_offer->invoice_date . $_offer->id . 2; + if ($_offer->getPaymentReceived() > 0) { + $list[] = array_merge($temp, array('type' => 'payment_received', 'time' => $_offer->getPaymentReceived(), 'description' => 'Payment received')); + $sort_list[] = $_offer->getPaymentReceived() . $_offer->id . 3; + } + } + + array_multisort($sort_list, SORT_DESC, $list); + $i = 0; + 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 ""; + } + ?> +
+
+ +
+ +
-- cgit v1.2.3