Skocz do zawartości

Eksport do EN (BETA)

Polecane posty

  • 3 tygodnie później...
  • 4 miesiące temu...

Witam, podczas próby eksportowania pliku do EN dla Pocztexu otrzymuję komunikat:

 

Błąd: Przesyłka kurierska This name may not begin with the '2' character:  -->2<--35656 Przesyłka kurierska This name may not begin with the '2' character:  -->2<--35656

 

Dla przesyłek biznesowych jest ok. Transformata wygląda tak:

 

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:s="http://www.sello.pl/export">

  <!--POCZTEX-->

  <!--Oznaczenie umowy na podstawie, której nadawane są przesyłki pocztowe (idUmowyMRUMC).-->

  <xsl:variable name="mój numer umowy - który usunąłem"></xsl:variable>

  <!--Oznaczenie Karty na podstawie, której nadawane są przesyłki pocztowe (idKartyMRUMR).-->

  <xsl:variable name="KartaUmowy"></xsl:variable>

  <!--Rodzaj serwisu przesyłki Pocztex-N:

  E – Ekspres

  K – Kurier-->

  <xsl:variable name="RodzajPrzesylki">E</xsl:variable>

  <!--Termin-serwis dla przesyłki:

  A – Miejski do 3h - do 5 km

  B – Miejski do 3h - do 10 km

  C – Miejski do 3h - do 15 km

  D – Miejski do 3h - powyżej 15 km

  E – Miejski do 4h - do 10 km

  F – Miejski do 4h - do 15 km

  G – Miejski do 4h - do 20 km

  H – Miejski do 4h - do 30 km

  J – Miejski do 4h - do 40 km

  M – Krajowy

  R – Bezpośredni do 30 kg

  S – Bezpośredni powyżej 30 do 100 kg

  X – Ekspres 24-->

  <xsl:variable name="Termin">X</xsl:variable>

  <!--Forma przekazania kwoty pobrania:

  P – Na wskazany adres

  S – Na rachunek bankowy-->

  <xsl:variable name="SposobPobrania">S</xsl:variable>

  <!--Sposób powiadomienia adresata przesyłki. Jeśli pole jest puste, to powiadomienie nie jest wysyłane.

  M – SMS

  E – E-mail-->

  <xsl:variable name="FormaPowiadomieniaAdresata">M</xsl:variable>

  <!--Opis dla danej paczki. Pole z dowolną zawartością nie przekraczającą długości 40 znaków-->

  <xsl:template name="Opis">

<xsl:value-of select="substring(s:Customer/s:Nick,0,15)"/>

