Guest User

Untitled

a guest
Oct 23rd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. <?php
  2. class AdminOrdersController extends AdminOrdersControllerCore
  3. {
  4. public function __construct()
  5. {
  6. parent::__construct();
  7. //BulkActions
  8.  
  9. $this->bulk_actions['divider2'] = array('text' => 'divider');
  10. $this->bulk_actions['printInvoices'] = array('text' => $this->l('Download Invoice'), 'icon' => 'icon-file-text');
  11. $this->bulk_actions['printDeliverySlips'] = array('text' => $this->l('Download Delivery Slip'), 'icon' => 'icon-truck');
  12. }
  13.  
  14. //processBulkUpdateOrderStatus
  15. protected function processBulkPrintInvoices()
  16. {
  17. $id_orders = implode(',', Tools::getValue('orderBox'));
  18. //ddd($id_orders);
  19. $order_invoice_collection = OrderInvoice::getByOrderIdBulk($id_orders);
  20. if (!count($order_invoice_collection)) {
  21. die(Tools::displayError('No invoice was found.'));
  22. }
  23. //Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice)))
  24. $pdf = new PDF($order_invoice_collection, PDF::TEMPLATE_INVOICE, Context::getContext()->smarty);
  25. $pdf->render();
  26. }
  27.  
  28. protected function processBulkPrintDeliverySlips()
  29. {
  30. $id_orders = implode(',', Tools::getValue('orderBox'));
  31. //ddd($id_orders);
  32. $order_invoice_collection = OrderInvoice::getByOrderIdBulk($id_orders);
  33. if (!count($order_invoice_collection)) {
  34. die(Tools::displayError('No invoice was found.'));
  35. }
  36. //Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice)))
  37. $pdf = new PDF($order_invoice_collection, PDF::TEMPLATE_DELIVERY_SLIP, Context::getContext()->smarty);
  38. $pdf->render();
  39. }
  40. }
Add Comment
Please, Sign In to add comment