Jump to content
PopTheTop

Fancier Invoice & Packingslip v1.0

Recommended Posts

This is doing my head in now...I've looked all over to see why this could be happening.

 

I've got this mod working fine but, the only problem I  have is that when an invoice is sent out to a customer, our company logo seems to be showing up as a broken link...looking at the source it shows the path as being;-

 

 

If the print invoice page works for you would you then mind posting it here or PM me ?

Share this post


Link to post
Share on other sites

I have come across several issues with this mod and have managed to sort out most of them but this has me totally stumped.....

 

maybe I am missing something VERY basic here. I get an error message on the popup invoice when calling print_my_invoice.php

 

The error appears to be in the line:

 

 $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from" . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

 

 

and gives me this error in the comments box on the invoice:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'os, orders_status_history osh where osh.orders_id = '47' and os

 

select os.orders_status_name, osh.date_added, osh.comments fromorders_status os, orders_status_history osh where osh.orders_id = '47' and osh.orders_status_id = os.orders_status_id and os.language_id = '1' order by osh.date_added

 

[TEP STOP]

 

 

What am I missing here?

 

 

Thanks

Scott

Share this post


Link to post
Share on other sites
1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'os, orders_status_history osh where osh.orders_id = '47' and os

 

select os.orders_status_name, osh.date_added, osh.comments fromorders_status os, orders_status_history osh where osh.orders_id = '47' and osh.orders_status_id = os.orders_status_id and os.language_id = '1' order by osh.date_added

 

[TEP STOP]

 

Ok so it looks like the issue lies here...

fromorders_status
where it is mashing the from statemnet of the query together with the table name.

 

 

 $statuses_query = tep_db_query("select os.orders_status_name, osh.date_added, osh.comments from " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh where osh.orders_id = '" . (int)$HTTP_GET_VARS['order_id'] . "' and osh.orders_status_id = os.orders_status_id and os.language_id = '" . (int)$languages_id . "' order by osh.date_added");

 

When adding a space between from and the closing quote, it reverts to a blank invoice with no details on it at all....

 

I am missing something simple here... help me please I am going insane looking at this code over and over and over again......

Share this post


Link to post
Share on other sites

Hi all,

 

I just installed this contrib and now at the top of every page I get this error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/phillrac/public_html/applebop/techshop/includes/local/configure.php:28) in /home/phillrac/public_html/applebop/techshop/includes/functions/sessions.php on line 67

 

Does anyone know how to fix that error?

 

Also when I go to the "checkout_shipping.php" page all I get is the error above and also this error:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/phillrac/public_html/applebop/techshop/includes/local/configure.php:28) in /home/phillrac/public_html/applebop/techshop/includes/functions/general.php on line 29

 

Please can someone help me ASAP. I would really appreciate it.

Share this post


Link to post
Share on other sites

I installed this contrib fine, but the problem is.. when I print out the packing slip/invoice.. only the corners of the graphics get printed.. my boxs are all broken up.. does anyone know how to fix this? Thanks!

Share this post


Link to post
Share on other sites

nevermind.. print backgrounds did the trick.. saw this solution before but i couldn't find it now.. spending all day adding contribs giving me headache :)

Share this post


Link to post
Share on other sites

I just installed this contrib. All looks good in Admin (I can view and print Invoices and Packing Slips) and Catalog (I can view and print invoices), but when I go to check out a new order, I get "500 Internal Server Error":

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

I re-read the instructions, and I don't believe I missed anything.

 

This error is showing up while loading checkout_process.php. I actually receive the invoice via email and the order is processed, but I can't figure out where it is getting the server error. If I turn this mod off in the Admin, I don't get the server error. Since the error happens after the email goes out, I suspect it is in the end of checkout_process.php, which looks like this:

 

// lets start with the email confirmation

// START HTML Invoice
 if (EMAIL_INVOICE == 'true') {
   require(DIR_WS_MODULES . EMAIL_INVOICE_DIR . FILENAME_EMAIL_INVOICE);
 } else {
// END HTML Invoice
.
.
(standard osC stuff here)
.
.
// START HTML Invoice
 }
// END HTML Invoice

// load the after_process function from the payment modules
 $payment_modules->after_process();

 $cart->reset(true);

