Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Batch Print Center (support thread)


blurb

Recommended Posts

Hi, Ihave just installed this contribution and can not get it to print out the labels, all I get is a blank pdf document with 50 pages, wigh are the amount of records I selected.

 

Can anyone please advise what I am doing wrong or is there a code error????

 

No sure why you would get blank pages .. not with the default setup anyway.

Did you change anything ? As mentioned in the readme the label code isn't 100%

 

Do the other types of print work properly ?

cheers

blurb

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 224
  • Created
  • Last Reply

Top Posters In This Topic

I am having problems getting Batch Printer Center to work with CRE Loaded 6.1a. I know that CRE has its own support forums, but I haven?t had much luck from there.

 

After I install Batch Print Center nothing shows up in the admin section under ?Tools? or ?Customer/Orders? section.

If I put the following code in http://{mysite}/admin/includes/boxes/tools.php, the link does not show up.

tep_admin_files_boxes(FILENAME_BATCH_PRINT, BOX_TOOLS_BATCH_CENTER) .

 

However, if I use the alternate code:

'<a href="' . tep_href_link(FILENAME_BATCH_PRINT) . '" class="menuBoxContentLink">' . BOX_TOOLS_BATCH_CENTER . '</a><br>' .

 

The link shows up, but I get the following

Access Denied

No Right Permission Access

Please contact your Webmaster to request more access or if you found any problem.

 

I have followed the directions in the install.txt file and assigned the permissions as noted in the file too.

 

Another note: I installed a base osCommerce site on a test server and was able to get Batch Print Center working on the first try. The mod does not overwrite any files on CRE Loaded 6.1a and only a few files are edited.

 

If anyone can help I would greatly appreciate it. Thanks in advance.

Link to comment
Share on other sites

Im trying 2 install this great looking cont into CRE Loaded but get the following error:

 

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 (1,2) and h.orders_id = o.orders_id and o.orders_status = 1 group by o.orders_id

 

Does this mean my database structure dosnt match...

 

Rich

Link to comment
Share on other sites

I am having problems getting Batch Printer Center to work with CRE Loaded 6.1a.

 

Sounds like a permissions issue. I don't have creloaded installed but try this

Login to your admin, goto Administrator/File access which should show

you the admin boxes section. choose customers , click store files

choose batch print from the drop down list and choose save.

 

Next goto administrator/ member groups/ click groups

choose the group you wish to use the batch print center (top admin)

if your the only user. Click new permission, and then in the tick boxes

make sure you have a tick next to batch_print.php which sets its permission

for you to use it.

 

see how that goes

cheers

blurb

Link to comment
Share on other sites

Im trying 2 install this great looking cont into CRE Loaded but get the following error:

 

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

 

Does this mean my database structure dosnt match...

 

Yes i would think that either you set a prefix during your install of creloaded

or there is no field named orders prefix.

Not sure what to suggest other then finding out if infact you did set a prefix

on your database and if so trying to set that for batch print. I don't use

a prefix and so have never seen this error. What file are you running when you

get the error ? Did you set a prefix during install ?

cheers

blurb

Link to comment
Share on other sites

  • 3 weeks later...

New problem. I have a customer who wants to print out a whole month worth of orders. Currently that is about 355. If I select the "Invoice" template and set the date range from the start of the month to the finish and then click "send" the browser acts like it is going to a new page (like it should) then just stops and says "Done" but I am still on the same page. Nothing was done at all. If I set the date range lower, like 1 day or 2 then it works. So is there a problem with printing so many orders to PDF? I tried it with another template that worked. So some of the templates seemt to be able to hand that many, others do not. Or perhaps it is not even the template. I really do not know at this point. I am trying to find a place to start debugging. Any ideas?

 

Thanks,

Jonathan

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

Link to comment
Share on other sites

  So is there a problem with printing so many orders to PDF?

 

Well I would think its the same error that happens with alot of php

that is maybe the server is timing out prior to getting everything done.

Php scripts that run for more then 30 seconds are often terminiated

before you get the output.

 

Using a different template is an option but if sales increase he may find

a smaller template may start to cause the same issue.

 

What i propose but currently don't have the time to do would be to add some new

code to check how many invoices your query produces and if its over a certain

number, break the query into multiple parts creating multiple pdf files.

 

I would think it would be fairly simple for someone with php knowledge to acheive

this modification. It would mean you could select a month of invoices and the

output would be a list of pdf's ready to open and print.

 

So the question is anyone willing to take on this task.

cheers

shaun

Link to comment
Share on other sites

I just installed Batch Print Center and I get the same error as the person who posted before.

 

===================================================

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.date_purchased between '2005-05-16' and '2005-05-1723:59:59' and h.orders_id = o.orders_id group by o.orders_id

 

[TEP STOP]

===================================================

 

 

I am not using the CRELOADED thing (whatever that is).

 

I am using the Fancier Invoices contribution, but I dont see why it would conflict.

 

Any help would be very much appreciated. I would like to actually use this great tool. Well it sounds/looks like it will be great if I could get it to work.

 

