"Print Out" Documents In Admin

I added a new template file “print_work_order” so I can print out this form right from each order in admin instead of the hassle of downloading & printing out in QuickBooks.



There are a couple of others for invoices & packing slip. How do I go about making this template link available ?

In /skins/YOURSKIN/admin/views/orders/details.tpl, add your link in the block of code starting at line 17:

{capture name="extra_tools"}
{hook name="orders:details_tools"}
{include file="buttons/button_popup.tpl" but_text=$lang.print_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`" width="900" height="600" but_role="tool"} |
{include file="buttons/button.tpl" but_text=$lang.print_pdf_invoice but_href="`$index_script`?dispatch=orders.print_invoice&order_id=`$order_info.order_id`&format=pdf" but_role="tool"} |
{include file="buttons/button_popup.tpl" but_text=$lang.print_packing_slip but_href="`$index_script`?dispatch=orders.print_packing_slip&order_id=`$order_info.order_id`" width="900" height="600" but_role="tool"} |
{include file="buttons/button.tpl" but_text=$lang.edit_order but_href="$index_script?dispatch=order_management.edit&order_id=`$order_info.order_id`" but_role="tool"}
{/hook}
{/capture}




You can use the hook at line 18 to make the change using the “My changes” addon. This will reduce the likelihood that you need to make changes after a software update.



Bob

Bob,



You are so very helpful…thank you :slight_smile:



I did exactly as you suggested, but I am getting a 404. I copied the print_packing_slip line exactly, and made the language variable. I also copied the print_packing_slip.tpl, changed the template name at the top & put it in

Current path: /skins/basic/mail/orders



I also changed permissions to be exactly the same as print_packing_slip



I am not sure what I did wrong…

In /controllers/admin/orders.php, add the following substituting your template name for the parts in red):

} elseif ($mode == '[B]print_[COLOR="Red"]work_order[/COLOR][/B]') {
if (!empty($_REQUEST['order_id'])) {
$order_info = fn_get_order_info($_REQUEST['order_id']);
if (empty($order_info)) {
return array(CONTROLLER_STATUS_NO_PAGE);
}

$view_mail->assign('order_info', $order_info);

$view_mail->display('orders/[B]print_[COLOR="red"]work_order[/COLOR][/B].tpl');

exit;
}




This should be added around line 298 - just below this:

} elseif ($mode == 'print_packing_slip') {
if (!empty($_REQUEST['order_id'])) {
$order_info = fn_get_order_info($_REQUEST['order_id']);
if (empty($order_info)) {
return array(CONTROLLER_STATUS_NO_PAGE);
}

$view_mail->assign('order_info', $order_info);

$view_mail->display('orders/print_packing_slip.tpl');

exit;
}




Bob

Bob…you have been my lifeline



Since you are in Arizona, I would be happy to treat you to lunch. We are in Casa Grande…



If you have another minute, I have a distressing problem with the Global Options under “Configuration”. I really hope there is a solution to it :frowning: