Jump to content
Sign in to follow this  
blurb

Batch Print Center (support thread)

Recommended Posts

Thanks - that wee bit of information got me thinking and I've worked out what the problem is...after your reply, I tested on Firefox and Opera - Firefox had the same problem but Opera worked great. And I noticed that Opera was ignoring the fact that in Acrobat Reader, I'd set my preferences to open the PDF inside the browser window.....so once I'd gone back to Acrobat Reader and unchecked that option (causing the PDF to open in its own, non-browser window) the printouts work fine in all browsers.

 

Looks like its a bug in how IE and Firefox treat PDF documents....I can live with PDFs opening outside of a browser window...

 

Thanks for the pointer!

 

A.

 

Torq, You're welcome!

 

While you are in teh process of testing, could you let me know if you can print a batch in which an order has been deleted (meaning: the order numbers are not consecutive numbers) and let me know what happens. I posted this a while ago and got no answer.

 

Thanks!

Share this post


Link to post
Share on other sites
Thanks - that wee bit of information got me thinking and I've worked out what the problem is...after your reply, I tested on Firefox and Opera - Firefox had the same problem but Opera worked great. And I noticed that Opera was ignoring the fact that in Acrobat Reader, I'd set my preferences to open the PDF inside the browser window.....so once I'd gone back to Acrobat Reader and unchecked that option (causing the PDF to open in its own, non-browser window) the printouts work fine in all browsers.

 

Looks like its a bug in how IE and Firefox treat PDF documents....I can live with PDFs opening outside of a browser window...

 

Thanks for the pointer!

 

A.

Damn - seems my problem isn't quite finished! Having set Acrobat reader to open in its own non-browser window, I now don't have the opportunity to hit the 'refresh' button to force the latest PDF to be shown - so I see what's in the browser's cache.

 

When I had PDFs opening in a browser window, the cache problem was still there, but it was easy to hit refresh to force the new PDF to load. If the PDF opens in its own window, the only way I can get the new one to load is either to disable broswer caching totally, or to delete my temporary internet files before creating the new PDF....both of which are a bit of a pain.

 

So I'm back to how to make PDfs within a browser window print out properly if they are only 1 page long....

 

again, any thoughts welcome....

 

A.

Share this post


Link to post
Share on other sites
Torq, You're welcome!

 

While you are in teh process of testing, could you let me know if you can print a batch in which an order has been deleted (meaning: the order numbers are not consecutive numbers) and let me know what happens. I posted this a while ago and got no answer.

 

Thanks!

The test you described worked perfectly for me - no problems whatsoever....sorry that this doesn't help!

 

A

Share this post


Link to post
Share on other sites
So I'm back to how to make PDfs within a browser window print out properly if they are only 1 page long....

 

again, any thoughts welcome....

 

A.

Well, it ain't pretty, but I got a workround at least...

 

1. uncheck 'open PDF in browser' option within Acrobat Reader

 

2. force a unique filename for the batch_orders.pdf file by attaching a timestamp as a parameter, using onClick from the 'click here to download the pdf' link to run this javascriot:

 

<script LANGUAGE="JavaScript"><!--

function updateLink(filename) {

now = new Date();

return filename + '?' + now.getTime();

}

//--></SCRIPT>

 

 

the script itself is placed in batch_print_header.php

 

 

Maybe no-one else has the same problem as me, but I guess the timestamp solution could help others with PDF or cache related problems, I guess....

 

A

Share this post


Link to post
Share on other sites

Hi

 

I installed the module fine and it's all working exept that it is not calling in any values for the products when creating invoices.

 

Could this maybe have something to do with me having installed the multi vendor shipping contrib.

 

Thanks in advance for any help you can give me.

Share this post


Link to post
Share on other sites

How do I strip HTML tags out of the shipping title on the invoice templates? Some of my shipping methods titles have html in them to add pictures and additional descriptive text etc.?

 

 

 

The template I'm working on right now is the "Packing Slip and Invoice" one.

 

 

 

I think the fix would go near line 412.

 

 

 

Thanks


I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Share this post


Link to post
Share on other sites
How do I strip HTML tags out of the shipping title on the invoice templates? Some of my shipping methods titles have html in them to add pictures and additional descriptive text etc.?

 

 

 

The template I'm working on right now is the "Packing Slip and Invoice" one.

 

 

 

I think the fix would go near line 412.

 

 

 

Thanks

 

Unfortunately, the PDF language does not understand HTML because they work differently:

In order to display an image PDF needs its path to the server and positions it with coordinates specified in

the function. Images and text are treated as separarte entities, they cannot be part of the same string.

 

to write text:

 

$pdf->addText(POSITION LEFT,POSITION TOP,FONT SIZE,TEXT TO BE WRITTEN);

 

