Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[-] PDF: smarty warning for Order slip. #PSCSX-6245 #3535

Merged
merged 2 commits into from Aug 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/pdf/HTMLTemplateInvoice.php
Expand Up @@ -30,6 +30,7 @@
class HTMLTemplateInvoiceCore extends HTMLTemplate
{
public $order;
public $order_invoice;
public $available_in_your_account = false;

/**
Expand Down
14 changes: 14 additions & 0 deletions classes/pdf/HTMLTemplateOrderSlip.php
Expand Up @@ -142,6 +142,18 @@ public function getContent()

$this->order->total_paid_tax_incl += $this->order->total_shipping_tax_incl;
$this->order->total_paid_tax_excl += $this->order->total_shipping_tax_excl;

$total_cart_rule = 0;
if ($this->order_slip->order_slip_type == 1 && is_array($cart_rules = $this->order->getCartRules($this->order_invoice->id))) {
foreach($cart_rules as $cart_rule) {
if ($tax_excluded_display) {
$total_cart_rule += $cart_rule['value_tax_excl'];
} else {
$total_cart_rule += $cart_rule['value'];
}
}
}

$this->smarty->assign(array(
'order' => $this->order,
'order_slip' => $this->order_slip,
Expand All @@ -152,6 +164,7 @@ public function getContent()
'invoice_address' => $formatted_invoice_address,
'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address),
'tax_excluded_display' => $tax_excluded_display,
'total_cart_rule' => $total_cart_rule
));

$tpls = array(
Expand Down Expand Up @@ -209,6 +222,7 @@ public function getTaxTabContent()
'ecotax_tax_breakdown' => $this->order_slip->getEcoTaxTaxesBreakdown(),
'is_order_slip' => true,
'tax_breakdowns' => $this->getTaxBreakdown(),
'display_tax_bases_in_breakdowns' => false
));

return $this->smarty->fetch($this->getTemplate('invoice.tax-tab'));
Expand Down
3 changes: 0 additions & 3 deletions pdf/order-slip.product-tab.tpl
Expand Up @@ -97,17 +97,14 @@
{/foreach}
{/if}

{assign var=total_cart_rule value=0}
{if is_array($cart_rules) && count($cart_rules)}
{foreach $cart_rules as $cart_rule}
<tr class="discount">
<td class="white left" colspan="3">{$cart_rule.name}</td>
<td class="white right">
{if $tax_excluded_display}
{$total_cart_rule = $total_cart_rule + $cart_rule.value_tax_excl}
+ {$cart_rule.value_tax_excl}
{else}
{$total_cart_rule = $total_cart_rule + $cart_rule.value}
+ {$cart_rule.value}
{/if}
</td>
Expand Down