Jump to content
chris23

[CONTRIBUTION] PDF Customer Invoice

Recommended Posts

It's looking like this http://www.g2distribuidora.com/pdfinvoice.pdf

 

What is wrong??

Can you help me?

 

This issue was answered in post #396 of this thread (this post links to an even earlier post)

 

And how can I add a line with space for customer signature?

 

Depends where you want it placed ...

 

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

Share this post


Link to post
Share on other sites
This issue was answered in post #396 of this thread (this post links to an even earlier post)

 

 

 

Depends where you want it placed ...

 

HTH

 

Chris

 

 

At the bottom (near footer)

Share this post


Link to post
Share on other sites
Managed to install this contribution and it works great, with one exception. The inc Tax field is not showing any tax added. For example, here is the invoice generated from OSAdmin:

 

os_invoice.jpg

 

where the tax is correctly shown. Now for the pdf invoice:

 

pdf_invoice.jpg

 

Although the VAT is correct, the line items are wrong.

 

Any ideas?

 

Very odd. Both pdfinvoice.php and invoice.php use the same standard osc functions format() and tep_add_tax() to display the price with the tax component.

 

Have you modified either of these functions (found in includes/classes/currencies.php or includes/functions/general.php respectively)?


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

Share this post


Link to post
Share on other sites
after decrease the font size to 1 I m getting this result http://www.g2distribuidora.com/pdfinvoice2.pdf

 

