Post by peteVA » Thu Mar 18, 2010 9:47 pm

I am not in the EU, this does not concern me directly, but I have been keeping track of it, just to see how it progresses.

What I think is being overlooked is not so much this is an EU requirement, but also a national requirement that varies by country. There are people from different EU countries asking for ALMOST the same thing. But each country has a variation.

I would suggest a new thread asking users to let you know their local requirements. Not personal wish list stuff, but what is legally required in specific countries. It may end up having a variety of small mods to be in compliance.

Personally, I have never seen this subject even mentioned on other cart forums. I visit many, asking about things for my hosting clients, who have a wide variety of carts in use. I have never seen this at all. I have seen no other cart offer anything special for EU invoicing, yet the carts are used all over.

Again, I am not there. I am not under any such rules. But I do know many other carts are being used throughout the EU, many developed by EU citizens, and I have never noticed anything at all about this. There must be some way to sell from a cart, using the default numbering system and still be in compliance.

I did suggest earlier to call the OC docs Packing Lists or Acknowledgments or some other term and then issue an "Official Invoice" from a bookkeeping program, since sales will have to be entered into some sort of accounting setup for tax records.

It seems like this could become a pit of quicksand, trying to come up with a setup that will comply with every possible users' country when simply setting things up for a country by country mod / patch / snippet would be a better solution than trying to incorporate a "one-size-fits-all" directly into the main script.

A Trusted Wholesale Dropshipper
Web Hosting Under $ 5.00 Month! FREE Shopping Carts!
25,000+ Real Wholesale & Dropship Sources!


User avatar
Active Member

Posts

Joined
Mon Jul 20, 2009 8:25 am

Post by 24-7-open » Thu Mar 18, 2010 10:11 pm

http://ec.europa.eu/taxation_customs/ta ... 733_en.htm

See section 1.4 What information must an invoice contain?

Greetings,

24-7-open

New member

Posts

Joined
Tue Feb 23, 2010 6:45 pm

Post by joop » Thu Mar 18, 2010 10:29 pm

Think things through before you start changing code.

See 1.5 in the link in the previous post.

Credit invoices ?
Partially returend goods ?

A cart system is not an accounting system.

Newbie

Posts

Joined
Fri Feb 05, 2010 11:17 pm


Post by peteVA » Thu Mar 18, 2010 11:22 pm

Good point that 1.4 -

1.4.1 Obligatory information for all invoices

An invoice must contain the following information:

1. the date of issue;
2. a sequential number that uniquely identifies the invoice;

It says nothing about starting over each year or anything else mentioned as far as prefixes or suffixes. Just sequential numbers.

It is the individual countries that impose these further regulations, so you will end up with something different for virtually all countries.

Please don't spend a lot of time on this "customization for specific users" and concentrate on the issues common to all users at this point. While there is a lot of talk about this, no other cart offers this sort of thing and thousands still manage to do business online.

Please don't get sidetracked on this.

A Trusted Wholesale Dropshipper
Web Hosting Under $ 5.00 Month! FREE Shopping Carts!
25,000+ Real Wholesale & Dropship Sources!


User avatar
Active Member

Posts

Joined
Mon Jul 20, 2009 8:25 am

Post by i2Paq » Thu Mar 18, 2010 11:58 pm

You ate mixing Invoices with Invoicenumbers.

In this topic we are discussing the Invoicenumbers, how the invoice should look is a completly differend balgame and that is mostly done by a template.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by 24-7-open » Fri Mar 19, 2010 12:19 am

In order to send invoices from OC admin panel, we would need invoices that comply with regulations. I agree OC is not an accounting system, but I would like to ship and archive standard invoices directly with fullfillment. I have asked for some globals with shop details before. Current order numbers are useless for any external references.

Greetings,

24-7-open

New member

Posts

Joined
Tue Feb 23, 2010 6:45 pm

Post by 24-7-open » Sat Mar 20, 2010 2:52 am

You ate mixing Invoices with Invoicenumbers.

In this topic we are discussing the Invoicenumbers, how the invoice should look is a completly differend balgame and that is mostly done by a template.
What are you planning to implement with the next version?

Greetings,

24-7-open

New member

Posts

Joined
Tue Feb 23, 2010 6:45 pm

Post by i2Paq » Sat Mar 20, 2010 3:00 am

24-7-open wrote:
You ate mixing Invoices with Invoicenumbers.

In this topic we are discussing the Invoicenumbers, how the invoice should look is a completly differend balgame and that is mostly done by a template.
What are you planning to implement with the next version?

Greetings,

24-7-open
I'm not planning anything, Daniel is ;)

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by 24-7-open » Sat Mar 20, 2010 3:31 am

It's an Open question. Systems need to comply, whatever developers think of requirements. In this case it would be convenient for shop owners/users to follow these as well.

Greetings,

24-7-open

New member

Posts

Joined
Tue Feb 23, 2010 6:45 pm

Post by palicao » Sat Mar 20, 2010 9:20 am

