Hi All,
Can anyone tell me how to define my own order numbers instead of (example) 143ec056
I am using VM 2 and Joomla 2.5
Thanks
Can't be 143ec056 ;-), ...
the number e.g. f50e0529 is built :
the first 4 digits of the number (f50e) is a randomized, generated number; the last 4 are consecutively numbered - here: Order No. 0529 .
Thomas
I may have altered the numbers slightly to mask anything :)
Can I alter it so it is something like I000100, I000101 ?
Thanks Thomas
You could, but this means changing the source.
Thomas
In addition: the order number is also used for linking to your order status etc. pp, so why changing? - Therefore, it's also a security option.
You could display it as you want in your template, by just manipulationg the order number itself in the invoice - tmeplate.
e.g. in mail_html_vendor.php in your template:
There is the $this->orderDetails['details']['BT']->order_number
You could change it to 'I000'.substr($this->orderDetails['details']['BT']->order_number,4)
Regards, Thomas.
Hi Thomas,
As you have probably guessed today, I am new to this.
Which of the mail_html_vendor.php files to I modify?:
components\com_virtuemart\components\com_virtuemart\views\invoice\tmpl
or
components\com_virtuemart\views\cart\tmpl
or
components\com_virtuemart\views\invoice\tmpl
Many thanks!
Chris
Hi Chris,
do not change any php files inside those directories. I don't know, but there are several descriptions how to change the invoice mail or other templates within VirtueMart or Joomla in general.
Surely, you have a template in Joomla or maybe a template for virtuemart in use?
Note:
QuoteI only have a components/com_virtuemart/views/invoice/tmpl/mail_html_vendor.php on my system AND
nearly the same and editable (and only there, you should edit only this file) at my template folder:
templates/lucid2/html/com_virtuemart/invoice/mail_html_vendor.php (lucid2 is my template)
First, you have to copy all those files, which you want to change in your views to the folder of your template, e.g. that file mail_html_vendor.php
That is:
make a directory within your active template e.g. template/lucid2/html/com_virtuemart/invoice/
then copy the components/com_virtuemart/views/invoice/tmpl/mail_html_vendor.php file to this directory.
Then edit this file in the template folder;
So if you install a new version of VirtueMart, the file within components/... are overwritten, but not your template folder! - This makes sense?
VirtueMart (and all other joomla components/modules etc) automatically recognizes the new template file (if there's no typo hi hi) and uses the template file instead of the original file.
Regards
Thomas
ps. Read the manual of joomla and virtuemart for using templates and adjusting your own stuff at your template folder.
Hi,
QuoteCan anyone tell me how to define my own order numbers instead of (example) 143ec056
The best way is to create a plugin of type vmshopper.
The trigger plgVmOnUserOrder will set the order_number .
You can have a look in the file adminsitrator/componenets/com_virtuemart/models/orders.php
function _createOrder()
Is there any documentation on how to write such a plugin? Or is there an example available?
I thought I could go live next monday, but today the people from the tax authorities (is that the right translation? Or is it tax administration?) told me that it's mandatory to have consecutive order numbers... If I start my shop, use the current weird numbers, and they want to check my administration, I'll get a fine and am not allowed to go further with my business.
Changing the way the number is displayed doesn't change anything to my administration. If someone wants to reopen an order on my site, they still need to know the first 4 characters, right?
No they just can use the provided link in the email, which stays always valid. The order numbers are consecutive. As Thomas said, just remove the first 4 chars. It is a security thing, because you can check your orders just with the number and a small password. But you can also just login and you see your orders listed.
A plugin, hmm quite easy thing actually. Learn the "hallo world" plugin of joomla, then search for the trigger and you can easily adjust it. You can also exactly describe how you want it. But ask your tax consultant again, btw, where do you come from?
Because in germany we were also forced to have one consequent part and vm2 is following this rule. But in germany we can now do what we want, as long it is unique. Ah yes and they are not interested in the ordernumber actually, they wanna know the invoice number.
You can also adjust the invoice number. The system of the invoice number is Date.random.countallinvoices+offset. The date has the format yymmdd, so a typical invoice number of vm2 is then for today 120713rje0345
Quote from: alatak on June 08, 2012, 19:42:42 PM
Hi,
QuoteCan anyone tell me how to define my own order numbers instead of (example) 143ec056
The best way is to create a plugin of type vmshopper.
The trigger plgVmOnUserOrder will set the order_number .
You can have a look in the file adminsitrator/componenets/com_virtuemart/models/orders.php
function _createOrder()
So would I copy/rename the vmshopperplugin.php file and edit that? what parts would i need to change? Where are some examples of simple plugins which drop in and work.
How do you intercept the order number?
Is the attached file heading in the right direction?
[attachment cleanup by admin]
Quote from: alatak on June 08, 2012, 19:42:42 PM
Hi,
QuoteCan anyone tell me how to define my own order numbers instead of (example) 143ec056
The best way is to create a plugin of type vmshopper.
I have now created such a plugin, which allows the shop owner to change the order number, order password and invoice number at will:
http://open-tools.net/virtuemart-2-extensions/40-vm2-ordernumber.html
The format is given as a text string, where [...] is understood as a variable and replaced by its value (e.g. [year] by the current year).
The running counter is indicated by #. The counter can be configured to be global (e.g. not reset each year/month/..) or a separate counter for each year/month/...
I hope you like the plugin and it does what you need. If you have any suggestions or further needs, just tell me: office@open-tools.net
Milbo I think this is a serious issue in VM2, is the same for us here in Spain, we have to use consecutive numbers or Invoices are not valid.
Actually is like that in most european countries.
Would be nice if you could add some kind of configuration for it, or a little plugin so we can use the core invoices instead of vm_invoice from artio or other components.
Regards
The numbers ARE consecutive. The numbers are according to the old german law with consecutive numbers.
Read exactly. I am almost 100% sure that no country demands a pure consecutive number. Most of them demand a consecutive PART ! For example
KudlleMuddle-0001_whatashit,
KudlleMuddle-0002_whatashit,
KudlleMuddle-0003_whatashit,
KudlleMuddle-0004_whatashit,
is a consecutive number.
The last three digits are the order numbering of the invoice the rest is a zero and random chrs. So there is a prefix (so security also) and then is the ordering, you could use some php to printout a second order_id for your customers/invoices/etc. You could use for example substr to printout only the last 3 digits or everything after finding a 0.
Quote from: Milbo on December 22, 2012, 11:36:27 AM
The numbers ARE consecutive. The numbers are according to the old german law with consecutive numbers.
Read exactly. I am almost 100% sure that no country demands a pure consecutive number. Most of them demand a consecutive PART ! For example
KudlleMuddle-0001_whatashit,
KudlleMuddle-0002_whatashit,
KudlleMuddle-0003_whatashit,
KudlleMuddle-0004_whatashit,
is a consecutive number.
Sure, but
12122103ca02
121221f71c03
121221ac6604
121221862905
are NOT consecutive numbers. They are unique numbers with one consecutive part and a completely random part. I know the German tax authorities officially interpret "consecutive number" as "does not have to be a consecutive number, unique is sufficient", but that's just the German interpretation. The Austrian law states (§11 Abs.1 Z.6 UStG): "eine fortlaufende Nummer mit einer oder mehreren Zahlenreihen, die zur Identifizierung der Rechnung einmalig vergeben wird;" (translation by me: "a consecutive invoice number with one or more number series, which is used only once to identify an invoice"). Most lawyers/tax accountants here interpret the first part ("fortlaufend") as: given one invoice number, you can immediately see how the next number will look (given the details like date, since the reset date for the counter needs to be systematic, like yearly/monthly/daily). So any random part in an invoice number will raise a red flag and might prevent your business customers from using that invoice for tax purposes.
You might get away with it for consumer customers (those invoices do not neccessarily need to be consecutively numbered), but several examples show that if the tax authorities audit someone who does not consecutively number all invoices, they are MUCH more strict when auditing: See e.g. http://www.springermedizin.at/artikel/29882-nummerieren-sie-ihre-rechnungen-durchgehend
"Bei der Betreuung von Betriebsprüfungen sehen wir, dass all jene Fälle, in denen Rechnungen an Privatpersonen nicht durchgehend nummeriert bzw. gar nicht erstellt werden, von Prüfern kritisch beäugt werden. Zu oft keimt hier der Verdacht auf, dass Leistungen abgerechnet werden, ohne das vereinnahmte Honorar ordnungsgemäß zu erfassen."
(I.e. while it's not illegal to not consecutively number the invoices to consumers, the tax authorities usually suspect that you do get money from customers without paying tax on it.)
See also the Austrian "Umsatzsteuerrichtlinien 2002", version as of November 23, 2011 (the official document that explains how the tax authorities apply the tax laws), in particular section 11.1.6.6:
https://findok.bmf.gv.at/findok/showGesPDFakt.do
While it does not explicitly say that random parts are not legal, it is quite strict about "Nummernkreise" and when to reset the running counter.
Anyway, have a look at my plugin, which lets you customize your invoice (and order) numbers to basically anything you like:
http://open-tools.net/virtuemart-2-extensions/vm2-ordernumber-plugin.html
Or spend 7 euro to reinhold and buy a nice plugin with different configurations from Reinhold.
Quote from: reinhold on December 22, 2012, 12:43:26 PM
They are unique numbers with one consecutive part and a completely random part. I know the German tax authorities officially interpret "consecutive number" as "does not have to be a consecutive number, unique is sufficient", but that's just the German interpretation.
That is mostly correct, but not 100%. In germany you had to have a unique number (you need that anywhere) with a consecutive part. Since two years or so, it is just enough to give a unique number.
Quote from: reinhold on December 22, 2012, 12:43:26 PM
The Austrian law states (§11 Abs.1 Z.6 UStG): "eine fortlaufende Nummer mit einer oder mehreren Zahlenreihen, die zur Identifizierung der Rechnung einmalig vergeben wird;" (translation by me: "a consecutive invoice number with one or more number series, which is used only once to identify an invoice").
Also not completly correct. " with one or more number series". Why more than one? There must be one part which is consecutive.
Quote from: reinhold on December 22, 2012, 12:43:26 PM
Most lawyers/tax accountants here interpret the first part ("fortlaufend") as: given one invoice number, you can immediately see how the next number will look (given the details like date, since the reset date for the counter needs to be systematic, like yearly/monthly/daily).
This is correct. The number must be formatted so, that there is a part which is consecutive. Vm2 is following this. For example the invoice is like yyyymmddRR####. You know exactly the next consecutive part, it is the ####. This number is atm created by count(allinvoices) + offset.
Quote from: reinhold on December 22, 2012, 12:43:26 PM
So any random part in an invoice number will raise a red flag and might prevent your business customers from using that invoice for tax purposes.
Either you choose a format which is easy to understand or you must explain them your format (what they dont like). As long you have a clear #### part in it, everything is fine. Please check the bill of the filling station or similar.
Quote from: Thomas Kuschel on June 08, 2012, 16:14:46 PM
In addition: the order number is also used for linking to your order status etc. pp, so why changing? - Therefore, it's also a security option.
You could display it as you want in your template, by just manipulationg the order number itself in the invoice - tmeplate.
e.g. in mail_html_vendor.php in your template:
There is the $this->orderDetails['details']['BT']->order_number
You could change it to 'I000'.substr($this->orderDetails['details']['BT']->order_number,4)
Regards, Thomas.
Parse error: syntax error, unexpected ';' in /components/com_virtuemart/views/invoice/tmpl/mail_html_vendor.php on line 28
It's problem here too... If i want to use an order or invoice number as variable symbol /identifier/ to merge payment and order - we can only use number, not letters... It's kind of issue - so I'm looking for solution now...
My ordernumber plugin allows you to change the format of the the order number to e.g. a simple running counter:
http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-orders/22803
Thank you Reinhold!!
I just upgraded Virtuemart and this was extremely frustrating. My whole ordering system was changed. Couldn't find a solution for the numbering.
Whatever the rules are, I find the current order numbers ugly and not convenient at all!
Besides I don't need a different order number and invoice number. So being able to change this is in my opinion a necessity.
Thanks Reinhold, love the plugin. Worth every penny, now I can get back to work!