Skocz do zawartości

Export do xml lub xls

Polecane posty

Witam

 

Potrzebuje wyeksportować grupę informacji z paczek do xml lub xls. Niestety po zaznaczeniu paczek i kliknięciu eksport otrzymuje kostkę rubika w postaci pliku wynikowego. Widziałem że jest możliwość napisania skryptu raportu ale zupełnie się na tym nie znam. Czy istnieje do tego jakiś manual? Potrzebuje z zaznaczonych paczek otrzymać: IMIĘ I NAZWISKO, NAZWA FIRMY(JEŻELI FV), NICK, ZAKUPIONE TOWARY, NR DOKUMENTU KOŃCOWEGO, ŁĄCZNA KWOTA ZAKUPU, SPOSÓB DOSTAWY, DATA UTWORZENIA. Czy jest to możliwe do zrobienia?

 

Proszę o pomoc. 

Link to postu

Do napisania eksportu wymagana jest znajomość języka XSLT i struktury domyślnej pliku eksportu Sello, którą można wyeksportować za pomocą domyślnego eksportu do XML. Na bazie tego pliku robi się wspomniana transformatę XSLT, która generuje plik wynikowy. Trudno tutaj mówić o jakimś manualu, będzie dobry każdy, który opisuje język XSLT.

 

Dane, które wymienione powyżej są dostępne już w domyślnym pliku XML eksportowanym z Sello, ale prócz nich jest tam jeszcze masa innych danych. Za pomocą transformaty "wybiera się" z tego pliku te dane, które mają zostać umieszczone w pliku wynikowym.

 

Link to postu

Nie wiem czy będzie się komuś chciało ale mam taka transformatę do przesyłek poleconych jak poniżej i EN przy każdym liście wymaga zapisania żeby nadać nr przesyłki a przedtem wyrzuca taki błąd:

 

Niedopuszczalna wartość dla obszaru oddawczego (miejscowa/zamiejscowa). (EN:33113)

 

transformata z jakiej korzystam do :

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

  <!--Przesyłka polecona-->

  <!--Informuje o tym, czy jest przesyłką „firmową”:

  T – tak

  N – nie-->

  <xsl:variable name="Firmowa">N</xsl:variable>

  <!--Informuje o tym, czy jest przesyłką „miejscową”:

  T – tak

  N – nie-->

  <xsl:variable name="Miejscowa">N</xsl:variable>

  <!--Informuje o tym, czy jest przesyłką „ubezpieczoną”:

  T – tak

  N – nie-->

  <xsl:variable name="Ubezpieczona">N</xsl:variable>

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

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

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

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

  <!--Dotyczy gabarytu przesyłki:

  A – gabaryt A

  B – gabaryt B-->

  <xsl:variable name="Gabaryt">B</xsl:variable>

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

  <xsl:template name="Opis">Paczka nr <xsl:value-of select="s:Symbol"/></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>

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

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

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

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

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

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

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

      </xsl:element>

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

        <xsl:choose>

          <xsl:when test="s:DeliveryMethod/s:Priority=1">P</xsl:when>

          <xsl:otherwise>E</xsl:otherwise>

        </xsl:choose>

      </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">PosteRestante</xsl:attribute>

        <xsl:choose>

          <xsl:when test="s:DeliveryMethod/s:PosteRestante=1">T</xsl:when>

          <xsl:otherwise>N</xsl:otherwise>

        </xsl:choose>

      </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="350"/>

        </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: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:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

      <xsl:element name="Atrybut">

        <xsl:attribute name="Typ"/>

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

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

      </xsl:element>

      <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">Opis</xsl:attribute>

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

        </xsl:element>

      </xsl:if>

    </xsl:element>

  </xsl:template>

</xsl:stylesheet>

 

 

Czy ktoś ma może gotową transformatę która działa przy E-Przesyłce odbiór w punkcie- zaciąga wybrany UP?

 

Link to postu

Działała ale od dłuższego czasu nie działa do końca.W elektronicznym nadawcy były jakieś zmiany,od tamtej pory pokazuję się błąd

 