Hi!
I'm working on openCart 1.2.x (I can't remember the exact version number... where can I find it???)...
I live in Italy so I have the same problem as all other italian users: I need to give a progressive, sequential and year-based ID to every invoice.
So I made this fix to create invoice ids like 2010-00001, 2010-0002, etc. for EVERY ORDER (even for cancelled or reversed ones).
I hope this can help someone!

In admin/model/customer/order.php I modified getOrder() and getOrders() functions:

GET_ORDER:

Code: Select all

public function getOrder($order_id) {
		$query = $this->db->query("SELECT *, (SELECT CONCAT(YEAR(o.date_added),'-',LPAD(COUNT(*)+1,5,'0')) FROM `" . DB_PREFIX . "order` ordcount WHERE ordcount.order_status_id > 0 and ordcount.order_id < o.order_id AND YEAR(ordcount.date_added) = YEAR(o.date_added)) AS invoice_id FROM `" . DB_PREFIX . "order` o WHERE order_id = '" . (int)$order_id . "'");
	
		return $query->row;
	}
(the first lines of) GET_ORDERS:

Code: Select all

	public function getOrders($data = array()) {
		$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS name, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->language->getId() . "') AS status, ";
                $sql .= "(SELECT CONCAT(YEAR(o.date_added),'-',LPAD(COUNT(*)+1,5,'0')) FROM `" . DB_PREFIX . "order` ordcount WHERE ordcount.order_status_id > 0 and ordcount.order_id < o.order_id AND YEAR(ordcount.date_added) = YEAR(o.date_added)) AS invoice_id, ";
                $sql .= "o.date_added, o.total, o.currency, o.value FROM `" . DB_PREFIX . "order` o";
...
Then, in admin/controller/customer/order.php i added everywhere I found

Code: Select all

$this->data['order_id'] = $order_info['order_id'];
the following line:

Code: Select all

$this->data['invoice_id'] = $order_info['invoice_id'];
Similarily in admin/controller/customer/home.php I modified:

Code: Select all

$this->data['orders'][] = array(
				'order_id'   => $result['order_id'],
				'name'       => $result['name'],
				'status'     => $result['status'],
				'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
				'total'      => $this->currency->format($result['total'], $result['currency'], $result['value']),
				'action'     => $action
			);
in:

Code: Select all

$this->data['orders'][] = array(
				'order_id'   => $result['order_id'],
				'invoice_id' => $result['invoice_id'],
				'name'       => $result['name'],
				'status'     => $result['status'],
				'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
				'total'      => $this->currency->format($result['total'], $result['currency'], $result['value']),
				'action'     => $action
			);
Finally, I added those new data in the views. This should be fairly simple even for a novice, simply find every occurrance of "$order_id" or "$order['order_id']" in admin/view/template folder and add (or replace) an "$invoice_id" or "$order['invoice_id']" where you think it fits best!

If you don't want to count all orders you can modify the two queries I wrote at the beginning... e.g. if you want to issue an invoice only for shipped orders you can change

Code: Select all

WHERE ordcount.order_status_id > 0
in:

Code: Select all

WHERE ordcount.order_status_id = 3
and so on.

Happy hacking! :)

Newbie

Posts

Joined
Sat Mar 20, 2010 8:34 am

Post by Daniel » Mon Mar 22, 2010 8:46 pm

The invoice number will be in the next version. Its nearly finished. I just need some inpout from you guys.

When should the invoice number be generated?

1. When the order has been confirmed by the payment gateway?
2. When the order status is set to complete or shipped?
3. When the admin clicks a generate invoice button on the order page?

Attachments

invoice.jpg

invoice.jpg (137.91 KiB) Viewed 4467 times


OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by i2Paq » Mon Mar 22, 2010 8:59 pm

Daniel wrote:The invoice number will be in the next version. Its nearly finished. I just need some inpout from you guys.

When should the invoice number be generated?

1. When the order has been confirmed by the payment gateway?
2. When the order status is set to complete or shipped?
3. When the admin clicks a generate invoice button on the order page?

1. No, because the customer can still cancel his order.
2 + 3 When the order changes to complete the generate Invoice-number Button changes from grayed out to actif.

Looks great Daniel, much appreciated!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by maomaox » Mon Mar 22, 2010 9:15 pm

Daniel wrote:The invoice number will be in the next version. Its nearly finished. I just need some inpout from you guys.

When should the invoice number be generated?

1. When the order has been confirmed by the payment gateway?
2. When the order status is set to complete or shipped?
3. When the admin clicks a generate invoice button on the order page?
#1 should be better, canceled orders is a non-issue as unpaid invoices are voided all the time
#2 if store owner click on "print invoice" before set status to complete, would it cause a error? it's hard to enforce people to follow the exact sequence when processing orders
#3 the problem is that the owner cannot see invoice number before manually generate one, so it would be better to automate this process by using method #1

User avatar
Newbie

Posts

Joined
Sun Jan 10, 2010 8:17 am

Post by i2Paq » Mon Mar 22, 2010 9:24 pm

maomaox wrote:
Daniel wrote:The invoice number will be in the next version. Its nearly finished. I just need some inpout from you guys.

When should the invoice number be generated?

