Module: Stupidedi::TransactionSets::ThirtyTen::Implementations

Defined in:
lib/stupidedi/transaction_sets/003010/implementations.rb,
lib/stupidedi/transaction_sets/003010/implementations/PC860.rb,
lib/stupidedi/transaction_sets/003010/implementations/PO850.rb,
lib/stupidedi/transaction_sets/003010/implementations/PS830.rb,
lib/stupidedi/transaction_sets/003010/implementations/RA820.rb

Defined Under Namespace

Modules: ElementReqs, SegmentReqs

Constant Summary collapse

PC860 =
b.build("PC", "860", "Ship Notice/Manifest",
          d::TableDef.header("Heading",
            b::Segment(10, s:: ST, "Transaction Set Header", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Identifier Code", b::Values("850")),
b::Element(e::Required,    "Transaction Set Control Number")),
            b::Segment(20, s::BCH, "Beginning Segment for Purchase Order Change", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Purpose Code", b::Values("00","05","18")),
b::Element(e::Required,    "Purchase Order Type Code", b::Values("BE","BK","SP")),
b::Element(e::Required,    "Purchase Order Number"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::Situational, "Change Order Sequence Number"),
b::Element(e::Situational, "Purchase Order Date")),
            b::Segment(40, s::CUR, "Currency", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Entity Identifier Code", b::Values("BY")),
b::Element(e::Required,    "Currency Code", b::Values("USD")),
b::Element(e::Situational, "Exchange Rate")),
            b::Segment(80, s::FOB, "F.O.B. Related Instructions", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Shipment Method of Payment", b::Values("DE")),
b::Element(e::Situational, "Location Qualifier", b::Values("AC")),
b::Element(e::Situational, "Description"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::Situational, "Location Qualifier"),
b::Element(e::Situational, "Description - Postal Code")),
            b::Segment(130, s::ITD, "Terms of Sale/Deferred Terms of Sale", r::Situational, d::RepeatCount.bounded(5),
b::Element(e::Situational, "Terms Type Code", b::Values("09","10","30")),
b::Element(e::Situational, "Terms Basis Date Code", b::Values("AA","AB","AE","NS","OR","TB","TD","TP")),
b::Element(e::Situational, "Terms Discount Percent"),
b::Element(e::Situational, "Terms Discount Due Date"),
b::Element(e::Situational, "Terms Discount Days Due"),
b::Element(e::Situational, "Terms Net Due Date"),
b::Element(e::Situational, "Terms Net Days"),
b::Element(e::Situational, "Terms Discount Amount"),
b::Element(e::Situational, "Terms Deferred Due Date"),
b::Element(e::Situational, "Deferred Amount Due"),
b::Element(e::Situational, "Percent of Invoice Payable"),
b::Element(e::Situational, "Description - Freight FOB Terms"),
b::Element(e::Situational, "Day of Month")),
            b::Segment(150, s::DTM, "Date/Time/Period", r::Situational, d::RepeatCount.bounded(2),
b::Element(e::Required,    "Date/Time Qualifier", b::Values("007","036")),
b::Element(e::Required,    "Date")),
            b::Segment(240, s::TD5, "Carrier Details (Routing Sequence/Transit Time)", r::Situational, d::RepeatCount.bounded(2),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::Required,    "Transportation Method/Type Code", b::Values("A","AE","M","PG","R","RR","SE","SS")),
b::Element(e::Required,    "Routing - Carrier's Name")),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(280, s:: N9, "Reference Number - Design Note Number", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("C4")),
  b::Element(e::Situational, "Reference Number - Design Note Number"))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(281, s:: N9, "Reference Number - Supplier Code", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("VR")),
  b::Element(e::Situational, "Reference Number"))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(282, s:: N9, "Reference Number - Business Type", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("PG")),
  b::Element(e::Situational, "Reference Number - Business Type", b::Values("AC","AE","AS","BS","ER","ES","ET",
                             "GW","IS","MP","MT","ND","NS","NT","PR","RB","RC","RP","SD","SN","SP","ST","UK","VP")))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(283, s:: N9, "Reference Number", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("CU")),
  b::Element(e::Situational, "Reference Number")),

