Reorder the invoices when retrieving the last invoice
This commit is contained in:
parent
fd6b853154
commit
acd2ab46e4
|
@ -1052,7 +1052,7 @@ module StopTime::Controllers
|
|||
return redirect R(CustomersN, customer_id) if @input.cancel
|
||||
|
||||
# Create the invoice.
|
||||
last = Invoice.last
|
||||
last = Invoice.reorder('number ASC').last
|
||||
number = if last
|
||||
last_year = last.number.to_s[0..3].to_i
|
||||
if Time.now.year > last_year
|
||||
|
|
Loading…
Reference in New Issue