// unregister session variables used during checkout
 tep_session_unregister('sendto');
 tep_session_unregister('billto');
 tep_session_unregister('shipping');
 tep_session_unregister('payment');
 tep_session_unregister('comments');

 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

Any help would be much appreciated.

 

Thanks,

Sean Johnson


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

Sean Johnson

Share this post


Link to post
Share on other sites

I just re-read the instructions again and realized I had multiple email addresses in "Send Extra Order Emails", which is not working with this contrib.

 

From the FAQ in the install for this contrib:

 

Also, if you have more than 1 e-mail addresses set, delete all of them except for 1. It appears that multiple e-mail address can not be used here with this contribution.

 

Does anyone have a fix for the multi-email adresses issue?

 

Thanks,

Sean Johnson

 

I just installed this contrib.  All looks good in Admin (I can view and print Invoices and Packing Slips) and Catalog (I can view and print invoices), but when I go to check out a new order, I get "500 Internal Server Error"...

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

Sean Johnson

Share this post


Link to post
Share on other sites

Fyrst of all: very nice contrib!

 

Here's my problem:

 

I use two billing methods - bank transfer and sending a bill.

Before I installed the new Invoice & Packingslip OSC automatically sent an email to the customer (you know the old ugly one) and added at the bottom my account number, if bank transfer was selected as payment method. If billing was selected the message was: "We will send Your products as soon as we register Your payment".

 

How can I get this feature back, still using "Fancier Invoice & Packingslip"?

 

Thank You!

 

/Carl

Share this post


Link to post
Share on other sites

In the files catalog/checkout_process.php and includes/modules/email_invoice/email_invoice.php there is a section like this:

 

if (is_object($$payment)) {

$email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .

EMAIL_SEPARATOR . "\n";

$payment_class = $$payment;

$email_order .= $payment_class->title . "\n\n";

if ($payment_class->email_footer) {

$email_order .= $payment_class->email_footer . "\n\n";

}

}

 

Somehow this adds a tekst to the email (text version) containing information about the specific payment method.

 

How can this be used in the files box_invoice.php and html_invoice.php?

Share this post


Link to post
Share on other sites
I just re-read the instructions again and realized I had multiple email addresses in "Send Extra Order Emails", which is not working with this contrib.

 

From the FAQ in the install for this contrib:

Does anyone have a fix for the multi-email adresses issue?

 

Thanks,

Sean Johnson

 

Possible Fix to Extra Order Emails problem.

 

I have the same problem as others with extra order emails not being sent after installing this contribution.

Currently running CRE Loaded 6.15 on my local network - Debian/ Apache / Dovecot ( pop3 server).

 

I'm very new to the scene and my PHP is rudimentary at best. The following may nevertheless shed some light on where the problem lies.

 

1. Edit /catalog/includes/modules/email_invoice/email_invoice.php as shown:-

 

// Mod to fix Fancy emails and extra order emails

 