b::Segment(290, s::MSG, "Message Text", r::Situational, d::RepeatCount.bounded(1000),
  b::Element(e::Required,    "Free-Form Message Text"))),

            d::LoopDef.build("N1", d::RepeatCount.bounded(1),
b::Segment(300, s::N1, "Name", r::Situational, d::RepeatCount.bounded(2),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("BT","MP")),
  b::Element(e::Situational, "Name")),
b::Segment(310, s::N2, "Additional Name Information", r::Situational, d::RepeatCount.bounded(2),
  b::Element(e::Required,    "Name"),
  b::Element(e::Situational, "Name")),
b::Segment(320, s::N3, "Address Information", r::Situational, d::RepeatCount.bounded(2),
  b::Element(e::Required,    "Address Information"),
  b::Element(e::Situational, "Address Information")),
b::Segment(330, s::N4, "Geographic Location", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "City Name"),
  b::Element(e::Situational, "State or Province Code"),
  b::Element(e::Situational, "Postal Code"),
  b::Element(e::NotUsed,     "Unknown")))),

          d::TableDef.detail("Detail",
            d::LoopDef.build("POC", d::RepeatCount.bounded(100000),
b::Segment(10, s::POC, "Line Item Change", r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Situational, "Assigned Identification - Purchase Order Line Number"),
  b::Element(e::Required,    "Change or Response Type Code",b::Values("AI","CA","CB","CC","CD","NC","PC","QD","QI")),
  b::Element(e::Situational, "Quantity Ordered"),
  b::Element(e::Situational, "Quantity Left to Receive"),
  b::Element(e::Situational, "Unit or Basis for Measurement Code",b::Values("EA")),
  b::Element(e::Situational, "Unit Price"),
  b::Element(e::NotUsed,     "Unknown"),
  b::Element(e::Situational, "Product/Service ID Qualifier",b::Values("BP")),
  b::Element(e::Situational, "Product/Service ID - Nissan Part Number"),
  b::Element(e::Situational, "Product/Service ID Qualifier",b::Values("C4")),
  b::Element(e::Situational, "Product/Service ID - Design Note Number")),

d::LoopDef.build("PID", d::RepeatCount.bounded(1),
  b::Segment( 50, s::PID, "Product/Item Description", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Item Description Type", b::Values("F")),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::Situational, "Description"))),

d::LoopDef.build("N9", d::RepeatCount.bounded(1),
  b::Segment(320, s:: N9, "Reference Number - Clear Text Clause", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("CU")),
    b::Element(e::NotUsed,     "Unknown")),
  b::Segment(330, s::MSG, "Message Text", r::Situational, d::RepeatCount.bounded(1000),
    b::Element(e::Required,    "Free-Form Message Text"))))),

          d::TableDef.header("Summary",
            b::Segment(10, s::CTT, "Transaction Totals", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Number of Line Items")),
            b::Segment(30, s::SE, "Transaction Set Trailer", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Number of Included Segments"),
b::Element(e::Required,    "Transaction Set Control Number"))))
PO850 =
b.build("PO", "850", "Ship Notice/Manifest",
          d::TableDef.header("Heading",
            b::Segment(10, s:: ST, "Transaction Set Header", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Identifier Code", b::Values("850")),
b::Element(e::Required,    "Transaction Set Control Number")),
            b::Segment(20, s::BEG, "Beginning Segment for Purchase Order", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Purpose Code", b::Values("00","05","18")),
b::Element(e::Required,    "Purchase Order Type Code", b::Values("BE","BK","SP")),
b::Element(e::Required,    "Purchase Order Number"),
b::Element(e::Situational, "Release Number - Purchase Order Sequence Number"),
b::Element(e::Situational, "Purchase Order Date")),
            b::Segment(40, s::CUR, "Currency", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Entity Identifier Code", b::Values("BY")),
b::Element(e::Required,    "Currency Code", b::Values("USD")),
b::Element(e::Situational, "Exchange Rate")),
            b::Segment(80, s::FOB, "F.O.B. Related Instructions", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Shipment Method of Payment", b::Values("DE")),
b::Element(e::Situational, "Location Qualifier", b::Values("AC")),
b::Element(e::Situational, "Description"),
b::Element(e::Situational, "Location Qualifier"),
b::Element(e::Situational, "Description")),
            b::Segment(130, s::ITD, "Terms of Sale/Deferred Terms of Sale", r::Situational, d::RepeatCount.bounded(5),
b::Element(e::Situational, "Terms Type Code", b::Values("09","10","30")),
b::Element(e::Situational, "Terms Basis Date Code", b::Values("AA","AB","AE","NS","OR","TB","TD","TP")),
b::Element(e::Situational, "Terms Discount Percent"),
b::Element(e::Situational, "Terms Discount Due Date"),
b::Element(e::Situational, "Terms Discount Days Due"),
b::Element(e::Situational, "Terms Net Due Date"),
b::Element(e::Situational, "Terms Net Days"),
b::Element(e::Situational, "Terms Discount Amount"),
b::Element(e::Situational, "Terms Deferred Due Date"),
b::Element(e::Situational, "Deferred Amount Due"),
b::Element(e::Situational, "Percent of Invoice Payable"),
b::Element(e::Situational, "Description - Freight FOB Terms"),
b::Element(e::Situational, "Day of Month")),
            b::Segment(150, s::DTM, "Date/Time/Period", r::Situational, d::RepeatCount.bounded(2),
b::Element(e::Required,    "Date/Time Qualifier", b::Values("007","036")),
b::Element(e::Required,    "Date")),
            b::Segment(240, s::TD5, "Carrier Details (Routing Sequence/Transit Time)", r::Situational, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transportation Method/Type Code", b::Values("A","AE","M","PG","R","RR","SE","SS")),
b::Element(e::Required,    "Routing - Carrier's Name")),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(290, s:: N9, "Reference Number - Design Note Number", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("C4")),
  b::Element(e::Situational, "Reference Number - Design Note Number"))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(291, s:: N9, "Reference Number - Supplier Code", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("VR")),
  b::Element(e::Situational, "Reference Number"))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(292, s:: N9, "Reference Number - Business Type", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("PG")),
  b::Element(e::Situational, "Reference Number - Business Type", b::Values("AC","AE","AS","BS","ER","ES","ET",
      "GW","IS","MP","MT","ND","NS","NT","PR","RB","RC","RP","SD","SN","SP","ST","UK","VP")))),

            d::LoopDef.build("N9", d::RepeatCount.bounded(1),
b::Segment(330, s:: N9, "Reference Number", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Reference Number Qualifier", b::Values("CU")),
  b::Element(e::Situational, "Reference Number")),
b::Segment(340, s::MSG, "Message Text", r::Situational, d::RepeatCount.bounded(1000),
  b::Element(e::Required,    "Free-Form Message Text"))),

            d::LoopDef.build("N1", d::RepeatCount.bounded(200),
b::Segment(310, s::N1, "Reference Number", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("BT","MP")),
  b::Element(e::Situational, "Name")),
