Jump to content
chris23

[CONTRIBUTION] PDF Customer Invoice

Recommended Posts

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

 

I also have this issue....

 

Best Regards,

Share this post


Link to post
Share on other sites

Hi Everybody

 

I am new to OS Commerce and I'am sorry if asking stupid questions. I installed the contrib from this site:

 

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

 

Last version from 3rd of August should allready include sending the invoice by e-mail, right? Or do I still need to install the Add-On?

 

Reason for the question is, that I find the invoice in the order history, but there is no invoice sent by mail. Do I have to set a flag or something to activate sending by e-mail?

 

Thank you for your help!

David

Share this post


Link to post
Share on other sites

Hi

 

Forgett the above question. Was to stupid / nervous to check all folders of the contrib.

 

For other impatient guys like me: Check the folder "pdf_invoice_email_attachment_v1.2" in the contrib folder. Everything nicely explained there!

 

Cheers

David

Share this post


Link to post
Share on other sites
Just installed the contribution but am having trouble. I tried looking through the boards, but I couldn't find any information about the following error:

 

FPDF error: Incorrect orientation: shiplabel_portrait_landscape

 

Thanks in advance for any help!

 

 

I'm still looking for some help on this issue. I haven't been able to get past it.

Share this post


Link to post
Share on other sites

PDF Customer Invoice V1.2:

I'm having a problem with the Invoice- and Deliver Addresses on the PDF-Invoice.

The State is written OK on the PDF Invoice, but only the first letter of the Country is written.

ex: Jylland, Danmark is written as Jylland, D

 

When viewing the normal OSCommerce Invoice the State and Country is Written OK.

 

Hope somebody can help

Share this post


Link to post
Share on other sites
PDF Customer Invoice V1.2:

I'm having a problem with the Invoice- and Deliver Addresses on the PDF-Invoice.

The State is written OK on the PDF Invoice, but only the first letter of the Country is written.

ex: Jylland, Danmark is written as Jylland, D

 

When viewing the normal OSCommerce Invoice the State and Country is Written OK.

 

Hope somebody can help

 

Sorry Chris, havn't read the entire Forum. Have solved it as described in Q&A

Share this post


Link to post
Share on other sites

I do not speak English, this is a translation, excuseme.

 

Hello, I need aid with contribution pdf to coustomer invoice.

I have seen that it has bug and I put captures so that one sees what it happens.

It seems to me a great contribution for the edition of invoices of easy form and with a very pleasant design, mainly because it adds one second page when they surpass a certain one I number of lines.

Fodder that this can not interest to some, but is something essential if they are wanted to use the invoices of oscommerce.

This contribution is developed from contribution pdf invoice. I have verified that the code piece which they share has the same error or problem.

In the file pdfinvoice.php we have this:

//Check for product line overflow 
 $item_count++; 
if ((is_long($item_count / 32) && $i >= 20) || ($i == 20)){ 
	$pdf->AddPage(); 
	//Fields Name position 
	$Y_Fields_Name_position = 125; 
	//Table position, under Fields Name 
	$Y_Table_Position = 70; 
	output_table_heading($Y_Table_Position-6); 
	if ($i == 20) $item_count = 1; 
}

With this when the invoice has 21 line adds one second page.

And this it is indeed the problem. That changing to number 20 by another number this it changes but is not that, that is already not the solution since the error would take place in another line.

As I say with this configuration if facura has 21 lines already are created two pages.

The failure is in which in first there are 21 lines (one by each reference) and is not the total of invoice. And in the second page there is no line of product and it appears the total of the invoice.

In this case the second page exceeds, I believe that it is an error of the contribution.

If the invoice has 20 lines or 22 lines its not problem since with 20 lines a single page is created and if there are 22 lines is created one front page with 21 lines and one second page with 1 line and the total.

Since I have before said in contribution pdf invoice, in version 1.4 it is spoken of the solution of this problem and the code is added that I have put before, or rather it changes by that there was in the previous versions.

This change does not serve don't mention it since with both it works similarly.

The code that was in the first versions of pdf invoice is this and as I say it works just as the one that I have put but above:

  //Check for product line overflow 