1. When the order has been confirmed by the payment gateway?
2. When the order status is set to complete or shipped?
3. When the admin clicks a generate invoice button on the order page?
#1 should be better, canceled orders is a non-issue as unpaid invoices are voided all the time
#2 if store owner click on "print invoice" before set status to complete, would it cause a error? it's hard to enforce people to follow the exact sequence when processing orders
#3 the problem is that the owner cannot see invoice number before manually generate one, so it would be better to automate this process by using method #1
#1 No, never auto-generate!. There is no invoice-number only a proforma (ergo: the order-number) during ordering. If a customer cancels his order then I have to regenerate a second invoice-number where I refund the amount payed. This is the Law and if you manualy generate the Invoice-number there is less hassle.
Plus when someone pays with "bank transfer" and he never pays I have an Invoice-number + a second "refund' Invoice-number. Useless.

#2 Then there should be a message saying 'Generate Invoice-number"

3# Again: No! It is to much work to create refund Invoices when using this Auto-generate setup. PrestaShop had it this way to and they changed it.
The owner does not have to see the invoice-number, he will see it when he prints the actual Invoice.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by palicao » Mon Mar 22, 2010 10:20 pm

IMHO, the right way is #3.
As a plus I would appreciate the possibility to change manually the auto-generated invoice number. The system should read the latest invoice number and add 1 to that number.
Another plus would be the possibility to use the actual year as prefix (maybe using a code like "{YEAR}" or something similar):
Thanks!!!

Newbie

Posts

Joined
Sat Mar 20, 2010 8:34 am

Post by Daniel » Mon Mar 22, 2010 10:42 pm

palicao wrote:IMHO, the right way is #3.
As a plus I would appreciate the possibility to change manually the auto-generated invoice number. The system should read the latest invoice number and add 1 to that number.
Another plus would be the possibility to use the actual year as prefix (maybe using a code like "{YEAR}" or something similar):
Thanks!!!
you can just manually ad the change the prefix at the end of the year. i don;t thinkits that much trouble.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by i2Paq » Mon Mar 22, 2010 10:43 pm

palicao wrote:IMHO, the right way is #3.
Who's number 3?
As a plus I would appreciate the possibility to change manually the auto-generated invoice number.
This you can do via your phpMyAdmin ;)
The system should read the latest invoice number and add 1 to that number.
That is what it does.
Another plus would be the possibility to use the actual year as prefix (maybe using a code like "{YEAR}" or something similar
Did you look at the image provided by Daniel?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by palicao » Tue Mar 23, 2010 4:28 am

Dear i2Paq,
Who's number 3?
#3 is:
3. When the admin clicks a generate invoice button on the order page?
This you can do via your phpMyAdmin
I know that there will be surely the opportunity to do this using phpMyAdmin, but I (and I don't think I'm the only one) am going to use openCart for my clients. I cannot ask them to log into phpMyAdmin and hack tables :)...
Did you look at the image provided by Daniel?
Surely I did, and I didn't find anything like "fill the prefix field with "{YEAR}" to have all your invoice number prefixed with the current year number"...

The reasons why I expressed my preferences in this way are:
1. If you generate invoices manually you can address all kind of requirements: either if you need to generate an invoice only for shipped items or if you need to generate for every order.
2. My request for a default invoice number and the possibility to change it is for the store owner who sells both online and offline. In this way they can have a consistent invoice numbering. This is also useful in countries like Italy where you have to start a new numbering each year
3. Also the "YEAR" request is for that purpose, it's useful to distinguish between the first invoice of (2009-0001) and 2010 (2010-0001).

Newbie

Posts

Joined
Sat Mar 20, 2010 8:34 am

Post by i2Paq » Tue Mar 23, 2010 5:03 am

Your not getting the point.

1. The invoicenumber is always generated, every order that goes thru needs an invoicenumber, not just the once you feel like.

2. The storeowner will mess up when he can change the invoicenumber when he feels like it. The invoicenumber system should be closed, secure and safe. The same way as it is with an accountand program.

3. That is possible, look at the image provided by Daniel, there you see a Prefix field, add anything you like, 2010, IT-, whatever....

And yes, #3 is the best. But, the button should only by accessable when the order has the status of completed. This to prevend accidentical generating of the invoicenumber.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by scot80 » Tue Mar 23, 2010 4:37 pm

Daniel wrote:When should the invoice number be generated?

1. When the order has been confirmed by the payment gateway?
2. When the order status is set to complete or shipped?
3. When the admin clicks a generate invoice button on the order page?
#1 make no sense. agree with i2paq

#2 also difficult to handle, agree with i2paq, too. Also think about downloadable products: the have not the "complete" or "shipped" status.

#3 this seems to be the only working solution, I think.

btw. the Invoice Number shouldn't be generated by / connected with the auto increment. If you use the "year" as prefix and want to restart the No. in 2011 you have a BIG problem with the database.

Order ID and Invoice number is never the same thing... then please don't handle it like the same.

Active Member

Posts

Joined
Fri Nov 06, 2009 12:14 am
Location - Germany
Who is online

Users browsing this forum: No registered users and 11 guests