Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] PDF Customer Invoice


chris23

Recommended Posts

Hi there!

 

First of all: thanks for the contrib! I really think that's said way too little. Creating one is a lot of work, en we can get it in 5 minutes & for free...

 

Everything works fine, except one thing went wrong. Some time ago I installed this contribution. On the order page in the admin section, I used to have a button to edit my orders. One problem: after I installed your contrib this button is gone. No errors or anything, it just isn't there anymore. Do you have any idea how to get it back? I guess the two adjustments conflict somewhere, but I have no idea where to look.

 

Thanks so much in advance!

Link to comment
Share on other sites

Fixed! And that with my coding skills... ;)

Thanks again!

 

Hi Daniel,

Glad you got it fixed.

 

First of all: thanks for the contrib! I really think that's said way too little.

 

Actually, I find that most people are very appreciative!

 

Regards,

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

how to add Euro symbol in Pdf Customer Invoice _v1.1 ?

 

Any help will be highly recommended.

 

thanks and Regards,

Brijesh.

 

Unfortunately, there's no easy fix for this. The fonts supplied with fpdf use iso-8859-1 encoding and the euro symbol is missing from this.

 

You can create and install your own fonts though.

 

A good place to start is:

 

http://www.weberdev.com/ViewArticle/FPDF,-...-PDFlib-library.

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

where does it gets his info for the website adres

because it uses my default website adres and i want this to be different

 

pdfinvoice.php gets this from the value in admin -> Configuration -> My Store -> Store address & Phone number.

 

If you want something different, edit pdfinvoice.php

 

 

FIND:

 

$this->MultiCell(50, 3.5, tep_html_entity_decode(STORE_NAME_ADDRESS),0,'L');

 

REPLACE WITH

 

$store_address = "Your store street\nStore City";
$this->MultiCell(50, 3.5, tep_html_entity_decode($store_address),0,'L');

 

Set $store_address to what you want. Remember to use \n to force a line break

 

and it would be realy cool if it can mail the pdf files to

 

I've thought about this but:

 

1. The osCommerce e-mail function doesn't support emailing of attachments directly (although the class it uses does support this having looked through it briefly)

2. When would you email the invoice? Automatically on payment or manually from within admin?

 

Cheers

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi

 

I am having a bit of a problem i hope someone can help.

 

The problem i am having is my customers can't see the box for PDF Invoice. As i assume it should be in account_history_info.php when customer are logged in to see therir invoice.

 

I can see the invoice manually eg www.someone.com/pdfinvoice.php?order_id=352

 

Thanks

Link to comment
Share on other sites

  • 4 weeks later...

All,

When I try to access the customer's invoice from the admin panel a new http tab is opened and I am asked to login as the customer. I have double checked all of the programming and cannot figure it out.

 

I do see this in my Apache server access log:

127.0.0.1 - - [20/Jan/2008:06:23:10 -0500] "GET /catalog/pdfinvoice.php?order_id=9&passthruID= HTTP/1.1" 302 - "http://localhost/catalog/admin/orders.php?cID=9" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.10) Gecko/20071213 Fedora/2.0.0.10-3.fc8 Firefox/2.0.0.10"

 

The customer ID is set correctly but the passthruID is blank. What is wrong here?

 

Thank you, Bob

Link to comment
Share on other sites

The customer ID is set correctly but the passthruID is blank. What is wrong here?

 

Hi Bob,

 

Can you please double check that in catalog/admin/orders.php you have

 

AFTER:

 

require('includes/application_top.php');

 

 $pass_phrase="jgdwuyuhfkjlljslfjsl";
$pass_phrase_hash=md5($pass_phrase);

 

and that you have a random value applied to $pass_phase

 

I can't think of any other reason your $pass_phase would have no value

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi Chris,

 

How are you doing?

 

just wondered if there was any way to stop the invoice replacing characters such as " and ' and & with code such as &quote etc, it confuses the postmen who have to decipher them when people put them around the name of thier houses :D

 

Any ideas?

 

Also any thoughts on how I could get the comments to show on the invoice? ;)

 

All the best

 

Dave

Link to comment
Share on other sites

Hi Chris,

 

How are you doing?

 

just wondered if there was any way to stop the invoice replacing characters such as " and ' and & with code such as &quote etc, it confuses the postmen who have to decipher them when people put them around the name of thier houses :D

 

Any ideas?

 

Also any thoughts on how I could get the comments to show on the invoice? ;)

 

