DD-MM-YYYY date format to create invoices

Hi,
In v1.5.9, discovered an issue when choosing the DD-MMM-YYYY date format (like 05-Sep-2018). When creating a quote and trying to get the invoice from this quote, picking the invoice date is adding a “.” between month and year (it becomes 05-Sep.-2018) and then the proceed button doesn’t work.
Romain

I have tried to reproduce that behaviour in the IP-demo sire and I haven’t found any problem.

Could you try it yourself in IP-demo just to make sure that the same steps are done? This way we will find whether this is an issue with IP or with your installation.

I tried with the demo and indeed it does not happen. The demo is v1.5.0 ? My version is 1.5.9, does it make a difference ?
Here the snapshot of the issue
issue_date

The demo also runs version 1.5.9, the title is not correct, sorry.

OK, no problem. Maybe it comes from a language specific issue (French --> KO, but other languages --> OK) ?

Have you made any modifications to IP? I think IP uses a php date formating function that does not use the language setting.

I did not modify IP. Can it be the 1000 or decimal separator ?

When you click on the date field to enter a date and the calendar opens, in which language language is it? in English or in French? For instance, does it say “today” or “aujourd’hui”? “September” or “Septembre”?

If it is on English, the problem is elsewhere, but if it appears on French, please, open the Firefox debugger,

Screenshot-1

then scroll down until you find this piece of code

Screenshot-2

and copy&paste it here or take a screenshot and post it.

1 Like

@grizzly there’s no need to run the debugger, just confirm that the calendar is in French (I am almost sure it does).

Yesterday I found the cause of your problem when investigating another language problem in IP. I will see later if there is an easy fix, otherwise I will send you a temporary solution.

@miquel_cabanas yes the calendar is in French

This change seems to solve the problem. In the file ‘application/modules/quotes/views/modal_quote_to_invoice.php’ comment out the line number 14

invoice_date_created: $('#invoice_date_created').val(),

and below it insert the line,

invoice_date_created: $('#invoice_date_created').datepicker("option", "dateFormat", "dd-mm-yy").val(),

to obtain

// invoice_date_created: $('#invoice_date_created').val(),
invoice_date_created: $('#invoice_date_created').datepicker("option", "dateFormat", "dd-mm-yy").val(),

Try it and let us know if it works in which case I will submit the fix for v1.5.10.

I have created an issue for this bug:

  • IP-734 - Datepicker returns in certain cases a date with a format not compatible with MySQL

Really not a cool issue. If I set a format for the datepicker it should not change it based on the locale. Let’s see if this can be fixed.

Bizarre, pas de souci pour moi
Bizarre, no problem for me

IP 1.5.9 on Chrome 70

image

Please try with DD-MM-YYYY date format. I’ve no issue either with DD/MM/YYYY date format

Let me summarize the current state of this issue:

  • The bug has been confirmed and we are working to fix it asap.
  • The cause is that IP1 was originally designed as a single-user English-user application, and it uses internally the PHP date-conversion function createFromFormat() that is not language-aware and crashes when it is handled certain non-English date strings.

Workaround: Until this bug gets fixed, the only workaround is to avoid data formats that cause problems, like DD-MM-YYYY in French.

How to find out if you are affected: If the Submitt-button stops responding in any of the pop-up (modal) windows like “Create Invoice”, “Enter Payment”, etc.

1 Like