aboutsummaryrefslogtreecommitdiff
path: root/include/pay.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/pay.php')
-rw-r--r--include/pay.php24
1 files changed, 11 insertions, 13 deletions
diff --git a/include/pay.php b/include/pay.php
index 596251c..37dd1cc 100644
--- a/include/pay.php
+++ b/include/pay.php
@@ -42,10 +42,10 @@ require('./header.php');
$notFound = true;
}
}
- if ($notFound || $offerKey != $_offer->key) {
- ?>
- <div class='form-group alert alert-danger'>The invoice could not be found.</div>
- <?php
+ if ($notFound || $offerKey != $_offer->payment_key) {
+ echo "<div class='form-group alert alert-danger'>The invoice could not be found.</div>";
+ } elseif ($_offer->payment_key == '') {
+ echo "<div class='form-group alert alert-danger'>This invoice is not eligible for online payment.</div>";
} elseif (isset($_POST['payment_method_nonce'])) {
$nonce = $_POST['payment_method_nonce'];
$trans = Braintree_Transaction::sale([
@@ -91,23 +91,21 @@ require('./header.php');
foreach ($_offer->getItems() as $item) {
$i++;
echo '<tr>';
- echo "<td class='col-max-width'>
+ echo "<td>
<b><a href='#collapse-item-$i' data-toggle='collapse'>{$item->title}</a></b>
<div class='collapse' id='collapse-item-$i'>{$item->getHTMLDescription()}</div>
</td>";
- echo "<td class='col-min-width'>".Constants::invoice_valuta."{$item->calculate(Calculatable::SUBTOTAL)}</td>";
- echo "<td class='col-min-width'>{$item->VAT_percentage}%</td>";
- echo "<td class='col-min-width'>".Constants::invoice_valuta."{$item->calculate(Calculatable::TOTAL)}</td>";
+ echo "<td>".Constants::invoice_valuta."{$item->calculate(Calculatable::SUBTOTAL)}</td>";
+ echo "<td>{$item->VAT_percentage}%</td>";
+ echo "<td>".Constants::invoice_valuta."{$item->calculate(Calculatable::TOTAL)}</td>";
echo '</tr>';
}
?>
<tr style="border-top:2px solid #666;">
- <th colspan="3" class="text-right">Subtotal</th>
+ <th class="text-right">Totals</th>
<td><?=$subtotal?></td>
- </tr>
- <tr>
- <th colspan="3" class="text-right">Total</th>
- <td><?=$total?></td>
+ <td></td>
+ <td><b><?=$total?></b></td>
</tr>
</table>
</div>