phax / ph-ubl

Java library for reading and writing UBL 2.0, 2.1, 2.2, 2.3 and 2.4 (CS01) documents

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LocationType

pdeleg opened this issue · comments

Hi Philip,
I have a problem for generate correctly the Delivery / DeliveryLocation (which is a LocationType).
Indeed, the LocationType class contains only a Language notion, and not an adress, id, description...
I work with frencyh financial administration and i have to generate this sequence :

<cac:Delivery>
  <cac:DeliveryLocation>
    <cbc:ID>Z3242</cbc:ID>
    <cbc:Description>Site numéro 1</cbc:Description>
    <cac:Address>
      <cbc:StreetName>2 avenue Charles de Gaulle</cbc:StreetName>
      <cbc:CityName>Paris</cbc:CityName>
      <cbc:PostalZone>75008</cbc:PostalZone>
      <cac:Country>
        <cbc:IdentificationCode>FR</cbc:IdentificationCode>
      </cac:Country>
  </cac:Address>
  </cac:DeliveryLocation>
</cac:Delivery>

I use the ph-ubl21 / 5.1.0.

Thanks for your attention,

Pierre

Hi Pierre,
what you basically need to do is the following:

AddressType address = new AddressType ();
address.set...();

LocationType location = new LocationType ();
location.set... ();
location.setAddress (address);

DeliveryTye delivery = new DeliveryType ();
delivery.setDeliveryLocation (location);
delivery.set... ();

hth, Philip

Hi philip,
Thanks for your quick response.
Excuse me my poor english, but it seems you dont't understand my problem :

In fact, I can't do that :

location.set... (); location.setAddress (address);

The LocationType extends TextType without any overrides.

Pierre

There is one LocationType in the commonbasiccomponents_21 and one in the commonaggregatecomponents_21.
Use the one from package commonbasiccomponents_21 to solve the issue :)

Hoo good,
I didn't make care when editor purposed me to import the class.
Thank you.