:(

 

Any Idea?

 

Hoe str_replace works? I'm a noooob lol

Thanks

 

 

Font size 1 is way too small! 6 or 8 is about the smallest you can do.

 

As for str_replace, have a look at the documentation on php.net:

 

http://uk2.php.net/str_replace

 

This useful feature works for any php function, just place the function you want to know about after http://php.net e.g. http://php.net/function_name_here

 

HTH


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

Share this post


Link to post
Share on other sites

We have installed the new module and we are not seeing the pdf showing up on our site at all, when we logon we are unable to see under account history.info , there are no pdf showing like the screen shots in the file. also do you need to unstall both files to make this work. please let me know

 

Version running is 2.2.rc2

Share this post


Link to post
Share on other sites
Very odd. Both pdfinvoice.php and invoice.php use the same standard osc functions format() and tep_add_tax() to display the price with the tax component.

 

Have you modified either of these functions (found in includes/classes/currencies.php or includes/functions/general.php respectively)?

 

No I don't think so.


t o n e u s

Share this post


Link to post
Share on other sites

hello,

 

i'm a error:

 

FPDF error: Some data has already been output, can't send PDF file

 

and i do that you say with the tag <? but it's not good and i always this error message.

 

I have do again my installation but it does not work so.

 

can you help me to resolve this problem?

 

thinks

Share this post


Link to post
Share on other sites

hello,

 

it's ok for me but i would like a sub total and TVa.How can i do it?

 

thinks:

 

 

pS: i'm sorry but my english is not very good.

Share this post


Link to post
Share on other sites

Hello Christian,

Thank you for an excellent contribution. I hope you see the amount of traffic here as a sign of how much it was needed. Also I would like to say I have never seen a better supported contribution on all the forums. Congrats.

First I would like to say I was having the same problem as others on the order total lines running over. The best solution I saw you post was #87. To others having the same problem please look there and read the forum before posting. Also to maista forget the standard paypal contribution it's junk IMHO. Move on to the paypal IPN it is coded by the creators of Oscommerce and is supported by them, as a bonus I can tell you from experience that it works great with this contribution, no conflicts.

I am going to install a gift certificate with account balance contribution. I am wondering if you can advise about having those fields show up on the pdf invoice.

Thanks

Christian


On your last day only you will have to approve or disaprove of how your life has been.

Share this post


Link to post
Share on other sites
I am going to install a gift certificate with account balance contribution. I am wondering if you can advise about having those fields show up on the pdf invoice.

 

Hi Christian,

 

Thanks for your post. Can you let me know which contribution you intend using (there are several CCGV contibs out there; Vger's CCGV(Trad) is by far the best IMHO)?

It should be possible to add the extra information to the PDF.

 

Kind 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

Share this post


Link to post
Share on other sites

Need a little help adjusting a field. Sample is below and the area inside the circle is my concern.

 

pdf_invoice.jpg

 

The first code the title boxes is below:

function output_table_heading($Y_Fields_Name_position){
   global  $pdf, $cell_color;
//First create each Field Name
//Gray color filling each Field Name box
$pdf->SetFillColor($cell_color[0],$cell_color[1],$cell_color[2]);
//Bold Font for Field Name
$pdf->SetFont(PDF_INV_CORE_FONT,'B',10);
$pdf->SetY($Y_Fields_Name_position);
$pdf->SetX(6);
$pdf->Cell(9,6,'Qty',1,0,'C',1);
$pdf->SetX(15);
$pdf->Cell(27,6,TABLE_HEADING_PRODUCTS_MODEL,1,0,'C',1);
$pdf->SetX(40);
$pdf->Cell(108,6,TABLE_HEADING_PRODUCTS,1,0,'C',1);
//$pdf->SetX(105);
//$pdf->Cell(15,6,TABLE_HEADING_TAX,1,0,'C',1);
$pdf->SetX(148);
$pdf->Cell(25,6,TABLE_HEADING_PRICE_EXCLUDING_TAX,1,0,'C',1);
//$pdf->SetX(138);
//$pdf->Cell(20,6,TABLE_HEADING_PRICE_INCLUDING_TAX,1,0,'C',1);
$pdf->SetX(173);
$pdf->Cell(25,6,TABLE_HEADING_TOTAL_EXCLUDING_TAX,1,0,'C',1);
//$pdf->SetX(178);
//$pdf->Cell(20,6,TABLE_HEADING_TOTAL_INCLUDING_TAX,1,0,'C',1);
$pdf->Ln();
}

 

And the second section is:

	$pdf->SetFont(PDF_INV_CORE_FONT,'',10);
//	$pdf->SetY($Y_Table_Position);
//	$pdf->SetX(95);
//	$pdf->MultiCell(15,6,tep_display_tax_value($order->products[$i]['tax']) . '%',1,'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(15);
   $pdf->SetFont(PDF_INV_CORE_FONT,'',8);
$pdf->MultiCell(25,6,$order->products[$i]['model'],1,'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(148);
   $pdf->SetFont(PDF_INV_CORE_FONT,'',10);
$pdf->MultiCell(25,6,$currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']),1,'C');
//	$pdf->SetY($Y_Table_Position);
//	$pdf->SetX(138);
//	$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']),1,'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(173);
$pdf->MultiCell(25,6,$currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'C');
//	$pdf->SetY($Y_Table_Position);
//	$pdf->SetX(178);
//	$pdf->MultiCell(20,6,$currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']),1,'C');
$Y_Table_Position += 6;

 

You notice with image I excluded price and total including. But been working to edit product description field, but with no luck.

 

blr044

Share this post


Link to post
Share on other sites

Dosen't seem like all is in the dark like me. Still can not get the product boxes to align up right. I know when one is +/-, it also affeects the other boxes.

 

If I can not solve this issue, I might have to remove this mod. Even tried fabncier invoice, but had a small issue, but was not able to solve it and end up removing that mod.

 

blr044

Share this post


Link to post
Share on other sites
Dosen't seem like all is in the dark like me. Still can not get the product boxes to align up right. I know when one is +/-, it also affeects the other boxes.

 

If I can not solve this issue, I might have to remove this mod. Even tried fabncier invoice, but had a small issue, but was not able to solve it and end up removing that mod.

 

blr044

 

 

Found the solution - Went down too many lines in code. Had to change line 615 also.

Share this post


Link to post
Share on other sites

Hi,

 

I would like to add this contribution to my shop, but can't figure out how or where I run the SQL script on my remote server. Is there a tool within the admin page to do this, or a tool within MySQL Administrator?

 

Any help appreciated,

 

Cheers,

Share this post


Link to post
Share on other sites

Great contribution!!

 

I want to make the invoice print lower on the page when it is printed out. Where do I need to change this. The logo and address are at the very top of the page.

Share this post


Link to post
Share on other sites

PDF customer invoice is installed. But am having some problems. Orders were not appearing at admin -> customers -> orders

 

So to a hint at this location - post #68. But when follow this tip, I now see the orders under admin. But now when customer places order, the subtotal, tax, shipping and total is missing from invoice.

 

Most of my customers pays by check or money orders. So when they gt their email, it only display's product description and price. This is what a customer sees:

 

Detailed Invoice: xxxxx://brs-giftshop.com/account_history_info.xxxxxxxxxx_xxxx

Date Ordered: Wednesday 17 September, 2008

 

Products

------------------------------------------------------

1 x Perfectly Plaid Decoupage Ornaments (37653) = $14.21

1 x Snowman Plate Holder (37113) = $14.21

1 x Posable Snowman (34871) = $14.95

1 x Snowbuddies Light-Up Diner (39319) = $31.69

6 x Thomas Kinkade Bell Ornaments (39294) = $27.90

------------------------------------------------------

 

Delivery Address

------------------------------------------------------

xxxxx xxxx

xxx cccccc xxx

xxxxxx, xx xxxxx

United States

 

Billing Address

------------------------------------------------------

xxxxx xxxx

xxx xxxxxx xxx

xxxxxx, xx xxxxx

United States

 

Payment Method

------------------------------------------------------

Check/Money Order

 

Make Payable To: Bennett Russell

 

Send To:

BRs Gift Shop

1001 McNutt RD # 297

Conway, Arkansas 72034

USA

(501)205-4762

 

Your order will not ship until we receive payment.

 

Am desparate for a solution. Al ready have tried a few other invoice mods

 

Thanks.

 

blr044

Share this post


Link to post
Share on other sites

Great contrib and straight forward to install however:

 

For some reason my install works perfectly apart from it writes the PDF document to the site root where it remains until I delete it.

 

Any ideas appreciated

 

Steve


It is Possible that the impossible has not been discovered yet. Solve it and start your search again.

Share this post


Link to post
Share on other sites

Great contribution! Especially with the mail-attachment add-on! Thanks a bunch.

 

One question, though.

 

Someone who puts an order in the system receives an email with the invoice. Is there any way to send a copy of this email with the pdf-invoice as an attachment to for example the shop administrator (i.e. cc of bcc is ok)? I've already tried putting an emailaddress to the config for 'send extra order email', but no pdf is attached to the mail to the administrator. Thanks in advance!

Edited by martinhhs

Share this post


Link to post
Share on other sites
Great contribution! Especially with the mail-attachment add-on! Thanks a bunch.

 

One question, though.

 

Someone who puts an order in the system receives an email with the invoice. Is there any way to send a copy of this email with the pdf-invoice as an attachment to for example the shop administrator (i.e. cc of bcc is ok)? I've already tried putting an emailaddress to the config for 'send extra order email', but no pdf is attached to the mail to the administrator. Thanks in advance!

 

 

Try this but note:

 

1. Not tested (but should work OK)

2. You'll have to see if attaching the second PDF slows down parsing of checkout_process.php too much

3. This patch will send an extra email, with attachment to the address specified under My Store -> Configuration -> Send Extra Order Emails To

 

BACKUP your copy of checkout_process.php

 

 

FIND the block:

 

	// BEGIN added for pdfinvoice email attachment:

if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') {
	// customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
   $HTTP_GET_VARS['order_id'] = $insert_id;
	// set stream mode
	$stream = true;
	// include pdfinvoice.php
	include_once(FILENAME_CUSTOMER_PDF);
	// add text to email informing customer a pdf invoice copy has been attached:
	$email_order .= PDF_INVOICE_ATTACHED ."\n\n";
	// send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
	// note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
	if (tep_not_null($pdf_data)) {
		tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
	} else {
		tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
	}
} else {
	// send vanilla e-mail - if email attachment option is false
	tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
}

// END added for pdfinvoice email attachment:


// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }

 

REPLACE WITH:

 

 // BEGIN added for pdfinvoice email attachment:

if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') {
	// customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up
   $HTTP_GET_VARS['order_id'] = $insert_id;
	// set stream mode
	$stream = true;
	// include pdfinvoice.php
	include_once(FILENAME_CUSTOMER_PDF);
	// add text to email informing customer a pdf invoice copy has been attached:
	$email_order .= PDF_INVOICE_ATTACHED ."\n\n";
	// send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email
	// note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name']
	if (tep_not_null($pdf_data)) {
		tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
		// send emails to other people, with PDF attachment
		if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
		tep_mail_string_attachment('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name);
		}
	} else {
		tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
		// send emails to other people
		if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
		   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
		}
	}
} else {
	// send vanilla e-mail - if email attachment option is false
	tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
	// send emails to other people
	if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
	  tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
	}
}

