Skip to content

Commit da13d2b

Browse files
committed
Samples
1 parent bd9846d commit da13d2b

File tree

6 files changed

+490
-38
lines changed

6 files changed

+490
-38
lines changed
Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
3+
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" version="4.01" doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
4+
<!-- Tekstit alkavat -->
5+
<xsl:variable name="txtOtsikko">Finvoice-sanoman lähettäjän ilmoitus</xsl:variable>
6+
<xsl:variable name="txtSellerPartyDetails">Myyjän tiedot</xsl:variable>
7+
<xsl:variable name="txtSellerPartyIdentifier">Y-tunnus/Hetu</xsl:variable>
8+
<xsl:variable name="txtSellerOrganisationName">Myyjän nimi</xsl:variable>
9+
<xsl:variable name="txtKatuosoite">Katuosoite</xsl:variable>
10+
<xsl:variable name="txtPostinroJaKaupunki">Postinumero ja kaupunki</xsl:variable>
11+
<xsl:variable name="txtPostilokero">Postilokero</xsl:variable>
12+
<xsl:variable name="txtMaa">Maa</xsl:variable>
13+
<xsl:variable name="txtOrganisationUnitNumber">Organisaatioyksikkö</xsl:variable>
14+
<xsl:variable name="txtInvoiceSenderInformationDetails">Finvoice-sanoman lähettäjän tiedot</xsl:variable>
15+
<xsl:variable name="txtWebaddressText">Linkki web-sivulle</xsl:variable>
16+
<xsl:variable name="txtWebaddressNameText">Web-sivuston selitys</xsl:variable>
17+
<xsl:variable name="txtInvoiceSenderAddress">Lähettäjän osoite</xsl:variable>
18+
<xsl:variable name="txtInvoiceSenderIntermediatorAddress">Lähettäjän välittäjän tunnus</xsl:variable>
19+
<xsl:variable name="txtNewInvoiceSenderAddress">Uusi lähettäjän osoite</xsl:variable>
20+
<xsl:variable name="txtNewInvoiceSenderIntermediatorAddress">Uusi lähettäjän välittäjän tunnus</xsl:variable>
21+
<xsl:variable name="txtMessageDetails">Viestin tiedot</xsl:variable>
22+
<xsl:variable name="txtMessageDate">Viestin päiväys</xsl:variable>
23+
<xsl:variable name="txtMessageTypeCode">Viestin tyyppikoodi</xsl:variable>
24+
<xsl:variable name="txtMessageTypeText">Viestin tyyppi</xsl:variable>
25+
<xsl:variable name="txtMessageActionCode">Viestin toimintakoodi</xsl:variable>
26+
<xsl:variable name="txtSenderInfoIdentifier">Lähettäjän viite sanomalle</xsl:variable>
27+
<xsl:variable name="txtSellerInvoiceDetails">Laskun tiedot</xsl:variable>
28+
<xsl:variable name="txtSellerDirectDebitIdentifier">Laskuttajan suoraveloitustunnus</xsl:variable>
29+
<xsl:variable name="txtSellerDirectPaymentIdentifier">Laskuttajan suoramaksutunnus</xsl:variable>
30+
<xsl:variable name="txtPaymentInstructionIdentifier">Laskun aiheen koodi</xsl:variable>
31+
<xsl:variable name="txtSellerInvoiceTypeText">Laskun aihe</xsl:variable>
32+
<xsl:variable name="txtSellerInvoiceIdentifierText">Pyydettävä tunnistetieto</xsl:variable>
33+
<xsl:variable name="txtSellerAccountID">Laskuttajan tilinumero</xsl:variable>
34+
<xsl:variable name="txtSellerBic">Laskuttajan</xsl:variable>
35+
<xsl:variable name="txtNewSellerAccountID">Uusi laskuttajan tilinumero</xsl:variable>
36+
<xsl:variable name="txtNewSellerBIC">Uusi laskuttajan BIC</xsl:variable>
37+
<xsl:variable name="txtSellerInstructionFreeText">Ohje vastaanottajalle</xsl:variable>
38+
<!-- Tekstit loppuivat -->
39+
<xsl:template match="/">
40+
<html>
41+
<body>
42+
<h2 align="center"><xsl:value-of select="$txtOtsikko"/></h2>
43+
<hr/>
44+
<table width="100%" border="0">
45+
<tr>
46+
<td width="49%" valign="top">
47+
<table bgcolor="#5555aa" border="0" width="100%" cellpadding="1" cellspacing="0">
48+
<tr>
49+
<td>
50+
<table bgcolor="#ccccee" border="0" width="100%" cellpadding="2">
51+
<tr>
52+
<th align="left"><xsl:value-of select="$txtSellerPartyDetails"/></th>
53+
</tr>
54+
</table>
55+
<table bgcolor="#eaedff" border="0" width="100%" cellpadding="2">
56+
<tr>
57+
<td><xsl:value-of select="$txtSellerPartyIdentifier"/>:</td>
58+
<td>
59+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPartyIdentifier"/>
60+
</td>
61+
</tr>
62+
<xsl:for-each select="FinvoiceSenderInfo/SellerPartyDetails/SellerOrganisationName">
63+
<tr>
64+
<td><xsl:value-of select="$txtSellerOrganisationName"/>:</td>
65+
<td>
66+
<xsl:value-of select="."/>
67+
</td>
68+
</tr>
69+
</xsl:for-each>
70+
<xsl:if test="count(FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails) &gt; 0">
71+
<tr>
72+
<td><xsl:value-of select="$txtKatuosoite"/>:</td>
73+
<td>
74+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails/SellerStreetName"/>
75+
</td>
76+
</tr>
77+
<tr>
78+
<td><xsl:value-of select="$txtPostinroJaKaupunki"/>:</td>
79+
<td>
80+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails/SellerPostCodeIdentifier"/>
81+
<xsl:text> </xsl:text>
82+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails/SellerTownName"/>
83+
</td>
84+
</tr>
85+
<tr>
86+
<td><xsl:value-of select="$txtPostilokero"/>:</td>
87+
<td>
88+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails/SellerPostOfficeBoxIdentifier"/>
89+
</td>
90+
</tr>
91+
<tr>
92+
<td><xsl:value-of select="$txtMaa"/>:</td>
93+
<td>
94+
<xsl:value-of select="FinvoiceSenderInfo/SellerPartyDetails/SellerPostalAddressDetails/CountryName"/>
95+
</td>
96+
</tr>
97+
</xsl:if>
98+
<xsl:if test="count(FinvoiceSenderInfo/SellerOrganisationUnitNumber) &gt; 0">
99+
<tr>
100+
<td><xsl:value-of select="$txtOrganisationUnitNumber"/>:</td>
101+
<td>
102+
<xsl:value-of select="FinvoiceSenderInfo/SellerOrganisationUnitNumber"/>
103+
</td>
104+
</tr>
105+
</xsl:if>
106+
</table>
107+
</td>
108+
</tr>
109+
</table>
110+
<br/>
111+
<table bgcolor="#5555aa" border="0" width="100%" cellpadding="1" cellspacing="0">
112+
<tr>
113+
<td>
114+
<table bgcolor="#ccccee" border="0" width="100%" cellpadding="2">
115+
<tr>
116+
<th align="left" colspan="2"><xsl:value-of select="$txtInvoiceSenderInformationDetails"/></th>
117+
</tr>
118+
</table>
119+
<table bgcolor="#eaedff" border="0" width="100%" cellpadding="2">
120+
<xsl:if test="count(FinvoiceSenderInfo/InvoiceSenderInformationDetails/SellerWebaddressText) &gt; 0">
121+
<tr>
122+
<td valign="top"><xsl:value-of select="$txtWebaddressText"/>:</td>
123+
<td>
124+
<a>
125+
<xsl:attribute name="href"><xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/SellerWebaddressText"/></xsl:attribute>
126+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/SellerWebaddressText"/>
127+
</a>
128+
</td>
129+
</tr>
130+
</xsl:if>
131+
<xsl:if test="count(FinvoiceSenderInfo/InvoiceSenderInformationDetails/SellerWebaddressNameText) &gt; 0">
132+
<tr>
133+
<td><xsl:value-of select="$txtWebaddressNameText"/>:</td>
134+
<td>
135+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/SellerWebaddressNameText"/>
136+
</td>
137+
</tr>
138+
</xsl:if>
139+
<tr>
140+
<td><xsl:value-of select="$txtInvoiceSenderAddress"/>:</td>
141+
<td>
142+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/InvoiceSenderAddress"/>
143+
</td>
144+
</tr>
145+
<tr>
146+
<td><xsl:value-of select="$txtInvoiceSenderIntermediatorAddress"/>:</td>
147+
<td>
148+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/InvoiceSenderIntermediatorAddress"/>
149+
</td>
150+
</tr>
151+
<xsl:if test="string-length(FinvoiceSenderInfo/InvoiceSenderInformationDetails/NewInvoiceSenderAddress) != 0">
152+
<tr>
153+
<td><xsl:value-of select="$txtNewInvoiceSenderAddress"/>:</td>
154+
<td>
155+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/NewInvoiceSenderAddress"/>
156+
</td>
157+
</tr>
158+
</xsl:if>
159+
<xsl:if test="string-length(FinvoiceSenderInfo/InvoiceSenderInformationDetails/NewInvoiceSenderIntermediatorAddress) != 0">
160+
<tr>
161+
<td><xsl:value-of select="$txtNewInvoiceSenderIntermediatorAddress"/>:</td>
162+
<td>
163+
<xsl:value-of select="FinvoiceSenderInfo/InvoiceSenderInformationDetails/NewInvoiceSenderIntermediatorAddress"/>
164+
</td>
165+
</tr>
166+
</xsl:if>
167+
</table>
168+
</td>
169+
</tr>
170+
</table>
171+
<br/>
172+
</td>
173+
<td width="2%"/>
174+
<td width="49%" valign="top">
175+
<table bgcolor="#5555aa" border="0" width="100%" cellpadding="1" cellspacing="0">
176+
<tr>
177+
<td>
178+
<table bgcolor="#ccccee" border="0" width="100%" cellpadding="2">
179+
<tr>
180+
<th align="left" colspan="2"><xsl:value-of select="$txtMessageDetails"/></th>
181+
</tr>
182+
</table>
183+
<table bgcolor="#eaedff" border="0" width="100%" cellpadding="2">
184+
<tr>
185+
<td><xsl:value-of select="$txtMessageDate"/>:</td>
186+
<td>
187+
<xsl:value-of select="substring(FinvoiceSenderInfo/MessageDetails/MessageDate,7,2)"/>.<xsl:value-of select="substring(FinvoiceSenderInfo/MessageDetails/MessageDate,5,2)"/>.<xsl:value-of select="substring(FinvoiceSenderInfo/MessageDetails/MessageDate,1,4)"/>
188+
</td>
189+
</tr>
190+
<tr>
191+
<td><xsl:value-of select="$txtMessageTypeCode"/>:</td>
192+
<td>
193+
<xsl:value-of select="FinvoiceSenderInfo/MessageDetails/MessageTypeCode"/>
194+
</td>
195+
</tr>
196+
<tr>
197+
<td><xsl:value-of select="$txtMessageTypeText"/>:</td>
198+
<td>
199+
<xsl:value-of select="FinvoiceSenderInfo/MessageDetails/MessageTypeText"/>
200+
</td>
201+
</tr>
202+
<tr>
203+
<td><xsl:value-of select="$txtMessageActionCode"/>:</td>
204+
<td>
205+
<xsl:value-of select="FinvoiceSenderInfo/MessageDetails/MessageActionCode"/>
206+
</td>
207+
</tr>
208+
<tr>
209+
<td><xsl:value-of select="$txtSenderInfoIdentifier"/>:</td>
210+
<td>
211+
<xsl:value-of select="FinvoiceSenderInfo/MessageDetails/SenderInfoIdentifier"/>
212+
</td>
213+
</tr>
214+
</table>
215+
</td>
216+
</tr>
217+
</table>
218+
<br/>
219+
<table bgcolor="#5555aa" border="0" width="100%" cellpadding="1" cellspacing="0">
220+
<tr>
221+
<td>
222+
<table bgcolor="#ccccee" border="0" width="100%" cellpadding="2">
223+
<tr>
224+
<th align="left" colspan="2"><xsl:value-of select="$txtSellerInvoiceDetails"/></th>
225+
</tr>
226+
</table>
227+
<table bgcolor="#eaedff" border="0" width="100%" cellpadding="2">
228+
<tr>
229+
<td><xsl:value-of select="$txtSellerDirectDebitIdentifier"/>:</td>
230+
<td>
231+
<xsl:value-of select="FinvoiceSenderInfo/SellerInvoiceDetails/SellerDirectDebitIdentifier"/>
232+
</td>
233+
</tr>
234+
<tr>
235+
<td><xsl:value-of select="$txtSellerDirectPaymentIdentifier"/>:</td>
236+
<td>
237+
<xsl:value-of select="FinvoiceSenderInfo/SellerInvoiceDetails/SellerDirectPaymentIdentifier"/>
238+
</td>
239+
</tr>
240+
<xsl:for-each select="FinvoiceSenderInfo/SellerInvoiceDetails/SellerInstructionFreeText">
241+
<tr>
242+
<td nowrap="nowrap"><xsl:value-of select="$txtSellerInstructionFreeText"/> (<xsl:value-of select="./@LanguageCode"/>):</td>
243+
<td>
244+
<xsl:value-of select="."/>
245+
</td>
246+
</tr>
247+
</xsl:for-each>
248+
<tr>
249+
<td><xsl:value-of select="$txtPaymentInstructionIdentifier"/>:</td>
250+
<td>
251+
<xsl:value-of select="FinvoiceSenderInfo/SellerInvoiceDetails/PaymentInstructionIdentifier"/>
252+
</td>
253+
</tr>
254+
<xsl:for-each select="FinvoiceSenderInfo/SellerInvoiceDetails/SellerInvoiceTypeDetails">
255+
<tr>
256+
<td><xsl:value-of select="$txtSellerInvoiceTypeText"/> (<xsl:value-of select="SellerInvoiceTypeText/@LanguageCode"/>):</td>
257+
<td>
258+
<xsl:value-of select="SellerInvoiceTypeText"/>
259+
</td>
260+
</tr>
261+
<tr>
262+
<td><xsl:value-of select="$txtSellerInvoiceIdentifierText"/> (<xsl:value-of select="SellerInvoiceIdentifierText/@LanguageCode"/>):</td>
263+
<td>
264+
<xsl:value-of select="SellerInvoiceIdentifierText"/>
265+
</td>
266+
</tr>
267+
</xsl:for-each>
268+
<xsl:for-each select="FinvoiceSenderInfo/SellerAccountDetails">
269+
<tr>
270+
<td><xsl:value-of select="$txtSellerAccountID"/><xsl:text> </xsl:text>(<xsl:value-of select="SellerAccountID/@IdentificationSchemeName"/>):</td>
271+
<td>
272+
<xsl:value-of select="SellerAccountID"/>
273+
</td>
274+
</tr>
275+
<xsl:if test="string-length(SellerBic) != 0">
276+
<tr>
277+
<td><xsl:value-of select="$txtSellerBic"/><xsl:text> </xsl:text><xsl:value-of select="SellerBic/@IdentificationSchemeName"/>:</td>
278+
<td>
279+
<xsl:value-of select="SellerBic"/>
280+
</td>
281+
</tr>
282+
</xsl:if>
283+
<xsl:if test="string-length(NewSellerAccountID) != 0">
284+
<tr>
285+
<td><xsl:value-of select="$txtNewSellerAccountID"/>:</td>
286+
<td>
287+
<xsl:value-of select="NewSellerAccountID"/>
288+
</td>
289+
</tr>
290+
</xsl:if>
291+
<xsl:if test="string-length(NewSellerBIC) != 0">
292+
<tr>
293+
<td><xsl:value-of select="$txtNewSellerBIC"/>:</td>
294+
<td>
295+
<xsl:value-of select="NewSellerBIC"/>
296+
</td>
297+
</tr>
298+
</xsl:if>
299+
</xsl:for-each>
300+
</table>
301+
</td>
302+
</tr>
303+
</table>
304+
<br/>
305+
</td>
306+
</tr>
307+
</table>
308+
</body>
309+
</html>
310+
</xsl:template>
311+
</xsl:stylesheet>

