tag = 'ALC' Eancom.register_segment(tag: tag, klass: Eancom::Edifact::ALC) 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 #============================================================================== # Allowance or Charge code qualifier #============================================================================== allowance_or_charge_code_qualifier = Eancom::Edifact::Composite.new data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: { 'A' => { description: 'Allowance', identifier: 'allowance' }, 'C' => { description: 'Charge', identifier: 'charge' }, 'N' => { description: 'No allowance or charge', identifier: 'no_allowance_or_charge' } }, description: 'Allowance or Charge code qualifier', required: true ) allowance_or_charge_code_qualifier.add(:allowance_or_charge_code_qualifier, data) structure << allowance_or_charge_code_qualifier #============================================================================== # Allowance/Charge information #============================================================================== allowance_charge_information = Eancom::Edifact::Composite.new data = Eancom::Edifact::Data.new( type: String, length: 0..35, dictionary: nil, description: 'Allowance or charge identifier', required: false ) allowance_charge_information.add(:allowance_or_charge_identifier, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { '64' => { description: 'Special agreement', identifier: 'special_agreement' }, '69' => { description: 'Charge for a customer specific finish', identifier: 'charge_for_a_customer_specific_finisch' }, '64E' => { description: 'Yearly turnover allowance/charge', identifier: 'yearly_turnover_allowance_charge' }, '101' => { description: 'Carbon footprint charge', identifier: 'carbon_footprint_charge' } }, description: 'Allowance or charge identification code', required: false ) allowance_charge_information.add(:allowance_or_charge_identification_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { '1' => { description: 'Bill back', identifier: 'bill_back' }, '2' => { description: 'Off invoice', identifier: 'off_invoice' }, '5' => { description: 'Charge to be paid by vendor', identifier: 'charge_to_be_paid_by_vendor' }, '6' => { description: 'Charge to be paid by customer', identifier: 'charge_to_be_paid_by_customer' } }, description: 'Settlement mean code', required: false ) allowance_charge_information.add(:settlement_mean_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { '1' => { description: 'First step of calculation', identifier: 'first_step_of_calculation' }, '2' => { description: 'Second step of calculation', identifier: 'second_step_of_calculation' }, '3' => { description: 'Third step of calculation', identifier: 'third_step_of_calculation' }, '4' => { description: 'Forth step of calculation', identifier: 'forth_step_of_calculation' }, '5' => { description: 'Fith step of calculation', identifier: 'fith_step_of_calculation' }, '6' => { description: 'Sixth step of calculation', identifier: 'sixth_step_of_calculation' }, '7' => { description: 'Seventh step of calculation', identifier: 'seventh_step_of_calculation' }, '8' => { description: 'Eighth step of calculation', identifier: 'eighth_step_of_calculation' }, '9' => { description: 'Ninth step of calculation', identifier: 'ninth_step_of_calculation' } }, description: 'Calculation sequence code', required: false ) allowance_charge_information.add(:calculation_sequence_code, data) structure << allowance_charge_information #============================================================================== # Special Services identification #============================================================================== special_services_identification = Eancom::Edifact::Composite.new data = Eancom::Edifact::Data.new( type: String, length: 1..3, dictionary: { 'AJ' => { description: 'Adjustments', identifier: 'adjustments' }, 'DDA' => { description: 'Dealer discount/allowance (GS1 Temporary Code)', identifier: 'dealer_discount_allowance_gs1' }, 'DBD' => { description: 'Debtor bound (GS1 Temporary Code)', identifier: 'debtor_bound' }, 'CAC' => { description: 'Cash Discount', identifier: 'cash_discount' }, 'CAV' => { description: 'Battery collection and recycling', identifier: 'battery_collection_and_recycling' }, 'CAU' => { description: 'Sorting', identifier: 'sorting' }, 'CAW' => { description: 'Product Take Back Fee', identifier: 'product_take_back_fee' }, 'AEK' => { description: 'Cash on delivery service', identifier: 'cash_on_delivery_service' }, 'AAB' => { description: 'Returned goods charges', identifier: 'returned_goods_charges' }, 'ABA' => { description: 'Compulsory storage fee', identifier: 'compulsory_storage_fee' }, 'ABL' => { description: 'Packaging surcharge', identifier: 'packaging_surcharge' }, 'ABZ' => { description: 'Miscellaneous rebate or discount', identifier: 'miscellaneous_rebate_or_discount' }, 'ACZ' => { description: 'Damaged merchandise', identifier: 'damaged_merchandise' }, 'ADS' => { description: 'Full pallet ordering', identifier: 'full_pallet_ordering' }, 'ADT' => { description: 'Pick-up', identifier: 'pick_up' }, 'EAB' => { description: 'Early payment allowance', identifier: 'early_payment_allowance' }, 'RCH' => { description: 'Return handling (GS1 Temporary Code)', identifier: 'return_handling' }, 'TD' => { description: 'Trade discount', identifier: 'trade_discount' }, 'FC' => { description: 'Freight charge', identifier: 'freght_charge' }, 'FI' => { description: 'Finance charge', identifier: 'finance_charge' }, 'FR' => { description: 'Flat Rate (GS1 Temporary Code)', identifier: 'flat_rate' }, 'HD' => { description: 'Handling', identifier: 'handling' }, 'QD' => { description: 'Quantity discount', identifier: 'quantity_discount' }, 'X01' => { description: 'Allowance Global (GS1 Temporary Code)', identifier: 'allowance_global' }, 'X02' => { description: 'Charge Global (GS1 Temporary Code)', identifier: 'charge_global' }, 'X03' => { description: 'Consolidated (GS1 Temporary Code)', identifier: 'consolidated' }, 'X04' => { description: 'Lump sum (GS1 Temporary Code)', identifier: 'lump_sum' }, 'X05' => { description: 'Markup for small volume purchases', identifier: 'markup_for_small_volume_purchases' }, 'X30' => { description: 'Point of sales allowance (GS1 Temporary Code)', identifier: 'point_of_sales_allowance' }, 'X40' => { description: 'Allowance/charge regulated by law', identifier: 'allowance_charge_regulated_by_law' } }, description: 'Special service description_code', required: false ) special_services_identification.add(:special_service_description_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..17, description: 'Code list identification code', required: false ) special_services_identification.add(:code_list_identification_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: { '9' => { description: 'GS1', identifier: 'gs1' } }, description: 'Code list responsible agency code', required: false ) special_services_identification.add(:code_list_responsible_agency_code, data) data = Eancom::Edifact::Data.new( type: String, length: 0..3, dictionary: nil, description: 'Special service description', required: false ) special_services_identification.add(:special_service_description_1, data) special_services_identification.add(:special_service_description_2, data) structure << special_services_identification #============================================================================== Eancom.register_structure(tag: 'ALC', structure: structure)