b::Segment(320, s::N2, "Additional Name Information", r::Situational, d::RepeatCount.bounded(2),
  b::Element(e::Required,    "Name"),
  b::Element(e::Situational, "Name")),
b::Segment(330, s::N3, "Address Information", r::Situational, d::RepeatCount.bounded(2),
  b::Element(e::Required,    "Address Information"),
  b::Element(e::Situational, "Address Information")),
b::Segment(340, s::N4, "Geographic Location", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "City Name"),
  b::Element(e::Situational, "State or Province Code"),
  b::Element(e::Situational, "Postal Code"),
  b::Element(e::Situational, "Country Code")))),


          d::TableDef.detail("Detail",
            d::LoopDef.build("PO1", d::RepeatCount.bounded(100000),
b::Segment(10, s::PO1, "Purchase Order Baseline Item Data", r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Situational, "Assigned Identification - Purchase Order Line Number"),
  b::Element(e::Required,    "Quantity Ordered"),
  b::Element(e::Required,    "Unit or Basis for Measurement Code",b::Values("EA")),
  b::Element(e::Situational, "Unit Price"),
  b::Element(e::NotUsed, "Unknown"),
  b::Element(e::Situational, "Product/Service ID Qualifier - Buyer's Part Number Qualifier",b::Values("BP")),
  b::Element(e::Situational, "Product/Service ID - Nissan Part Number"),
  b::Element(e::Situational, "Product/Service ID Qualifier",b::Values("C4")),
  b::Element(e::Situational, "Product/Service ID - Design Note Number")),

d::LoopDef.build("PID", d::RepeatCount.bounded(1),
  b::Segment( 50, s::PID, "Product/Item Description", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Item Description Type", b::Values("F")),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::Situational, "Description - Part Description"))),

d::LoopDef.build("N9", d::RepeatCount.bounded(1000),
  b::Segment(330, s:: N9, "Reference Number", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("CU")),
    b::Element(e::Situational, "Reference Number")),
  b::Segment(340, s::MSG, "Message Text", r::Situational, d::RepeatCount.bounded(1000),
    b::Element(e::Required,    "Free-Form Message Text"))))),

          d::TableDef.header("Summary",
            b::Segment(10, s::CTT, "Transaction Totals", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Number of Line Items")),
            b::Segment(30, s::SE, "Transaction Set Trailer", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Number of Included Segments"),
b::Element(e::Required,    "Transaction Set Control Number"))))
PS830 =
b.build("PS", "830", "Planning Schedule with Release Capability",
          d::TableDef.header("Header",
            b::Segment(10, s:: ST, "Transaction Set Header", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Identifier Code", b::Values("830")),
b::Element(e::Required,    "Transaction Set Control Number")),
            b::Segment(20, s::BFR, "Beginning Segment for Planning Schedule", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Purpose Code", b::Values("00")),
b::Element(e::Situational,  "Reference Number NNA Release Period"),
b::Element(e::Situational,  "Release Number"),
b::Element(e::Required,    "Schedule Type Qualifier", b::Values("SH")),
b::Element(e::Required,    "Schedule Quantity Qualifier", b::Values("A")),
b::Element(e::Required,    "Date - Forecast Start Date"),
b::Element(e::Required,    "Date - Horizon End Date"),
b::Element(e::Required,    "Date - Release Issue Date"),
b::Element(e::Required,    "Date"),
b::Element(e::Situational,  "Purchase Order Number")),

            # b::Segment(30, s::NTE, "Note/Special Instruction",
            #   r::Situational, d::RepeatCount.bounded(100),
            #   b::Element(e::Situational, "Note Reference Code", b::Values("GEN","LIN")),
            #   b::Element(e::Required,  "Free Form Message"),

            d::LoopDef.build("N1 - LOOP1", d::RepeatCount.bounded(200),
b::Segment(90, s:: N1, "Name", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("BT")),
  b::Element(e::Situational, "Name"),
  b::Element(e::Situational, "Identification Code Qualifier", b::Values("1")),
  b::Element(e::Situational,  "Identification Code")))),

          d::TableDef.header("Detail",
            d::LoopDef.build("LIN", d::RepeatCount.bounded(10000),
b::Segment( 10, s::LIN, "Item Identification", r::Required, d::RepeatCount.bounded(1),
  b::Element(e::NotUsed,     "LIN01"),
  b::Element(e::Required,    "Product/Service ID Qualifier - LIN02", b::Values("BP")),
  b::Element(e::Required,    "Product/Service ID"),
  b::Element(e::Situational, "Product/Service ID"),
  b::Element(e::Situational, "Product/Service ID"),
  b::Element(e::NotUsed,     "LIN06"),
  b::Element(e::NotUsed,     "LIN07"),
  b::Element(e::NotUsed,     "LIN08"),
  b::Element(e::NotUsed,     "LIN09"),
  b::Element(e::NotUsed,     "LIN10"),
  b::Element(e::NotUsed,     "LIN11"),
  b::Element(e::NotUsed,     "LIN12"),
  b::Element(e::NotUsed,     "LIN13"),
  b::Element(e::NotUsed,     "LIN14"),
  b::Element(e::NotUsed,     "LIN15"),
  b::Element(e::NotUsed,     "LIN16"),
  b::Element(e::NotUsed,     "LIN17"),
  b::Element(e::NotUsed,     "LIN18"),
  b::Element(e::NotUsed,     "LIN19"),
  b::Element(e::NotUsed,     "LIN20"),
  b::Element(e::NotUsed,     "LIN21"),
  b::Element(e::NotUsed,     "LIN22"),
  b::Element(e::NotUsed,     "LIN23"),
  b::Element(e::NotUsed,     "LIN24"),
  b::Element(e::NotUsed,     "LIN25"),
  b::Element(e::NotUsed,     "LIN26"),
  b::Element(e::NotUsed,     "LIN27"),
  b::Element(e::NotUsed,     "LIN28"),
  b::Element(e::NotUsed,     "LIN29"),
  b::Element(e::NotUsed,     "LIN30"),
  b::Element(e::NotUsed,     "LIN31")),

b::Segment( 20, s::UIT, "Unit Detail", r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Unit or Basis for Measurement Code", b::Values("PC")),
  b::Element(e::Situational, "Unit Price")),

b::Segment( 80, s::PID, "Product/Item Description", r::Situational, d::RepeatCount.bounded(1000),
  b::Element(e::Required,     "Item Description Type",  b::Values("F")),
  b::Element(e::Situational, "Product/Process Characteristic Code", b::Values("9B")),
  b::Element(e::NotUsed,     "PID03"),
  b::Element(e::NotUsed,     "PID04"),
  b::Element(e::Situational, "Description")),

d::LoopDef.build("N1", d::RepeatCount.bounded(200),
  b::Segment(210, s:: N1, "Name", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("SF","ST")),
    b::Element(e::Situational, "Name"),
    b::Element(e::Situational, "Identification Code Qualifier", b::Values("92")),
    b::Element(e::Situational,  "Identification Code"))),

d::LoopDef.build("SDP", d::RepeatCount.bounded(100),
  b::Segment( 290, s::SDP, "Ship/Delivery Pattern", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Ship/Delivery or Calendar Pattern Code", b::Values("Y")),
    b::Element(e::Required,    "Ship/Delivery Pattern Time Code", b::Values("Y"))),

  b::Segment( 301, s::FST, "Forecast Schedule", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Quantity"),
    b::Element(e::Required,    "Forecast Qualifier", b::Values("C","D")),
    b::Element(e::Required,    "Forecast Timing Qualifier", b::Values("F")),
    b::Element(e::Required,    "Date - Forecast Begin Date"),
    b::Element(e::Situational, "Date - Forecast End Date"),
    b::Element(e::NotUsed,     "FST06"),
    b::Element(e::NotUsed,     "FST07"),
    b::Element(e::Situational, "Reference Number Qualifier", b::Values("RE")),
    b::Element(e::Situational, "Reference Number"))),

  d::LoopDef.build("NTE", d::RepeatCount.bounded(100),
    b::Segment(30, s::NTE, "Note/Special Instruction", r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Situational, "Note Reference Code", b::Values("GEN","LIN")),
      b::Element(e::Required,  "Free Form Message")),

    b::Segment( 300, s::FST, "Forecast Schedule", r::Situational, d::RepeatCount.bounded(260),
      b::Element(e::Required,    "Quantity"),
      b::Element(e::Required,    "Forecast Qualifier", b::Values("C","D")),
      b::Element(e::Required,    "Forecast Timing Qualifier", b::Values("F")),
      b::Element(e::Required,    "Date - Forecast Begin Date"),
      b::Element(e::Situational, "Date - Forecast End Date"),
      b::Element(e::NotUsed,     "FST06"),
      b::Element(e::NotUsed,     "FST07"),
      b::Element(e::Situational, "Reference Number Qualifier", b::Values("RE")),
      b::Element(e::Situational, "Reference Number"))),