Niedopuszczalna wartość dla obszaru oddawczego (miejscowa/zamiejscowa). (EN:33113)

 

pomaga klikniecie w przesyłkę i jej zapisanie, dopiero wtedy zostaje nadany nr przesyłce i przy zbiorowym exporcie trzeba prze klikać każda paczkę- list polecony.

 

Wcześniej robiłem zbiorowy export, wszystko w zbiorze się zgadzało i od razu można było drukować listy.

Link to postu

Używam tego exportu tylko dla przesyłki poleconej:

-polecony list ekonomiczny

-polecony list priorytetowy

 

do e-przesyłki odbiór w punkcie używam oddzielnej i tam muszę niestety klikać z palca wybrany urząd pocztowy przez klienta.

 

E-przesyłkę w sello można używać jedynie tak: w pliku pocztowym wyszukujesz nr PNI urzędu, wklejasz go w transakcji do nr NIP, z odpowiednią transformatą eksport przechodzi poprawnie (tzn. przechodził bo ostatnio nie używam tego rodzaju wysyłki wieć nie mogę zwertyfikować).

Link to postu
  • 2 miesiące temu...

Faktura mi uświadomiła, że cały grudzień słałam miejscowe... Coś się zmieniło w EN i dotychczasowa transformata nie działa poprawnie. Kiedyś

  <xsl:variable name="Miejscowa">T</xsl:variable>

działało ładnie, bo wyłapywało miejscowe/zamiejscowe. Teraz wali miejscowe wszędzie.

Rozwiązaliście to jakoś oprócz wpisania na stałe zamiast "T" "N"?

Link to postu

Nakina, od stycznia miejscowe są tylko w orębie Twojej miejscowości zamieszkania.

 

Ja pozmieniałem te linie:

 

w nagłówku transformaty:

<xsl:variable name="Miejscowa">N</xsl:variable>

 

Potem w parametrach firmówki (może masz inną transformatę i może być trochę inaczej):

<xsl:element name="Atrybut">
				<xsl:attribute name="Typ"/>
				<xsl:attribute name="Nazwa">Miejscowa</xsl:attribute>
				<xsl:choose>
					<xsl:when test="starts-with(s:DeliveryAddress/s:ZipCode, '41-20') or starts-with(s:DeliveryAddress/s:ZipCode, '41-21') or starts-with(s:DeliveryAddress/s:ZipCode, '41-22')">T</xsl:when>
					<xsl:otherwise>N</xsl:otherwise>
				</xsl:choose>
			</xsl:element>

 

Jeśli musisz podać więcej niż 3 początki kodów to należy skopiować dokładnie kod i wpisać inny kod pocztowy (u mnie musi być 4 cyfry, ale nie musi, bo np. jeśli miasto ma cały zakres "43" to wystarczy tylko liczba 43.

Musisz odnaleźć podobne u siebie, znaleźć w sieci zakres kodów swojej miejscowości i podmienić. Możesz wyszukać kody np. tu: http://kody.poczta-polska.pl/ - strona dzisiaj aktualizowana.

Link to postu

u mnie ten fragment wygląda tak:

<xsl:element name="Atrybut">
       <xsl:attribute name="Typ"/>
       <xsl:attribute name="Nazwa">Miejscowa</xsl:attribute>
       <xsl:value-of select="$Miejscowa"/>
     </xsl:element>

kurcze, tu się na programowaniu trzeba także znać... Rozumiem, że ten fragment powinien wyglądać teraz tak?

<xsl:element name="Atrybut">
       <xsl:attribute name="Typ"/>
       <xsl:attribute name="Nazwa">Miejscowa</xsl:attribute>
       <xsl:choose>
<xsl:when test="starts-with(s:DeliveryAddress/s:ZipCode, '90-') or starts-with(s:DeliveryAddress/s:ZipCode, '91-') or starts-with(s:DeliveryAddress/s:ZipCode, '92-')">T</xsl:when>
<xsl:otherwise>N</xsl:otherwise>
</xsl:choose>
</xsl:element>

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ę...