From 2acc7787e73c966c3fc1794d77dd758a3f56b566 Mon Sep 17 00:00:00 2001
From: Camil Staps
Date: Wed, 27 Jul 2016 21:29:57 +0200
Subject: Offer: use Model
---
include/offers-view.php | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
(limited to 'include/offers-view.php')
diff --git a/include/offers-view.php b/include/offers-view.php
index aba4c26..6f3e493 100644
--- a/include/offers-view.php
+++ b/include/offers-view.php
@@ -34,7 +34,7 @@ $_offer = new Offer($_pdo, $_id);
$sort_list = array();
$temp = array(
- 'id' => $_offer->getId(),
+ 'id' => $_offer->id,
'contact' => $_offer->getContact()->name,
'assignments' => '',
'assignments_header' => ''
@@ -43,16 +43,16 @@ $_offer = new Offer($_pdo, $_id);
$temp['assignments'] .= "{$assignment->title}
(".Constants::invoice_valuta."{$assignment->calculate(assignment::SUBTOTAL)} excl. VAT, ".Constants::invoice_valuta."{$assignment->calculate(assignment::TOTAL)} incl. VAT)
{$assignment->getHTMLDescription()}
";
$temp['assignments_header'] .= "{$assignment->title}
(".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;
+ $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->getId() . 3;
+ $sort_list[] = $_offer->getPaymentReceived() . $_offer->id . 3;
}
}
@@ -101,7 +101,7 @@ $_offer = new Offer($_pdo, $_id);
getId()}"));
+ $assignments = BusinessAdmin::getAssignments($_pdo, array("offerId = {$_offer->id}"));
foreach ($assignments as $assignment) {
echo "
{$assignment->id} |
@@ -144,7 +144,7 @@ $_offer = new Offer($_pdo, $_id);
getId()}"));
+ $discounts = BusinessAdmin::getDiscounts($_pdo, array("offerId = {$_offer->id}"));
foreach ($discounts as $discount) {
echo "
{$discount->id} |
--
cgit v1.2.3