Progressive invoice number without "holes"

  • Posts: 107
  • Thank you received: 3
12 years 2 days ago #74178

Hi Nicolas. I've installed the 2.0 Business version (with no problems in Joomla 2.5.4) to test the invoice number function, but I don't know how this function works. The only thing I see about this is a new variable in System-Config-Main named 'Invoice Number Format' but I don't know where is this var applied to the orders, and its format. Is the format configurable the same way as the order number format? Do you have a 'little user manual' about how may we apply the function to an order to 'convert' it to an invoice? Is there an 'invoice section'? Can you give a short explain about how this new function works?

Sorry for so many questions :unsure:

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 1 day ago #74397

Hi,

The invoice number format can be configured in the same way as the order number format option.
The only difference is that the order number is generated when the order is created while the invoice number format is generated when the status of an order change to one of the statuses of the option "Invoice order statuses".
The invoice number is used in invoices while the order number is used for the orders details.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
12 years 1 day ago #74451

Hi Nicolas. I'm testing this feature because it's very important for me here in Spain.

I've seen that if I create several orders and I if confirm one of them (the last), the invoice number is set to the next of the last confirmed invoice, which is ok, but the invoices need an invoice date too to be set in the same moment wich the order is confirmed (invoice number created), because legally (in Spain) I can't have an invoice today with number 15 and yesterday an invoice with number 16. This can happen in hikashop because I can confirm an order today with today date (number 15) and confirm tomorrow an order with yesterday date (number 16), and this is not legal in Spain.

Am I doing something wrong or this is the way that the invoice numbering system is working today?

Also I have active the attach invoice plugin, and I don't know if I must reinstall it (newer version) to have the invoice number in the invoices (I've downloaded and installed the last version), because though I have an invoice number in my orders, the number that appears in my invoices is the order number and not the invoice number.

Is this number an autoincrement value in an 'invoice number table'? How can I reset this id? Can I edit/modify an invoice number? Can I create an 'invoices report'? Would be possible that the invoice number appears like a column in the main orders section (back end)?

Sorry for the insistence, but this questions are very important for me.

Thanks. :silly:

Last edit: 12 years 1 day ago by lanzanet.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
12 years 1 day ago #74493

lanzanet wrote: ... because legally (in Spain) I can't have an invoice today with number 15 and yesterday an invoice with number 16. This can happen in hikashop because I can confirm an order today with today date (number 15) and confirm tomorrow an order with yesterday date (number 16), and this is not legal in Spain.


Confirm in Italy too we require that. Also we must restart the numeration from number "1" everey 01/01/new year (2013).

Please Log in or Create an account to join the conversation.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
12 years 1 day ago #74517

You need to change the line:
$format = str_replace($matches[0],date($matches[1],$data->order_created),$format);

to:
$format = str_replace($matches[0],date($matches[1],$data->order_modified),$format);

in the file administrator/components/com_hikashop/helpers/helper.php so that is uses the current date and not the creation date.
We'll correct that on our end as it should indeed be that way.

For the PDF invoice plugin, as it is a separate package, you indeed need to download it again on our website and install it again so that it uses the invoice number and not the order number.

The invoice number is an auto increment for now. You can't reset it for now nor modify it.
What is an "invoices report" ?
The orders listing lists orders not invoices so it seems more logical to display the order number on the listing and not the invoice number.

You can edit the file "listing" of the view "order" for your back end template to change order_number by order_invoice_number if you want to do that though.

Note that this is a first version of that new feature.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
12 years 1 day ago #74540

Hi Nicolas.

I downloaded the attach invoice plugin and installed again and now the invoice number is ok.

I replaced the line in helper.php, but the invoice was still showing the created date, so I modified the file invoice.php of the attach invoice plugin too and now is showing ok the modified date (this modification must be done in the current version of the plugin to show the modified date, otherwise it shows the created date). I suppose that modifying the line in helper.php will be ok if you don't have installed the attach plugin.

My procedure is Creation->Confirm->Ship, so if I confirm an order today the invoice date is Nov-06, but if I ship it tomorrow then the modified date (invoice date too) is Nov-07 and then I lose my invoice date. Is there any way to preserve the confirm date (invoice date)? Can the attach plugin send the attached invoice only when I change the order state to shipped (last 'theorical' state)? Or a new field to store the modified date ONLY THE FIRST TIME when the state is changed to Confirmed, so I can resend the invoice to the customer some days/months later with the original invoice date. (maybe an idea for next version of this feature)

Well, sorry, I wanted to say an 'invoices listing' (separately from 'orders listing' or simply a filter to see which orders are invoiced). I don't want to replace the 'order number' column, but I want to have (if possible) the info column of 'invoice number', so I can see very easily the orders which have been invoiced (which have an invoice number).

Thanks again.

Last edit: 12 years 13 hours ago by lanzanet.

Please Log in or Create an account to join the conversation.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
11 years 11 months ago #74887

Hi,

Indeed by default the date used is the order creation date. The date of the confirmation of the order is not saved. There are already two dates saved in the order...
We'll see for the future, but I suppose that the reset of the id will be prioritized over the date.
You could potentially add a custom order field and with the help of a custom hikashop plugin, you could set the date yourself in that field when orders are confirmed.

