Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Batch Printing without Frames or PDF


assembler

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
Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

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

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

 

Thank you!

At least 90% of my programming problems lie somewhere between my keyboard and my chair.

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
Share on other sites

  • 2 months later...

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!!!

Link to comment
Share on other sites

  • 2 weeks later...
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.

Link to comment
Share on other sites

  • 1 month later...
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?

Link to comment
Share on other sites

  • 2 months later...
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...

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
Share on other sites

  • 3 weeks later...

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

Link to comment
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?

Link to comment
Share on other sites

  • 4 weeks later...

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

Link to comment
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";

Link to comment
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.

Link to comment
Share on other sites

  • 3 weeks later...
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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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

Alex, totally forgot about this - here is the contribution for the comments on invoice http://www.oscommerce.com/community/contri...nvoice+comments

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...