@@ -173,7 +178,7 @@ require('./header.php');
}
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
+ echo "
#{$item['id']} to {$item['contactClientName']} ({$item['start']} - {$item['end']}; {$item['price_excl']} excl. VAT, {$item['price_incl']} incl. VAT){$item['percentage']}% complete
";
@@ -206,11 +211,11 @@ require('./header.php');
CURDATE()"));
foreach ($offers as $offer) {
- echo "
";
- echo "{$offer->id} | ";
- echo "{$offer->getContact()->getClient()->name} | ";
- echo "".BusinessAdmin::formatDate($offer->end_date, false)." | ";
- echo "
";
+ echo "
+ {$offer->id} |
+ {$offer->getContact()->getClient()->name} |
+ ".BusinessAdmin::formatDate($offer->end_date, false)." |
+
";
}
if (count($offers) == 0) {
echo "
There are no offers that need an invoice. |
";
@@ -235,6 +240,7 @@ require('./header.php');
# |
Contact |
Invoice sent |
+
Braintree status |
@@ -243,15 +249,35 @@ require('./header.php');
"`invoice_date` > '1970-01-01'",
"`invoice_date`<=CURDATE()",
"NOT EXISTS (SELECT * FROM `".Constants::db_prefix."payment` WHERE `offerId`=`".Constants::db_prefix."offer`.`id`)"));
- if (count($offers) == 0) {
- echo "There are no currently open invoices. |
";
+ $open_offers = BusinessAdmin::getOffers($_pdo,
+ ['EXISTS (SELECT * FROM `'.Constants::db_prefix.'payment` WHERE `offerId`=`'.Constants::db_prefix.'offer`.`id` AND `braintree_id` IS NOT NULL)']);
+ $count = count($offers);
+ foreach ($open_offers as $offer) {
+ if (!$offer->getPayment()->isBraintreeFinished()) {
+ $count++;
+ }
+ }
+ if ($count == 0) {
+ echo "There are no currently open invoices. |
";
} else {
foreach ($offers as $offer) {
- echo "";
- echo "{$offer->id} | ";
- echo "{$offer->getContact()->getClient()->name} | ";
- echo "".BusinessAdmin::formatDate($offer->invoice_date, false)." | ";
- echo "
";
+ echo "
+ {$offer->id} |
+ {$offer->getContact()->getClient()->name} |
+ ".BusinessAdmin::formatDate($offer->invoice_date, false)." |
+ |
+
";
+ }
+ foreach ($open_offers as $offer) {
+ if ($offer->getPayment()->isBraintreeFinished()) {
+ continue;
+ }
+ echo "
+ {$offer->id} |
+ {$offer->getContact()->getClient()->name} |
+ ".BusinessAdmin::formatDate($offer->invoice_date, false)." |
+ {$offer->getPayment()->braintree_status} |
+
";
}
}
?>
--
cgit v1.2.3