docs/sample_soap.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
2+
xmlns:xlink="http://www.w3.org/1999/xlink"
3+
xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ envelope.xsd">
6+
<SOAP-ENV:Header>
7+
<eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd msg-header-2_0.xsd"
10+
SOAP-ENV:mustUnderstand="1" eb:version="2.0">
11+
<eb:From>
12+
<eb:PartyId>FI9956789012345678</eb:PartyId>
13+
<eb:Role>Sender</eb:Role>
14+
</eb:From>
15+
<eb:From>
16+
<eb:PartyId>OKOYFIHH</eb:PartyId>
17+
<eb:Role>Intermediator</eb:Role>
18+
</eb:From>
19+
<eb:To>
20+
<eb:PartyId>PROPOSAL</eb:PartyId>
21+
<eb:Role>Receiver</eb:Role>
22+
</eb:To>
23+
<eb:To>
24+
<eb:PartyId>OKOYFIHH</eb:PartyId>
25+
<eb:Role>Intermediator</eb:Role>
26+
</eb:To>
27+
<eb:CPAId>yoursandmycpa</eb:CPAId>
28+
<!--<eb:ConversationId>cannot_be_empty</eb:ConversationId>-->
29+
<eb:Service>Routing</eb:Service>
30+
<eb:Action>ProcessInvoice</eb:Action>
31+
<eb:MessageData>
32+
<eb:MessageId>RP_20120831/1</eb:MessageId>
33+
<eb:Timestamp>2012-08-31T12:40:57+02:00</eb:Timestamp>
34+
<!--<eb:RefToMessageId>cannot_be_empty</eb:RefToMessageId>-->
35+
</eb:MessageData>
36+
</eb:MessageHeader>
37+
</SOAP-ENV:Header>
38+
<SOAP-ENV:Body>
39+
<eb:Manifest eb:id="Manifest" eb:version="2.0">
40+
<eb:Reference eb:id="ReceiverProposal" xlink:href="RP_20120831">
41+
<eb:Schema eb:location="http://www.fkl.fi/verkkolasku/yrityksen_verkkolasku/ladattavat/Tekniset%20tiedostot/ilmoittamispalvelu/ReceiverProposal.xsd" eb:version="2.0"/>
42+
</eb:Reference>
43+
</eb:Manifest>
44+
</SOAP-ENV:Body>
45+
</SOAP-ENV:Envelope>

