OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [ubl-dev] UBL DespatchAdvice - Delivered Quantity - Who to represent in another quantity/Unit of Measure


At 2013-07-10 10:43 -0300, Carlos Martin wrote:
Could be the DespatchLine\cbc:DeliveredQuantity\cbc:PackQuantity element to represent 3 coils and the DespatchLine\cbc:DeliveredQuantity\cbc:PackSizeNumeric to represent that a coil has 300 meters?

"Basic" elements are atomic values and do not have children, so looking at the XPath addresses (with backwards slashes ... they should be "/" instead), I can tell those are inappropriate. Anything with cbc: cannot have children. Children are always under either cac: or the document element (which XML defines as the top-most element in the document tree).

I've never tried to use DespatchAdvice before, but I'm looking at its constituent members here and I can see some ideas to experiment with:

http://docs.oasis-open.org/ubl/prd4-UBL-2.1/mod/summary/reports/UBL-DespatchAdvice-2.1.html#Table_DespatchAdvice.Details

I hope that others will critique my analysis below and suggest improvements. I'm offering this as an exercise in exploring the UBL document model and hope that community members benefit from the excursion. Please tell me where I have gone wrong in my analysis.

da:DespatchAdvice/cac:DespatchLine takes us to the line, where I see that cac:Item is mandatory. By its having children, the despatch line has an associated cbc:DeliveredQuantity and cac:OrderLineReference. I would assume that you would want the delivered quantity to reflect the total quantity for the despatch line, so cbc:DeliveredQuantity might be where you would indicate 1200m as the total.

We need somewhere to say that "3" pieces were despatched at "400m" each piece.

So I looked in cac:Item:

http://docs.oasis-open.org/ubl/prd4-UBL-2.1/mod/summary/reports/UBL-DespatchAdvice-2.1.html#Table_Item.Details

... and I see information available with respect to package quantity and number of items, but then I discounted using these because the definitions are the inverse of what is needed. The definitions indicate that a unit of measure is used for the total quantity found in a pack and the pack size is how many items are found in the pack. So that doesn't help us. The cac:Item is still mandatory, so that is where the item itself is being described, that being cable.

What is left in cac:DespatchLine?  Let's look at cac:Shipment:

http://docs.oasis-open.org/ubl/prd4-UBL-2.1/mod/summary/reports/UBL-DespatchAdvice-2.1.html#Table_Shipment.Details

I see that cac:GoodsItem describes items included in the shipment, and it is repeatable, so we could describe multiple pieces included in the shipment for the despatch line. I think this is important, because in your example there is a single breakdown of 3 coils of 400m each coil, but what if there were 2 coils of 500m and 1 coil of 200m?

So, looking at cac:GoodsItem:

http://docs.oasis-open.org/ubl/prd4-UBL-2.1/mod/summary/reports/UBL-DespatchAdvice-2.1.html#Table_GoodsItem.Details

... the description can be "coil". cac:GoodsItem/cbc:Quantity would be 3 and cac:GoodsItem/cac:MeasurementDimension/cbc:Measure could be 400m with cbc:AttributeID being "length". Since the measurement dimension is repeatable, one could add another for "diameter" or other measurable properties.

Regarding the unit of measure, I can find "MTR" for "metre" in the units of measure code list:

http://docs.oasis-open.org/ubl/prd4-UBL-2.1/cva/UBL-DefaultDTQ-2.1.html#d30e1

So that would produce something along the lines of the following for three coils of 400m each:

  <cac:DespatchLine>
    <cbc:ID>...</>
    <cbc:DeliveredQuantity unitCode="MTR">1200</>
    <cac:OrderLineReference>
      ...
    </>
    <cac:Item>
      <cbc:Description>Cable</>
    </>
    <cac:Shipment>
      <cbc:ID>...</>
      <cac:GoodsItem>
        <cbc:Description>Coil</>
        <cbc:Quantity>3</>
        <cac:MeasurementDimension>
          <cbc:AttributeID>Length</>
          <cbc:Measure unitCode="MTR">400</>
        </>
      </>
    </>
  </>

And for my alternate shipping scenario of three coils with different lengths:

  <cac:DespatchLine>
    <cbc:ID>...</>
    <cbc:DeliveredQuantity unitCode="MTR">1200</>
    <cac:OrderLineReference>
      ...
    </>
    <cac:Item>
      <cbc:Description>Cable</>
    </>
    <cac:Shipment>
      <cbc:ID>...</>
      <cac:GoodsItem>
        <cbc:Description>Coil</>
        <cbc:Quantity>2</>
        <cac:MeasurementDimension>
          <cbc:AttributeID>Length</>
          <cbc:Measure unitCode="MTR">500</>
        </>
      </>
      <cac:GoodsItem>
        <cbc:Description>Coil</>
        <cbc:Quantity>1</>
        <cac:MeasurementDimension>
          <cbc:AttributeID>Length</>
          <cbc:Measure unitCode="MTR">200</>
        </>
      </>
    </>
  </>

Would others (particularly members of the UBL PSC) agree with the above analysis and proposed resulting markup?

If other members of the UBL Dev community would propose scenarios for analysis, then collectively we can propose different approaches to markup the required information.

Note my use of the HTML tables that expose the document model spreadsheets with numerous hyperlinks:

  http://docs.oasis-open.org/ubl/prd4-UBL-2.1/mod/summary/readme-Reports.html

I hope this is considered helpful, even if I'm wrong above and someone corrects me! I know the exercise helps me ... I've never looked at DespatchAdvice before.

. . . . . . . . . . Ken

--
Contact us for world-wide XML consulting and instructor-led training |
Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/u/ |
G. Ken Holman                   mailto:gkholman@CraneSoftwrights.com |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]