Jump to content
assembler

Batch Printing without Frames or PDF

Recommended Posts

This contribution allows you to batch print the orders on the orders.php screen. You can filter based on order status, and can then select/deselect orders for printing. Can batch update order status as well. Instead of using frames or a PDF, this contrib produces 1 invoice per page by using CSS page breaks.

 

Can easily be adapted to your custom invoice layout.

 

Batch Printing with Frames or PDF

Edited by assembler

Share this post


Link to post
Share on other sites

Please pardon my ingnorance... I am "learning":

To what file do we make the listed "Three easy changes"?

 

Thank you!

Share this post


Link to post
Share on other sites

Hello assembler

 

I was trying this at my test shop but have a bit of a problem. Everything seems to work fine except that the invoice number is the same for all and it shows an invoice number -1. Do you know where I could have gone wrong?

 

Thanks

Share this post


Link to post
Share on other sites

I have successfully installed this contribution.

 

My questions:

 

- The circle YES at Update Status? is standard. How to make NO standard?

 

- Now you have to pick boxes. Is it also possible to make a box and just type the numbers of the invoices? So that you are not limited to the orders of one particular orders-page?

 

- Is it possible to send a message with the status-update?

 

Thanks in advance!!!

Share this post


Link to post
Share on other sites
nobody?  :'(

 

To change the default Yes/No on the update status, open includes/print_multi.php

 

Change this:

 

echo " Yes " . tep_draw_radio_field('autoupdatestatus', 'Yes', true);
echo " No " . tep_draw_radio_field('autoupdatestatus', 'No');

 

to:

 

echo " Yes " . tep_draw_radio_field('autoupdatestatus', 'Yes');
echo " No " . tep_draw_radio_field('autoupdatestatus', 'No',True);

 

It is possible to send the update email when you update the status.

You would need to include the regular update mail fuction it admin/print_multi.php, after:

 