Since you can filter the orders by status and that all the confirmed orders have an invoice, you can already list all the invoiced orders.
If you want to add a column to that listing, you can simply copy/paste the code related to the order number in that view file (2 places) and change one to use the invoice number instead of the order number.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 11 months ago #74966

nicolas wrote: The invoice number is an auto increment for now. You can't reset it for now nor modify it.


Will you add this feature for the end of the year?

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
11 years 11 months ago #75003

Hi,

OK, I didn't thought filtering orders by state, but filtering by 'Confirmed' can solve me the problem.

I've added a column to display the invoice number next to the order number following the steps you gave me to modify the listing view and all is ok.

I've created a custom field named 'invoice_date' in the table 'orders' that appears in my back end, and now I have only one question: Can I add some code to the attach invoice plugin to set this field? I've thought that the plugin could set this field with the current date, ONLY if the field is empty, so I can change the state to created->confirmed later to resend the invoice to my client and don't lose the invoice date. if it's possible, Can you give me this code, please? If this could be possible I think that the invoice number procedure will be finally solved for me and legal in Spain.

Or maybe easier doing the same procedure (setting the field value) at the same time that the order is changed to 'Confirmed', and then this option is valid also if you don't have the attach plugin installed. Maybe a few lines of code.

Thanks for your help.

PD: Regarding to reset the invoice number, Is the auto field in a table that is used only for this purpose? If so, Can we truncate this table manually to get the number '1' each beginnig of a new year? Thanks.

Last edit: 11 years 11 months ago by lanzanet.

Please Log in or Create an account to join the conversation.

  • Posts: 82760
  • Thank you received: 13346
  • MODERATOR
11 years 11 months ago #75369

For the end of the year, I won't be able to do it as I will be travelling for most of December.
So doing a new release while travelling is not possible.

However, that's something we actually want to add for next version of HikaShop at the beginning of the year.
We'll also add a new field to store the date of creation of the invoice.

As a temporary solution for the date, if you're using PayPal, the order is confirmed with this line:
$order->order_status = $element->payment_params->verified_status;
in the file plugins/hikashoppayment/paypal/paypal.php

so you could just add after that line:
$order->invoice_date=date("Y-m-d H:i:s");

Then, you will be able to display it where you need to like that:
echo $order->invoice_date;

Last edit: 11 years 11 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
11 years 11 months ago #75424

Hi Nicolas, thanks for answering.

While waiting for your answer, I modified some parts of code and now I have a 'complete invoice number system' that is working for me. If you have no problem I could post here my steps (pdf in spanish, but I could translate it, if needed), so you could only review them (and give your OK) to see if there's something wrong, but now it's working for me.

Maybe could be useful and help other users (Spain, Italy, etc.) with same needs and/or for next versions of this invoice system.

I wait for your answer.

Thanks.

Last edit: 11 years 11 months ago by lanzanet.

Please Log in or Create an account to join the conversation.

  • Posts: 107
  • Thank you received: 3
11 years 11 months ago #75870

Hi Nicolas.

Please, can you review my steps and give me your ok? I want to be sure that what I've done is going to work with no problem.

I can attach a PDF.

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #76033

Hi,

We talk with Nicolas two days ago about this feature of invoice reset.
We made a design and the feature is in our TODO list for the next release of HikaShop.

You can send me your PDF by email, I will read it and give you my feedbacks.
I can understand Spanish but I am not really good or fluent with this language. So if you have an English version, I would loved it !

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 272
  • Thank you received: 13
11 years 11 months ago #76057

Jerome wrote: We talk with Nicolas two days ago about this feature of invoice reset.
We made a design and the feature is in our TODO list for the next release of HikaShop.


Cant wait for it! :woohoo: I cannot start 2 new projects without this feature.

Please Log in or Create an account to join the conversation.

  • Posts: 344
  • Thank you received: 3
11 years 11 months ago #77566

Hi !

Is this function you talk about here avaliable in the Hikashop 1.6 version from september 2012 ?

If you want that the invoice numbers get incremented only for confirmed orders, you will have to wait. We're working on that but it won't be available in HikaShop before September.


If so, is it included with the free version or do I need the paid one ?

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77576

Hi,

The invoice number feature is in all versions, starter included.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 344
  • Thank you received: 3
11 years 11 months ago #77577

Where do I enable this feature ?

I tried to locate it but can't fint it.
I use the starter version.

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77587

Hi,

There is no need to enable the feature.
HikaShop 2.0 know generates an invoice number when an order is confirmed. You can see this value in the backend, when you open (edit) an order.
There is just one option in order to select all statuses which would generate the invoice if not yet generated (default is : confirmed, shipped).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: river

Please Log in or Create an account to join the conversation.

  • Posts: 344
  • Thank you received: 3
11 years 11 months ago #77590

Ok i understand. But I use hikashop 1.6 starter.

do I have this function here ?

Please Log in or Create an account to join the conversation.

  • Posts: 26151
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #77592

Hi,

You can just check the changelog.
www.hikashop.com/en/support/documentatio...ashop-changelog.html

There is now a separate invoice number from the order number and both format can be configured independently


Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.117 seconds
Powered by Kunena Forum