Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding Invoice Date Field


modena360

Recommended Posts

Hi

Was wondering if anyone has added an invoice date field into their database and used this date in their invoices. I've seen others put the current date and order date into their invoices but I'm not after that. I want one that stays in the database and shows the date the order was invoiced. I've noticed that there's a 'orders_date_finished' field in the database orders table which is always empty. Is that what this field is for or can it be used for it???? Any ideas please??

 

Thanks

Link to comment
Share on other sites

In /catalog/admin/invoice.php, look for:

 

  require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>

 

Replace with:

 

  require('includes/application_top.php');

 require(DIR_WS_CLASSES . 'currencies.php');
 $currencies = new currencies();

     $customer_query = tep_db_query("select customers_id, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
     $customer = tep_db_fetch_array($customer_query);
     $ship_date_query = tep_db_query("select date_added from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . (int)$oID . "'  and orders_status_id = '3'"); // 3 is the status id for me that represents shipped status your id may be different
     $ship_date = tep_db_fetch_array($ship_date_query);

 $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']);
 $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);
?>

 

Then, where you want the date to appear on your invoice, add this:

 

<?php echo tep_date_long($ship_date['date_added']); ?>

 

HTH,

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

i've just tried that but thats still only showing the date the order was placed right??

i'm after an additional field for the invoice date so that if a customer places an order today and pays me 1 week later, i can put the actual invoice date on my invoices instead of just the date it was ordered for warranty purposes. Thanks anyway.

Link to comment
Share on other sites

This part of the code contains an explanation:

 

and orders_status_id = '3'"); // 3 is the status id for me that represents shipped status your id may be different

 

Go to your database and look to see what the status_id number is for orders that are shipped. If it's something other than '3' for shipped status, then change it to whatever the id number is in your database.

 

I presume you won't be shipping until you receive payment, so if your status_id is 3 for 'shipped' and you don't update your status to shipped until you receive payment, then print your invoice at that time, it should work.

 

HTH,

 

Terry

Terry Kluytmans

 

Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:

 

Add order total to checkout_shipment

Add order total to checkout_payment

Add radio buttons at checkout_shipping (for backorder options, etc.)

Duplicate Table Rate Shipping Module

Better Product Review Flow

 

* If at first you don't succeed, find out if there's a prize for the loser. *

Link to comment
Share on other sites

  • 1 year later...
Go to your database and look to see what the status_id number is for orders that are shipped. If it's something other than '3' for shipped status, then change it to whatever the id number is in your database.

 

I presume you won't be shipping until you receive payment, so if your status_id is 3 for 'shipped' and you don't update your status to shipped until you receive payment, then print your invoice at that time, it should work.

 

Forgive my ignorance, but where exactly do you find the status_id number? In the My SQL database or the database.php file? I'm having trouble finding it. Can you please point me in the right direction?

 

Any help will be much appreciated. :)

 

Cheers,

Tim

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...