diff --git a/admin-dev/pdf.php b/admin-dev/pdf.php index c20a7ba32..4bc9a6dc4 100644 --- a/admin-dev/pdf.php +++ b/admin-dev/pdf.php @@ -66,13 +66,31 @@ function generateSupplyOrderFormPDF() function generateInvoicePDF() { - if (!isset($_GET['id_order'])) - die (Tools::displayError('Missing order ID')); - $order = new Order((int)($_GET['id_order'])); + if (Tools::isSubmit('id_order')) + generateInvoicePDFByIdOrder(Tools::getValue('id_order')); + elseif (Tools::isSubmit('id_order_invoice')) + generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice')); + else + die (Tools::displayError('Missing order ID or invoice order ID')); + exit; +} + +function generateInvoicePDFByIdOrder($id_order) +{ + $order = new Order($id_order); if (!Validate::isLoadedObject($order)) die(Tools::displayError('Cannot find order in database')); - generatePDF($order, PDF::TEMPLATE_INVOICE); + generatePDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE); +} + +function generateInvoicePDFByIdOrderInvoice($id_order_invoice) +{ + $order_invoice = new OrderInvoice($id_order_invoice); + if (!Validate::isLoadedObject($order_invoice)) + die(Tools::displayError('Cannot find order invoice in database')); + + generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); } function generateOrderSlipPDF() diff --git a/admin-dev/themes/template/orders/_customized_data.tpl b/admin-dev/themes/template/orders/_customized_data.tpl index 682b71db0..a3dd0e43d 100755 --- a/admin-dev/themes/template/orders/_customized_data.tpl +++ b/admin-dev/themes/template/orders/_customized_data.tpl @@ -47,6 +47,7 @@ {/if}
+{else}
+ -
+{/if}
+
+
+{* Generate HTML code for printing Delivery Icon with link *}
+
+{if ($order_state->delivery && $order->delivery_number)}
+
+{else}
+ -
+{/if}
+
\ No newline at end of file
diff --git a/admin-dev/themes/template/orders/_product_line.tpl b/admin-dev/themes/template/orders/_product_line.tpl
index 1e002c260..e43c1bc13 100755
--- a/admin-dev/themes/template/orders/_product_line.tpl
+++ b/admin-dev/themes/template/orders/_product_line.tpl
@@ -26,9 +26,9 @@
{* Assign product price *}
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
- {assign var=product_price value=($product['product_price'] + $product['ecotax'])}
+ {assign var=product_price value=($product['unit_price_tax_excl'] + $product['ecotax'])}
{else}
- {assign var=product_price value=$product['product_price_wt']}
+ {assign var=product_price value=$product['unit_price_tax_incl']}
{/if}
{if ($product['product_quantity'] > $product['customizationQuantityTotal'])}
@@ -39,13 +39,31 @@
{if $product.product_reference}{l s='Ref:'} {$product.product_reference}
+
+
+
+