Post by matthewbaynham » Sat Mar 27, 2021 12:45 am

Version 3.0.3.2

I'm editing the twig files to create my invoices.

My invoices have to have the date of the invoice. I'm selling in Germany so they will be very particular about this, it is not the same as the order date. If the order was create and I processed things the next day then the invoice date will be different.

Is there a help page on the internet listing all the php objects so I can just look and find things like invoice date? (I might need other things so a manual listing everything might be handy).

Or does know just which php object gives me the invoice date?

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by by mona » Sat Mar 27, 2021 4:16 am

You know there is a generate invoice in the orders section right ?
Screen-Shot-2021-03-26-at-20.13.20.jpg

Screen-Shot-2021-03-26-at-20.13.20.jpg (41.4 KiB) Viewed 424 times

To answer your question - I doubt there is such a thing on the internet, but feel free to create one :)
Although understanding this will be a lot of help to you.
http://docs.opencart.com/en-gb/developer/module/

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Active Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by matthewbaynham » Sun Mar 28, 2021 2:20 pm

Yes the orders section creates invoices with the file admin/view/template/sale/order_invoice.twig and this is what I'm editing. And this doesn't have the time stamp as to when the invoice was created.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by matthewbaynham » Sun Mar 28, 2021 2:27 pm

Here is a link to a German Government pdf (in English)
https://www.existenzgruender.de/SharedD ... cationFile

You can see it's compulsory to have the invoice date.

There are a few other things I need to change on the invoice to make it legal in Germany, but that was easy enough, it's just the invoicing date I can't solve.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by sw!tch » Sun Mar 28, 2021 3:25 pm

So when you process the order I assume you update the order status? oc_order_history has date_added, you might be able to pull off of that, otherwise you will need to write some simple logic to generate a date.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by matthewbaynham » Sun Mar 28, 2021 3:38 pm

"date_added" looks like the date when the order was was added (when the customer clicked on the button to buy) because it's on an order object. Because it's on a "order" object.

Code: Select all

<td style="width: 50%;"><b>{{ text_date_added }}</b> {{ order.date_added }}<br />
I have no idea about "oc_order_history"

But when I create the invoice might not be the same day as when my customer ordered it.

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by matthewbaynham » Sun Mar 28, 2021 3:53 pm

I'm starting to think it might not be possible.

I dumped the mysql backend to a text file and searched it for the test "invoice" it looks like when I click the button to generate an index the table oc_order will have the field "invoice_no" populated with the next invoice number.

However although the text search for "invoice" came up with a couple of other results, none of them looked like the date when the invoice is generated is stored anywhere, which is a bit of a problem if you want to obey German law for writing an invoice.

Any thoughts?

New member

Posts

Joined
Fri Nov 01, 2019 9:18 pm

Post by pprmkr » Sun Mar 28, 2021 5:52 pm

- Add invoice_date datetime NOT NULL to table 'order'
- Get invoice_date from order
- Add text and date to shipping and invoice template

Faster to write modification then explaining all the steps ...
- Download attachment and install using extensions - Installer
- After that Refresh Modifications

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by OSWorX » Sun Mar 28, 2021 7:04 pm

matthewbaynham wrote:
Sun Mar 28, 2021 3:53 pm
I'm starting to think it might not be possible.
No, as one poster before has written, use his solution (or the idea behind).
matthewbaynham wrote:
Sun Mar 28, 2021 3:53 pm
I dumped the mysql backend to a text file and searched it for the test "invoice" it looks like when I click the button to generate an index the table oc_order will have the field "invoice_no" populated with the next invoice number.

However although the text search for "invoice" came up with a couple of other results, none of them looked like the date when the invoice is generated is stored anywhere, which is a bit of a problem if you want to obey German law for writing an invoice.

Any thoughts?
Correct, order create date, delivery date and invoice date are rare the same dates.
And on the Invoice, the correct date of the Invoice creation must be printed - and none of the others.

Using mentioned solution, you may fullfill the requirement.
But! > Keep in mind, this is only a temporary solution, whenever the German Finance is inspecting your bookkeeping, you have no chance to become proven.
Because the dates can be "manipulated" directly in the database.
And the so called "Invoice" is therefore NOT a real Invoice - only HTML generated content which can be printed.
To "obay" the German (and other Countries Law), you must create "non reversable" Invoices - like PDFs.

Additonally you have to check if the "Registrierkassenpflicht" https://www.deutsche-handwerks-zeitung. ... 554/332932 a requirement is for you .. and how to combine such with your "Invoices".

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 8 guests