Thanks

Link to comment
Share on other sites

I just installed Batch Print Center and I get the same error as the person who posted before.

 

===================================================

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.date_purchased between '2005-05-16' and '2005-05-1723:59:59' and h.orders_id = o.orders_id group by o.orders_id

 

[TEP STOP]

===================================================

I am not using the CRELOADED thing (whatever that is).

 

I am using the Fancier Invoices contribution, but I dont see why it would conflict.

 

Any help would be very much appreciated. I would like to actually use this great tool. Well it sounds/looks like it will be great if I could get it to work.

 

Thanks

 

REPLY TO MY OWN POST

 

 

I found something that might be a clue as to why its doing this. Look at the image.

 

batchprint.jpg

 

This is a srceen shot of the top of the batch print screen in admin.

 

Notice that the text for TEXT_ORDER_NUMBER_RANGES is not what it should be.

 

Im suspecting it shouldnt be displaying the define tag (or whatever you call it).

 

Im no php guru at all, but it seems to me like its getting stuck here and isnt continuing through the code past this point.

 

I have checked and re checked my installation and it is EXACTLY as the instructions say.

 

I have looked through the code to see if something wasnt closed properly but cannot find anything.

 

Thanks again.

Link to comment
Share on other sites

Ok, I just found the text problem.

 

The define for it was missing from the languages/english/batch_print.php file.

 

Just add this

 

define('TEXT_ORDER_NUMBERS_RANGES','Order Number or Range');

 

to the languages/english/batch_print.php file to fix the text if yours is messed up.

 

 

BUT

 

That did not fix the error posted above. So back to square 1 with that.

Link to comment
Share on other sites

I GOT IT

 

Here is the fix for the 1054 error.

 

 

Open admin/batch_print.php and find this:

 

 

===================================================

 

 

// if there is a invoice number use first order query otherwise use second date style order query

