lv:procedures
Šī ir veca dokumenta versija!
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:js="urn:formulas"
exclude-result-prefixes="msxsl js fo">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:variable name="discount">
<xsl:for-each select="/documents/document/rows/row[pross>'0.00000001']">
<xsl:value-of select="pross"/>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="eiro">
<xsl:choose>
<xsl:when test="/documents/document/valuuta='LVL'">
1.42287181
</xsl:when>
<xsl:when test="/documents/document/valuuta=''">
1.42287181
</xsl:when>
<xsl:when test="/documents/document/valuuta='EUR'">
0.702804
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nauda">
<xsl:choose>
<xsl:when test="/documents/document/valuuta='LVL'">LVL</xsl:when>
<xsl:when test="/documents/document/valuuta=''">LVL</xsl:when>
<xsl:when test="/documents/document/valuuta!='' and /documents/document!='LVL'">
<xsl:value-of select="/documents/document/valuuta"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="nauda2">
<xsl:choose>
<xsl:when test="/documents/document/valuuta='LVL'">EUR</xsl:when>
<xsl:when test="/documents/document/valuuta=''">EUR</xsl:when>
<xsl:when test="/documents/document/valuuta!='' and /documents/document!='LVL'">LVL</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ridu_laius">
<xsl:choose>
<xsl:when test="$discount!=''">38</xsl:when>
<xsl:otherwise>55</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ridu_lk">
<xsl:for-each select="/documents/document/rows/row">
<xaccum>
<accum>
<xsl:value-of select="floor(number(string-length(keelne_seletus) div $ridu_laius))+1"/>
</accum>
<pos><xsl:value-of select="position()"/></pos>
</xaccum>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="rsk">
<xsl:value-of select="sum(msxsl:node-set($ridu_lk)/xaccum/accum)"/>
</xsl:variable>
<xsl:variable name="ridu_lk1">
<xsl:choose>
<xsl:when test="$rsk > 35">35</xsl:when>
<xsl:otherwise>20</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="ridu_lk2">
<xsl:choose>
<xsl:when test="$rsk > 90">55</xsl:when>
<xsl:otherwise>40</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="lppsk">
<xsl:if test="$rsk > $ridu_lk1"><xsl:value-of select="ceiling(($rsk - $ridu_lk1) div $ridu_lk2)+1"/></xsl:if>
<xsl:if test="$rsk <= $ridu_lk1"><xsl:value-of select="1"/></xsl:if>
</xsl:variable>
<xsl:variable name="lang">
<xsl:choose>
<xsl:when test="/documents/kontakt/keel='LV' or /documents/kontakt/keel='LAT' or /documents/kontakt/keel=''">LV</xsl:when>
<xsl:otherwise>ENG</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="day" select="substring(/documents/document/aeg_date,1,2)" />
<xsl:variable name="month" select="substring(/documents/document/aeg_date,4,2)" />
<xsl:variable name="year" select="substring(/documents/document/aeg_date,7,4)" />
<xsl:variable name="menesis">
<xsl:if test="$month='01'">janvārī</xsl:if>
<xsl:if test="$month='02'">februārī</xsl:if>
<xsl:if test="$month='03'">martā</xsl:if>
<xsl:if test="$month='04'">aprīlī</xsl:if>
<xsl:if test="$month='05'">maijā</xsl:if>
<xsl:if test="$month='06'">jūnijā</xsl:if>
<xsl:if test="$month='07'">jūlijā</xsl:if>
<xsl:if test="$month='08'">augustā</xsl:if>
<xsl:if test="$month='09'">septembrī</xsl:if>
<xsl:if test="$month='10'">oktobrī</xsl:if>
<xsl:if test="$month='11'">novembrī</xsl:if>
<xsl:if test="$month='12'">decembrī</xsl:if>
</xsl:variable>
<xsl:variable name="datums">
<xsl:choose>
<xsl:when test="$lang='LV'"><xsl:value-of select="concat($year,'. gada',' ',$day,'. ',$menesis)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="/documents/document/aeg_date" /></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="lapa">
<xsl:choose>
<xsl:when test="$lang='LV'">Lapa</xsl:when>
<xsl:otherwise>Page</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field1">
<xsl:choose>
<xsl:when test="$lang='LV'">Datums</xsl:when>
<xsl:otherwise>Date</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field2">
<xsl:choose>
<xsl:when test="$lang='LV'">Pavadzīme Nr.</xsl:when>
<xsl:otherwise>Invoice No</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field3">
<xsl:choose>
<xsl:when test="$lang='LV'">Preču nosūtītājs</xsl:when>
<xsl:otherwise>Sender</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field4">
<xsl:choose>
<xsl:when test="$lang='LV'">Preču saņēmējs</xsl:when>
<xsl:otherwise>Receiver</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field5">
<xsl:choose>
<xsl:when test="$lang='LV'">PVN reģ. Nr.</xsl:when>
<xsl:otherwise>VAT reg. No</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field6">
<xsl:choose>
<xsl:when test="$lang='LV'">Reģ. Nr.</xsl:when>
<xsl:otherwise>Reg. No</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field7">
<xsl:choose>
<xsl:when test="$lang='LV'">Preču izsniegšana</xsl:when>
<xsl:otherwise>Stock address</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field8">
<xsl:choose>
<xsl:when test="$lang='LV'">Preču saņemšana</xsl:when>
<xsl:otherwise>Delivery address</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field9">
<xsl:choose>
<xsl:when test="$lang='LV'">Pārvadātājs</xsl:when>
<xsl:otherwise>Forwarder</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field10">
<xsl:choose>
<xsl:when test="$lang='LV'">Apmaksas veids</xsl:when>
<xsl:otherwise>Payment</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field11">
<xsl:choose>
<xsl:when test="$lang='LV'">Apmaksas termiņš</xsl:when>
<xsl:otherwise>Due date</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field12">
<xsl:choose>
<xsl:when test="$lang='LV'">Speciālas atzīmes</xsl:when>
<xsl:otherwise>Notes</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field13">
<xsl:choose>
<xsl:when test="$lang='LV'">Summa bez PVN</xsl:when>
<xsl:otherwise>Sum w/o VAT</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field14">
<xsl:choose>
<xsl:when test="$lang='LV'">Nr.</xsl:when>
<xsl:otherwise>No</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field15">
<xsl:choose>
<xsl:when test="$lang='LV'">Kods</xsl:when>
<xsl:otherwise>Item</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field16">
<xsl:choose>
<xsl:when test="$lang='LV'">Nosaukums</xsl:when>
<xsl:otherwise>Description</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field17">
<xsl:choose>
<xsl:when test="$lang='LV'">Mērv.</xsl:when>
<xsl:otherwise>Unit</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field18">
<xsl:choose>
<xsl:when test="$lang='LV'">Daudz.</xsl:when>
<xsl:otherwise>Qty</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field19">
<xsl:choose>
<xsl:when test="$lang='LV'">Cena</xsl:when>
<xsl:otherwise>Price</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field20">
<xsl:choose>
<xsl:when test="$lang='LV'">Cena ar %</xsl:when>
<xsl:otherwise>Price w/ %</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field21">
<xsl:choose>
<xsl:when test="$lang='LV'">PVN</xsl:when>
<xsl:otherwise>VAT</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field22">
<xsl:choose>
<xsl:when test="$lang='LV'">Summa</xsl:when>
<xsl:otherwise>Sum</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field23">
<xsl:choose>
<xsl:when test="$lang='LV'">Kopā bez PVN</xsl:when>
<xsl:otherwise>Subtotal w/o VAT</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field24">
<xsl:choose>
<xsl:when test="$lang='LV'">Kopā ar PVN</xsl:when>
<xsl:otherwise>Total</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field25">
<xsl:choose>
<xsl:when test="$lang='LV'">Summa apmaksai</xsl:when>
<xsl:otherwise>Amount Due</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field26">
<xsl:choose>
<xsl:when test="$lang='LV'">Priekšapmaksa</xsl:when>
<xsl:otherwise>Amount Paid</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field27">
<xsl:choose>
<xsl:when test="$lang='LV'">Summa vārdiem</xsl:when>
<xsl:otherwise>Amount to be paid in words</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field28">
<xsl:choose>
<xsl:when test="$lang='LV'">Kavēto maksājumu uzraudzība tiek veikta sadarbībā ar SIA CreditReform Latvija.</xsl:when>
<xsl:otherwise>Late payments are monitored in cooperation with CreditReform Latvija SIA.</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field29">
<xsl:choose>
<xsl:when test="$lang='LV'">Paraksts</xsl:when>
<xsl:otherwise>Signature</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field30">
<xsl:choose>
<xsl:when test="$lang='LV'">Jur. adrese</xsl:when>
<xsl:otherwise>Address</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field31">
<xsl:choose>
<xsl:when test="$lang='LV'">Izsniedza</xsl:when>
<xsl:otherwise>Sender</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field32">
<xsl:choose>
<xsl:when test="$lang='LV'">Pieņēma</xsl:when>
<xsl:otherwise>Receiver</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field33">
<xsl:choose>
<xsl:when test="$lang='LV'">ar pārskaitījumu</xsl:when>
<xsl:otherwise>by bank transfer</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field34">
<xsl:choose>
<xsl:when test="$lang='LV'"><xsl:value-of select="/documents/document/lisa_field1"/></xsl:when>
<xsl:otherwise>
<xsl:if test="/documents/document/lisa_field1='Kurjers'">Courier</xsl:if>
<xsl:if test="/documents/document/lisa_field1='Pašizvešana'">Self-pickup</xsl:if>
<xsl:if test="/documents/document/lisa_field1='Omniva SIA'">Omniva SIA</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="field35">
<xsl:choose>
<xsl:when test="$lang='LV'"><xsl:value-of select="js:numText(string(format-number(/documents/document/converted_tasuda div 100 - /documents/document/ettemaks, '0.00')),string($nauda))" /></xsl:when>
<xsl:otherwise><xsl:value-of select="js:numTextEng(string(format-number(/documents/document/converted_tasuda div 100 - /documents/document/ettemaks, '0.00')),string($nauda))" /></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
<html><head>
<title>
Invoice no <xsl:value-of select="/documents/document/number"/>
</title>
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Condensed:300,400&display=swap&subset=latin-ext" rel="stylesheet" />
</head>
<style>
.table2 {
border-collapse: collapse;
border: inset;
border-width: 2px 2px 0px 2px;
}
th {
border-right: 1px solid lightgray;
}
.table3 {
border: 2px inset;
border-collapse: collapse;
}
.td3 {
border-right: 1px solid white;
}
.divider {
clear:both;
height: 30px;
}
.divsmall {
clear:both;
height: 5px;
}
.bottom {
height: 230px;
}
.top {
height: 380px;
}
.RobotoNimi {
font-size: 10.0pt;
font-family: 'Roboto Condensed', sans-serif;
}
.Roboto10 {
font-size: 10.0pt;
font-family: 'Roboto Condensed', sans-serif;
}
.Roboto8 {
font-size: 9.0pt;
font-family: 'Roboto Condensed', sans-serif;
}
.PageNumbers {
font-size: 9.0pt;
font-family: 'Roboto Condensed', sans-serif;
padding: 1px;
text-align: right;
width: 660px;
}
.FooterText {
font-size: 8.0pt;
font-weight: bold;
font-family: 'Roboto', sans-serif;
color: dimgray;
padding-left: 2px;
}
.HeaderText {
font-size: 12.0pt;
font-weight: bold;
font-family: 'Roboto Condensed', sans-serif;
color: dimgray;
}
</style>
<body>
<center>
<div class="top">
<div class="divsmall"></div>
<table border="0" width="660" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3" width="100%" valign="bottom" align="left">
<xsl:if test="/documents/footer/firma_logo!=''">
<IMG BORDER="0" width="300px" align="left">
<xsl:attribute name="SRC" ><xsl:value-of select="/documents/footer/firma_logo"/></xsl:attribute></IMG>
</xsl:if>
</td>
<td>
<br />
</td>
</tr>
<tr>
<td width="330" class="HeaderText">
<br />
<b>
<xsl:value-of select="$field1"/>: <xsl:value-of select="$datums" />
</b>
</td>
<td width="330" class="HeaderText" align="right">
<br />
<b><xsl:value-of select="$field2"/> <xsl:value-of select="/documents/document/prefix"/><xsl:value-of select="/documents/document/number"/></b>
</td>
</tr>
</table>
<hr width="660"></hr>
<table border="0" width="660" cellpadding="0" cellspacing="0">
<tr>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field3"/>: <b><xsl:value-of select="/documents/footer/firma_nimi"/></b>
</td>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field4"/>: <b><xsl:value-of select="/documents/document/klient_nimi"/></b>
</td>
</tr>
<tr>
<td width="330" class="Roboto10">
<xsl:value-of select="$field5"/>: <xsl:value-of select="/documents/footer/firma_kmnr"/>
</td>
<td width="330" class="Roboto10">
<xsl:value-of select="$field5"/>: <xsl:value-of select="/documents/document/kmregnumber"/>
</td>
</tr>
<tr>
<td width="330" class="Roboto10">
<xsl:value-of select="$field6"/>: <xsl:value-of select="/documents/footer/firma_regnr"/>
</td>
<td width="330" class="Roboto10">
<xsl:value-of select="$field6"/>: <xsl:value-of select="/documents/kontakt/regnr"/>
</td>
</tr>
<tr>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field30"/>: <xsl:value-of select="normalize-space(concat(/documents/footer/firma_aadress,' ',/documents/footer/firma_aadress2))"/>
</td>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field30"/>: <xsl:value-of select="normalize-space(concat(/documents/document/aadress1,' ',/documents/document/aadress2))"/>
</td>
</tr>
<!--<tr>
<td width="330" class="Roboto10">
Kredītiestādes nosaukums: <xsl:value-of select="/documents/footer/firma_pank"/>
</td>
<td width="330" class="Roboto10">
Kredītiestādes nosaukums: <xsl:value-of select="/documents/kontakt/klient_pank_nimi"/>
</td>
</tr>
<tr>
<td width="330" class="Roboto10">
N/Konts: <xsl:value-of select="/documents/footer/firma_aa"/>
</td>
<td width="330" class="Roboto10">
N/Konts: <xsl:value-of select="/documents/kontakt/arveldusarve"/>
</td>
</tr>-->
<tr>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field7"/>: <xsl:value-of select="/documents/document/ladu_aadress"/>
</td>
<td width="330" valign="top" class="Roboto10">
<xsl:value-of select="$field8"/>: <xsl:value-of select="normalize-space(concat(/documents/document/lahetusaadress1,' ',documents/document/lahetusaadress2,' ',/documents/document/lahetusaadress3))"/>
</td>
</tr>
</table>
<hr width="660"></hr>
<table border="0" width="660" cellpadding="0" cellspacing="0">
<tr>
</tr>
<tr>
<td width="330" class="Roboto10">
<xsl:value-of select="$field9"/>: <b><xsl:value-of select="$field34"/></b>
</td>
<td width="330" class="Roboto10">
<!--TL vadītāja vārds, uzvārds:-->
</td>
</tr>
<tr>
<td width="330" class="Roboto10">
<xsl:if test="/documents/document/lisa_field1='Omniva SIA'"><xsl:value-of select="$field6"/>: <b>40103527192</b></xsl:if> 
</td>
<td width="330" class="Roboto10">
<!--Transportlīdzekļa reģ. Nr.:-->
</td>
</tr>
</table>
<hr width="660"></hr>
<table border="0" width="660" cellpadding="0" cellspacing="0">
<tr>
<td width="330" class="Roboto10">
<xsl:value-of select="$field10"/>: 
<xsl:choose>
<xsl:when test="/documents/document/tingimus_lisavaljad/lisa[@kood='LANG']=''">
<xsl:value-of select="$field33"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="/documents/document/tingimus_lisavaljad/lisa[@kood='LANG' and @param=$lang]"/></xsl:otherwise>
</xsl:choose>
</td>
<td width="330" class="Roboto10">
<xsl:value-of select="$field12"/>: <xsl:value-of select="/documents/document/kommentaar"/>
</td>
</tr>
<tr>
<td width="330" class="Roboto10">
<xsl:value-of select="$field11"/>: <xsl:value-of select="/documents/document/aeg2"/>
</td>
<td width="330" class="Roboto10">
 