$pdf->addJpegFromFile(BATCH_PRINT_INC . 'templates/' . 'invoicelogo.jpg',30,725,210,80);

 

On top of that, your images must be at 300 dpi to be printed nicely without being pixelized.

 

Bottom line: you goal may be difficult to to reach without intense modifications: adding an extra field to your database in the order_total table which will be the image reference for the class ot_shipping , process it in the oscommerce front end to be displayed by merging them with HTML on the checkout pages, and call this single image in the pdf template. I don't even know if I would be able to code that myself ....

 

Hope this helps, even if a little bit negative :-)

Share this post


Link to post
Share on other sites
Unfortunately, the PDF language does not understand HTML because they work differently:

In order to display an image PDF needs its path to the server and positions it with coordinates specified in

the function. Images and text are treated as separarte entities, they cannot be part of the same string.

 

to write text:

 

$pdf->addText(POSITION LEFT,POSITION TOP,FONT SIZE,TEXT TO BE WRITTEN);

 

$pdf->addJpegFromFile(BATCH_PRINT_INC . 'templates/' . 'invoicelogo.jpg',30,725,210,80);

 

On top of that, your images must be at 300 dpi to be printed nicely without being pixelized.

 

Bottom line: you goal may be difficult to to reach without intense modifications: adding an extra field to your database in the order_total table which will be the image reference for the class ot_shipping , process it in the oscommerce front end to be displayed by merging them with HTML on the checkout pages, and call this single image in the pdf template. I don't even know if I would be able to code that myself ....

 

Hope this helps, even if a little bit negative :-)

 

 

 

What I need to do is remove all tag infomation before the contribution prints the pdf file. That is everything between the < > tags. No images, hyperlinks or formating. I just need the plain basic text of what the title description is so it doesn't extend across the page and into the price that is shown on the right side of the pdf page (invoice).

 

 

 

Thanks for your input,

 

Rod


I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Share this post


Link to post
Share on other sites
What I need to do is remove all tag infomation before the contribution prints the pdf file. That is everything between the < > tags. No images, hyperlinks or formating. I just need the plain basic text of what the title description is so it doesn't extend across the page and into the price that is shown on the right side of the pdf page (invoice).

 

 

 

Thanks for your input,

 

Rod

 

The only option I see is to go back to the original osc display, not embeding images in your shipping method description...

Share this post


Link to post
Share on other sites
What I need to do is remove all tag infomation before the contribution prints the pdf file. That is everything between the < > tags. No images, hyperlinks or formating.

 

So im guessing that currently you use html markup in the image description and all you need to do is remove any markup leaving jsut the text for batch print to insert as per normal.

 

This shouldn't be hard but i don't have time to do it but i can give you the basics.

At some point in the php after the script grabs the text (with the html markup in it) it places it into a variable

all you need to do is use a php command like http://au3.php.net/strip-tags to remove the markup , leaving the variable contain just the text you want.

 

Hope that points you in the right direction, its most certainly do able if I have understood what your after.

cheers

shaun

Share this post


Link to post
Share on other sites
So im guessing that currently you use html markup in the image description and all you need to do is remove any markup leaving jsut the text for batch print to insert as per normal.

 

Sorry I meant you are using html markup in the shipping description in your language file

which is being written into the databse on each order and when that order is pulled by BPC

its adding that markup because the pdf maker (the template) isn't striping it out ... is that correct ?

 

And on another note, the pdf maker does use some html style markup for things like bold

so although a pdf does not use html markup the class to convert to pdf does have limited markup

in it

 

cheers

shaun

Share this post


Link to post
Share on other sites
Sorry I meant you are using html markup in the shipping description in your language file

which is being written into the databse on each order and when that order is pulled by BPC

its adding that markup because the pdf maker (the template) isn't striping it out ... is that correct ?

 

 

 

Yes, you are correct.

Edited by Leak-Proof

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Share this post


Link to post
Share on other sites

Just installed this contrib (and will admit very new to oSC still) but was wondering if there is anyway to have it put a barcode on the print out? Basically i want to barcode the Order Number and the Model #'s. Any help out there? Thanks

Share this post


Link to post
Share on other sites
Just installed this contrib (and will admit very new to oSC still) but was wondering if there is anyway to have it put a barcode on the print out? Basically i want to barcode the Order Number and the Model #'s. Any help out there? Thanks

 

It is possible. If you are new to OSCom, It's a lot of work, you will need to start by steps :-)

 

1) Make your site capable to store UPC (or EAN) numbers. For this, you have 2 options:

 

a) OS Commerce "Model number" to store the UPC code numbers (13 or 14 digits). You may have to extend this field, as it may have been defined with a maximum of 7 characters in the default OsCommerce install. But because m ost of sellers use the products_model field as a SKU field, I would recommend teh option B)

 