d::LoopDef.build("SHP", d::RepeatCount.bounded(25),
  b::Segment(330, s::SHP, "Shipped/Received Information", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Situational, "Quantity Qualifier", b::Values("02")),
    b::Element(e::Situational, "Quantity"),
    b::Element(e::Situational, "Date/Time Qualifier", b::Values("003")),
    b::Element(e::Situational, "Date -  Forecast Start Date"),
    b::Element(e::Situational, "Date - Estimated Delivery/Horizon End Date"))))),

          d::TableDef.header("Summary",
            b::Segment(10, s::CTT, "Transaction Totals", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required, "Number of Line Items"),
b::Element(e::Situational,  "Hash Total"),
b::Element(e::NotUsed,  "CTT03"),
b::Element(e::NotUsed,  "CTT04"),
b::Element(e::NotUsed,  "CTT05"),
b::Element(e::NotUsed,  "CTT06"),
b::Element(e::NotUsed,  "CTT07")),
            b::Segment(20, s:: SE, "Transaction Set Trailer", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required, "Number of Included Segments"),
b::Element(e::Required, "Transaction Set Control Number"))))
RA820 =
b.build("RA", "820", "Ship Notice/Manifest",
          d::TableDef.header("Heading",
            b::Segment(10, s:: ST, "Transaction Set Header", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Transaction Set Identifier Code", b::Values("820")),
b::Element(e::Required,    "Transaction Set Control Number")),
            b::Segment(20, s::BPS, "Beginning Segment for Payment Order/Remittance Advice", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Payment Method Code", b::Values("PBC")),
b::Element(e::Required,    "Monetary Amount"),
b::Element(e::Required,    "Transaction Handling Code", b::Values("I")),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::NotUsed,     "Unknown"),
b::Element(e::Situational, "Account Number - Supplier Number"),
b::Element(e::Situational, "Effective Entry Date - Issue Date")),
            b::Segment(50, s::REF, "Reference Numbers", r::Required, d::RepeatCount.bounded(5),
b::Element(e::Required,    "Reference Number Qualifier", b::Values("R2")),
b::Element(e::Situational, "Reference Number", b::Values("CPICS","ERS","NLC")),
b::Element(e::NotUsed,     "Unknown")),
            b::Segment(60, s::DTM, "Date/Time/Period", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Date/Time Qualifier", b::Values("195")),
b::Element(e::Required,    "Date")),
            d::LoopDef.build("N1", d::RepeatCount.bounded(1),
b::Segment(70, s:: N1, "Name", r::Situational, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("SU")),
  b::Element(e::Situational, "Name - Supplier Contact"),
  b::Element(e::NotUsed,     "Unknown"),
  b::Element(e::NotUsed,     "Unknown")))),


          d::TableDef.detail("Detail",
            b::Segment(10, s:: LS, "Loop Header", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Loop Identifier Code", b::Values("A"))),

            d::LoopDef.build("N1", d::RepeatCount.bounded(10000),
b::Segment( 20, s:: N1, "Name - Invoice Number/Check Number/Bill of Lading Number - Header", r::Required, d::RepeatCount.bounded(1),
  b::Element(e::Required,    "Entity Identifier Code", b::Values("HH")),
  b::Element(e::Situational, "Name - Header Reference Number"),
  b::Element(e::NotUsed,     "Unknown"),
  b::Element(e::NotUsed,     "Unknown")),

d::LoopDef.build("RMT", d::RepeatCount.unbounded,
  b::Segment( 30, s::RMT, "Remittance Advice", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("IV")),
    b::Element(e::Required,    "Reference Number"),
    b::Element(e::Situational, "Monetary Amount - Total Gross Amount"),
    b::Element(e::Situational, "Total Invoice Amount - Total Net Amount"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::Situational, "Amount of Discount Taken - Discount Amount Due"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown")),

  b::Segment( 50, s::REF, "Reference Numbers - AETC Number", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("AE")),
    b::Element(e::Situational, "Reference Number - AETC Number"),
    b::Element(e::NotUsed,     "Unknown")),

  b::Segment( 51, s::REF, "Reference Numbers - Purchase Order Number", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("PO")),
    b::Element(e::Situational, "Reference Number - Purchase Order Number"),
    b::Element(e::NotUsed,     "Unknown")),

  b::Segment( 52, s::REF, "Reference Numbers - Shipper Number", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("SI")),
    b::Element(e::Situational, "Reference Number - Shipper Number"),
    b::Element(e::NotUsed,     "Unknown")),

  b::Segment( 53, s::REF, "Reference Numbers - Debit/Credit Memo Description", r::Situational, d::RepeatCount.bounded(12),
    b::Element(e::Required,    "Reference Number Qualifier", b::Values("CU")),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::Situational, "Description - Debit/Credit Memo Description")),

  b::Segment( 60, s::DTM, "Date/Time/Period", r::Situational, d::RepeatCount.bounded(10),
    b::Element(e::Required,    "Date/Time Qualifier", b::Values("011","193")),
    b::Element(e::Situational, "Date - Invoice Date"))),

