Jump to content

Invoice number and year in PS 1.5


Recommended Posts

Hi

I figured out how to add year, but only in pdf, I cannot see same number in BO

 

If anyone did something similar and wants to share ti?

 

Or posting to this forum has no purpose, asking for help or advice on this forum is like asking a wall :)

 

Maybe using prestahop was not so good idea :D

Link to comment
Share on other sites

  • 3 weeks later...

You can reset invoice number at the beginning of each year in BackOffice and to display year as a part of invoice number from the date of order creation.

 

Hi

when I do that in BO I get error that number has to be greater than current invoice number

 

Where I can do it in BO?

 

Thanks

Link to comment
Share on other sites

Also

 

If I change in order/Order.php

 

This:

 public static function getLastInvoiceNumber()
 {
  return Db::getInstance()->getValue('
   SELECT MAX(`number`)
  FROM `'._DB_PREFIX_.'order_invoice`
  ');
}

 

to this:

 

public static function getLastInvoiceNumber()
{
 return Db::getInstance()->getValue('

  SELECT COUNT( number ) FROM ps_order_invoice WHERE DATE(date_add) >=  "2013-04-1 00:00:00";
 ');
}

 

 

That will change to start counting form 1 from april?

 

am I correct?

Link to comment
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
×
×
  • Create New...