Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Batch Print Center (support thread)


blurb

Recommended Posts

Is there some sort of PDF code manual that anyone knows off so I can try an fix this?........Shaun - If you're out there....HEEEEELLLLPP (pretty please).http://www.oscommerce.com/forums/style_images/1/folder_rte_images/quote.gif

Wrap in a Quote

 

Hi Jodes, I have a suggestion, but I'm not sure if it will work. I can't test anything because I keep getting the error popups when the pdf files are generated. Looking at what you said in your post and at the invoice code, it looks like maybe the <br> isn't in quotes and it should be. It shouldn't be printing out with your shipping info. I would first check for the quotes and the I would try testing putting it in other places in the code where you know things are printing on the pdf file and then try to put it where you need to. Maybe find this line:

 

$pdf->addText (LEFT_MARGIN ,$pos -= PRODUCT_TOTALS_LEADING,PRODUCT_TOTALS_FONT_SIZE,"<b>" . str_replace($vilains , $cools ,$order->totals[$i]['title']) . "</b>");

 

And add a bunch of <br> characters between the quotes like this:

 

$pdf->addText (LEFT_MARGIN ,$pos -= PRODUCT_TOTALS_LEADING,PRODUCT_TOTALS_FONT_SIZE,"<br><br><br><br><br><br><br><b>" . str_replace($vilains , $cools ,$order->totals[$i]['title']) . "</b>");

 

And see if that works. Then I would try putting it in other spots and see what happens.

 

Just a thought.

 

Now, can anyone help me with my error popup problems? Here are two more:

 

"Illegal operation 'BT' inside a text object."

 

"There were several parse errors on this page."

 

Corinne

Link to comment
Share on other sites

  • Replies 224
  • Created
  • Last Reply

Top Posters In This Topic

For the people who get "no orders" when putting in a date range, I fixed mine by adding a space in front of 23:59:59 in $orders_query

i.e. in the file /admin/batch_pring.php

change from:

$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');

 

to:

$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');

Link to comment
Share on other sites

Okay, I've been messing around a while and I got the date thing to work with two different admin/batch_print files. The space before "23:59:59" works on the 1054 file (THANKS GATTA!) and the date fix by Travis Wiznuik also works.

 

I'm still getting those stupid popup problems. Here's yet another error message in the popup:

 

"There were too many arguments."

 

HELLLLLP PLEEEEASE!

Corinne

Link to comment
Share on other sites

I'm still having problems with the popup error messages. I've been thinking maybe there is a conflict with a couple of modules. I have about 19 modules added. The only ones that I think might have a possibility of a conflict are the "Purchase Without Account" and the "Cancelled Orders Module".

 

If the Batch Print Center Module is going through an array of orders and comes to one of the cancelled ones, maybe it is causing it to go haywire because its not finding what it expected to find. Also, if its looking for a customer's account and they went through checkout without creating an account, maybe that is messing it up. Can someone tell me how it accesses the orders/accounts?

 

Again, here is the list of typical errors I'm getting:

 

"Illegal operation 'BT' inside a text object."

 

"There were several parse errors on this page."

 

"There were too many arguments."

 

"An unrecognized token 'City,' was found."

 

"There was a problem reading this document (114)."

 

"An unrecognized token 'ETT' was found."

 

"An unrecognized token 'F2' was found."

 

"A drawing error occurred."

 

Does anyone have any idea what these errors mean?

 

Corinne

Link to comment
Share on other sites

Someone else had this same problem before, but there are no answer to the problem then.

 

I have installed batch_print, it seems to be OK as far as trying to print something. When I select dates and press submit i get following:

 

 

1054 - Unknown column 'o.orders_prefix' in 'field list'

 

select o.orders_id,o.orders_prefix,h.comments,MIN(h.date_added) from orders o, orders_status_history h where o.orders_id in (4) and h.orders_id = o.orders_id group by o.orders_id

 

[TEP STOP]

 

 

Does someone no now what is the reason?