if ($i == 20){ 
	$pdf->AddPage(); 
	//Fields Name position 
	$Y_Fields_Name_position = 125; 
	//Table position, under Fields Name 
	$Y_Table_Position = 70; 
	output_table_heading($Y_Table_Position-6); 
}

 

I put captures so that veais of which I speak.

 

14-2-2009%200.2.19%202.jpg

14-2-2009%200.2.47%203.jpg

14-2-2009%200.2.50%201.jpg

That there are many they have this contribution and seems to me stranger who has not been solved before.

I have looked for in the forum but I have not found anything.

If some him podeis to throw a look would thank for it to you.

 

A greeting and thanks.

Share this post


Link to post
Share on other sites
Just installed the contribution but am having trouble. I tried looking through the boards, but I couldn't find any information about the following error:

 

FPDF error: Incorrect orientation: shiplabel_portrait_landscape

 

Thanks in advance for any help!

 

Third time the charm? I still need some sort of insight into this problem.

Share this post


Link to post
Share on other sites

Hi,

thanks for this contribution.

 

My problem:

I have a multi-language-shop (English, Russian, Latvian), everything is configured to use UTF8. When I use russian or latvian characters in the language-specific pdfinvoice.php-Files, these characters are not displayed correctly in the resulting PDF.

 

I.e. a latvian "ā" is displayed as "Ä•".

 

Any ideas how to solve this issue?

 

Thanks,

Markus

Share this post


Link to post
Share on other sites

Hello,

Thank you for this perfect contribution.

 

please I need urgent HELP.

In my country I need in invoice at the end cost in SKK and that is 1 EUR = 30,126 SKK and I need to automaticaly wrote after end cost in SKK. Can oyu help me please?

Edited by jozinecko

Share this post


Link to post
Share on other sites

Hi Chris,

 

how are you?

 

You probably remember about 18 months ago i was speaking to you about the problems I was having with page overuns on long orders? Example here. Well its obviously been an issue since as we never got to the bottom of it, but I've just shed a bit more light on it. The problem only seems to occur on orders which have been created with order editor

 

I found this bit of text the ajax order editor (which I assume is similar) which got me thinking

 

If you use PDF invoice rather than the standard invoice or packing slip you will get errors. Missing arguments.

This is because the order editor adds a couple of arguments to the address function in functions - general.php.

These are not needed for the invoice and packing slip but placeholders will need to be added.

 

open admin - invoice.php and add to lines as detailed

 

find

 

tep_address_format(

 

at the end of this line after the "n") add the following ,'','' before the bracket

 

mine looks like this when complete

 

$pdf->MultiCell(70, 3.3, tep_address_format(1, $order->customer, '', '', "n",'',''),0,'L');

 

Do this as many times as the tep_address_format( line appears 3 in my case

 

same in admin - packing_slip.php

 

do this on each occurence of the tep_address_format

 

And i wondered if that my be a similar problem to that which i'm experiencing?

 

Any ideas

 

Thanks

 

Dave

Edited by stubbsy

Share this post


Link to post
Share on other sites

Ive installed this mod and its a great mod, all works fine apart from the display in the pdf for price (ex and inc), total (ex and inc)

 

which has for example

 

<span

class=curr

ency_symb

ol>£</span

>4.99<spa

n

class=curr

ency_symb

ol></span>

 

so its printing the formatting too.

 

How can i get it to the plain old 4.99?

 

thanks

Share this post


Link to post
Share on other sites

I get the following error:

 

Call to a member function on a non-object in /***/***/***/pdfinvoice.php on line 550

 

function output_table_heading($Y_Fields_Name_position){
global  $pdf, $cell_color;
//First create each Field Name
// Config color filling each Field Name box
[b]$pdf->SetFillColor($cell_color[0],$cell_color[1],$cell_color[2]);[/b]  ////  Line 550 /////
//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,tep_html_entity_decode(PDF_INV_QTY_CELL),1,0,'C',1);
$pdf->SetX(15);
$pdf->Cell(27,6,tep_html_entity_decode(TABLE_HEADING_PRODUCTS_MODEL),1,0,'C',1);
$pdf->SetX(40);
$pdf->Cell(78,6,tep_html_entity_decode(TABLE_HEADING_PRODUCTS),1,0,'C',1);
$pdf->SetX(118);
$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_PRICE_EXCLUDING_TAX),1,0,'C',1);
$pdf->SetX(138);
$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_PRICE_INCLUDING_TAX),1,0,'C',1);
$pdf->SetX(158);
$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_TOTAL_EXCLUDING_TAX),1,0,'C',1);
$pdf->SetX(178);
$pdf->Cell(20,6,tep_html_entity_decode(TABLE_HEADING_TOTAL_INCLUDING_TAX),1,0,'C',1);
$pdf->Ln();
}