d::LoopDef.build("N1 - 2", d::RepeatCount.bounded(10000),
  b::Segment( 21, s:: N1, "Name - DM/CM Supplier Authorizer", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("AA")),
    b::Element(e::Situational, "Name - Supplier Authorizer"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"))),

d::LoopDef.build("N1 - 3", d::RepeatCount.bounded(10000),
  b::Segment( 22, s:: N1, "Name - DM/CM Nissan Contact", r::Situational, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("PJ")),
    b::Element(e::Situational, "Name - Nissan Contact"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown"))),

d::LoopDef.build("N1 - 4", d::RepeatCount.bounded(10000),
  b::Segment( 22, s:: N1, "Name - Invoice Number/Check Number/Bill of Lading Number - Line Item", r::Required, d::RepeatCount.bounded(1),
    b::Element(e::Required,    "Entity Identifier Code", b::Values("LI")),
    b::Element(e::Situational, "Name - Invoice Number/Check Number/Bill of Lading"),
    b::Element(e::NotUsed,     "Unknown"),
    b::Element(e::NotUsed,     "Unknown")),

  d::LoopDef.build("RMT - 2", d::RepeatCount.unbounded,
    b::Segment( 30, s::RMT, "Remittance Advice", r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("IX")),
      b::Element(e::Required,    "Reference Number - Item/Part Number"),
      b::Element(e::Situational, "Monetary Amount - Unit Price"),
      b::Element(e::Situational, "Total Invoice Amount - Extended Price"),
      b::Element(e::NotUsed,     "Unknown"),
      b::Element(e::NotUsed,     "Unknown"),
      b::Element(e::NotUsed,     "Unknown"),
      b::Element(e::NotUsed,     "Unknown"),
      b::Element(e::Situational, "Adjustment Reason Code - Reprice Indicator", b::Values("NO","YS")),
      b::Element(e::Situational, "Description - Original Invoice Number")),
    b::Segment( 50, s::REF, "Reference Numbers - Quantity of Item", r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("QI")),
      b::Element(e::Situational, "Reference Number - Quantity of Item"),
      b::Element(e::NotUsed,     "Unknown")),
    b::Segment( 50, s::REF, "Reference Numbers - Purchase Order Number", r::Situational, d::RepeatCount.bounded(1),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("PO")),
      b::Element(e::Situational, "Reference Number - Purchase Order Number"),
      b::Element(e::NotUsed,     "Unknown")),
    b::Segment( 50, s::REF, "Reference Numbers - Release Number (RAN)", r::Situational, d::RepeatCount.bounded(15),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("RE")),
      b::Element(e::Situational, "Reference Number - Release Number (RAN)"),
      b::Element(e::NotUsed,     "Unknown")),
    b::Segment( 50, s::REF, "Reference Numbers - Coil ID/PDSN", r::Situational, d::RepeatCount.bounded(15),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("PM")),
      b::Element(e::Situational, "Reference Number - Coil ID/PDSN"),
      b::Element(e::NotUsed,     "Unknown")),
    b::Segment( 50, s::REF, "Reference Numbers - Supplier Unit of Measurement", r::Situational, d::RepeatCount.bounded(15),
      b::Element(e::Required,    "Reference Number Qualifier", b::Values("UM")),
      b::Element(e::Situational, "Reference Number - Supplier Unit of Measurement"),
      b::Element(e::NotUsed,     "Unknown"))))),

            b::Segment( 70, s:: LE, "Loop Trailer", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Loop Identifier Code", b::Values("A")))),

          d::TableDef.header("Summary",
            b::Segment( 10, s:: SE, "Transaction Set Trailer", r::Required, d::RepeatCount.bounded(1),
b::Element(e::Required,    "Number of Included Segments"),
b::Element(e::Required,    "Transaction Set Control Number"))))