All the best

 

Dave

 

 

Hello mate,

 

I'm fine thanks.

 

I'm surprised you're getting encoded characters - pdfinvoice.php handles the conversion of encoded characters to literal ones.

 

I know you're using a customised file, so you may need to apply the following function manually to each returned variable / constant that may have an encoded character:

 

tep_html_entity_decode()

 

Have a look in pdfinvoice.php to see where I've used it (around addresses, names mainly)

 

Your second question surprised me - I wrote up a HOWTO "comments" fix and uploaded it back in early December - see post #185. It's quite straight forward and expands on your suggestion for code added to the order.php class so that the coments code can be accessed in other areas of the site if needed.

 

Good to hear from you,

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Aha...

 

I had a baby boy on the 30th of November, so that, combined with a shop move in December and the Christmas rush means this is the first time I've been on the forum since we last spoke :)

 

Thanks for the info and sorry I had to ask :)

 

All the best

 

Dave

Link to comment
Share on other sites

Just taken a look, and once again it's due to my mixing and matching of contributions that my html characters were messed up. When I get 5 minutes I'm going to ditch my botched attemp in install yours :)

 

Thanks for taking the time to write the comments tutorial, just had a quick look and I'm sure there will be a question or two ;)

 

Thanks for your help

 

Dave

Link to comment
Share on other sites

I had a baby boy on the 30th of November

 

Congratulations!

 

I suspect you'll be sleep deprived for at least the next 10 years so I wouldn't go fiddling with your website ;)

 

I've got two boys - one of 3 years and one of 17 months and I understand fully why you've not been on the forum.

 

Make the most of him whilst he's tiny. It really doesn't last for long.

 

Kind regards,

 

Chris

Edited by chris23

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Help,

 

I can't seem to get this contrib to work on my live store.

 

I first installed to my off-line test store and was able to get it working without any real trouble. I had a typo in config for my store logo, but I found and corrected that and everything works great. Now I want it on my live store and I get this error message (php error_reporting=on)...

Warning: getimagesize(PDF_INVOICE_IMAGE) [function.getimagesize]: failed to open stream: No such file or directory in /var/www/catalog_orig/pdfinvoice.php on line 152

Warning: getimagesize(PDF_INVOICE_IMAGE) [function.getimagesize]: failed to open stream: No such file or directory in /var/www/catalog_orig/fpdf/fpdf.php on line 900
FPDF error: Image file has no extension and no type was specified: PDF_INVOICE_IMAGE

And in my log files I get this...

[Fri Jan 25 11:44:39 2008] [error] [client 172.16.88.6] PHP Warning:  getimagesize(PDF_INVOICE_IMAGE) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: No such file or directory in /var/www/catalog_orig/pdfinvoice.php on line 152, referer: https://secure.rlknight.com/account_history_info.php?order_id=1235
[Fri Jan 25 11:44:39 2008] [error] [client 172.16.88.6] PHP Warning:  getimagesize(PDF_INVOICE_IMAGE) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: No such file or directory in /var/www/catalog_orig/fpdf/fpdf.php on line 900, referer: https://secure.rlknight.com/account_history_info.php?order_id=1235

From the messages above it looks to me like my logo isn't being found even though my logo is in catalog_orig/images. I've gone over every step of the install and everything looks correct. I've looked at the configuration table and all 18 PDF Invoice entries have the same configuration_group id (113) and PDF_INVOICE_IMAGE has the correct information.

 

As I said above, this worked on my test store and the live store is virtually identical. So what could be causing this problem?

 

Thanks,

Rick

Link to comment
Share on other sites

Help,

 

I can't seem to get this contrib to work on my live store.

 

Thanks,

Rick

 

Hi Rick,

 

What exactly have you put in config -> pdf invoices -> choose logo?

 

Regards,

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Help,

 

I can't seem to get this contrib to work on my live store.

 

I first installed to my off-line test store and was able to get it working without any real trouble. I had a typo in config for my store logo, but I found and corrected that and everything works great. Now I want it on my live store and I get this error message (php error_reporting=on)...

 

Nevermind, I found the problem. I have several contributions installed, among them, Configuration Cache. For some reason Configuration Cache cached the my configuration prior to me setting up the PDF Invoice config. Deleted the cache and everything is OK.

 

Great contrib.

 

Thanks,

Rick

Link to comment
Share on other sites

Chris,

 

