tag = 'RFF' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::RFF) structure = Eancom::Edifact::Structure.new(tag: tag) #============================================================================== # Tag # #============================================================================== tag = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 3, dictionary: nil, description: "Message Header", required: true ) tag.add(:tag, data) structure << tag #============================================================================== # Reference # #============================================================================== reference = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: { 'AAB' => { description: 'Proforma Invoice number', identifier: 'proforma_invoice_number' }, 'AAJ' => { description: 'Delivery order number', identifier: 'delivery_order_number' }, 'AAK' => { description: 'Despache advice number', identifier: 'despatch_advice_number' }, 'AAN' => { description: 'Delivery schedule number', identifier: 'delivery_schedule_number' }, 'AAU' => { description: 'Despatch note number', identifier: 'despatch_note_number' }, 'AFO' => { description: 'Beneficiarys reference', identifier: 'beneficiarys_reference' }, 'AJS' => { description: 'Agreement number', identifier: 'agreement_number' }, 'ALL' => { description: 'Message Batch number', identifier: 'message_batch_number' }, 'AIZ' => { description: 'Consolidated Invoice number', identifier: 'consolidated_invoice_number' }, 'AMT' => { description: 'Goods and Service Tax identifier number', identifier: 'goods_and_service_tax_identifier_number' }, 'APQ' => { description: 'Commercial account summary', identifier: 'commercial_account_summary' }, 'AWT' => { description: 'Administrative reference Code', identifier: 'administrative_reference_code' }, 'CD' => { description: 'Credit note number', identifier: 'credit_note_number' }, 'CR' => { description: 'Customer reference number', identifier: 'customer_reference_number' }, 'CT' => { description: 'Contact number', identifier: 'contact_number' }, 'DL' => { description: 'Debit note number', identifier: 'debit_note_number' }, 'DQ' => { description: 'Delivery note number', identifier: 'delivery_note_number' }, 'FC' => { description: 'Fiscal number', identifier: 'fiscal_number' }, 'IP' => { description: 'Import licence number', identifier: 'import_licence_number' }, 'IV' => { description: 'Invoice number', identifier: 'invoice_number' }, 'ON' => { description: 'Order number (buyer)', identifier: 'order_number_buyer' }, 'PL' => { description: 'Price list number', identifier: 'price_list_numebr' }, 'PK' => { description: 'Packing list number', identifier: 'packing_list_number' }, 'POR' => { description: 'Purchase order response number', identifier: 'purchase_order_response_number' }, 'PP' => { description: 'Purchase order change number', identifier: 'purchase_order_change_number' }, 'RF' => { description: 'Export reference number', identifier: 'export_reference_number' }, 'TN' => { description: 'Transaction reference number', identifier: 'transaction_reference_number' }, 'VN' => { description: 'Order number (supplier)', identifier: 'order_number_supplier' }, 'VA' => { description: 'VAT registration number', identifier: 'vat_registration_number' }, 'XB8' => { description: 'Agreement number', identifier: 'agreement_number_old' } }, description: "Reference code quailifier", required: true ) reference.add(:reference_code_qualifier, data) data = Eancom::Edifact::Data.new( type: String, length: 1..70, dictionary: nil, description: "Reference identifier", required: true ) reference.add(:reference_identifier, data) data = Eancom::Edifact::Data.new( type: String, length: 1..6, dictionary: nil, description: "Document line identifier", required: false ) reference.add(:document_line_identifier, data) structure << reference #============================================================================== Eancom.register_structure(tag: 'RFF', structure: structure)