Skip to content

Commit

Permalink
chg: invoice-timeframe for invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
Skulli committed Jun 27, 2024
1 parent 59ff02b commit c9457fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/secretariat/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ module Secretariat
:footer_text,
:project_id,
:project_name,
:invoice_start,
:invoice_end,
keyword_init: true) do
include Versioner

Expand Down Expand Up @@ -262,6 +264,20 @@ def to_xml(version: 1, skip_validation: false, mode: :zugferd)
percent = by_version(version, "ApplicablePercent", "RateApplicablePercent")
xml["ram"].send(percent, Helpers.format(tax_percent))
end
if invoice_start.to_s != "" && invoice_end.to_s != ""
xml["ram"].BillingSpecifiedPeriod do
xml["ram"].StartDateTime do
xml["udt"].DateTimeString(format: "102") do
xml.text(invoice_start.strftime("%Y%m%d"))
end
end
xml["ram"].OccurrenceDateTime do
xml["udt"].EndDateTime(format: "102") do
xml.text(invoice_end.strftime("%Y%m%d"))
end
end
end
end
xml["ram"].SpecifiedTradePaymentTerms do
if payment_status == "unpaid"
xml["ram"].Description payment_description
Expand Down

0 comments on commit c9457fc

Please sign in to comment.