tep_mail_fancy_invoice($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $ei_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

// send emails to other people

if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

tep_mail_fancy_invoice('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $ei_message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

}

 

Substitute the above in place of this code:_

 

// $ei_message->build_message();

// $ei_message->send($order->customer['name'], $order->customer['email_address'], STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_TEXT_SUBJECT);

 

// if (SEND_EXTRA_ORDER_EMAILS_TO != '') {

// $ei_message->send(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT);

// }

 

 

2. Add this to /includes/functions/general.php

 

////

//! Send email (text/html) using MIME

// This is the central mail function. The SMTP Server should be configured

// correct in php.ini

// Parameters:

// $to_name The name of the recipient, e.g. "Jan Wildeboer"

// $to_email_address The eMail address of the recipient,

// e.g. jan.wildeboer@gmx.de

// $email_subject The subject of the eMail

// $ei_message The content of the eMail, may contain HTML entities

// $from_email_name The name of the sender, e.g. Shop Administration

// $from_email_adress The eMail address of the sender,

// e.g. info@mytepshop.com

 

function tep_mail_fancy_invoice($to_name, $to_email_address, $email_subject, $ei_message, $from_email_name, $from_email_address) {

if (SEND_EMAILS != 'true') return false;

 

// Instantiate a new mail object

// $message = new email(array('X-Mailer: osCommerce Mailer'));

 

// Build the text version

// $text = strip_tags($email_text);

// if (EMAIL_USE_HTML == 'true') {

// $message->add_html($email_text, $text);

// } else {

// $message->add_text($text);

// }

 

// Send message

$ei_message->build_message();

$ei_message->send($to_name, $to_email_address, $from_email_name, $from_email_address, $email_subject);

}

 

I have shown the "commented out" sections of the original code so you can see what's going on.

 

Nothing fancy, simply arranges for the functions "build_message" and "send" to NOT be called directly from email_invoice.php. I left the original "tep_mail" function in place to avoid any possible disturbance to other system functions. Compare the above to the original code and you will get the drift.

 

The above seems to work on my system.

I can now again arrange for multiple emails from Admin. I used the format xxx@bbbbb.com, yyy@bbbb.com

 

I am not sure if this will work on a live site though.

 

Again, this is only intended to serve as a possible pointer to where the actual problem lies.

 

I would be very grateful if people with PHP coding skills could take a look at this further.

 

It's a great contribution.

Thanks

Share this post


Link to post
Share on other sites
Everything has been working fine until now.

When I try to checkout with a purchase I get this message:

Warning: main(/home/YOUR_DOMAIN/public_html/catalog/admin/includes/languages/english/invoice.php): failed to open stream: No such file or directory in /home/www/hpoawear.com/catalog/includes/modules/email_invoice/email_invoice.php on line 30

 

Warning: main(/home/YOUR_DOMAIN/public_html/catalog/admin/includes/languages/english/invoice.php): failed to open stream: No such file or directory in /home/www/hpoawear.com/catalog/includes/modules/email_invoice/email_invoice.php on line 30

 

Fatal error: main(): Failed opening required '/home/YOUR_DOMAIN/public_html/catalog/admin/includes/languages/english/invoice.php' (include_path='.:/usr/local/lib/php') in /home/www/hpoawear.com/catalog/includes/modules/email_invoice/email_invoice.php on line 30

 

email_invoice.php Line 30 is where I get lost

 

Thanks

jer37

 

 

I'am having the same problem what was your fix?

Share this post


Link to post
Share on other sites

Great contribution... I used this for awhile in my store but started using the Paypal IPN..... I really wish there was a way to make the two of them work together... Since this is such a great contribution... Keep up the good work tho Pop!

Share this post


Link to post
Share on other sites
Great contribution... I used this for awhile in my store but started using the Paypal IPN..... I really wish there was a way to make the two of them work together... Since this is such a great contribution... Keep up the good work tho Pop!

 

Same here; --- if I only could write some code I would have jumped on this, but??

 

It is a greate contribution..!

Share this post


Link to post
Share on other sites

Hi All

This is an excellent contribution, i have been using it for a while now on my other site and all's OK.

I now have a small problem. I have copied my site over to a new domain and configured everything to suit, but now get the following error at checkout_success. Does anybody know where this path is being called from as my configure.php is set up correctly for home/julianbc but the invoice path is looking for home/julianp???? which is my other site. I have virtually looked through every single file and cannot find this, so any help appreciated.

TIA

Julian

 

 

Warning: main(): open_basedir restriction in effect. File(/home/julianp/public_html/admin/includes/languages/english/invoice.php) is not within the allowed path(s): (/home/julianbc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/julianbc/public_html/includes/modules/email_invoice/email_invoice.php on line 30

Warning: main(/home/julianp/public_html/admin/includes/languages/english/invoice.php): failed to open stream: Operation not permitted in /home/julianbc/public_html/includes/modules/email_invoice/email_invoice.php on line 30

Warning: main(): open_basedir restriction in effect. File(/home/julianp/public_html/admin/includes/languages/english/invoice.php) is not within the allowed path(s): (/home/julianbc:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/julianbc/public_html/includes/modules/email_invoice/email_invoice.php on line 30

Warning: main(/home/julianp/public_html/admin/includes/languages/english/invoice.php): failed to open stream: Operation not permitted in /home/julianbc/public_html/includes/modules/email_invoice/email_invoice.php on line 30

Fatal error: main(): Failed opening required '/home/julianp/public_html/admin/includes/languages/english/invoice.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/julianbc/public_html/includes/modules/email_invoice/email_invoice.php on line 30


A little knowledge is dangerous, I SHOULD KNOW.

If Life Begins At 40, What ends????

Share this post


Link to post
Share on other sites

Sorry, it doesn't matter. Finally found it!!! :blush: i was looking in my configure.php and not in the configure.php in the local folder! :blush:

This applies to all the above posts with similar errors showing error email_invoice.php on line 30.

Make sure you have the correct path to your files in your local folder.

 

Great contri, thanks

 

Julian


A little knowledge is dangerous, I SHOULD KNOW.

If Life Begins At 40, What ends????

Share this post


Link to post
Share on other sites

Hi,

 

I don't know if it just me but when I click on print invoice button, invoice# on the top and order# (below address) just blank. Go through the code and I've replaced

 

$oID with

 

$HTTP_GET_VARS['order_id']

 

and it fix the problem.

 

 

I also comment out

 

$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . tep_db_input($oID) . "'");

 

Is this ok? Or am I using a wrong solution here? Don't know much about PHP.. :(

Share this post


Link to post
Share on other sites

hI,

 

Great Contrib, but I am having a problem with CSS.

 

My site is all fine but when I view an invoice, the background is the wrong colour, not the same as the main site.

 

I have tried everything and all I seem to end up with it not the right colour, and the side columns are the same dark grey colour as the invoie back, or all another colour.

 

Where am I going wrong?

 

 

 

 

 

 

 

 

 

 

Go into your Amin / Configuration / My Store and edit your stor address. Then just add your phone number below. I saved mine as:

 

Pop-the-top Trading Post

13 Algonquin Circle

Hillsboro, MO 63050

419-710-5712

 

Instead of

 

Pop-the-top Trading Post

13 Algonquin Circle

Hillsboro, MO 63050

Easy huh?


Born - Scotland

Location - Kent, England

Job - hunting for one

Share this post


Link to post
Share on other sites

Brilliant contrib - far better than the standard osc one!

 

I have four (probably simple) questions, but as I know virtually nothing about scripting, I need some help:

 

1) On the packing slip, just above the box showing "sold to", it says osCommerce and not Packing Slip; however, the invoice is fine. How do I change it?

 

2) I can't get my store logo to appear in the top left corner of the invoice and packing slip. All that appears is a placeholder showing where is should appear. I have tried with the path files in the language changed from just the file name to the full path to everything in between. I am probably missing something straightforward, but don't know what it is.

 

