aboutsummaryrefslogtreecommitdiff
path: root/include/offers.php
diff options
context:
space:
mode:
authorCamil Staps2016-08-01 12:25:46 +0200
committerCamil Staps2016-08-01 12:25:46 +0200
commit8349ec2938f40b0a69b71f5ae9dad2b7bf23d661 (patch)
treeb5211a4bfab92c09a9cf27238f70dd70355c4316 /include/offers.php
parentError when sending email when invoice is not generated yet (diff)
Generate invoice from detailed offer view
Diffstat (limited to 'include/offers.php')
-rw-r--r--include/offers.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/offers.php b/include/offers.php
index 6379f62..9facf3c 100644
--- a/include/offers.php
+++ b/include/offers.php
@@ -146,10 +146,19 @@ require('./header.php');
['Eligible for online payment', 'btn-success'] :
['Not eligible for online payment', 'btn-default'];
$header .= "<span class='pull-right'>
- <a title='{$accepted[0]}' href='?id={$offer->id}&toggle_accept={$offer->id}' class='btn {$accepted[1]}'><i class='fa fa-fw fa-check'></i> {$accepted[0]}</a>
- <a title='{$eligible[0]}' href='?id={$offer->id}&toggle_payment_eligibility={$offer->id}' class='btn {$eligible[1]}'><i class='fa fa-fw fa-credit-card'></i> {$eligible[0]}</a>
- <a title='Send invoice' href='#' onclick='offerEmail({$offer->id})' class='btn btn-info'><i class='fa fa-fw fa-envelope'></i> Send invoice to contact</a>
- <a title='Delete' href='?delete={$offer->id}' class='btn btn-danger'><i class='fa fa-fw fa-times'></i> Delete</a>
+ <a title='{$accepted[0]}' href='?id={$offer->id}&toggle_accept={$offer->id}' class='btn {$accepted[1]} btn-circle fa fa-fw fa-check'></a>
+ <a title='{$eligible[0]}' href='?id={$offer->id}&toggle_payment_eligibility={$offer->id}' class='btn {$eligible[1]} btn-circle fa fa-fw fa-credit-card'></a>\t";
+ if (is_null($offer->getInvoiceFile())) {
+ $header .= "<a title='Generate invoice' href='?id={$offer->id}&generate_invoice={$offer->id}' class='btn btn-default btn-circle fa fa-fw fa-calculator'></a>";
+ } else {
+ $header .= "
+ <a title='View invoice' href='{$offer->getInvoiceFile()->getFilenameURI()}' target='_blank' class='btn btn-default btn-circle fa fa-eye'></a>
+ <a title='Regenerate invoice' href='?id={$offer->id}&generate_invoice={$offer->id}' class='btn btn-default btn-circle fa fa-refresh'></a>
+ <a title='Trash invoice' href='?id={$offer->id}&trash_invoice={$offer->id}' class='btn btn-default btn-circle fa fa-trash'></a>";
+ }
+ $header .= "
+ <a title='Send invoice' href='#' onclick='offerEmail({$offer->id})' class='btn btn-info btn-circle fa fa-fw fa-envelope'></a>
+ <a title='Delete' href='?delete={$offer->id}' class='btn btn-danger btn-circle fa fa-fw fa-times'></a>
</span>";
} catch (PDOException $e) {
$alert = "<div class='alert alert-danger alert-dismissable'><button type='button' class='close fa fa-times' data-dismiss='alert' aria-hidden='true'></button>The offer with id $id</i> could not be found.</div>";