I have a suggestion for an addition to this contribution. PDF Packing List. It looks like most of the work for this is already done. Some modification to pdfinvoice.pdf and another button.

 

Just a thought,

Rick

 

Thanks again for this contrib.

Link to comment
Share on other sites

Chris,

 

I have a suggestion for an addition to this contribution. PDF Packing List. It looks like most of the work for this is already done. Some modification to pdfinvoice.pdf and another button.

 

Just a thought,

Rick

 

Thanks again for this contrib.

 

Hi Rick,

 

Good idea. I've thought for a long time that the osC packing list is spartan.

 

What features do you think should be on the list (and what shouldn't be)?

 

My thoughts:

 

1. No logo

2. Large font for quantity, product & code to help with picking

3. "Picked By" and "Checked By" areas

4. Total order weight in Kg (?)

5. No prices

 

Cheers

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

Hi Rick,

 

Good idea. I've thought for a long time that the osC packing list is spartan.

 

What features do you think should be on the list (and what shouldn't be)?

 

My thoughts:

 

1. No logo

2. Large font for quantity, product & code to help with picking

3. "Picked By" and "Checked By" areas

4. Total order weight in Kg (?)

5. No prices

 

Cheers

 

Chris

Chris,

 

I think I would keep the logo just so the invoice and packing list have a cohesive look. In fact I would make the upper half of both look pretty much the same with the exception of one being the invoice and the other the packing list. I too, would add Picked By and Checked By boxes and I would keep the weight. No price or tax information.

 

Also, the more pdfinvoice.php and pdfpackinglist.php resemble each other the easier it will be for store owners to modify them.

 

Thanks again for PDF Invoice and for considering my ideasfor PDF Packing List.

 

Rick

Link to comment
Share on other sites

Hi Chris,

 

first of all thank you for making this contribution. It's so useful and looks our shop more proffesional.

 

I've installed admin module of your pdf invoice contrib. I've got a small problem which I couldn't resolve.

 

If you could help me I'd appreciate.

 

when I click invoice link (create pdf invoice) that shows on admin page the path of the link shows as something like "http://xxxx.com/admin/HTTPS_SERVER/pdfinvoice.php?order_id=000014&passthruID=xxxxx&osCAdminID=xxxxxxx"

I believe that "HTTPS_SERVER" is the source of the problem, but I couldn't eliminate this problem.

refere code is in the orders.php;

		$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link('../pdfinvoice.php', 'order_id=' . $oInfo->orders_id . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">' . tep_image_button('button_invoice_pdf.gif', IMAGE_ORDERS_PDF_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

isthere any way to get rid of this problem chris, I'm not sure where I'm doing wrong. thank you in advance.

Link to comment
Share on other sites

when I click invoice link (create pdf invoice) that shows on admin page the path of the link shows as something like "http://xxxx.com/admin/HTTPS_SERVER/pdfinvoice.php?order_id=000014&passthruID=xxxxx&osCAdminID=xxxxxxx"

I believe that "HTTPS_SERVER" is the source of the problem, but I couldn't eliminate this problem

 

Hi,

 

HTTPS_SERVER is a configuration constant found in includes/configure.php and includes/admin/configure.php

 

It should always be set to a value, regardless of whether you're using SSL or not. Please check what you have for HTTPS_SERVER in these files

 

That said, I've no idea why HTTPS_SERVER should end up in the url you posted!

 

HTH

 

Chris

Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored.

Google Site Search is your friend

My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes

Link to comment
Share on other sites

try this..

 

<a href="' . tep_catalog_href_link('pdfinvoice.php', 'order_id=' . $HTTP_GET_VARS['oID'] . '&passthruID=' . $pass_phrase_hash, 'SSL') . '" TARGET="_blank">

 

BlackCap

 

Perfect! Thanks BlackCap it worked! Much appreciated.

 

Chris, thanks for your reply as well.

Link to comment
Share on other sites

Hello Chris,

I have a problem with this contribution. I installed everything well but does not work well, provided I get this. I have installed other contributions:

 

http://www.oscommerce.com/community/contributions,4999

http://www.oscommerce.com/community/contributions,5322

http://www.oscommerce.com/community/contributions,1778

http://addons.oscommerce.com/info/2521

 

It is possible that these contributions affect pdfinvoice?

As possible solutions to this problem?

I do not know anything about php but thank all aid.

 

My English very bad, I hope you know excuse.

Greetings from Spain.

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