</td>
</tr>
</table></div>
<xsl:if test="$lppsk > 1"><div class="PageNumbers"><xsl:value-of select="$lapa"/> <xsl:value-of select="1"/>/<xsl:value-of select="$lppsk"/></div></xsl:if>
<table class="table2" width="660" cellpadding="0" cellspacing="1">
<tr height="12">
<th height="10" width="20" class="Roboto8">
<xsl:value-of select="$field14"/>
</th>
<th height="10" width="100" class="Roboto8">
<xsl:value-of select="$field15"/>
</th>
<th height="10" class="Roboto8">
<xsl:value-of select="$field16"/>
</th>
<th height="10" width="35" class="Roboto8">
<xsl:value-of select="$field17"/>
</th>
<th height="10" width="45" class="Roboto8">
<xsl:value-of select="$field18"/>
</th>
<th height="10" width="55" class="Roboto8">
<xsl:value-of select="$field19"/>
</th>
<xsl:if test="$discount!=''">
<th height="10" width="20" class="Roboto8">
%
</th>
<th height="10" width="60" class="Roboto8">
<xsl:value-of select="$field20"/>
</th>
</xsl:if>
<th height="10" width="30" class="Roboto8">
<xsl:value-of select="$field21"/>
</th>
<th height="10" width="60" class="Roboto8">
<xsl:value-of select="$field22"/>
</th>
</tr>
</table>
<table class="table3" width="660" height="330" cellpadding="0" cellspacing="1" style="max-height: 550px">
<xsl:for-each select="/documents/document/rows/row[rv=rn]">
<tr height="12">
<td height="10" width="20" align="left" valign="top" class="Roboto10 td3">
<xsl:value-of select="position()"/>.
</td>
<td height="10" width="100" align="left" valign="top" class="Roboto10 td3">
<xsl:value-of select="artikkel"/>
</td>
<td height="10" align="left" valign="top" class="RobotoNimi td3">
<xsl:value-of select="keelne_seletus"/>
</td>
<td height="10" width="35" align="center" valign="top" class="Roboto10 td3">
<xsl:if test="kogus!=0">
<xsl:value-of select="arve_yhik"/>
</xsl:if>
</td>
<td height="10" width="45" align="right" valign="top" class="Roboto10 td3">
<xsl:if test="kogus!=0">
<xsl:value-of select="kogus"/>
</xsl:if>
</td>
<td height="10" width="55" align="right" valign="top" class="Roboto10 td3">
<xsl:value-of select="format-number((converted_hind) div 100,'0.00')"/>
</td>
<xsl:if test="$discount!=''">
<td height="10" width="20" align="right" valign="top" class="Roboto10 td3">
<xsl:value-of select="pross"/>
</td>
<td height="10" width="60" align="right" valign="top" class="Roboto10 td3">
<xsl:value-of select="format-number(rv_hind_ale div 100, '0.00')"/>
</td>
</xsl:if>
<td height="10" width="30" align="center" valign="top" class="Roboto10 td3">
<xsl:variable name="kmk"><xsl:value-of select="kmk"/></xsl:variable>
 <xsl:if test="/documents/kmkoodid/kmkood[km=$kmk]/ilmakm >= 0"><xsl:value-of select="/documents/kmkoodid/kmkood[km=$kmk]/ilmakm"/>%</xsl:if>