B) Create another field in your "products" table, called products_UPC for example. Do do this, install this MOD:

 

Adding_product_fields (the Sandalwood version)

 

 

2) Then, you will need to get a special font that renders the barcode from your UPC numbers.

There are many avialbale, this page explains teh differences between them:

 

http://www.hallogram.com/barcodes/software...ation/complete/ and allows you to purchase licences

 

The fonts used for the batch print center are .afm (poscript), you need to upload this format of the font that you will purchase.

 

3) Upload the .afm version of the font to the folder: admin/modules/batch_print/temp_pdf

 

3) Rendering the barcode in the invoice or packing slip is "just" a question of printing your UPC field (which is a number) where you want (most likely before after your product name). This requires intensive work on the pdf tempalte. I can give you direction once you are there, but I think you need first to be sure you want to go through all this.

 

Ready to do it? Let me know, can be fun!!

Share this post


Link to post
Share on other sites

Hi all,

 

I just installed this and FYI, I did need to install the "Fix for Error 1054" but that is not my issue.

 

When I try to print an invoice with "Show credit card number? (for credit card orders only)" I just get the credit card name, no number?

 

Am I missing something obvious?

 

Thanks in advance,

 

Don

Share this post


Link to post
Share on other sites

Hello, i just installed this Batch Print center.Great Contrib yes

Sorry my english lol :-"

The problem is that when i only want to export 1 order the number of order filter doesnt work i put for example 5 and in date from 2007-02-18 to 2007-02-18 but it allways take 5 and 6 and i want a pdf only with order #5 but it exports #5 and #6

I dont know what its the problem , maybe i dont write the number order in the correct format or i dont know i put only the number like this : 5

And if i only put a number and no date , its give me the invalid date error, and i want to print it only wiht write the number if its possible.

Note: My server has register globals=off (i dont know if this its relevant for this)

So friends, many thanks for all.

Share this post


Link to post
Share on other sites

I have installed this contribution on my online shops, and it works great!. No im working on 3 other websites (locale with Apache 2 traid) and the invoice print "fails"

 

If i print an invoice you have the following totals:

 

Sub-total: <span class=currency....

Shipping: <span class=currency....

VAT 19%: <span class=currency....

Total: <span class=currency....

 

(maybe there is some more text on the dots, but they are outside the page margin, so i cant see it)

 

Normaly, by al my online stores, there are amounts on the place of the "<span class=currency...." but by my locale store not :'(

 

Can some please help me with this problem?

 

Thanks!

Edited by Bacoman

Share this post


Link to post
Share on other sites

I must say this is an awesome contrib. Thank you Thank you Thank you!

 

I have one problem though, but it isn't necessarily and error just (I think) an incompatibility with another contrib (MVS or Manual Order Entry).

 

 

My store works fine except for when I attempt to run BPC.....If I run it so to pull orders which were manually entered and entered through the website normally by customers the following happens.

 

the orders that were manually entered works without a problem

 

orders which were entered through the website leaves the product details empty...

 

If you want to see the difference look at: http://www.jtstech.com/shop/batch_orders.pdf

 

Order # 1010 was entered through the website by the customer

Order # 1011 was entered by me through the manual order entry contrib

 

 

Any idea on how I can fix this?

Share this post


Link to post
Share on other sites

This is a great contrib. Thanks for doing so much work with it!

 

I do have a question about the order that the products are displayed within the invoice. How can I control the sort order of the products that are being displayed. On many orders I see Prod1 first, and Prod2 second. But on other orders I see Prod2 first, and Prod1 second. Is there an "easy" way to update this? i would love for it to ALWAYS sort by one specific column. As of right now it seems like its just being displayed by the order that it was placed into the cart.

 

I know this sounds silly. But my client only uses his ecom site once a year at easter for a huge sale they run. They get 6500+ orders in 4 days, selling only 5 different products. And when the kids they hire pack the envelopes to send out they don't like to read and mess up some orders. So always having Prod1 first and Prod2 second would really help them out.

 

Thanks for any help/direction.


Jeff Conklin

Share this post


Link to post
Share on other sites

Hello!

I would like to know how can I create a template in a landscape way? I have already change from portrait to Landscape in the beginning of the template code and it does not work.

Thankyou in advance

Share this post


Link to post
Share on other sites

when i install this contribute i get the following:

 

 

Fatal error: Call to a member function on a non-object in /home/hussain/public_html/os/includes/languages/english/modules/printslip/printslip.php on line 71

 

 

could you please help

Share this post


Link to post
Share on other sites
I would like to know how can I create a template in a landscape way? I have already change from portrait to Landscape in the beginning of the template code and it does not work.

It is possible that the appropriate code has been commented out in admin/batch_print.php

 

