Lista globale dei pagamenti da fatturare con dati intestazione, caricamento PDF per riga che crea la fattura e invia email; rimuove il flusso bozza manuale. Co-authored-by: Cursor <cursoragent@cursor.com>
10 lines
221 B
Ruby
10 lines
221 B
Ruby
module Billing
|
|
class InvoiceNumber
|
|
def self.next_for(club)
|
|
year = Date.current.year
|
|
count = club.billing_invoices.where("number LIKE ?", "%#{year}%").count + 1
|
|
"#{year}/#{count}"
|
|
end
|
|
end
|
|
end
|