Share this post


Link to post
Share on other sites

I have also discover that FPDF class is already defined using the "class_exists()" function.

 

I think this may be cause of the problem. If the version I am using (1.3) if different I guess this explains the problems. How can I find out where the class is being called? I can't find any other occurrences when the call is called.

 

If I comment out line 550 the moves to 552 and so on... therefore it seems all the function don't work inside output_table_heading().

Edited by WS Evolution

Share this post


Link to post
Share on other sites

Hi Guys, Nice Contrib A+++

 

Can you manually add the PDF Invoice to the email upon updating the order in the admin rather than have it automatically attach itself to every order in the check-out ... ?

 

I just don't see the point in sending a PDF Invoice to every customer in the checkout process - as my clients store also accepts payments in the form of Bank Transfer and Checks - and basically lets face it some people don't follow through with the purchase and never send the money - so why should they receive an invoice too... ?

 

I think an admin based manual attachment alternative might work nicely - like a tick box in the "admin order edit / order update area" similar to the two that already exist:

 

Notify Customer: tick::

Append Comments: tick::

 

and a new one like:

 

Attach PDF INVOICE to Notify Email: tick::

 

this way only customers who have fully paid and been approved for shipment will receive a invoice by email attachment once the admin updates the status of the order to "Dispatched".

 

Thnx.

Edited by MaxiDVD

Share this post


Link to post
Share on other sites

Hi all,

 

thanks for the contrib...works almost great ;-)

 

i just tried to install the email add on : Email PDF as Attachment - ADD-ON v1.2 but im facing a small problem... when user have to finalize the oder (the last last step) i got an error message :

 faultCode1faultStringFatal error:Call to a member function Output() on a non-object in /home/eq74179/html/catalog/pdfinvoice.php on line 100

 

the line 100 refers to :

 

// are we streaming for email attachment or outputting to browser?
if($stream){
$pdf_data = $pdf->Output('' , 'S');
} else {
$mode = (FORCE_PDF_INVOICE_DOWNLOAD == 'true') ? 'D' : 'I';
// what do we do? display inline or force download
$pdf->Output($file_name , $mode);
}

 

i tried to look over the forum but couldn't find the problem...and by the way, if i disable the "attach pedf invoice to email.." then it works fine...

 

if anyone could help that would be great...

 

thanks

Edited by kyli5

Share this post


Link to post
Share on other sites

Here's my problem.

 

I've installed this mod on a clean install of oscommerce, but it's not working.

When the user creates an order, the email sent to them is still plain text which looks gross.

I also can't view invoices in PDF form from the admin panel, it just uses the old style. I followed the instructions to the tee, but I don't know what's going on? :S

Share this post


Link to post
Share on other sites

I guess I am using the original contribution that this is based on, but there doesn't seem to be a support thread devoted to that so here I am hoping that someone can help me.

 

I have two issues. One is that while I can personally access the invoices from the admin side for customer orders, I cannot get the thing to function for customers. It errors out saying something about an undefined object on line 325. Can anyone help me on that? I copied all files to the catalog side as I did with the admin side. I suspect there are some things which need to be added at the beginning of the fiile, I'm just not sure what.

 

I have spent the better part of the day formatting the output and I think I have everything the way I want it, except for the lines around each product entry. This is especially annoying when there are multiple products ordered. Can anyone tell me how to get rid of those lines except at the very bottom and the sides? The fpdf documentation was a little weak in that regard, and I couldn't seem to find anyplace in the code to change it..

 