3) I want to show the "Sold to" and "Ship to" addresses to be un the UK format, with the zip code and country shown under the state, not next to it. How do I do this.

 

4) I want the date in the top right corner to be in the format dd mm yy, but don't know how to do it.

 

Thanks.

 

Bob.

Edited by bobeisenberg

Share this post


Link to post
Share on other sites

Hi There,

Firstly thanks for this contribution all working just great.

 

One quick question - How to increase the number of charecters for Model no/SKU ?

In my SQL database these can go up to 25 charrecters but in the invoice that is generated it can only have 12 charecters how to increase this to 25

 

Thanks in advance.

Kunal

Share this post


Link to post
Share on other sites
Hi There,

Firstly thanks for this contribution all working just great.

 

One quick question - How to increase the number of charecters for Model no/SKU ?

In my SQL database these can go up to 25 charrecters but in the invoice that is generated it can only have 12 charecters how to increase this to 25

 

Thanks in advance.

Kunal

Can anyone help on this?

Share this post


Link to post
Share on other sites

Well, it seems like everything works fine, I just seem to be having some little problems:

 

help.jpg

 

The invoice # isnt showing up, just says, INVOICE_TEXT_CURRENT_YEAR. on the invoice that is emailed.

When you print the invoices the boxes arent there just the corners.

When you go to print the invoice under account history, it looks like this

 

help2.jpg

 

 

Im also want to know how I can put a couple spaces between total price and subtotal to give it cleaner look on both the invoices, and account info(not the print one,well i dont know what the print one should look like really)

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi All

 

Has anyone been able to rectify the problem of the languge file contents not showing on the emailed invoices, on mine it only displays like INVOICE_TEXT_NO_COMMENT

 

any ideas?

 

Also where do i on the invoices remove 05- bit after invoice number, as we use random order id's generated with date we don't need it.

 

its the only things stopping me sending this live.

 

Thanks in advance

Andy


Literally, Laterally Thinking! If you cannot get through it, go round it.

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

×