if($autoupdatestatus=='Yes') {

 

If you want to print based on a range of numbers, this isn't the contribution for you. It was coded with the current functionality in mind.

Share this post


Link to post
Share on other sites
This contribution allows you to batch print the orders on the orders.php screen. You can filter based on order status, and can then select/deselect orders for printing. Can batch update order status as well. Instead of using frames or a PDF, this contrib produces 1 invoice per page by using CSS page breaks.

 

Can easily be adapted to your custom invoice layout.

 

Batch Printing with Frames or PDF

 

Hello,

i installed this contribution, it is very useful, but there is only one problem about CSS page break.

They doesn't work on firefox, opera 8.5, nor IE 6.0.

 

Is there a solution?

Share this post


Link to post
Share on other sites

This is a nice contrib its seems thought that it will just batch print the orders listed on one page.... if they are split and lap over to the 2nd or 3rd page they will not go to output. Is there anyway to solve this?

 

thanks!

Share this post


Link to post
Share on other sites
It is possible to send the update email when you update the status.

You would need to include the regular update mail fuction it admin/print_multi.php, after:

 

if($autoupdatestatus=='Yes') {

 

If you want to print based on a range of numbers, this isn't the contribution for you. It was coded with the current functionality in mind.

 

Has anyone implemented this yet? I'd like to get this working on mine but I figured someone has probably already done it...

Share this post


Link to post
Share on other sites

Hi this contribution works fine.

 

If you want to change the default "Update status?" to "No" by default then what I had to do was edit the new orders.php that came with the contribution.

 

In line 396

change the ('autoupdatestatus', 'Yes',true) to ('autoupdatestatus', 'Yes'), then replace the ('autoupdatestatus', 'No', true);

 

I have a question for you people how to add the invoice date to print_batch_invoice.php

 

In the single print invoice.php it prints the invoice date using the following command

 

$order = tep_db_query("select orders_id, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

$order_query = tep_db_fetch_array($order);

 

<?php echo tep_date_short($order_query['date_purchased']);?>

 

Now I dont know how PHP works so when I copy and paste this code into print_batch_invoice.php it doesnt work.

 

This is the error message:

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /homepages/12/d98245522/htdocs/catalog/admin/includes/functions/database.php:13) in /homepages/12/d98245522/htdocs/catalog/admin/includes/functions/database.php on line 13

 

Can anyone give me the correct query to retrieve the date?

Share this post


Link to post
Share on other sites

For some odd reason, I am not getting the tick boxes next to each order. I do get the line underneath if I want to make labels and such but nothing to choose orders.

Please help.

Thank you

 

 

This contribution allows you to batch print the orders on the orders.php screen. You can filter based on order status, and can then select/deselect orders for printing. Can batch update order status as well. Instead of using frames or a PDF, this contrib produces 1 invoice per page by using CSS page breaks.

 

Can easily be adapted to your custom invoice layout.

 

Batch Printing with Frames or PDF

Share this post


Link to post
Share on other sites
For some odd reason, I am not getting the tick boxes next to each order. I do get the line underneath if I want to make labels and such but nothing to choose orders.

Please help.

Thank you

I'm having the same problemo.

 

Does the author have any suggestions here?

Share this post


Link to post
Share on other sites

Just to point something out for those of you that may not have noticed....

 

The export to csv option exports the customers address, not the shipping address so if you're doing labels and the customer's selected a different shipping address then the label will be wrong.... happened to me this week but I don't have a fix for it yet.

 

Sam

Share this post


Link to post
Share on other sites

Scratch that....

 

If you need to change it just look for a line similar to this one near the top of print_batch_process.php and replace "customer" with "delivery":

 

echo "" . $oID . "," . $order->delivery['name'] . "," . $order->delivery['company'] . "," . $order->delivery['street_address'] . "," . $order->delivery['suburb'] . "," . $order->delivery['city'] . "," . $order->delivery['state'] . "," . $order->delivery['postcode'] . "," . $order->delivery['country'] . "," . $order->delivery['telephone'] . "\n";

Share this post


Link to post
Share on other sites

Everyone, I am having a problem with this contribution in that the check boxes are not showing at all.

I have reinstalled the contrbution twice and still the boxs are not showing.

 

Please can someone help or offer any suggestion? It would be much appreciated.

Share this post


Link to post
Share on other sites
Everyone, I am having a problem with this contribution in that the check boxes are not showing at all.

I have reinstalled the contrbution twice and still the boxs are not showing.

That's because install instructions aren't complete. In orders.php find this:

<td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>

immediately after insert this:

<td class="dataTableContent" align="right"><?php echo tep_draw_checkbox_field('batch_order_numbers[' . $orders['orders_id'] . ']', 'no', '' , 'yes', 'onclick="CheckCheckAll(document.trackunread)'); ?></td>

And if it looks like this:

<td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
		  <td class="dataTableContent" align="right"><?php echo tep_draw_checkbox_field('batch_order_numbers[' . $orders['orders_id'] . ']', 'no', '' , 'yes', 'onclick="CheckCheckAll(document.trackunread)'); ?></td>
		   <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

You're done!

 

Does anybody know how to implement comments to be printed on the invoice?

 

Thanks a lot, great contribution BTW!


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites
That's because install instructions aren't complete. In orders.php find this:
<td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>

immediately after insert this:

<td class="dataTableContent" align="right"><?php echo tep_draw_checkbox_field('batch_order_numbers[' . $orders['orders_id'] . ']', 'no', '' , 'yes', 'onclick="CheckCheckAll(document.trackunread)'); ?></td>

And if it looks like this:

<td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td>
		  <td class="dataTableContent" align="right"><?php echo tep_draw_checkbox_field('batch_order_numbers[' . $orders['orders_id'] . ']', 'no', '' , 'yes', 'onclick="CheckCheckAll(document.trackunread)'); ?></td>
		   <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

You're done!

 

Does anybody know how to implement comments to be printed on the invoice?

 

Thanks a lot, great contribution BTW!

Alex,

 

Thanks for coming to the rescue here. I will try your suggestion out.

 

There is a contribution that I downloaded that added the comments to the invoice. I will post it later.

Share this post


Link to post
Share on other sites
There is a contribution that I downloaded that added the comments to the invoice. I will post it later.

Great clue, thank you... it's always better to continue few days later if you stuck. Anyway, I made few slight improvements, updated install instructions and uploaded new version. :-"

 

Alex


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Hi

 

I have installed this contributiona nd the Invoice printing works a treat however the status of orders is not updated.

 

For example if I have several orders that are pending and select the processing option from the drop down, when I press confirm it opens the print screen in a new window but does not update the status of the orders in the orders screen.

 

Have you got any ideas where I am going wrong?

 

Would be most greatful for your help.

 

Thanks

Share this post


Link to post
Share on other sites
Hi

 

I have installed this contributiona nd the Invoice printing works a treat however the status of orders is not updated.

 

For example if I have several orders that are pending and select the processing option from the drop down, when I press confirm it opens the print screen in a new window but does not update the status of the orders in the orders screen.

 

Have you got any ideas where I am going wrong?

 

Would be most greatful for your help.

 

Thanks

 

Hello,

 

Are you trying to print the invoices or download the labels file when you're updating? If it's the former it should work ok - but please note that you need to let the pop up window with the invoices in it load completely otherwise the script to update them will stop running and won't update all the orders. If it's the latter of the two and you're trying to download the .csv file and update at the same time - you won't be able to, the update only works on the invoice printing option - although you could change the code to do this if necessary.

 

Thanks

 

Sam

Share this post


Link to post
Share on other sites
Hello,

 

Are you trying to print the invoices or download the labels file when you're updating? If it's the former it should work ok - but please note that you need to let the pop up window with the invoices in it load completely otherwise the script to update them will stop running and won't update all the orders. If it's the latter of the two and you're trying to download the .csv file and update at the same time - you won't be able to, the update only works on the invoice printing option - although you could change the code to do this if necessary.

 

Thanks

 

Sam

 

Hi Sam

 

Thanks for taking the time to help.

 

I'm trying to print the invoices. I am using IE 6 and the page completes loading. When I return to the orders screen again and refresh, the orders are still being displayed as pending.

 

Could there be a problem with the logic at the bottom of the print_batch_process.php?

 

I am running the code on a Sun Solaris box. I changed the format of each of the files from ASCII to Binary to remove any control characters that may hav been interpreted on upload but this seemed to have no effect.

 

Thanks

Mike

Share this post


Link to post
Share on other sites

Hi

 

Every thing is working fine except for when i click to print labels. I get the following error on the popup window :

 

Warning: Header may not contain more than a single header, new line detected. in /hsphere/local/home/~sitename~/admin/print_batch_process.php on line 39

 

Its to do with the following line I think :

 

header ("Content-type: application/csv\nContent-Disposition: \"inline; filename=customers.csv\"");

 

Have I missed something in the install, or is there something else I need to do to make this work?

 

Thanks for your help

 

K

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×