2016 is over, I want to enter new year for books and all other stuff for my business.
In my country from 01.01. every new invoice created have to start from number 1; for e.q. last invoice # (number/id) in 2016. was 20/W/1 (/W/1 must be with invoice no. by the law…). and first in 2017. must be 1/W/1
Ive tried to created new invoice group with the same unique id and create new invoice in that group.
IP creates invoice and saves draft (that is ok) but when I try to change anything and click Save it trows me an error : “The Invoice # field must contain a unique value.”
In db I can see that invoice in table, and when I change it thru phpmyadmin its ok, but if I try to change anything and save it i get the same problem again.
in the v1.4.4 in file application/modules/invoices/models/mdl_invoices.php @ line 144
change 'rules' => 'required|is_unique[ip_invoices.invoice_number' . (($this->id) ? '.invoice_id.' . $this->id : '') . ']'
to 'rules' => 'required'
in the v1.4.10 same file @ line 145 'rules' => 'is_unique[ip_invoices.invoice_number' . (($this->id) ? '.invoice_id.' . $this->id : '') . ']'
to 'rules' => 'required'
now Im able to save invoice without an error.
Will this mess up something else or it can be like this?
I mean will forcing same invoice ID/name mess up something other in the system?
I was using v1.4.4 for one year, and then updated the IP.
Other solution is to backup it, all files and db, drop most of the tables (invoices tables, preserve clients, quotes, settings, users…) and then start all over again.
If some inspection comes, show them on local server past year, and on live server current year.
To be hones, I dont like second solution
G.
Edit: as I can see in db, unique ID in ip_invoices is not invoice_number column it is invoice_id