printslip.php

Are you sure you have the right forum?

Share this post


Link to post
Share on other sites

My batch print just stopped working yesterday. Now, when I try to pull any status, I get this error:

Fatal error: Call to undefined function: message_handler() in /home/brushwoo/public_html/catalog/amin/batch_print.php on line 48

 

This worked yesterday early morning and not in the afternoon. I looked and saw in my logs that the server was restarted at 11:21 AM. Can anyone guide me to an answer? I had this happen to me on the storefront with credit card entry error messages when I first moved to my new host. I'm concerned that they have upgraded something and I need the batch print almost daily.

Any thoughts?


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites

OK, no. I was wrong. My server was not restarted and I think I loaded an older version of my batch print php file yesterday. Somewhere in the back of my brain there's something about mysql asking for dates in a different way in newer versions. Some minor change in the way to query the db. I may have tweaked it by ftp just after the move to this host (a month ago) and not updated my backup. This is the top of my batch_print.php file and the error is:

Fatal error: Call to undefined function: message_handler() in /home/brushwoo/public_html/catalog/amin/batch_print.php on line 48

 

 
<?php

require('includes/application_top.php');

if ($HTTP_GET_VARS['mkey']) {

$key = $HTTP_GET_VARS['mkey']; 
$message = $error[$key]; 
$HTTP_GET_VARS['act'] = 0; 

}

if ($HTTP_GET_VARS['act'] == '') { $HTTP_GET_VARS['act'] = 0; }

if (strlen($HTTP_GET_VARS['act']) == 1 && is_numeric($HTTP_GET_VARS['act']))
{

switch ($HTTP_GET_VARS['act']) {

case 1:

// CHECK DATE ENTERED, GRAB ALL ORDERS FROM THAT DATE, AND CREATE PDF FOR ORDERS
if (!isset($HTTP_POST_VARS[ 'startdate'])) { message_handler(); }
if ((strlen($HTTP_POST_VARS['startdate']) != 10) || verify_start_date($HTTP_POST_VARS['startdate'])) { message_handler('ERROR_BAD_DATE'); }
if (!is_writeable(BATCH_PDF_DIR)) { message_handler('SET_PERMISSIONS'); }
$time0   = time();
$startdate = tep_db_prepare_input($HTTP_POST_VARS['startdate']);

if (!isset($HTTP_POST_VARS['enddate'])) { message_handler(); }
if ((strlen($HTTP_POST_VARS['enddate']) != 10) || verify_end_date($HTTP_POST_VARS['enddate'])) { message_handler('ERROR_BAD_DATE'); }
if (!is_writeable(BATCH_PDF_DIR)) { message_handler('SET_PERMISSIONS'); }
$time0   = time();
$enddate = tep_db_prepare_input($HTTP_POST_VARS['enddate']);
require(DIR_WS_CLASSES . 'currencies.php');
require(BATCH_PRINT_INC . 'class.ezpdf.php');
require(DIR_WS_CLASSES . 'order.php');

$pdf = new Cezpdf(PAGE);
$currencies = new currencies();

$pdf->selectFont(BATCH_PDF_DIR . 'Helvetica.afm');
$pdf->setFontFamily(BATCH_PDF_DIR . 'Helvetica.afm');
if ($HTTP_POST_VARS['show_comments']) { $get_customer_comments = ' and h.orders_status_id = ' . DEFAULT_ORDERS_STATUS_ID; }
if ($HTTP_POST_VARS['pull_status']){ $pull_w_status = " and o.orders_status = ". $HTTP_POST_VARS['pull_status']; }

$orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . "23:59:59'  and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');

if (!tep_db_num_rows($orders_query) > 0) { message_handler('NO_ORDERS'); }
$num = 0;

while ($orders = tep_db_fetch_array($orders_query)) {

 $order = new order($orders['orders_id']);

if ($num != 0) { $pdf->EzNewPage(); }

$y = $pdf->ezText("PACKING SLIP",COMPANY_HEADER_FONT_SIZE);
$y = $pdf->ezText(STORE_NAME_ADDRESS,SUB_HEADING_FONT_SIZE);
$y -= 10;

 

Line 48 is:

if (!tep_db_num_rows($orders_query) > 0) { message_handler('NO_ORDERS'); }

 

Any thoughts?


-Dan

Always, always back up your files before you make any changes!

Share this post


Link to post
Share on other sites

OK, brain function needs coffee! I remembered and found the problem. It is a date query issue. I needed to put a space in from of the time 23:59:59 here:

. tep_db_input($enddate) . "23:59:59'  and h.orders_id = o.orders_id" . $pull_w_status .

 

Working fine now.


-Dan

Always, always back up your files before you make any changes!

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
Sign in to follow this  

×