</td>
<td height="10" width="60" align="right" valign="top" class="Roboto10 td3">
<xsl:if test="converted_summa!=0">
<xsl:value-of select="format-number((converted_summa) div 100,'0.00')"/>
</xsl:if>
</td>
</tr>
<xsl:variable name="pos" select="position()"/>
<xsl:variable name="rsk1" select="sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos])" />
<xsl:variable name="rsk2" select="sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos <= ($pos+1)])" />
<xsl:if test="(((sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos]) < $ridu_lk1 and (sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < ($pos+1)]) > $ridu_lk1))) or ((((((sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos]))-$ridu_lk1) mod $ridu_lk2)>(sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos+1]))-$ridu_lk1) mod $ridu_lk2) or (((sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos+1]))-$ridu_lk1) mod $ridu_lk2)=0)) and sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos+2])>sum(msxsl:node-set($ridu_lk)/xaccum/accum[../pos < $pos+1])">
<tr><td colspan="8"></td><xsl:if test="$discount!=''"><td></td><td></td></xsl:if></tr>
<xsl:text disable-output-escaping="yes"></table></xsl:text><h4 class="pb"> </h4>
<div class="divider"></div>
<div class="PageNumbers"><xsl:value-of select="$lapa"/> <xsl:value-of select="ceiling(($rsk2 - $ridu_lk1) div $ridu_lk2)+1"/>/<xsl:value-of select="$lppsk"/></div>
<table class="table2" width="660" cellpadding="0" cellspacing="1">
<tr height="12">
<th height="10" width="20" class="Roboto8">
<xsl:value-of select="$field14"/>
</th>
<th height="10" width="100" class="Roboto8">
<xsl:value-of select="$field15"/>
</th>
<th height="10" class="Roboto8">
<xsl:value-of select="$field16"/>
</th>
<th height="10" width="35" class="Roboto8">
<xsl:value-of select="$field17"/>
</th>
<th height="10" width="45" class="Roboto8">
<xsl:value-of select="$field18"/>
</th>
<th height="10" width="55" class="Roboto8">
<xsl:value-of select="$field19"/>
</th>
<xsl:if test="$discount!=''">
<th height="10" width="20" class="Roboto8">
%
</th>
<th height="10" width="60" class="Roboto8">
<xsl:value-of select="$field20"/>
</th>
</xsl:if>
<th height="10" width="30" class="Roboto8">
<xsl:value-of select="$field21"/>
</th>
<th height="10" width="60" class="Roboto8">
<xsl:value-of select="$field22"/>
</th>
</tr>
</table><xsl:text disable-output-escaping="yes"><table class="table3" width="660" height="650" cellpadding="0" cellspacing="1" style="max-height: 850px"></xsl:text></xsl:if>
</xsl:for-each>
<tr><td colspan="8"></td><xsl:if test="$discount!=''"><td></td><td></td></xsl:if></tr>
</table>
<div class="bottom">
<table border="0" width="660">
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"></td>
<td width="100" align="right" class="Roboto10" height="10"></td>
</tr>
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"><xsl:value-of select="$field23"/>:</td>
<td width="100" align="right" class="Roboto10" height="10"><xsl:value-of select="format-number(/documents/document/kokku,'0.00')"/> <xsl:value-of select="$nauda"/></td>
</tr>
<xsl:for-each select="/documents/kmkoodid/kmkood">
<xsl:if test="summa!=0 and count(/documents/kmkoodid/kmkood) > 1">
<tr height="12">
<td width="360" class="Roboto10" height="10"><xsl:value-of select="./kmkoodi_lisavaljad/lisa[@kood='ATSAUCE']" /></td>
<td width="220" class="Roboto10" height="10" align="right"><xsl:value-of select="$field13"/> <xsl:value-of select="ilmakm" />%:</td>
<td width="100" align="right" class="Roboto10" height="10"><xsl:value-of select="format-number(summa div 100,'0.00')" /> <xsl:value-of select="$nauda"/></td>
</tr></xsl:if>
<xsl:if test="summa!=0">
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"><xsl:value-of select="$field21"/> <xsl:value-of select="ilmakm" />%:</td>
<td width="100" align="right" class="Roboto10" height="10"><xsl:value-of select="format-number(summakm div 100,'0.00')" /> <xsl:value-of select="$nauda"/></td>
</tr>
</xsl:if>
</xsl:for-each>
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"><xsl:value-of select="$field24"/>:</td>
<td width="100" align="right" class="Roboto10" height="10"><xsl:value-of select="format-number(/documents/document/converted_tasuda div 100,'0.00')"/> <xsl:value-of select="$nauda"/></td>
</tr>
<xsl:if test="/documents/document/ettemaks > '0.00000001'">
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"><b><xsl:value-of select="$field26"/> (<xsl:value-of select="format-number((/documents/document/ettemaks div (/documents/document/converted_tasuda div 100) * 100), '00')"/>%):</b></td>
<td width="100" align="right" class="Roboto10" height="10"><b><xsl:value-of select="format-number(/documents/document/ettemaks,'0.00')"/> <xsl:value-of select="$nauda"/></b></td>
</tr>
</xsl:if>
<tr height="12">
<td width="360" class="Roboto10" height="10"></td>
<td width="220" class="Roboto10" height="10" align="right"><b><xsl:value-of select="$field25"/>:</b></td>
<td width="100" align="right" class="Roboto10" height="10"><b><xsl:value-of select="format-number(/documents/document/converted_tasuda div 100 - /documents/document/ettemaks,'0.00')"/> <xsl:value-of select="$nauda"/></b></td>
</tr>
<tr height="22">
<td width="660" colspan="4" valign="bottom" class="Roboto10" height="20">
<xsl:value-of select="$field27"/>: <span style="font-style: italic;"><xsl:value-of select="$field35" /></span>
</td>
</tr>
<!--<xsl:if test="(/documents/kmkoodid/kmkood[km=0]/summa>0) or (/documents/kmkoodid/kmkood[km=4]/summa>0)">
<tr>
<td width="660" colspan="3" class="Roboto10" height="10">
PVN tiek aprēķināts saskaņā ar likuma par PVN 7. panta 7. punktu
</td>
</tr>
</xsl:if>-->
<tr height="12">
<td width="660" colspan="3" class="Roboto10" height="10">
<xsl:value-of select="$field28"/>
</td>
</tr>
</table>
</div>
<table border="0" width="660">
<tr height="12">
<td width="50" class="Roboto10"> </td>
<td width="340" class="Roboto10"><xsl:value-of select="$field31"/>: <xsl:value-of select="/documents/document/myyja_andmed/nimi"/></td>
<td width="270" class="Roboto10"><xsl:value-of select="$field32"/>: _________________________</td>
</tr>
<tr>
<td width="50"> </td>
<td width="340"> </td>
<td width="270"> </td>
</tr>
<tr height="12">
<td width="50" class="Roboto10"> </td>
<td width="340" class="Roboto10"><xsl:value-of select="$field29"/> _________________</td>
<td width="270" class="Roboto10"><xsl:value-of select="$field29"/> _________________</td>
</tr>
<tr height="12">
<xsl:variable name="year1" select="substring(/documents/document/aeg_date,7,4)" />
<td width="50" class="Roboto10"> </td>
<td width="340" class="Roboto10"><xsl:value-of select="$field1"/>: <xsl:value-of select="documents/document/aeg_date"/></td>
<td width="270" class="Roboto10"><xsl:value-of select="$field1"/>: <xsl:value-of select="$year1"/>. gada ___ . __________</td>
</tr>
</table>
<div class="divsmall"></div>
<hr width="660"></hr>
<table width="660">
<tr>
<td class="FooterText" width="190"><xsl:value-of select="/documents/footer/firma_nimi"/></td>
<td class="FooterText" width="320"><xsl:value-of select="/documents/footer/firma_aadress"/> <xsl:value-of select="/documents/footer/firma_aadress2"/></td>
<td class="FooterText" width="150"><xsl:value-of select="/documents/footer/firma_iban"/></td>
</tr>
<tr>
<td class="FooterText" width="190"><xsl:value-of select="/documents/footer/firma_regnr"/></td>
<td class="FooterText" width="320"><xsl:value-of select="/documents/footer/firma_telefon"/></td>
<td class="FooterText" width="150"><xsl:value-of select="/documents/footer/firma_pank"/></td>
</tr>
<tr>
<td class="FooterText" width="190"><xsl:value-of select="/documents/footer/firma_kmnr"/></td>
<td class="FooterText" width="320"><xsl:value-of select="/documents/footer/firma_email"/></td>
<td class="FooterText" width="150"><xsl:value-of select="/documents/footer/firma_swift"/></td>
</tr>
</table>
</center>
</body>
</html>
</xsl:template>
<msxsl:script language="JScript" implements-prefix="js"><![CDATA[
var cipari=['','viens ','divi ','trīs ','četri ','pieci ','seši ','septiņi ','astoņi ','deviņi '];
var padsmiti=['desmit ','vienpadsmit ','divpadsmit ','trīspadsmit ','četrpadsmit ','piecpadsmit ','sešpadsmit ','septiņpadsmit ','astoņpadsmit ','deviņpadsmit '];
var desmiti=['','','divdesmit ','trīsdesmit ','četrdesmit ','piecdesmit ','sešdesmit ','septiņdesmit ','astoņdesmit ','deviņdesmit '];
function simti(str) {
res='';
// pirmais cipars no labaas
if (str.charAt(1)=='1') // chekojam pirmspeedeejo ciparu - ja viens tad vai nu desmit vai padsmit
res=padsmiti[parseInt(str.charAt(2))];
else res=cipari[parseInt(str.charAt(2))];
// otrais cipars no labaas
if (str.charAt(0)=='1') // ja treshais cipars no labaas ir 1 tad jaaraksta simts
res='simts '+desmiti[parseInt(str.charAt(1))]+res;
else if (str.charAt(0)!='0') // ja treshais cipars no labaas nav 1 vai 0 tad jaaraksta simti
res='simti '+desmiti[parseInt(str.charAt(1))]+res;
else // ja nav simtu
res=desmiti[parseInt(str.charAt(1))]+res;
// treshais cipars no labaas
res=cipari[parseInt(str.charAt(0))]+res;
return res;
}
function numText(skaitlis,nauda) {
fullStr='0000000000';
tempStr='';
tempRes='';
resStr='';
minus='';
punkts=skaitlis.indexOf('.');
if (punkts==-1) {
pirmspStr=skaitlis;
aizpStr='0';
} else {
pirmspStr=skaitlis.substring(0,punkts);
aizpStr='0'+skaitlis.substring(punkts);
}
if (pirmspStr.charAt(0)=='-') { // ja ar miinus ziimi
pirmspStr=pirmspStr.substring(1);
minus='mīnus ';
}
for (i=pirmspStr.length-1, j=9; i>=0; i--, j--) { // paarliekam uz fullstr, kas sastaav no desmit cipariem
fullStr=fullStr.substring(0,j) + pirmspStr.charAt(i) + fullStr.substring(j+1);
}
if (fullStr.length>10) fullStr=fullStr.substring(fullStr.length-10); // ja vairaak par 10 cipariem, tad trim
if (nauda=='LVL') {
if ((fullStr.charAt(9)=='1') && (fullStr.charAt(8)!='1')) resStr+='lats'; // lats vai lati
else if (parseInt(fullStr,10)!=0) resStr+='lati';
} else {
resStr+=nauda;
}
if (parseInt(fullStr.substring(7),10)>0) {
tempStr=fullStr.substring(7); // simti
tempRes=simti(tempStr);
resStr=tempRes+resStr;
}
if (parseInt(fullStr.substring(4,7),10)>0) {
tempStr=fullStr.substring(4,7); // tūkstoši
tempRes=simti(tempStr);
if ((tempStr.charAt(2)=='1') && (tempStr.charAt(1)!='1')) tempRes+='tūkstotis ';
else if (parseInt(tempStr,10)!=0) tempRes+='tūkstoši ';
resStr=tempRes+resStr;
}
if (parseInt(fullStr.substring(1,4),10)>0) {
tempStr=fullStr.substring(1,4); // miljoni
tempRes=simti(tempStr);
if ((tempStr.charAt(2)=='1') && (tempStr.charAt(1)!='1')) tempRes+='miljons ';
else if (parseInt(tempStr,10)!=0) tempRes+='miljoni ';
resStr=tempRes+resStr;
}
if (fullStr.charAt(0)!='0') { // miljardi
if (fullStr.charAt(0)=='1') resStr='viens miljards '+resStr;
else resStr=cipari[parseInt(fullStr.charAt(0),10)]+'miljardi '+resStr;
}
if (resStr!='') { // pirmais burts lielais
resStr=resStr.charAt(0).toUpperCase()+resStr.substring(1);
}
aizpStr=aizpStr+'0';
santimi=parseInt(aizpStr*100,10); //santimi
if (santimi>0) {
resStr+=' '+santimi;
if ((aizpStr.charAt(aizpStr.length-1)=='1') && (aizpStr.charAt(aizpStr.length-2)!='1')) {
if (nauda=='EUR' || nauda=='USD') { resStr+=' cents'; } else {resStr+=' santīms'; }
} else {
if (nauda=='EUR' || nauda=='USD') { resStr+=' centi'; } else {resStr+=' santīmi'; }
}
} else {
if (nauda=='EUR' || nauda=='USD') { resStr+=' 00 centi'; } else {resStr+=' 00 santīmi'; }
}
return (minus+resStr);
}
var cipariEng=['','one ','two ','three ','four ','five ','six ','seven ','eight ','nine '];
var padsmitiEng=['ten ','eleven ','twelve ','thirteen ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
var desmitiEng=['','','twenty ','thirty ','fourty ','fifty ','sixty ','seventy ','eighty ','ninety '];
function simtiEng(str) {
res='';
// pirmais cipars no labaas
if (str.charAt(1)=='1') // chekojam pirmspeedeejo ciparu - ja viens tad vai nu desmit vai padsmit
res=padsmitiEng[parseInt(str.charAt(2))];
else res=cipariEng[parseInt(str.charAt(2))];
// otrais cipars no labaas
if (str.charAt(0)=='1') // ja treshais cipars no labaas ir 1 tad jaaraksta simts
res='hundred '+desmitiEng[parseInt(str.charAt(1))]+res;
else if (str.charAt(0)!='0') // ja treshais cipars no labaas nav 1 vai 0 tad jaaraksta simti
res='hundred '+desmitiEng[parseInt(str.charAt(1))]+res;
else // ja nav simtu
res=desmitiEng[parseInt(str.charAt(1))]+res;
// treshais cipars no labaas
res=cipariEng[parseInt(str.charAt(0))]+res;
return res;
}
function numTextEng(skaitlis,nauda) {
fullStr='0000000000';
tempStr='';
tempRes='';
resStr='';
minus='';
punkts=skaitlis.indexOf('.');
if (punkts==-1) {
pirmspStr=skaitlis;
aizpStr='0';
} else {
pirmspStr=skaitlis.substring(0,punkts);
aizpStr=skaitlis.substring(punkts+1);
}
if (pirmspStr.charAt(0)=='-') { // ja ar miinus ziimi
pirmspStr=pirmspStr.substring(1);
minus='minus ';
}
for (i=pirmspStr.length-1, j=9; i>=0; i--, j--) { // paarliekam uz fullstr, kas sastaav no desmit cipariem
fullStr=fullStr.substring(0,j) + pirmspStr.charAt(i) + fullStr.substring(j+1);
}
if (fullStr.length>10) fullStr=fullStr.substring(fullStr.length-10); // ja vairaak par 10 cipariem, tad trim
if (nauda=='EUR') {
if (parseInt(fullStr,10)==1) resStr+='euro'; // lats vai lati
else if (parseInt(fullStr,10)!=0) resStr+='euros';
else resStr+='Null euros';
} else if (nauda=='LVL') {
if (parseInt(fullStr,10)==1) resStr+='lat'; // lats vai lati
else if (parseInt(fullStr,10)!=0) resStr+='lats';
else resStr+='Null euros';
} else if (parseInt(fullStr,10)!=0) {
resStr+=nauda;
} else resStr+='Null '+nauda;
if (parseInt(fullStr.substring(7),10)>0) {
tempStr=fullStr.substring(7); // simti
tempRes=simtiEng(tempStr);
resStr=tempRes+resStr;
}
if (parseInt(fullStr.substring(4,7),10)>0) {
tempStr=fullStr.substring(4,7); // tūkstoši
tempRes=simtiEng(tempStr);
if ((tempStr.charAt(2)=='1') && (tempStr.charAt(1)!='1')) tempRes+='thousand ';
else if (parseInt(tempStr,10)!=0) tempRes+='thousand ';
resStr=tempRes+resStr;
}
if (parseInt(fullStr.substring(1,4),10)>0) {
tempStr=fullStr.substring(1,4); // miljoni
tempRes=simtiEng(tempStr);
if ((tempStr.charAt(2)=='1') && (tempStr.charAt(1)!='1')) tempRes+='million ';
else if (parseInt(tempStr,10)!=0) tempRes+='million ';
resStr=tempRes+resStr;
}
if (fullStr.charAt(0)!='0') { // miljardi
if (fullStr.charAt(0)=='1') resStr='one billion '+resStr;
else resStr=cipariEng[parseInt(fullStr.charAt(0),10)]+'billion '+resStr;
}
if (resStr!='') { // pirmais burts lielais
resStr=resStr.charAt(0).toUpperCase()+resStr.substring(1);
}
santimi=parseInt(aizpStr,10); //santimi
if (santimi>0) {
resStr+=' '+santimi;
if (santimi==1) {
if (nauda=='EUR' || nauda=='USD') { resStr+=' cent'; } else {resStr+=' santim'; }
} else {
if (nauda=='EUR' || nauda=='USD') { resStr+=' cents'; } else {resStr+=' santims'; }
}
} else {
if (nauda=='EUR' || nauda=='USD') { resStr+=' 00 cents'; } else {resStr+=' 00 santims'; }
}
return (minus+resStr);
}
]]></msxsl:script>
</xsl:stylesheet>
lv/procedures.1603815666.txt.gz · Labota: 2020/10/27 18:21 , labojis marija