</xsl:template>

 

  <xsl:param name="Year"/>

  <xsl:param name="Month"/>

  <xsl:param name="Day"/>

  <xsl:param name="Hour"/>

  <xsl:param name="Minute"/>

  <xsl:param name="Second"/>

  <xsl:template match="s:ExportData">

    <xsl:element name="Nadawca">

      <xsl:attribute name="Struktura">1.6</xsl:attribute>

      <xsl:attribute name="Nazwa">

        <xsl:value-of select="s:Company/s:Address/s:Company"/>

      </xsl:attribute>

      <xsl:attribute name="NazwaSkrocona">

        <xsl:variable name="companyName" select="s:Company/s:Address/s:Company"/>

        <xsl:value-of select="substring($companyName,0,10)"/>

      </xsl:attribute>

      <xsl:attribute name="Ulica">

        <xsl:value-of select="s:Company/s:Address/s:Street"/>

      </xsl:attribute>

      <xsl:attribute name="Dom">

        <xsl:value-of select="s:Company/s:Address/s:HouseNumber"/>

      </xsl:attribute>

      <xsl:attribute name="Lokal">

        <xsl:value-of select="s:Company/s:Address/s:FlatNumber"/>

      </xsl:attribute>

      <xsl:attribute name="Miejscowosc">

        <xsl:value-of select="s:Company/s:Address/s:City"/>

      </xsl:attribute>

      <xsl:attribute name="Kod">

        <xsl:value-of select="translate(s:Company/s:Address/s:ZipCode,'- ','')"/>

      </xsl:attribute>

      <xsl:attribute name="NIP">

        <xsl:value-of select="translate(s:Company/s:Address/s:NIP,'- ','')"/>

      </xsl:attribute>

      <xsl:attribute name="Zrodlo">NADAWCA</xsl:attribute>

      <xsl:attribute name="Guid">

        <xsl:value-of select="s:Company/s:GUID"/>

      </xsl:attribute>

      <xsl:element name="Zbior">

        <xsl:attribute name="Nazwa">

          <xsl:value-of select="concat(format-number($Day,'00'),'-',format-number($Month,'00'),'-',$Year,'\1')"/>

        </xsl:attribute>

        <xsl:attribute name="DataUtworzenia">

          <xsl:value-of select="concat($Year,'-',format-number($Month,'00'),'-',format-number($Day,'00'),'T',format-number($Hour,'00'),':',format-number($Minute,'00'),':',format-number($Second,'00'))"/>

        </xsl:attribute>

        <xsl:attribute name="Opis">Jakis dowolny opis</xsl:attribute>

        <xsl:attribute name="IloscPrzesylek">

          <xsl:value-of select="count(s:Package)"/>

        </xsl:attribute>

        <xsl:attribute name="Guid">

          <xsl:value-of select="s:GUID"/>

        </xsl:attribute>

        <xsl:apply-templates select="s:Package"/>

      </xsl:element>

    </xsl:element>

  </xsl:template>

  <xsl:template match="s:Package">

    <xsl:element name="Przesylka">

      <xsl:attribute name="Guid">

        <xsl:value-of select="s:GUID"/>

      </xsl:attribute>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Nazwa</xsl:attribute>

        <xsl:choose>

          <xsl:when test="s:DeliveryAddress/s:Company!=''">

            <xsl:value-of select="s:DeliveryAddress/s:Company"/>

          </xsl:when>

          <xsl:otherwise>

            <xsl:value-of select="s:DeliveryAddress/s:Name"/>

          </xsl:otherwise>

        </xsl:choose>

      </xsl:element>

      <xsl:if test="s:DeliveryAddress/s:Company!='' and s:DeliveryAddress/s:Name!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ">Adresat</xsl:attribute>

          <xsl:attribute name="Nazwa">NazwaII</xsl:attribute>

          <xsl:value-of select="s:DeliveryAddress/s:Name"/>

        </xsl:element>

      </xsl:if>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Ulica</xsl:attribute>

        <xsl:value-of select="s:DeliveryAddress/s:Street"/>

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Dom</xsl:attribute>

        <xsl:value-of select="s:DeliveryAddress/s:HouseNumber"/>

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Lokal</xsl:attribute>

        <xsl:value-of select="s:DeliveryAddress/s:FlatNumber"/>

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Miejscowosc</xsl:attribute>

        <xsl:value-of select="s:DeliveryAddress/s:City"/>

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Kod</xsl:attribute>

        <xsl:value-of select="translate(s:DeliveryAddress/s:ZipCode,'- ','')"/>

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ">Adresat</xsl:attribute>

        <xsl:attribute name="Nazwa">Kraj</xsl:attribute>

        <xsl:choose>

          <xsl:when test="s:DeliveryAddress/s:Country=''">Polska</xsl:when>

          <xsl:otherwise>

            <xsl:value-of select="s:DeliveryAddress/s:Country"/>

          </xsl:otherwise>

        </xsl:choose>

      </xsl:element>

      <xsl:if test="$FormaPowiadomieniaAdresata!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">FormaPowiadomieniaAdresata</xsl:attribute>

          <xsl:value-of select="$FormaPowiadomieniaAdresata"/>

        </xsl:element>

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">KontaktPowiadomieniaAdresata</xsl:attribute>

          <xsl:choose>

            <xsl:when test="$FormaPowiadomieniaAdresata='M'">

              <xsl:variable name="phone" select="translate(s:DeliveryAddress/s:PhoneNumber,'- ()/','')"/>

              <xsl:variable name="phone2" select="format-number(substring($phone,string-length($phone)-8,9),'000000000')"/>

              <xsl:value-of select="$phone2"/>

            </xsl:when>

            <xsl:when test="$FormaPowiadomieniaAdresata='E'">

              <xsl:value-of select="s:DeliveryAddress/s:Email"/>

            </xsl:when>

          </xsl:choose>

        </xsl:element>

      </xsl:if>

      <!--Atrybuty specyficzne dla przesyłki 834-->

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

        <xsl:attribute name="Nazwa">Symbol</xsl:attribute>834</xsl:element>

      <xsl:if test="$NrUmowy!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Umowa</xsl:attribute>

          <xsl:value-of select="$NrUmowy"/>

        </xsl:element>

      </xsl:if>

      <xsl:if test="$KartaUmowy!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">KartaUmowy</xsl:attribute>

          <xsl:value-of select="$KartaUmowy"/>

        </xsl:element>

      </xsl:if>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

        <xsl:attribute name="Nazwa">Ilosc</xsl:attribute>1</xsl:element>

      <xsl:if test="s:Weight">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Masa</xsl:attribute>

          <xsl:value-of select="round(number(s:Weight)*1000)"/>

        </xsl:element>

      </xsl:if>

      <xsl:if test="s:SendingNumber!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">NrNadania</xsl:attribute>

          <xsl:value-of select="translate(s:SendingNumber,'- ','')"/>

        </xsl:element>

      </xsl:if>

      <xsl:if test="$RodzajPrzesylki!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Serwis</xsl:attribute>

          <xsl:value-of select="$RodzajPrzesylki"/>

        </xsl:element>

      </xsl:if>

      <xsl:if test="$Termin!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Termin</xsl:attribute>

          <xsl:value-of select="$Termin"/>

        </xsl:element>

      </xsl:if>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

        <xsl:attribute name="Nazwa">CzyOplacaOdbiorca</xsl:attribute>N</xsl:element>

      <xsl:if test="s:DeliveryMethod/s:IsPayOnDelivery=1">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Uslugi</xsl:attribute>P</xsl:element>

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">SposobPobrania</xsl:attribute>

          <xsl:value-of select="$SposobPobrania"/>

        </xsl:element>

        <xsl:if test="s:Charge">

          <xsl:element name="Atrybut">

            <xsl:attribute name="Typ"/>

            <xsl:attribute name="Nazwa">KwotaPobrania</xsl:attribute>

            <xsl:value-of select="round(number(s:Charge)*100)"/>

          </xsl:element>

        </xsl:if>

      </xsl:if>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

        <xsl:attribute name="Nazwa">Wersja</xsl:attribute>1</xsl:element>

      <xsl:variable name="description">

        <xsl:call-template name="Opis"/>

      </xsl:variable>

      <xsl:if test="$description!=''">

        <xsl:element name="Atrybut">

          <xsl:attribute name="Typ"/>

          <xsl:attribute name="Nazwa">Uwagi</xsl:attribute>

          <xsl:value-of select="$description"/>

        </xsl:element>

      </xsl:if>

    </xsl:element>

  </xsl:template>

</xsl:stylesheet>

Link to postu
  • 3 miesiące temu...
  • 9 miesięcy temu...

Odkopuję wątek, czy ktoś się orientuje czy coś się zmieniło w eksporcie do EN Przesyłki biznesowej (Pocztex 48) - po zaimportowaniu jej w EN wskakuje jako przesyłka polecona ekonomiczna. WTF ?

 

WTF ;) Sam sobie odpowiadam, zapomniałem, że grzebiąc ostatnio w transformacie robiłem to również no kopii i tam popełniłem błąd jednocześnie zapisując zmiany.

 

 

Edytowane przez Alwin Kolano
Link to postu

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.
Uwaga: Twój wpis zanim będzie widoczny, będzie wymagał zatwierdzenia moderatora.

Użytkownik forum
Odpowiedz...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

×
×
  • Dodaj nową pozycję...