tag = 'PRI' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PRI) 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 #============================================================================== # Price Information #============================================================================== price_information = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: { 'AAA' => { description: 'Calculation net', identifier: 'calculation_net', }, 'AAB' => { description: 'Calculation gross', identifier: 'calculation_gross', }, 'AAE' => { description: 'Information Price, excluding allowances or charges, including taxes', identifier: 'information_price_excluding_allowance_or_charches_includeing_taxes', }, 'AAF' => { description: 'Information Price, excluding allowances or charges or taxes', identifier: 'information_price_excluding_allowance_or_charches_or_taxes', }, 'INF' => { description: 'Information', identifier: 'information', }, 'NTP' => { description: 'Net unit price', identifier: 'net_unit_price', }, 'AAH' => { description: 'Subject to escalation and price adjustment', identifier: 'subject_to_escaltion_and_price_adjustment', }, 'AAQ' => { description: 'Firm price', identifier: 'firm_price', }, 'ABL' => { description: 'Base price', identifier: 'base_price', }, 'ABM' => { description: 'Base price difference', identifier: 'base_price_difference', }, }, description: 'Price code qualifier', required: true ) price_information.add(:price_code_qualifier, data) data = Eancom::Edifact::Data.new( type: String, length: 0..15, dictionary: nil, description: 'Price amount', required: true ) price_information.add(:price_amount, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { 'CA' => { description: 'Catalogue', identifier: 'cataloque', }, 'CT' => { description: 'Contract', identifier: 'contract', }, }, description: 'Price type code', required: false ) price_information.add(:price_type_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { 'AAE' => { description: 'Not subject to fluctuation', identifier: 'not_subject_to_fluctuation', }, 'ALT' => { description: 'Alternate price', identifier: 'alternate_price', }, 'DPR' => { description: 'Discount price', identifier: 'discount_price', }, 'MRP' => { description: 'Market retail price', identifier: 'market_retail_price', }, 'LIU' => { description: 'List price', identifier: 'list_price', }, 'SRP' => { description: 'Suggested retail price', identifier: 'suggested_retail_price', }, 'RTP' => { description: 'Retail price', identifier: 'retail_price', }, 'NTP' => { description: 'Net unit price', identifier: 'net_unit_price', } }, description: 'Price specification code', required: false ) price_information.add(:price_specification_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..9, dictionary: nil, description: 'Unit price basis value', required: false ) price_information.add(:unit_price_basis_value, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { 'KGM' => { description: 'Kilogram', identifier: 'kilogram', }, 'PCE' => { description: 'Pice', identifier: 'pice', }, }, description: 'Measurement unit code', required: false ) price_information.add(:measurment_unit_code, data) structure << price_information #============================================================================== # Sub-line item price change operation code #============================================================================== subline_item_price_change_operation_code = Eancom::Edifact::Composite.new() data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: nil, description: 'Sub-line item price change operation code', required: false ) subline_item_price_change_operation_code.add(:subline_item_price_change_operation_code, data) structure << subline_item_price_change_operation_code #============================================================================== Eancom.register_structure(tag: 'PRI', structure: structure)