Link to comment
Share on other sites

  • 2 weeks later...
Thanks .. I love it too but Im biased.

I had hoped the community had gotten behind it to create more templates

but alas there has been very little interest and only a couple of extra templates.

 

If you are interested in more templates maybe you should post suggestions here

and maybe if i get time or maybe others will be able to help.

 

I always had hoped that others would create templates that i never dreamed of.

I suppose I should be happy that although I have had very few comments

about this contrib I have also had very little in the way of errors reported.

 

cheers

shaun

 

 

Great Contribution. I am unimpressed, as many designers would be, at the template look and selection. I want to design a new invoice and labels template (and maybe more), but am unsure how to do this easily (easily means with little coding). I have Acrobat Prof. 7 and it comes with Adobe Designer to design dynamic PDF templates. Can these be used? I would be more than happy to design killer templates if someone would be willing to work with me on getting these files to work. Shaun, I think you would be the best one to help, but anyone, please let me know ASAP, as I think this contribution could be much better for well designed templates.

 

Thanks

Link to comment
Share on other sites

Im no coder, and no designer. I had a need for soemthing for 1 client and batch print center was born.

 

I have always hoped others would create way better templates and share them with us all. There has been a couple but not as many as i had hoped.

 

Adobe products however aren't much help. Adobe creates pdf's and not my version of a template. The way the BPC templates work are php code that grab database info and write it to the pdf class which creates the pdf.

 

The best looking templates could be acheived using background images inserted by a template php.

 

So suggestion would be to create 1 or a couple of graphics in png or jpg format to watermark

the pdf files and get a php template to write plain text info ontop, making it seem like it all came

from the same generation process.

 

The default templates have done there job and if i had time i would design new ones.

The only stumbling block is everyone wants a different look,feel. My largest client is printing large volumes of invoices every hr so the basic templates have saved on ink if nothing else.

 

This is also getting long in the tooth. So ideally someone should re code the entire concept into a much smoother application as im sure there are much better ways of doing what i stuck together so long ago.

 

cheers

shaun

Link to comment
Share on other sites

  • 1 month later...

Hi, Im using this great contribution Batch print center.

 

Everything works for printing and sow. But when printing packing slip i get the line across Verified by, and all the text is outside the boxes.

 

Is there someone that nows how i can fix it?. I have tried to figure it out, but im not that good in php sow i didn't manage it.

 

Cheers

Thomas B

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

I am testing Batch Print Center and it works great except when I print an invoice (or any template with order totals in it) I get "<span class=currency_" in the places where the sub total, UPS shipping total and Total should be. Does anyone know of how to fix this?

 

Thanks,

Clayton

Link to comment
Share on other sites

Hi,

 

I am testing Batch Print Center and it works great except when I print an invoice (or any template with order totals in it) I get "<span class=currency_" in the places where the sub total, UPS shipping total and Total should be. Does anyone know of how to fix this?

 

Thanks,

Clayton

Link to comment
Share on other sites

I don't think the pdf templates like html.

Not sure if this is for the same reason but I did notice something similar after adding the Easy Discount Contribution. I had some html appearing in the template in from of the total. Something like

<font color="red">

. When I removed this from the class everything worked normally.

Link to comment
Share on other sites

  • 2 months later...

Hello All, I have just installed and set up batch print and its super !

 

I have fixed up an order template but i am having a bit of trouble removing some of the columns. Basically none of my items attract tax so i don't need 4 price columns. As you can see in the attached image i just managed to get rid of the column by just commenting them out. However how to i get the columns i have justified to the right ? Thanks Alex

 

picture22tm5.png

Link to comment
Share on other sites

  • 2 weeks later...

I got the labelprinting function working, but I'm still puzzled about the label measures.

 

define('PAGE_WIDTH', '8.9');

define('PAGE_HEIGHT', '3.6');

$pdf = new Cezpdf(array(PAGE_WIDTH, PAGE_HEIGHT));

 

