Merge pull request #2660 from opensourcepos/payments-for-invoice-email

Add payments to emailed invoice and fix issue with unsupported fonts
This commit is contained in:
FrancescoUK
2020-01-04 10:41:50 +00:00
committed by GitHub
2 changed files with 71 additions and 25 deletions

View File

@@ -6,12 +6,13 @@
</head>
<body>
<?php
if(isset($error_message))
{
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
}
if(isset($error_message))
{
echo "<div class='alert alert-dismissible alert-danger'>".$error_message."</div>";
exit;
}
?>
<div id="page-wrap">
@@ -76,9 +77,9 @@
if($discount > 0)
{
$invoice_columns = $invoice_columns + 1;
?>
?>
<th><?php echo $this->lang->line('sales_customer_discount'); ?></th>
<?php
<?php
}
?>
<th><?php echo $this->lang->line('sales_total'); ?></th>
@@ -89,19 +90,19 @@
{
if($item['print_option'] == PRINT_YES)
{
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><?php echo $item['name']; ?></td>
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo ($item['discount_type']==FIXED)?to_currency($item['discount']):$item['discount'] . '%';?></td>
<?php if ($item['discount'] > 0): ?>
<td><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></td>
<?php endif; ?>
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php
?>
<tr class="item-row">
<td><?php echo $item['item_number']; ?></td>
<td class="item-name"><?php echo $item['name']; ?></td>
<td><?php echo to_quantity_decimals($item['quantity']); ?></td>
<td><?php echo to_currency($item['price']); ?></td>
<td><?php echo ($item['discount_type']==FIXED)?to_currency($item['discount']):$item['discount'] . '%';?></td>
<?php if ($item['discount'] > 0): ?>
<td><?php echo to_currency($item['discounted_total'] / $item['quantity']); ?></td>
<?php endif; ?>
<td class="total-line"><?php echo to_currency($item['discounted_total']); ?></td>
</tr>
<?php
}
}
?>
@@ -134,6 +135,51 @@
<td colspan="2" class="total-line"><?php echo $this->lang->line('sales_total'); ?></td>
<td id="total" class="total-value"><?php echo to_currency($total); ?></td>
</tr>
<?php
$only_sale_check = FALSE;
$show_giftcard_remainder = FALSE;
foreach($payments as $payment_id=>$payment)
{
$only_sale_check |= $payment['payment_type'] == $this->lang->line('sales_check');
$splitpayment = explode(':', $payment['payment_type']);
$show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard');
?>
<tr>
<td colspan="<?php echo $invoice_columns-3; ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?php echo $splitpayment[0]; ?></td>
<td class="total-value"><?php echo to_currency(-$payment['payment_amount']); ?></td>
</tr>
<?php
}
?>
<?php
if(isset($cur_giftcard_value) && $show_giftcard_remainder)
{
?>
<tr>
<td colspan="<?php echo $invoice_columns-3; ?>" class="blank"> </td>
<td colspan="2" class="total-line"><textarea rows="5" cols="6"><?php echo $this->lang->line('sales_giftcard_balance'); ?></textarea></td>
<td class="total-value"><textarea rows="5" cols="6" id="giftcard"><?php echo to_currency($cur_giftcard_value); ?></textarea></td>
</tr>
<?php
}
?>
<?php
if(!empty($payments))
{
?>
<tr>
<td colspan="<?php echo $invoice_columns-3; ?>" class="blank"> </td>
<td colspan="2" class="total-line"><?php echo $this->lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?></td>
<td class="total-value"><?php echo to_currency($amount_change); ?></td>
</tr>
<?php
}
?>
</table>
<div id="terms">

View File

@@ -5,11 +5,11 @@
*/
#menubar, #footer { display: none; }
* { margin: 0; padding: 0; }
body { font-family: Helvetica; font-size: 13px; }
body { font-family: DejaVu Sans, Helvetica, Sans-Serif; font-size: 13px; }
#page-wrap { width: 750px; margin: 0 auto; }
pre { font-family: Helvetica; font-size: 13px; }
pre { font-family: DejaVu Sans, Helvetica, Sans-Serif; font-size: 13px; }
#page-wrap { font-family: Helvetica; }
#page-wrap { font-family: DejaVu Sans, Helvetica, Sans-Serif; }
#page-wrap table { border-collapse: collapse; }
#page-wrap table#items td { padding: 10px; }
#page-wrap #meta table td, #page-wrap table th { border: 1px solid black; padding: 5px; }
@@ -39,7 +39,7 @@ pre { font-family: Helvetica; font-size: 13px; }
#items { width: 100%; border: 1px solid black; }
#items th { background: #eee; }
#items tr.item-row td { border: 0; vertical-align: top; }
#items td { font-family: DejaVu Sans; }
#items td { font-family: DejaVu Sans, Helvetica, Sans-Serif; }
#items td.description { width: 300px; }
#items td.item-name { width: 175px; }
#items td.total-line { text-align: right; border-width: 1px 0 1px 1px; border-style: solid; }
@@ -49,7 +49,7 @@ pre { font-family: Helvetica; font-size: 13px; }
#items td.blank { border: 0; }
#terms { text-align: center; margin: 20px 0; }
#terms h5 { border-bottom: 1px solid black; font: 13px Helvetica, Sans-Serif; padding: 8px 0; margin: 8px 0; line-height: 1.3em; }
#terms h5 { border-bottom: 1px solid black; font: 13px DejaVu Sans, Helvetica, Sans-Serif; padding: 8px 0; margin: 8px 0; line-height: 1.3em; }
.delete-wpr { position: relative; }
.delete { display: block; color: #000; text-decoration: none; position: absolute; background: #EEEEEE; font-weight: bold; padding: 0px 3px; border: 1px solid; top: -6px; left: -22px; font-family: Verdana; font-size: 12px; }