This is a great mod and really makes the printout look very neat, and it seems fairly easy to modify for the most part.

 

I would be most oblliged for any help.

 

Thanks in advance!!

 

BTW, I thought you all might be interested in some clarification on the term "invoice". I am assuming that most of you get payment from the customer before shipping a product, as I do. This means that technically, this is not an invoice at all, but a receipt, and this would be a more proper terminology to use on your printouts. I suppose for a lot of people the terms are used interchangeably, but that is incorrect. An invoice means there is money owed, and a receipt denotes that good or services have been bought and paid for.

Share this post


Link to post
Share on other sites

Hi a NOVICE with oscommerce/PHP needs HELP..

I can not see the PDF invoice below the HTML invoices as it should be and in PDF config only store logo can be changed. According to the readme file i should do this.

 

To fix this, open phpMyAdmin and select table `configuration_group`. Click 'Browse'. Make a note of the `configuration_group_id` for configuration_group_title "PDF Invoices"

 

Select table `configuration`. Click 'Browse'. Navigate to the last page(s). You will see 18 new configuration entries.

 

I am able to see the ID number of the pdf invoice which is "16" but from thereon i can not find what is meant by Select table `configuration`. Click 'Browse'. Navigate to the last page(s). You will see 18 new configuration entries.

and nor am i able to see the 18 new tables of whose values have to be changed. Please HELP.

 

Thanks in Advance

Edited by cyberguru

Share this post


Link to post
Share on other sites

Hi,

 

I have installed this contribution, and all seemed to go well - with all the options available in admin. However, even when I have the setting Force PDF download? set to true, I am just presented with what I assume to be the pdf in code form in my browser window. It replaces the shop content already on view in the browser.

 

I currently have the PDF Invoice add-on installed, to allow for pdf creation of invoices from within admin, and pdf creation works perfectly well with that. However, I will soon be overwriting that with the admin version of this add-on, but I can't do that until I get the client side fully working.

 

I am working on a Mac, but as the PDF Invoice add-on works, I would think that that isn't the issue.

 

I am sure I have done something wrong - but can't quite fathom what it is!

 

Thanks in advance,

 

Jonathan

Share this post


Link to post
Share on other sites
Hi,

 

I have installed this contribution, and all seemed to go well - with all the options available in admin. However, even when I have the setting Force PDF download? set to true, I am just presented with what I assume to be the pdf in code form in my browser window. It replaces the shop content already on view in the browser.

 

I currently have the PDF Invoice add-on installed, to allow for pdf creation of invoices from within admin, and pdf creation works perfectly well with that. However, I will soon be overwriting that with the admin version of this add-on, but I can't do that until I get the client side fully working.

 

I am working on a Mac, but as the PDF Invoice add-on works, I would think that that isn't the issue.

 

I am sure I have done something wrong - but can't quite fathom what it is!

 

Thanks in advance,

 

Jonathan

 

OK, so I could just delete my original question and pretend nothing went wrong, or I could own up to somehow having removed the < in front of the php? at the stop of the pdfinvoice.php file. :blush:

Share this post


Link to post
Share on other sites

Hi again,

 

Before I start, I just want to say that this is an absolutely superb add-on - thanks so much for writing it, and just as importantly, the subsequent support given to those implementing it.

 

I have been trying to add the Manufacturers name alongside the Model No, by taking the post about adding the customer email and telephone number and amending accordingly. However, I haven't managed to achieve what I want I am afraid, mainly because that information is being added into a different place to the main headings.

 

Basically I want the headings to be:

 

Qty : Model : Manufacturer: Products : Total

 

I have managed to comment out the extra headings that I don't need, and also re layout all of the boxes, but this has me stumped!

 

Any help would be gratefully received.

 

Thanks,

 

Jonathan

Share this post


Link to post
Share on other sites

i have added a word wrapped dynamically created comments box as an addon in the contrib download link!!!

 

everything after the comments box will be dynamically placed also.

 

here is a screenshot.

 

comments1.jpg

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

×