My continuous labels are 101,6 x 35,7 mm

The vertical space between the labels is 2 mm

 

What are the correct dimensions I need to define (I really don't understand the formula ("I think dimensions are (72 * inches)" :huh:)

 

If someone can do the correct calculation, it would be superb !

Thanks in advance for your help.

Edited by Sixten
Link to comment
Share on other sites

  • 2 weeks later...

Good evening,

 

this contribution is excellent and saves us a lot of time. thank you for that.

We still have a few glitches to fix such as "header already sent" but it works.

 

The thing is, I would like to call the page through another page : for instance, I'm editing oID=XXX in the admin/orders.php and I would like to be able to "call the page" to print a new invoice or packing slip.

what kind of url should I call

/batch_print.php?oID=XX&type_of_document_called.

 

I hope my question is clear enough.

Thank you.

Nicholas

Link to comment
Share on other sites

Hi

 

I think I found a bug. Could you please do some testing on your end by trying to print a batch of orders from an interval with non-consecutive order numbers (meaning some orders have been deleted in between).

 

It only prints one here.

 

Please confirm if you have the same issue

 

Thanks

Edited by pixclinic
Link to comment
Share on other sites

  • 2 weeks later...
Sawwy mate..

 

Should have been more specific. It is the orders_products.orders_products_id

I am just so used to work with "Item number" for a product unique identifier.

 

OK

 

Not difficult:

 

in admin>includes>classes>order.php

 

find

 

$orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

 

replace by: (switch the product model and product ID)

 

$orders_products_query = tep_db_query("select orders_products_id, products_name, products_id, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$order_id . "'");

 

and in the same file, a little below, look for:

 

  'model' => $orders_products['products_model'],

 

replace by

 

  'pid' => $orders_products['products_id'],

 

 

then, in your invoice or slip template, look for

 

$pdf->addText($x += PRODUCTS_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['model']);

 

and replace by

 

$pdf->addText($x += PRODUCTS_COLUMN_SIZE,$pos,TABLE_HEADER_FONT_SIZE,$order->products[$i]['pid']);

 

that's it! (in a slip+invoice template, you have two occurences of this)

 

Enjoy!

Link to comment
Share on other sites

Thanx alot

 

I just love this contrib, just what i was looking for as my orders are packed oir of house once a week. Now i just need to make a little change, such that the script generates a batch-id for each time I print a batch, and update the orders, such I can reprint if needed.

 

osCommerce is probly the best sjoppinmh system i've seen until now.

 

Best regards

Palle

Link to comment
Share on other sites

Hi,

 

I've installed Batch Print center and all is fine except for one thing...if I specify a single order number to print, and I use the Invoice template or the packing slip template, the PDF looks fine on screen but prints out distorted. The distortion means that the top few lines of the header info is chopped off, and the last few lines of print are repeated.

 

I've done some tests:

 

If I select a range of orders, rather than a single order number, the invoice template and the packing slip template work perfectly and all pages of the PDF print out fine.

 

Similarly, if I use the packing slip and invoice template (which creates two pages) it works fine, even if I only choose to print one of the two pages of the PDF.

 

I've wracked my brains on this to see what the difference between the two templates is and I can't crack it - although obviously it's to with the PDF being only a single page in length.

 

Does anyone have any suggestions on this? I'm using Acrobat Reader 7.0 if that's remotely connected to the problem....

 

grateful for any advice.

 

A.

Link to comment
Share on other sites

Hi,

 

I've installed Batch Print center and all is fine except for one thing...if I specify a single order number to print, and I use the Invoice template or the packing slip template, the PDF looks fine on screen but prints out distorted. The distortion means that the top few lines of the header info is chopped off, and the last few lines of print are repeated.

 

A.

 

I use MacOs X 10.4.7 , and neither Safari nor Firefox could reproduce the problem.

Link to comment
Share on other sites

I use MacOs X 10.4.7 , and neither Safari nor Firefox could reproduce the problem.

 

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.

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