Class: YDIM::AutoInvoice
- Defined in:
- lib/ydim/odba.rb,
lib/ydim/invoice.rb
Constant Summary collapse
- @@year_ptrn =
%r{<year>([^<])*</year>}
Constants inherited from Invoice
Instance Attribute Summary collapse
-
#invoice_interval ⇒ Object
Returns the value of attribute invoice_interval.
-
#reminder_body ⇒ Object
Returns the value of attribute reminder_body.
-
#reminder_subject ⇒ Object
Returns the value of attribute reminder_subject.
Attributes inherited from Invoice
#currency, #date, #debitor, #deleted, #description, #items, #payment_period, #payment_received, #precision, #suppress_vat, #unique_id
Instance Method Summary collapse
Methods inherited from Invoice
#add_item, #debitor_email, #debitor_id, #debitor_name, #due_date, #empty?, #info, #initialize, #item, #pdf_invoice, #status, sum, #to_pdf
Methods included from ItemId
Constructor Details
This class inherits a constructor from YDIM::Invoice
Instance Attribute Details
#invoice_interval ⇒ Object
Returns the value of attribute invoice_interval.
152 153 154 |
# File 'lib/ydim/invoice.rb', line 152 def invoice_interval @invoice_interval end |
#reminder_body ⇒ Object
Returns the value of attribute reminder_body.
152 153 154 |
# File 'lib/ydim/invoice.rb', line 152 def reminder_body @reminder_body end |
#reminder_subject ⇒ Object
Returns the value of attribute reminder_subject.
152 153 154 |
# File 'lib/ydim/invoice.rb', line 152 def reminder_subject @reminder_subject end |
Instance Method Details
#advance(date) ⇒ Object
156 157 158 159 160 161 162 163 164 165 |
# File 'lib/ydim/invoice.rb', line 156 def advance(date) months = @invoice_interval.to_s[/\d+/].to_i if @reminder_subject @reminder_subject.gsub!(@@year_ptrn) do |match| years = months / 12 match.gsub(%r{\d+}) do |year| (year.to_i + years).to_s end end end @date = date >> months end |
#invoice_key ⇒ Object
153 154 155 |
# File 'lib/ydim/invoice.rb', line 153 def invoice_key :autoinvoice end |