// END added for pdfinvoice email attachment:

 

Let me know how you get on.


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

Share this post


Link to post
Share on other sites
Great contrib and straight forward to install however:

 

For some reason my install works perfectly apart from it writes the PDF document to the site root where it remains until I delete it.

 

Any ideas appreciated

 

Steve

 

This is really weird. I don't use any of the FPDF options to write to disk, only to stream to the browser (for security reasons, I chose not to write any PDF info to the filesystem)

 

Any error messages?

 

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

Share this post


Link to post
Share on other sites
PDF customer invoice is installed. But am having some problems. Orders were not appearing at admin -> customers -> orders

 

So to a hint at this location - post #68. But when follow this tip, I now see the orders under admin. But now when customer places order, the subtotal, tax, shipping and total is missing from invoice.

 

Most of my customers pays by check or money orders. So when they gt their email, it only display's product description and price. This is what a customer sees:

 

Detailed Invoice: xxxxx://brs-giftshop.com/account_history_info.xxxxxxxxxx_xxxx

Date Ordered: Wednesday 17 September, 2008

 

Products

------------------------------------------------------

1 x Perfectly Plaid Decoupage Ornaments (37653) = $14.21

1 x Snowman Plate Holder (37113) = $14.21

1 x Posable Snowman (34871) = $14.95