if ($invoicenumbers != '') {

$orders_query = tep_db_query("select o.orders_id,o.orders_prefix,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.orders_id in (" . tep_db_input($invoicenumbers) . ") and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');

} else {

$orders_query = tep_db_query("select o.orders_id,o.orders_prefix,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');

}

 

===================================================

 

 

AND REPLACE WITH THIS

 

 

===================================================

 

// if there is a invoice number use first order query otherwise use second date style order query

if ($invoicenumbers != '') {

$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.orders_id in (" . tep_db_input($invoicenumbers) . ") and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');

} else {

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

}

 

====================================================

 

 

 

It was the date issue previously posted about.

 

This is the only change needed.

 

 

This is a cool contrib. Thanks.

Link to comment
Share on other sites

I GOT IT

 

Here is the fix for the 1054 error.

 

I think that must be a issue for certain date/country settings

as I have never been able to duplicate that date error

but I have only run australian date formats.

 

Good to hear you have it working

cheers

blurb

Link to comment
Share on other sites

I would think it would be fairly simple for someone with php knowledge to acheive

this modification. It would mean you could select a month of invoices and the

output would be a list of pdf's ready to open and print.

 

So the question is anyone willing to take on this task.

cheers

shaun

 

This is something I was thinking as well, but wanted to see if someone else knew of another way. Another thought I had was to ditch PDF's altogether and just print out to the screen. Either way, I plan on working on this as my customer requires the ability to print a month of orders and that can be quite a hefty amount of trees.

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

Link to comment
Share on other sites

Another thought I had was to ditch PDF's altogether and just print out to the screen. 

 

I don't really like using PDF's myself but the advantages of them out weighed

printing to screen like in the fanicer invoice type contributions. Being able

to print backgrounds (without out having to turn them on) and pixel perfect

alignment and perfect page breaks just can't be acheived with simple html

and print to screen.

 

If you are wanting to print a whole months worth of invoices maybe its not a invoice

you require maybe its a report of some sort.

If you didn't need every single detail of a order you could print a summary of

your invoices and have several invoice details all on the one page.

You could probably modify the labels template and have a invoice fit inside

each label and get 15 to a page. If its not going to a customer the print could be

reduced to fit alot more data.

cheers

shaun

Link to comment
Share on other sites

If you are wanting to print a whole months worth of invoices maybe its not a invoice

you require maybe its a report of some sort.

 

That is a very good point. I think I will question my customers purposes as this whole situation could be averted. I agree with you on the benefits of the PDF. If this is still something that is needed I think I will work on splitting the output, as you mentioned.

 

Thanks,

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

Link to comment
Share on other sites

I'm unable to get the default packing slip to lign up properly. I want to remove the line that runs across the page under the store address & the verified by box, or at least drop it down some. It currently slashes right through the Order Date and part of the the verified by box.

 

I also want to move the order date to the left some, and put some space between the "SOLD TO" and "SHIP TO" and their respective boxes. I can't seem to get these parameters set. Everything is just squished too close together. Otherwise I don't mind using this "plain" packing slip for now.

 

Great contribution otherwise! I've been looking for something like this.

Link to comment
Share on other sites

I'm unable to get the default packing slip to lign up properly.

 

Add

require(BATCH_PRINT_INC . 'templates/' . 'grid.php');

To your template to turn the grid display on which hopefully will allow

you to find out the right cordinates to place your lines and elements.

 

The templates are heavily commented but if you can't find the exact

section divider or element try using // infront of items to comment them

out and see what disappears till you find the right item your looking for.

 

Some of the elements get there position based on what the last element

location was set to, plus or minus a number so you can use statements like

$pdf->ezSetY($pos - 40 ); to change the postion of the cursor prior to the

next element being drawn on the page.

 

Hope these hints helps

cheers

shaun

Link to comment
Share on other sites

I seem to be ok with the boxes...but the elements themselves I'm totally lost on how exactly they're moved around. I did turn on the grid but it's the actual movement I have trouble with.

 

Can you explain how exactly I would move the Store Address down just a "notch" or two? That'd at least get me started and take care of one problem.

Link to comment
Share on other sites

  • 2 weeks later...

I have added a new field to the database called product_bin_number using "New Fields with Easy Populate (4 Mar 2005)". How can I add this new field to the packing slip template in place of the model number?

Link to comment
Share on other sites

That is a very good point.  I think I will question my customers purposes as this whole situation could be averted.  I agree with you on the benefits of the PDF.  If this is still something that is needed I think I will work on splitting the output, as you mentioned.

 

Thanks,

 

Still needed by the customer. I have now modified the batch_print.php file to create multiple PDF files depending on whatever threshold I specify. I have it set to 50. Great feature. I anyone is interested perhaps I will post it to the contrib.

 

However, this did not solve the problem of the page hanging when upwards of 100+ orders are selected. After extensive debugging I have found the line of code that is causing the problem.

 

require(DIR_WS_CLASSES . 'currencies.php');
require(BATCH_PRINT_INC . 'class.ezpdf.php');
require(DIR_WS_CLASSES . 'order.php');

//grab only the page size and layout from template
require(BATCH_PRINT_INC . 'templates/' . $HTTP_POST_VARS['file_type']);

/********************************/
$pageloop = "1";
/********************************/

//$pdf = new Cezpdf($HTTP_POST_VARS['page'],$HTTP_POST_VARS['orientation']);

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']; }

 

The "$pageloop = 1" line is what kills it. If I comment that out, then everything seems to work just fine.

 

What does "$pageloop = 1" do? It seems to create a new object:

 

if ($pageloop == "0") {
    $pdf = new Cezpdf(A4,portrait);
} else {

 

Any ideas why that works? But the if the loop = 1 it does not?

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

Link to comment
Share on other sites

I have now modified the batch_print.php file to create multiple PDF files depending on whatever threshold I specify.  I have it set to 50.  Great feature.  I anyone is interested perhaps I will post it to the contrib.

 

$pageloop = "1";

 

What does "$pageloop = 1" do?  It seems to create a new object:

 

Im interested in what you have done for multiple pages.

If the changes are simple just post them here for me to look at.

 

As for the page loop .. well thats my late night hack of someone else's code.

It was done early in the coding of batch print center and seeing as it worked I

never bothered to learn the right way to do what that loop does.

 

If you look through the code of batch_print.php you will see twice I call

require(BATCH_PRINT_INC . 'templates/' . $HTTP_POST_VARS['file_type']);

The first call should not infact be a require but some other php call to simply

grab values from the template file and not run the template like i do twice.

 

So around where is says //grab only the page size and layout from template

needs to be changed from a "require" to different code to simply grab from the

template values like these (these values replace the loop in the template)

define('PAGE_SIZE','A4');

define('PAGE_ORIENTATION,'portrait');

 

And then in the batch_print.php those values could be used like this

$pdf = new Cezpdf($PAGE_SIZE,$PAGE_ORIENTATION);

 

So any php guru want to code that up Im not going to argue.

Without the loop the page size isn't gathered from the template

and although in most cases that is ok the problem lies if you had different paper

sizes for different templates the templates do infact need to set the page size.

cheers

shaun

Link to comment
Share on other sites

I have added a new field to the database called product_bin_number using "New Fields with Easy Populate (4 Mar 2005)". How can I add this new field to the packing slip template in place of the model number?

 

I have tried several different ways to get this work and I either get nothing or the word "Array". I want to display the product_bin_number from the products table in place of the model number on the packing slip. I have the formatting done, I just can get the bin number to display correctly.

 

I would appreciate any ideas or suggestions.

Link to comment
Share on other sites

I have tried several different ways to get this work and I either get nothing or the word "Array". I want to display the product_bin_number from the products table in place of the model number on the packing slip. I have the formatting done, I just can get the bin number to display correctly.

 

I would appreciate any ideas or suggestions.

 

Use the function "print_r($arrayname)" on the variable that is printing out "Array". That will tell you what is in the array and then you can reference the contents if what you want is in there.

Jonathan Duncan

JKD Web Magic

Web Site Hosting and Design

http://www.jkdwebmagic.com/

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