Giter VIP home page Giter VIP logo

Comments (4)

kputnam avatar kputnam commented on July 26, 2024

Yep, this seems like a bug. Can you paste the code used to generate the segments up to this point? Does the stack trace blame the line that says buidler.MEA or a different line?

from stupidedi.

irobayna avatar irobayna commented on July 26, 2024

Hi Kyle,

Yes the stack trace blames the builder.MEA line

from stupidedi.

irobayna avatar irobayna commented on July 26, 2024
    config = Stupidedi::Config.contrib

    config.interchange.register("00200") do
      Stupidedi::Versions::Interchanges::TwoHundred::InterchangeDef
    end

    config.functional_group.register("002001") do
      Stupidedi::Versions::FunctionalGroups::TwoThousandOne::FunctionalGroupDef
    end

    config.transaction_set.register("002001", "SH", "856") do
      Stupidedi::Contrib::TwoThousandOne::TransactionSetDefs::SH856
    end

    strict = true
    builder = Stupidedi::Builder::BuilderDsl.build(config, strict)

builder.ISA("00", " " * 6,             # authorization information
          "00", " " * 6,             # authentication information
          "01", edi_asn_oem.sender_id, # submitter identification
          "01", edi_asn_oem.receiver_id,  # recipient identification
          Time.now.utc,         # date
          Time.now.utc,         # time
          "U",                  # repetition separator
          "00200",              # interchange version
          isa_control_number,          # control number
          "0",                  # acknowledgement request
          "P",                  # usage indicator
          ":")                  # component separator

        builder.GS "PS", edi_asn_oem.sender_id, edi_asn_oem.receiver_id, create_date, create_time, gs_group_control_number, "X", "002001"
        builder.ST "856", st_transaction_set_control_number
        builder.BSN "00", bol, create_date, create_time
        req_date = '140824'
        req_time = '0920'
        builder.DTM "011",req_date, req_time
        builder.HL "1", nil, "S"
          builder.MEA "PD", "G", weight_total, "LB", "0", "0"

from stupidedi.

kputnam avatar kputnam commented on July 26, 2024

Ah, the error happens because there are SyntaxNotes for elements 3, 5, 6, and 8; however the declaration of MEA only has six elements. You should review whatever documentation you can find -- either the syntax notes are incorrect or you are missing information about some of the elements in MEA.

The error message is pretty useless, and worse, the error handling code fails if you don't have pp already loaded, so I'm going to fix that in the next commit.

from stupidedi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.