• Type: Improvement
    • Resolution: No Action
    • Priority: Major
    • Component/s: None

      In EN16931, external document references from an invoice line can be to a certain document or document line; for example, for a Purchase Order, there will be:
       

      1. BT-188 - A reference to Purchase Order Document
      2. BT-132 - A reference to Purchase Order Line 

      Both document and line reference are optional in the semantic model, in relation to their Business Group (BG) being the Invoice Line:
      /Invoice(1..1)/cac:InvoiceLine(1..n)

      In UBL, both are optional relative to the invoice line as well, as the document reference is optional:

      BT-188  : 
      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:OrderLineReference(0..n)/cac:OrderReference(0..1)/cbc:ID(1..1)

      Same for its sibling, a LineID
      (mandatory as an element, but optional regarding the InvoiceLine)
      BT-132  : /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:OrderLineReference(0..n)/cbc:LineID(1..1)

      The problem is now if BT-188 is being created 
      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:OrderLineReference(0..n)/cac:OrderReference(0..1)/cbc:ID(1..1)

      There also has to be an ID for the LineID BT-132:
      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:OrderLineReference(0..n)/cbc:LineID(1..1)

      In EN16931 Core Semantic, CII XML, and other formats, line IDs are not mandatory.
      It might be discussable if the LineID becomes optional. Personally, I find it logical that there is be document ID before there is a (relative) line ID in that document.

      We might only restrict it to mandatory in "strict profiles", but not in general, to allow better interoperability.

      I discussed this on Monday with Kees, and he suggested an alternative serialisation of BT-188 in case of no LineID, instead of 

      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:OrderLineReference(0..n)/cac:OrderReference(0..1)/cbc:ID(1..1)

      to use

      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:DocumentReference(0..n)/cbc:ID(1..1)

      with the addition of the appropriate DocumentTypeCode (i.e. 220 from code list 1001)

      /Invoice(1..1)/cac:InvoiceLine(1..n)/cac:DocumentReference(0..n)/cbc:DocumentTypeCode(0..1)

      We have in EN16931-3-2  now a workaround provided by Kees, but making LineID optional might ease the complexity of the current solution.

      PS: I am sorry for the late notice. The bug in the script revealing such problems was found & fixed only after the last EN16931-1 meeting.

            Assignee:
            Kenneth Bengtsson
            Reporter:
            Svante Schubert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: