Module: ZATCA::UBL::InvoiceSubtypeBuilder
- Extended by:
- InvoiceSubtypeBuilder
- Included in:
- InvoiceSubtypeBuilder
- Defined in:
- lib/zatca/ubl/invoice_subtype_builder.rb
Instance Method Summary collapse
-
#build(simplified:, third_party:, nominal:, exports:, summary:, self_billed:) ⇒ String
Builds the invoice subtype code based on the provided parameters.
Instance Method Details
#build(simplified:, third_party:, nominal:, exports:, summary:, self_billed:) ⇒ String
Builds the invoice subtype code based on the provided parameters.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/zatca/ubl/invoice_subtype_builder.rb', line 35 def build( simplified:, third_party:, nominal:, exports:, summary:, self_billed: ) subtype_prefix = simplified ? "02" : "01" values = [third_party, nominal, exports, summary, self_billed] values = values.map { |v| v ? "1" : "0" } subtype_prefix + values.join end |