finvoice3 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +0 -0
- data/README.md +46 -0
- data/Rakefile +8 -0
- data/lib/finvoice3/any_party_communication_details.rb +19 -0
- data/lib/finvoice3/any_party_details/any_party_communication_details.rb +19 -0
- data/lib/finvoice3/any_party_details/any_party_postal_address_details.rb +34 -0
- data/lib/finvoice3/any_party_details.rb +46 -0
- data/lib/finvoice3/attachment_message_details/attachment_message_identifier.rb +5 -0
- data/lib/finvoice3/attachment_message_details.rb +14 -0
- data/lib/finvoice3/buyer_communication_details.rb +19 -0
- data/lib/finvoice3/buyer_party_details/buyer_postal_address_details.rb +32 -0
- data/lib/finvoice3/buyer_party_details.rb +46 -0
- data/lib/finvoice3/country_code.rb +7 -0
- data/lib/finvoice3/delivery_communication_details.rb +19 -0
- data/lib/finvoice3/delivery_details/delivery_period_details.rb +19 -0
- data/lib/finvoice3/delivery_details/destination_name.rb +13 -0
- data/lib/finvoice3/delivery_details/package_details.rb +31 -0
- data/lib/finvoice3/delivery_details/shipment_party_details/shipment_postal_address_details.rb +34 -0
- data/lib/finvoice3/delivery_details/shipment_party_details.rb +34 -0
- data/lib/finvoice3/delivery_details.rb +112 -0
- data/lib/finvoice3/delivery_party_details/delivery_postal_address_details.rb +34 -0
- data/lib/finvoice3/delivery_party_details.rb +31 -0
- data/lib/finvoice3/direct_debit_info.rb +22 -0
- data/lib/finvoice3/electronic_addr_id.rb +14 -0
- data/lib/finvoice3/epi_account_id.rb +13 -0
- data/lib/finvoice3/epi_details/epi_identification_details/epi_reference.rb +7 -0
- data/lib/finvoice3/epi_details/epi_identification_details.rb +28 -0
- data/lib/finvoice3/epi_details/epi_party_details/epi_beneficiary_party_details.rb +22 -0
- data/lib/finvoice3/epi_details/epi_party_details/epi_bfi_party_details/epi_bfi_identifier.rb +14 -0
- data/lib/finvoice3/epi_details/epi_party_details/epi_bfi_party_details.rb +19 -0
- data/lib/finvoice3/epi_details/epi_party_details.rb +19 -0
- data/lib/finvoice3/epi_details/epi_payment_instruction_details/epi_amount.rb +7 -0
- data/lib/finvoice3/epi_details/epi_payment_instruction_details/epi_charge.rb +14 -0
- data/lib/finvoice3/epi_details/epi_payment_instruction_details/epi_remittance_info_identifier.rb +14 -0
- data/lib/finvoice3/epi_details/epi_payment_instruction_details.rb +40 -0
- data/lib/finvoice3/epi_details.rb +22 -0
- data/lib/finvoice3/factoring_agreement_details/factoring_party_postal_address_details.rb +34 -0
- data/lib/finvoice3/factoring_agreement_details.rb +37 -0
- data/lib/finvoice3/finvoice.rb +187 -0
- data/lib/finvoice3/invoice.rb +33 -0
- data/lib/finvoice3/invoice_details/definition_details/definition_header_text.rb +14 -0
- data/lib/finvoice3/invoice_details/definition_details.rb +19 -0
- data/lib/finvoice3/invoice_details/discount_details.rb +34 -0
- data/lib/finvoice3/invoice_details/invoice_charge_details.rb +32 -0
- data/lib/finvoice3/invoice_details/invoice_classification.rb +19 -0
- data/lib/finvoice3/invoice_details/invoice_type_code_fi.rb +13 -0
- data/lib/finvoice3/invoice_details/origin_code.rb +4 -0
- data/lib/finvoice3/invoice_details/payment_terms_details/cash_discount_vat_details.rb +19 -0
- data/lib/finvoice3/invoice_details/payment_terms_details/header_value.rb +16 -0
- data/lib/finvoice3/invoice_details/payment_terms_details/payment_over_due_fine_details.rb +22 -0
- data/lib/finvoice3/invoice_details/payment_terms_details.rb +46 -0
- data/lib/finvoice3/invoice_details/vat_point.rb +19 -0
- data/lib/finvoice3/invoice_details/vat_specification_details.rb +31 -0
- data/lib/finvoice3/invoice_details.rb +211 -0
- data/lib/finvoice3/invoice_recipient_communication_details.rb +19 -0
- data/lib/finvoice3/invoice_recipient_party_details/invoice_recipient_postal_address_details.rb +34 -0
- data/lib/finvoice3/invoice_recipient_party_details.rb +31 -0
- data/lib/finvoice3/invoice_row/article_group_identifier.rb +13 -0
- data/lib/finvoice3/invoice_row/customs_info.rb +28 -0
- data/lib/finvoice3/invoice_row/ean_code.rb +9 -0
- data/lib/finvoice3/invoice_row/row_any_party_details/row_any_party_postal_address_details.rb +34 -0
- data/lib/finvoice3/invoice_row/row_any_party_details.rb +40 -0
- data/lib/finvoice3/invoice_row/row_charge_details.rb +28 -0
- data/lib/finvoice3/invoice_row/row_definition_details/row_definition_header_text.rb +9 -0
- data/lib/finvoice3/invoice_row/row_definition_details.rb +14 -0
- data/lib/finvoice3/invoice_row/row_delivery_details/row_package_details.rb +34 -0
- data/lib/finvoice3/invoice_row/row_delivery_details.rb +97 -0
- data/lib/finvoice3/invoice_row/row_over_due_payment_details.rb +73 -0
- data/lib/finvoice3/invoice_row/row_progressive_discount_details.rb +28 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_any_party_details/sub_row_any_party_postal_address_details.rb +34 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_any_party_details.rb +40 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_definition_details/sub_row_definition_header_text.rb +9 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_definition_details.rb +19 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_delivery_details/sub_row_package_details.rb +34 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_delivery_details.rb +73 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_over_due_payment_details.rb +73 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row/sub_row_progressive_discount_details.rb +28 -0
- data/lib/finvoice3/invoice_row/sub_invoice_row.rb +250 -0
- data/lib/finvoice3/invoice_row/transaction_details.rb +22 -0
- data/lib/finvoice3/invoice_row.rb +255 -0
- data/lib/finvoice3/invoice_sender_party_details.rb +25 -0
- data/lib/finvoice3/invoiced_object_id.rb +13 -0
- data/lib/finvoice3/message_transmission_details/message_details.rb +29 -0
- data/lib/finvoice3/message_transmission_details/message_receiver_details.rb +19 -0
- data/lib/finvoice3/message_transmission_details/message_sender_details.rb +19 -0
- data/lib/finvoice3/message_transmission_details.rb +22 -0
- data/lib/finvoice3/original_invoice_reference.rb +19 -0
- data/lib/finvoice3/partial_payment_details.rb +43 -0
- data/lib/finvoice3/party_identifier.rb +17 -0
- data/lib/finvoice3/party_legal_reg_id.rb +13 -0
- data/lib/finvoice3/payment_card_info.rb +19 -0
- data/lib/finvoice3/payment_status_details/payment_status_code.rb +5 -0
- data/lib/finvoice3/payment_status_details.rb +19 -0
- data/lib/finvoice3/seller_communication_details.rb +19 -0
- data/lib/finvoice3/seller_information_details/invoice_recipient_details.rb +19 -0
- data/lib/finvoice3/seller_information_details/seller_account_details/seller_account_id.rb +15 -0
- data/lib/finvoice3/seller_information_details/seller_account_details/seller_bic.rb +14 -0
- data/lib/finvoice3/seller_information_details/seller_account_details.rb +22 -0
- data/lib/finvoice3/seller_information_details/seller_official_postal_address_details.rb +31 -0
- data/lib/finvoice3/seller_information_details.rb +61 -0
- data/lib/finvoice3/seller_party_details/seller_postal_address_details.rb +32 -0
- data/lib/finvoice3/seller_party_details.rb +46 -0
- data/lib/finvoice3/soap_envelope.rb +82 -0
- data/lib/finvoice3/specification_details/external_specification_details.rb +5 -0
- data/lib/finvoice3/specification_details.rb +19 -0
- data/lib/finvoice3/tag/complex.rb +22 -0
- data/lib/finvoice3/tag/simple.rb +13 -0
- data/lib/finvoice3/tag.rb +27 -0
- data/lib/finvoice3/templates/fi_b2b.rb +232 -0
- data/lib/finvoice3/vat_category_code.rb +4 -0
- data/lib/finvoice3/version.rb +5 -0
- data/lib/finvoice3.rb +135 -0
- metadata +225 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class DirectDebitInfo < Tag::Complex
|
|
3
|
+
attr_accessor :mandate_reference
|
|
4
|
+
attr_accessor :creditor_identifier
|
|
5
|
+
attr_accessor :debited_account_id
|
|
6
|
+
|
|
7
|
+
def initialize
|
|
8
|
+
super
|
|
9
|
+
@mandate_reference = Tag::Simple.new(name: "MandateReference")
|
|
10
|
+
@creditor_identifier = Tag::Simple.new(name: "CreditorIdentifier")
|
|
11
|
+
@debited_account_id = EpiAccountId.new(name: "DebitedAccountID")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def sub_tags
|
|
15
|
+
[
|
|
16
|
+
@mandate_reference,
|
|
17
|
+
@creditor_identifier,
|
|
18
|
+
@debited_account_id
|
|
19
|
+
]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiAccountId < Tag::Simple
|
|
3
|
+
attr_accessor :identification_scheme_name
|
|
4
|
+
|
|
5
|
+
def initialize(name: "EpiAccountID")
|
|
6
|
+
super(name: name)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def attributes
|
|
10
|
+
{"IdentificationSchemeName": @identification_scheme_name}
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiIdentificationDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_date
|
|
4
|
+
attr_accessor :epi_reference
|
|
5
|
+
attr_accessor :epi_url
|
|
6
|
+
attr_accessor :epi_email
|
|
7
|
+
attr_accessor :epi_order_info
|
|
8
|
+
|
|
9
|
+
def initialize
|
|
10
|
+
super
|
|
11
|
+
@epi_date = Tag::Simple.new(name: "EpiDate")
|
|
12
|
+
@epi_reference = EpiReference.new
|
|
13
|
+
@epi_url = Tag::Simple.new(name: "EpiUrl")
|
|
14
|
+
@epi_email = Tag::Simple.new(name: "EpiEmail")
|
|
15
|
+
@epi_order_info = Tag::Simple.new(name: "EpiOrderInfo")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def sub_tags
|
|
19
|
+
[
|
|
20
|
+
@epi_date,
|
|
21
|
+
@epi_reference,
|
|
22
|
+
@epi_url,
|
|
23
|
+
@epi_email,
|
|
24
|
+
@epi_order_info
|
|
25
|
+
]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPartyDetails::EpiBeneficiaryPartyDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_name_address_details
|
|
4
|
+
attr_accessor :epi_bei
|
|
5
|
+
attr_accessor :epi_account_id
|
|
6
|
+
|
|
7
|
+
def initialize
|
|
8
|
+
super
|
|
9
|
+
@epi_name_address_details = Tag::Simple.new(name: "EpiNameAddressDetails")
|
|
10
|
+
@epi_bei = Tag::Simple.new(name: "EpiBei")
|
|
11
|
+
@epi_account_id = Finvoice3::EpiAccountId.new(name: "EpiAccountID")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def sub_tags
|
|
15
|
+
[
|
|
16
|
+
@epi_name_address_details,
|
|
17
|
+
@epi_bei,
|
|
18
|
+
@epi_account_id
|
|
19
|
+
]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPartyDetails::EpiBfiPartyDetails::EpiBfiIdentifier < Tag::Simple
|
|
3
|
+
attr_accessor :identification_scheme_name
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
super
|
|
7
|
+
@identification_scheme_name = "" # "BIC"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def attributes
|
|
11
|
+
{"IdentificationSchemeName": @identification_scheme_name}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPartyDetails::EpiBfiPartyDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_bfi_identifier
|
|
4
|
+
attr_accessor :epi_bfi_name
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
super
|
|
8
|
+
@epi_bfi_identifier = EpiBfiIdentifier.new
|
|
9
|
+
@epi_bfi_name = Tag::Simple.new(name: "EpiBfiName")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def sub_tags
|
|
13
|
+
[
|
|
14
|
+
@epi_bfi_identifier,
|
|
15
|
+
@epi_bfi_name
|
|
16
|
+
]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPartyDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_bfi_party_details
|
|
4
|
+
attr_accessor :epi_beneficiary_party_details
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
super
|
|
8
|
+
@epi_bfi_party_details = EpiBfiPartyDetails.new
|
|
9
|
+
@epi_beneficiary_party_details = EpiBeneficiaryPartyDetails.new
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def sub_tags
|
|
13
|
+
[
|
|
14
|
+
@epi_bfi_party_details,
|
|
15
|
+
@epi_beneficiary_party_details
|
|
16
|
+
]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPaymentInstructionDetails::EpiCharge < Tag::Simple
|
|
3
|
+
attr_accessor :charge_option
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
super
|
|
7
|
+
@charge_option = ""
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def attributes
|
|
11
|
+
{"ChargeOption": @charge_option}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/finvoice3/epi_details/epi_payment_instruction_details/epi_remittance_info_identifier.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPaymentInstructionDetails::EpiRemittanceInfoIdentifier < Tag::Simple
|
|
3
|
+
attr_accessor :identification_scheme_name
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
super(name: "EpiRemittanceInfoIdentifier")
|
|
7
|
+
@identification_scheme_name = ""
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def attributes
|
|
11
|
+
{"IdentificationSchemeName": @identification_scheme_name}
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails::EpiPaymentInstructionDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_payment_instruction_id
|
|
4
|
+
attr_accessor :epi_transaction_type_code
|
|
5
|
+
attr_accessor :epi_instruction_code
|
|
6
|
+
attr_accessor :epi_remittance_info_identifier
|
|
7
|
+
attr_accessor :epi_instructed_amount
|
|
8
|
+
attr_accessor :epi_charge
|
|
9
|
+
attr_accessor :epi_date_option_date
|
|
10
|
+
attr_accessor :epi_payment_means_code
|
|
11
|
+
attr_accessor :epi_payment_means_text
|
|
12
|
+
|
|
13
|
+
def initialize
|
|
14
|
+
super
|
|
15
|
+
@epi_payment_instruction_id = Tag::Simple.new(name: "EpiPaymentInstructionId")
|
|
16
|
+
@epi_transaction_type_code = Tag::Simple.new(name: "EpiTransactionTypeCode")
|
|
17
|
+
@epi_instruction_code = Tag::Simple.new(name: "EpiInstructionCode")
|
|
18
|
+
@epi_remittance_info_identifier = EpiRemittanceInfoIdentifier.new
|
|
19
|
+
@epi_instructed_amount = EpiAmount.new(name: "EpiInstructedAmount")
|
|
20
|
+
@epi_charge = EpiCharge.new
|
|
21
|
+
@epi_date_option_date = Tag::Simple.new(name: "EpiDateOptionDate")
|
|
22
|
+
@epi_payment_means_code = Tag::Simple.new(name: "EpiPaymentMeansCode")
|
|
23
|
+
@epi_payment_means_text = Tag::Simple.new(name: "EpiPaymentMeansText")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def sub_tags
|
|
27
|
+
[
|
|
28
|
+
@epi_payment_instruction_id,
|
|
29
|
+
@epi_transaction_type_code,
|
|
30
|
+
@epi_instruction_code,
|
|
31
|
+
@epi_remittance_info_identifier,
|
|
32
|
+
@epi_instructed_amount,
|
|
33
|
+
@epi_charge,
|
|
34
|
+
@epi_date_option_date,
|
|
35
|
+
@epi_payment_means_code,
|
|
36
|
+
@epi_payment_means_text
|
|
37
|
+
]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class EpiDetails < Tag::Complex
|
|
3
|
+
attr_accessor :epi_identification_details
|
|
4
|
+
attr_accessor :epi_party_details
|
|
5
|
+
attr_accessor :epi_payment_instruction_details
|
|
6
|
+
|
|
7
|
+
def initialize
|
|
8
|
+
super
|
|
9
|
+
@epi_identification_details = EpiIdentificationDetails.new
|
|
10
|
+
@epi_party_details = EpiPartyDetails.new
|
|
11
|
+
@epi_payment_instruction_details = EpiPaymentInstructionDetails.new
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def sub_tags
|
|
15
|
+
[
|
|
16
|
+
@epi_identification_details,
|
|
17
|
+
@epi_party_details,
|
|
18
|
+
@epi_payment_instruction_details
|
|
19
|
+
]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class FactoringAgreementDetails::FactoringPartyPostalAddressDetails < Tag::Complex
|
|
3
|
+
attr_accessor :factoring_party_street_name
|
|
4
|
+
attr_accessor :factoring_party_town_name
|
|
5
|
+
attr_accessor :factoring_party_post_cost_identifier
|
|
6
|
+
attr_accessor :factoring_party_country_subdivision
|
|
7
|
+
attr_accessor :country_code
|
|
8
|
+
attr_accessor :country_name
|
|
9
|
+
attr_accessor :factoring_party_post_office_box_identifier
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
super
|
|
13
|
+
@factoring_party_street_name = Tag::Simple.new(name: "FactoringPartyStreetName")
|
|
14
|
+
@factoring_party_town_name = Tag::Simple.new(name: "FactoringPartyTownName")
|
|
15
|
+
@factoring_party_post_cost_identifier = Tag::Simple.new(name: "FactoringPartyPostCostIdentifier")
|
|
16
|
+
@factoring_party_country_subdivision = Tag::Simple.new(name: "FactoringPartyCountrySubdivision")
|
|
17
|
+
@country_code = CountryCode.new
|
|
18
|
+
@country_name = Tag::Simple.new(name: "CountryName")
|
|
19
|
+
@factoring_party_post_office_box_identifier = Tag::Simple.new(name: "FactoringPartyPostOfficeBoxIdentifier")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def sub_tags
|
|
23
|
+
[
|
|
24
|
+
@factoring_party_street_name,
|
|
25
|
+
@factoring_party_town_name,
|
|
26
|
+
@factoring_party_post_cost_identifier,
|
|
27
|
+
@factoring_party_country_subdivision,
|
|
28
|
+
@country_code,
|
|
29
|
+
@country_name,
|
|
30
|
+
@factoring_party_post_office_box_identifier
|
|
31
|
+
]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class FactoringAgreementDetails < Tag::Complex
|
|
3
|
+
attr_accessor :factoring_agreement_identifier
|
|
4
|
+
attr_accessor :transmission_list_identifier
|
|
5
|
+
attr_accessor :endorsement_clause_code
|
|
6
|
+
attr_accessor :factoring_type_code
|
|
7
|
+
attr_accessor :factoring_free_text
|
|
8
|
+
attr_accessor :factoring_party_identifier
|
|
9
|
+
attr_accessor :factoring_party_name
|
|
10
|
+
attr_accessor :factoring_party_postal_address_details
|
|
11
|
+
|
|
12
|
+
def initialize
|
|
13
|
+
super
|
|
14
|
+
@factoring_agreement_identifier = Tag::Simple.new(name: "FactoringAgreementIdentifier")
|
|
15
|
+
@transmission_list_identifier = Tag::Simple.new(name: "TransmissionListIdentifier")
|
|
16
|
+
@endorsement_clause_code = Tag::Simple.new(name: "EndorsementClauseCode")
|
|
17
|
+
@factoring_type_code = Tag::Simple.new(name: "FactoringTypeCode")
|
|
18
|
+
@factoring_free_text = Tag::Simple.new(name: "FactoringFreeText")
|
|
19
|
+
@factoring_party_identifier = PartyLegalRegId.new(name: "FactoringPartyIdentifier")
|
|
20
|
+
@factoring_party_name = Tag::Simple.new(name: "FactoringPartyName")
|
|
21
|
+
@factoring_party_postal_address_details = FactoringPartyPostalAddressDetails.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def sub_tags
|
|
25
|
+
[
|
|
26
|
+
@factoring_agreement_identifier,
|
|
27
|
+
@transmission_list_identifier,
|
|
28
|
+
@endorsement_clause_code,
|
|
29
|
+
@factoring_type_code,
|
|
30
|
+
@factoring_free_text,
|
|
31
|
+
@factoring_party_identifier,
|
|
32
|
+
@factoring_party_name,
|
|
33
|
+
@factoring_party_postal_address_details
|
|
34
|
+
]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Finvoice3
|
|
4
|
+
class Finvoice < Tag::Complex
|
|
5
|
+
attr_accessor :message_transmission_details
|
|
6
|
+
attr_accessor :seller_party_details
|
|
7
|
+
attr_accessor :seller_information_details
|
|
8
|
+
attr_accessor :seller_organisation_number
|
|
9
|
+
attr_accessor :seller_site_code
|
|
10
|
+
attr_accessor :seller_contact_person_name
|
|
11
|
+
attr_accessor :seller_contact_person_function
|
|
12
|
+
attr_accessor :seller_contact_person_department
|
|
13
|
+
attr_accessor :seller_communication_details
|
|
14
|
+
attr_accessor :invoice_sender_party_details
|
|
15
|
+
attr_accessor :invoice_recipient_party_details
|
|
16
|
+
attr_accessor :invoice_recipient_organisation_unit_number
|
|
17
|
+
attr_accessor :invoice_recipient_site_code
|
|
18
|
+
attr_accessor :invoice_recipient_contact_person_name
|
|
19
|
+
attr_accessor :invoice_recipient_contact_person_function
|
|
20
|
+
attr_accessor :invoice_recipient_contact_person_department
|
|
21
|
+
attr_accessor :invoice_recipient_language_code
|
|
22
|
+
attr_accessor :invoice_recipient_communication_details
|
|
23
|
+
attr_accessor :buyer_party_details
|
|
24
|
+
attr_accessor :buyer_organisation_unit_number
|
|
25
|
+
attr_accessor :buyer_site_code
|
|
26
|
+
attr_accessor :buyer_contact_person_name
|
|
27
|
+
attr_accessor :buyer_contact_person_function
|
|
28
|
+
attr_accessor :buyer_contact_person_department
|
|
29
|
+
attr_accessor :buyer_communication_details
|
|
30
|
+
attr_accessor :delivery_party_details
|
|
31
|
+
attr_accessor :delivery_organisation_unit_number
|
|
32
|
+
attr_accessor :delivery_site_code
|
|
33
|
+
attr_accessor :delivery_contact_person_name
|
|
34
|
+
attr_accessor :delivery_contact_person_function
|
|
35
|
+
attr_accessor :delivery_contact_person_department
|
|
36
|
+
attr_accessor :delivery_communication_details
|
|
37
|
+
attr_accessor :delivery_details
|
|
38
|
+
attr_accessor :any_party_details
|
|
39
|
+
attr_accessor :invoice_details
|
|
40
|
+
attr_accessor :payment_card_info
|
|
41
|
+
attr_accessor :direct_debit_info
|
|
42
|
+
attr_accessor :payment_status_details
|
|
43
|
+
attr_accessor :partial_payment_details
|
|
44
|
+
attr_accessor :factoring_agreement_details
|
|
45
|
+
attr_accessor :virtual_bank_barcode
|
|
46
|
+
attr_accessor :invoice_rows
|
|
47
|
+
attr_accessor :specification_details
|
|
48
|
+
attr_accessor :epi_details
|
|
49
|
+
attr_accessor :invoice_url_name
|
|
50
|
+
attr_accessor :invoice_url_text
|
|
51
|
+
attr_accessor :storage_url_text
|
|
52
|
+
attr_accessor :lay_out_identifier
|
|
53
|
+
attr_accessor :invoice_segment_identifier
|
|
54
|
+
attr_accessor :control_checksum
|
|
55
|
+
attr_accessor :message_checksum
|
|
56
|
+
attr_accessor :control_stamp_text
|
|
57
|
+
attr_accessor :acceptance_stamp_text
|
|
58
|
+
attr_accessor :original_invoice_format
|
|
59
|
+
attr_accessor :attachment_message_details
|
|
60
|
+
|
|
61
|
+
def initialize
|
|
62
|
+
super
|
|
63
|
+
@message_transmission_details = MessageTransmissionDetails.new
|
|
64
|
+
@seller_party_details = SellerPartyDetails.new
|
|
65
|
+
@seller_information_details = SellerInformationDetails.new
|
|
66
|
+
@seller_communication_details = SellerCommunicationDetails.new
|
|
67
|
+
@seller_organisation_number = Tag::Simple.new(name: "SellerOrganisationNumber")
|
|
68
|
+
@seller_site_code = Tag::Simple.new(name: "SellerSiteCode")
|
|
69
|
+
@seller_contact_person_name = Tag::Simple.new(name: "SellerContactPersonName")
|
|
70
|
+
@seller_contact_person_function = Tag::Simple.new(name: "SellerContactPersonFunction")
|
|
71
|
+
@seller_contact_person_department = Tag::Simple.new(name: "SellerContactPersonDepartment")
|
|
72
|
+
@invoice_sender_party_details = InvoiceSenderPartyDetails.new
|
|
73
|
+
@invoice_recipient_party_details = InvoiceRecipientPartyDetails.new
|
|
74
|
+
@invoice_recipient_organisation_unit_number = Tag::Simple.new(name: "InvoiceRecipientOrganisationUnitNumber")
|
|
75
|
+
@invoice_recipient_site_code = Tag::Simple.new(name: "InvoiceRecipientSiteCode")
|
|
76
|
+
@invoice_recipient_contact_person_name = Tag::Simple.new(name: "InvoiceRecipientContactPersonName")
|
|
77
|
+
@invoice_recipient_contact_person_department = Tag::Simple.new(name: "InvoiceRecipientContactPersonDepartment")
|
|
78
|
+
@invoice_recipient_language_code = Tag::Simple.new(name: "InvoiceRecipientLanguageCode")
|
|
79
|
+
@invoice_recipient_communication_details = InvoiceRecipientCommunicationDetails.new
|
|
80
|
+
@buyer_party_details = BuyerPartyDetails.new
|
|
81
|
+
@buyer_organisation_unit_number = Tag::Simple.new(name: "BuyerOrganisationUnitNumber")
|
|
82
|
+
@buyer_site_code = Tag::Simple.new(name: "BuyerSiteCode")
|
|
83
|
+
@buyer_contact_person_name = Tag::Simple.new(name: "BuyerContactPersonName")
|
|
84
|
+
@buyer_contact_person_function = Tag::Simple.new(name: "BuyerContactPersonFunction")
|
|
85
|
+
@buyer_contact_person_department = Tag::Simple.new(name: "BuyerContactPersonDepartment")
|
|
86
|
+
@buyer_communication_details = BuyerCommunicationDetails.new
|
|
87
|
+
@delivery_party_details = DeliveryPartyDetails.new
|
|
88
|
+
@delivery_organisation_unit_number = Tag::Simple.new(name: "DeliveryOrganisationUnitNumber")
|
|
89
|
+
@delivery_site_code = Tag::Simple.new(name: "DeliverySiteCode")
|
|
90
|
+
@delivery_contact_person_name = Tag::Simple.new(name: "DeliveryContactPersonName")
|
|
91
|
+
@delivery_contact_person_function = Tag::Simple.new(name: "DeliveryContactPersonFunction")
|
|
92
|
+
@delivery_contact_person_department = Tag::Simple.new(name: "DeliveryContactPersonDepartment")
|
|
93
|
+
@delivery_communication_details = DeliveryCommunicationDetails.new
|
|
94
|
+
@delivery_details = DeliveryDetails.new
|
|
95
|
+
@any_party_details = AnyPartyDetails.new
|
|
96
|
+
@invoice_details = InvoiceDetails.new
|
|
97
|
+
@payment_card_info = PaymentCardInfo.new
|
|
98
|
+
@direct_debit_info = DirectDebitInfo.new
|
|
99
|
+
@payment_status_details = PaymentStatusDetails.new
|
|
100
|
+
@partial_payment_details = PartialPaymentDetails.new
|
|
101
|
+
@factoring_agreement_details = FactoringAgreementDetails.new
|
|
102
|
+
@virtual_bank_barcode = Tag::Simple.new(name: "VirtualBankBarcode")
|
|
103
|
+
@invoice_rows = []
|
|
104
|
+
@specification_details = SpecificationDetails.new
|
|
105
|
+
@epi_details = EpiDetails.new
|
|
106
|
+
@invoice_url_name = Tag::Simple.new(name: "InvoiceUrlName")
|
|
107
|
+
@invoice_url_text = Tag::Simple.new(name: "InvoiceUrlText")
|
|
108
|
+
@storage_url_text = Tag::Simple.new(name: "StorageUrlText")
|
|
109
|
+
@lay_out_identifier = Tag::Simple.new(name: "LayOutIdentifier")
|
|
110
|
+
@invoice_segment_identifier = Tag::Simple.new(name: "InvoiceSegmentIdentifier")
|
|
111
|
+
@control_checksum = Tag::Simple.new(name: "ControlChecksum")
|
|
112
|
+
@message_checksum = Tag::Simple.new(name: "MessageChecksum")
|
|
113
|
+
@control_stamp_text = Tag::Simple.new(name: "ControlStampText")
|
|
114
|
+
@acceptance_stamp_text = Tag::Simple.new(name: "AcceptanceStampText")
|
|
115
|
+
@original_invoice_format = Tag::Simple.new(name: "OriginalInvoiceFormat")
|
|
116
|
+
@attachment_message_details = AttachmentMessageDetails.new
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
def sub_tags
|
|
120
|
+
[
|
|
121
|
+
@message_transmission_details,
|
|
122
|
+
@seller_party_details,
|
|
123
|
+
@seller_information_details,
|
|
124
|
+
@seller_organisation_number,
|
|
125
|
+
@seller_site_code,
|
|
126
|
+
@seller_contact_person_name,
|
|
127
|
+
@seller_contact_person_function,
|
|
128
|
+
@seller_contact_person_department,
|
|
129
|
+
@seller_communication_details,
|
|
130
|
+
@invoice_sender_party_details,
|
|
131
|
+
@invoice_recipient_party_details,
|
|
132
|
+
@invoice_recipient_organisation_unit_number,
|
|
133
|
+
@invoice_recipient_site_code,
|
|
134
|
+
@invoice_recipient_contact_person_name,
|
|
135
|
+
@invoice_recipient_contact_person_function,
|
|
136
|
+
@invoice_recipient_contact_person_department,
|
|
137
|
+
@invoice_recipient_language_code,
|
|
138
|
+
@invoice_recipient_communication_details,
|
|
139
|
+
@buyer_party_details,
|
|
140
|
+
@buyer_organisation_unit_number,
|
|
141
|
+
@buyer_site_code,
|
|
142
|
+
@buyer_contact_person_name,
|
|
143
|
+
@buyer_contact_person_function,
|
|
144
|
+
@buyer_contact_person_department,
|
|
145
|
+
@buyer_communication_details,
|
|
146
|
+
@delivery_party_details,
|
|
147
|
+
@delivery_organisation_unit_number,
|
|
148
|
+
@delivery_site_code,
|
|
149
|
+
@delivery_contact_person_name,
|
|
150
|
+
@delivery_contact_person_function,
|
|
151
|
+
@delivery_contact_person_department,
|
|
152
|
+
@delivery_communication_details,
|
|
153
|
+
@delivery_details,
|
|
154
|
+
@any_party_details,
|
|
155
|
+
@invoice_details,
|
|
156
|
+
@payment_card_info,
|
|
157
|
+
@direct_debit_info,
|
|
158
|
+
@payment_status_details,
|
|
159
|
+
@partial_payment_details,
|
|
160
|
+
@factoring_agreement_details,
|
|
161
|
+
@virtual_bank_barcode,
|
|
162
|
+
*@invoice_rows,
|
|
163
|
+
@specification_details,
|
|
164
|
+
@epi_details,
|
|
165
|
+
@invoice_url_name,
|
|
166
|
+
@invoice_url_text,
|
|
167
|
+
@storage_url_text,
|
|
168
|
+
@lay_out_identifier,
|
|
169
|
+
@invoice_segment_identifier,
|
|
170
|
+
@control_checksum,
|
|
171
|
+
@message_checksum,
|
|
172
|
+
@control_stamp_text,
|
|
173
|
+
@acceptance_stamp_text,
|
|
174
|
+
@original_invoice_format,
|
|
175
|
+
@attachment_message_details
|
|
176
|
+
]
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def attributes
|
|
180
|
+
{
|
|
181
|
+
"Version": "3.0",
|
|
182
|
+
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
|
|
183
|
+
"xsi:noNamespaceSchemaLocation": Finvoice3::XSD_SCHEMA
|
|
184
|
+
}
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "nokogiri"
|
|
4
|
+
|
|
5
|
+
module Finvoice3
|
|
6
|
+
class Invoice
|
|
7
|
+
attr_accessor :finvoice
|
|
8
|
+
|
|
9
|
+
def initialize
|
|
10
|
+
@finvoice = Finvoice.new
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def document
|
|
14
|
+
Nokogiri::XML::Builder.new(encoding: "ISO-8859-15") do |root|
|
|
15
|
+
@finvoice.to_xml(root)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def to_xml
|
|
20
|
+
document.to_xml
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def validate
|
|
24
|
+
xml = document.to_xml
|
|
25
|
+
xsd = Nokogiri::XML::Schema(File.read(File.join(File.dirname(__FILE__), XSD_SCHEMA)))
|
|
26
|
+
document = Nokogiri::XML(xml)
|
|
27
|
+
|
|
28
|
+
xsd.validate(document).map do |error|
|
|
29
|
+
error.message
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class InvoiceDetails::DefinitionDetails::DefinitionHeaderText < Tag::Complex
|
|
3
|
+
attr_accessor :definition_code
|
|
4
|
+
|
|
5
|
+
def initialize
|
|
6
|
+
super
|
|
7
|
+
@definition_code = Tag::Simple.new(name: "DefinitionCode")
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def sub_tags
|
|
11
|
+
[@definition_code]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class InvoiceDetails::DefinitionDetails < Tag::Complex
|
|
3
|
+
attr_accessor :definition_header_text
|
|
4
|
+
attr_accessor :definition_value
|
|
5
|
+
|
|
6
|
+
def initialize
|
|
7
|
+
super
|
|
8
|
+
@definition_header_text = DefinitionHeaderText.new
|
|
9
|
+
@definition_value = Tag::Simple.new(name: "DefinitionValue")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def sub_tags
|
|
13
|
+
[
|
|
14
|
+
@definition_header_text,
|
|
15
|
+
@definition_value
|
|
16
|
+
]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class InvoiceDetails::DiscountDetails < Tag::Complex
|
|
3
|
+
attr_accessor :free_text
|
|
4
|
+
attr_accessor :reason_code
|
|
5
|
+
attr_accessor :percent
|
|
6
|
+
attr_accessor :amount
|
|
7
|
+
attr_accessor :base_amount
|
|
8
|
+
attr_accessor :vat_category_code
|
|
9
|
+
attr_accessor :vat_rate_percent
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
super
|
|
13
|
+
@free_text = Tag::Simple.new(name: "FreeText")
|
|
14
|
+
@reason_code = Tag::Simple.new(name: "ReasonCode")
|
|
15
|
+
@percent = Tag::Simple.new(name: "Percent")
|
|
16
|
+
@amount = Tag::Simple.new(name: "Amount")
|
|
17
|
+
@base_amount = Tag::Simple.new(name: "BaseAmount")
|
|
18
|
+
@vat_category_code = Finvoice3::VatCategoryCode.new
|
|
19
|
+
@vat_rate_percent = Tag::Simple.new(name: "VatRatePercent")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def sub_tags
|
|
23
|
+
[
|
|
24
|
+
@free_text,
|
|
25
|
+
@reason_code,
|
|
26
|
+
@percent,
|
|
27
|
+
@amount,
|
|
28
|
+
@base_amount,
|
|
29
|
+
@vat_category_code,
|
|
30
|
+
@vat_rate_percent
|
|
31
|
+
]
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Finvoice3
|
|
2
|
+
class InvoiceDetails::InvoiceChargeDetails < Tag::Complex
|
|
3
|
+
attr_accessor :reason_text
|
|
4
|
+
attr_accessor :reason_code
|
|
5
|
+
attr_accessor :percent
|
|
6
|
+
attr_accessor :amount
|
|
7
|
+
attr_accessor :base_amount
|
|
8
|
+
attr_accessor :vat_category_code
|
|
9
|
+
attr_accessor :vat_rate_percent
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
super
|
|
13
|
+
@reason_text = Tag::Simple.new(name: "ReasonText")
|
|
14
|
+
@reason_code = Tag::Simple.new(name: "ReasonCode")
|
|
15
|
+
@percent = Tag::Simple.new(name: "Percent")
|
|
16
|
+
@amount = Tag::Simple.new(name: "Amount")
|
|
17
|
+
@vat_category_code = VatCategoryCode.new
|
|
18
|
+
@vat_rate_percent = Tag::Simple.new(name: "VatRatePercent")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def sub_tags
|
|
22
|
+
[
|
|
23
|
+
@reason_text,
|
|
24
|
+
@reason_code,
|
|
25
|
+
@percent,
|
|
26
|
+
@amount,
|
|
27
|
+
@vat_category_code,
|
|
28
|
+
@vat_rate_percent
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|