finvoice/sender/senderinfo.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
###
5+
# Copyright 2014 Code Master Oy (http://www.codemaster.fi/)
46
#
5-
# Generated Mon Jun 30 15:14:33 2014 by generateDS.py version 2.12e.
7+
# This file is part of py-finvoice.
68
#
7-
# Command line options:
8-
# ('-o', 'finvoice/sender/senderinfo.py')
9-
# ('-s', 'finvoice/sender/senderinfosubs.py')
10-
# ('--external-encoding', 'ISO-8859-15')
11-
#
12-
# Command line arguments:
13-
# xsd/FinvoiceSenderInfo.xsd
14-
#
15-
# Command line:
16-
# /usr/local/bin/generateDS.py -o "finvoice/sender/senderinfo.py" -s "finvoice/sender/senderinfosubs.py" --external-encoding="ISO-8859-15" xsd/FinvoiceSenderInfo.xsd
17-
#
18-
# Current working directory (os.getcwd()):
19-
# py-finvoice
9+
# py-finvoice is free software: you can redistribute it and/or modify
10+
# it under the terms of the GNU General Public License as published by
11+
# the Free Software Foundation, either version 3 of the License, or
12+
# (at your option) any later version.
13+
#
14+
# py-finvoice is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License for more details.
2018
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with py-finvoice. If not, see <http://www.gnu.org/licenses/>.
21+
##
2122

2223
import sys
2324
import getopt

0 commit comments

Comments
 (0)