1 x Snowbuddies Light-Up Diner (39319) = $31.69

6 x Thomas Kinkade Bell Ornaments (39294) = $27.90

------------------------------------------------------

 

Delivery Address

------------------------------------------------------

xxxxx xxxx

xxx cccccc xxx

xxxxxx, xx xxxxx

United States

 

Billing Address

------------------------------------------------------

xxxxx xxxx

xxx xxxxxx xxx

xxxxxx, xx xxxxx

United States

 

Payment Method

------------------------------------------------------

Check/Money Order

 

Make Payable To: Bennett Russell

 

Send To:

BRs Gift Shop

1001 McNutt RD # 297

Conway, Arkansas 72034

USA

(501)205-4762

 

Your order will not ship until we receive payment.

 

Am desparate for a solution. Al ready have tried a few other invoice mods

 

Thanks.

 

blr044

 

Hi,

 

Are you using the email PDF attachment add-on? This is the only change what would affect order processing. Please confirm.

 

The "fix" from the post you quoted will just remove the order totals as you've discovered and is most likely not your issue. I'd put that code back in.

 

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

Share this post


Link to post
Share on other sites

Hi Chris,

You're a madman in helping us all out! I'll give your sollution a try tomorrow! I'll let you know! THANKS!

Edited by martinhhs

Share this post


Link to post
Share on other sites

PHP Fatal error: Call to undefined function tep_session_is_registered() in /var/www/vhosts/xxxxx/httpdocs/catalog/pdfinvoice.php on line 33, referer: http://www.xxxxx/catalog/account_history_i...php?order_id=23

 

This error comes while trying to open a pdf invoice from the account history, no pdf is shown. It seems like the error existed after installing the pdf invoice attachment add-on. Never noticed it though, cause the email attachment function works great.

 

The problem seems complicated, has to do with session? Spent about 4 hours finding out whats wrong.... Any ideas?

Edited by martinhhs

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

×