Šī 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="item_per_page">25</xsl:variable> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <title>Rekins</title> </head> <body class="body"> <xsl:variable name="disc"> <xsl:for-each select="/documents/document/rows/row[pross!='' or pross!='0']"> <xsl:value-of select="pross"/> </xsl:for-each> </xsl:variable> <style> .body2{ font-size: 12pt;} .body{ font-size: 8pt;} .bodywol{ font-size: 8pt;} .bodybold{ font-size: 8pt; font-weight:900; text-align: left;} .bodyboldt{ font-size: 8pt; border-bottom: 1px solid black;} </style> <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> <table width="660px" align="center" cellpadding="0" cellspacing="0"> <tr> <td> <table width="660px" cellpadding="0" cellspacing="0"> <tr> <td width="380" align="left" ><img alt="logo" height="70"><xsl:attribute name="src"><xsl:value-of select="/documents/footer/firma_logo"/></xsl:attribute></img></td> <td width="280" class="body2" valign="bottom">Rēķins/<font size="-2">Invoice</font>: <xsl:value-of select="/documents/document/number"/><br /> Datums/<font size="-2">Date</font>: <xsl:value-of select="concat(substring(/documents/document/aeg,1,2),'-',substring(/documents/document/aeg,4,2),'-',substring(/documents/document/aeg,7,4))"/><br /> Apmaksa/<font size="-2">Due date</font>: <xsl:value-of select="concat(substring(/documents/document/aeg2,1,2),'-',substring(/documents/document/aeg2,4,2),'-',substring(/documents/document/aeg2,7,4))"/><br /><br /> </td> </tr> <tr> <td style="border-bottom:1px solid black; height:1px;" colspan="2"> </td> </tr> <tr> <td colspan="2" style="border-bottom:1px solid black;"> <table width="660" cellpadding="0" cellspacing="0"> <tr> <td class="body" width="140">Piegādātājs/<font size="-2">Supplier</font></td> <td class="body" width="240"><xsl:value-of select="/documents/footer/firma_nimi"/></td> <td class="body" width="140">Banka/<font size="-2">Bank</font></td> <td class="body" width="140"><xsl:value-of select="/documents/footer/firma_pank"/></td> </tr> <tr> <td class="body">Juridiskā adrese/<font size="-2">Address</font></td> <td class="body"><xsl:value-of select="/documents/footer/firma_aadress"/></td> <td class="body">S.W.I.F.T</td> <td class="body"><xsl:value-of select="/documents/footer/firma_swift"/></td> </tr> <tr> <td class="body"><b> </b></td> <td class="body"><xsl:value-of select="/documents/footer/firma_aadress2"/></td> <td class="body">Konts/<font size="-2">Account</font></td> <td class="body"><xsl:value-of select="/documents/footer/firma_iban"/></td> </tr> <tr> <td class="body">Reģ. nr./<font size="-2">Reg.No.</font></td> <td class="body"><xsl:value-of select="/documents/footer/firma_regnr"/></td> <td class="body" width="140">Banka//<font size="-2">Bank</font></td> <td class="body" width="140"><xsl:value-of select="'Citadeles banka AS'"/></td> </tr> <tr> <td class="body">PVN Reģ. nr./<font size="-2">VAT</font></td> <td class="body"><xsl:value-of select="/documents/footer/firma_kmnr"/></td> <td class="body">S.W.I.F.T</td> <td class="body"><xsl:value-of select="'PARXLV22'"/></td> </tr> <tr> <td class="body"> </td> <td class="body"> </td> <td class="body">Konts/<font size="-2">Account</font></td> <td class="body"><xsl:value-of select="'LV91PARX0017238520001'"/></td> </tr> </table> </td> </tr> <tr> <td colspan="2" style="border-bottom:1px solid black; height:10px;"> </td> </tr> <tr> <td colspan="2" style="border-bottom:1px solid black;"> <table width="660" cellpadding="0" cellspacing="0"> <tr> <td class="body" width="140">Saņēmējs/<font size="-2">Client</font></td> <td class="body" width="240"><xsl:value-of select="/documents/kontakt/nimi"/></td> <td class="body" width="140">Banka//<font size="-2">Bank</font></td> <td class="body" width="140"><xsl:value-of select="/documents/kontakt/pangaandmed/nimi"/></td> </tr> <tr> <td class="body" >Juridiskā adrese/<font size="-2">Address</font></td> <td class="body"><xsl:value-of select="/documents/kontakt/aadress1"/></td> <td class="body">S.W.I.F.T</td> <td class="body"><xsl:value-of select="/documents/kontakt/pangaandmed/swift"/></td> </tr> <tr> <td class="body"><b> </b></td> <td class="body"><xsl:value-of select="/documents/kontakt/aadress2"/></td> <td class="body">Konts/<font size="-2">Account</font></td> <td class="body"><xsl:value-of select="/documents/kontakt/arveldusarve"/></td> </tr> <tr> <td class="body">Reģ. nr./<font size="-2">Reg.No.</font></td> <td class="body"><xsl:value-of select="/documents/kontakt/regnr"/></td> <td class="body"><b> </b></td> <td class="body"> </td> </tr> <tr> <td class="body">PVN Reģ. nr./<font size="-2">VAT</font></td> <td class="body"><xsl:value-of select="/documents/kontakt/kmregnr"/></td> <td class="body"><b> </b></td> <td class="body"> </td> </tr> <tr> <td colspan="4" style="border-bottom:0px solid black; height:10px;"> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" style="border-bottom:1px solid black; height:20px;"> </td> </tr> <tr> <td colspan="2"> <table width="660" cellpadding="0" cellspacing="0"> <tr> <td class="bodyboldt" height="20">Nosaukums<br /><font size="-2">Description</font></td> <td class="bodyboldt">Skaits<br /><font size="-2">Quantity</font></td> <td class="bodyboldt">Mērv.<br /><font size="-2">Unit</font></td> <td class="bodyboldt">Cena<br /><font size="-2">Price</font></td> <xsl:choose> <xsl:when test="$disc!=''"> <td class="bodyboldt">%</td> <td class="bodyboldt">Cena ar atl.<br /><font size="-2">Price with %</font></td> </xsl:when> </xsl:choose> <td class="bodyboldt" align="right">Summa<br /><font size="-2">Amount</font> </td> <td class="bodyboldt" align="right">PVN<br /><font size="-2">VAT</font> </td> </tr> <xsl:for-each select="/documents/document/rows/row"> <tr> <xsl:variable name="sum_check"><xsl:value-of select="format-number(hind_ale div 100,'0.00')"/></xsl:variable> <xsl:choose> <xsl:when test="$sum_check!='NaN'"> <td class="body" height="20"><xsl:value-of select="keelne_seletus"/></td> <td width="60" class="body"><xsl:value-of select="kogus"/></td> <td width="40" class="body"><xsl:value-of select="yhik"/></td> <td width="60" class="body"><xsl:value-of select="format-number(hind,'0.00')"/></td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body"><xsl:value-of select="pross"/></td> <td width="60" class="body"><xsl:value-of select="format-number(hind_ale div 100,'0.00')"/></td> </xsl:when> </xsl:choose> <td width="80" class="body" align="right"><xsl:value-of select="format-number(converted_summa div 100,'0.00')"/></td> <td width="40" class="body" align="right"><xsl:value-of select="format-number(kmkokku div 100,'0.00')"/></td> </xsl:when> <xsl:when test="$sum_check='NaN'"> <td class="body" height="20"><xsl:value-of select="keelne_seletus"/></td> <td width="40" class="body"> </td> <td width="60" class="body"> </td> <td width="60" class="body"> </td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body"> </td> <td width="60" class="body"> </td> </xsl:when> </xsl:choose> <td width="80" class="body" align="right"> </td> <td width="40" class="body" align="right"> </td> </xsl:when> </xsl:choose> </tr> </xsl:for-each> <xsl:for-each select="/documents/kmkoodid/kmkood"> <tr> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-top:1px solid black;"> </td> <td width="60" class="body" style="border-top:1px solid black;"> </td> </xsl:when> </xsl:choose> <td colspan="4" class="body" align="right" style="border-top:1px solid black;"> <xsl:choose> <xsl:when test="km='8'">PVN aprēķināts pie līguma noslēgšanas/<font size="-2">VAT paid by closing contract</font></xsl:when> <xsl:when test="km='11'">Ar PVN neapliekamā summa/<font size="-2">VAT free allowance</font></xsl:when> <xsl:when test="km='1' or km='0'">Ar PVN (<xsl:value-of select="ilmakm"/>%) apliekamā summa/<font size="-2">VAT (<xsl:value-of select="ilmakm"/>%) sum</font></xsl:when> <xsl:when test="km='10' or km='9'">VAT reverse charge</xsl:when> <xsl:otherwise>Ar PVN (<xsl:value-of select="ilmakm"/>%) apliekamā summa/<font size="-2">VAT (<xsl:value-of select="ilmakm"/>%) sum</font></xsl:otherwise> </xsl:choose> (<xsl:value-of select="/documents/document/valuuta"/>)</td> <td width="80" class="body" align="right" style="border-top:1px solid black;"><xsl:value-of select="format-number(summa div 100,'0.00')"/></td> <td width="40" class="body" style="border-top:1px solid black;"> </td> </tr> </xsl:for-each> <xsl:for-each select="/documents/kmkoodid/kmkood[summakm!='0']"> <tr> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body"> </td> <td width="60" class="body"> </td> </xsl:when> </xsl:choose> <td colspan="4" class="body" align="right"> Pievienotās vērtības nodoklis (<xsl:value-of select="ilmakm"/>%)/<font size="-2">VAT</font> (<xsl:value-of select="ilmakm"/>%) </td> <td width="80" class="body" align="right"><xsl:value-of select="format-number(summakm div 100,'0.00')"/></td> <td width="40" class="body"> </td> </tr> </xsl:for-each> <tr> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:1px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:1px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> <td colspan="4" class="body" align="right" style="border-bottom:1px solid black; height:20px;">Summa ar PVN/<font size="-2">Total with VAT</font> (<xsl:value-of select="/documents/document/valuuta"/>)</td> <td width="80" class="body" align="right" style="border-bottom:1px solid black; height:20px;"><xsl:value-of select="format-number(/documents/document/converted_tasuda div 100,'0.00')"/></td> <td width="40" class="body" style="border-bottom:1px solid black; height:20px;"> </td> </tr> <tr> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:0px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:0px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> <td colspan="4" class="body" align="right" style="border-bottom:0px solid black; height:20px;"><b>Summa apmaksai/<font size="-2">To Pay</font> (<xsl:value-of select="/documents/document/valuuta"/>)</b></td> <td width="80" class="body" align="right" style="border-bottom:0px solid black; height:20px;"><b><xsl:value-of select="format-number(/documents/document/converted_tasuda div 100,'0.00')"/></b></td> <td width="40" class="body"> </td> </tr> <!--<tr> <td colspan="6" class="body" align="left" style="border-bottom:0px solid black; height:20px;">Apmaksas termiņš:   <xsl:value-of select="concat(substring(/documents/document/aeg2,1,2),'-',substring(/documents/document/aeg2,4,2),'-',substring(/documents/document/aeg2,7,4))"/></td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:0px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:0px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> </tr> <tr> <td colspan="6" class="body" align="left" style="border-bottom:0px solid black; height:20px;">Summa vārdiem: <xsl:value-of select="js:numText(string(format-number(/documents/document/converted_tasuda div 100, '0.00')),string($nauda))" /></td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:0px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:0px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> </tr>--> <tr> <td colspan="6" class="body" align="left" style="border-bottom:0px solid black; height:20px;">Pusēm vienojoties, rēķins sagatavots elektroniski un derīgs bez paraksta</td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:0px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:0px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> </tr> <tr> <td colspan="6" class="body" align="left" style="border-bottom:0px solid black; height:20px;">As agreed by parties, invoices ar issued electronically and valid without signature</td> <xsl:choose> <xsl:when test="$disc!=''"> <td width="40" class="body" style="border-bottom:0px solid black; height:20px;"> </td> <td width="60" class="body" style="border-bottom:0px solid black; height:20px;"> </td> </xsl:when> </xsl:choose> </tr> </table> </td> </tr> </table> </td> </tr> </table> </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=skaitlis.substring(punkts+1); } 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 (parseInt(fullStr,10)!=0) { resStr+=nauda; } else resStr+='Nulle '+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); } santimi=parseInt(aizpStr,10); //santimi if (santimi>0) { resStr+=' '+santimi; tmpSant=santimi.toString(); if ((tmpSant.charAt(tmpSant.length-1)=='1') && (tmpSant.charAt(tmpSant.length-2)!='1')) { resStr+=' cents'; } else { resStr+=' centi'; } } else { resStr+=' 00 centi'; } return (minus+resStr); document.getElementById('teksts').innerHTML=minus+resStr; }]]> </msxsl:script> </xsl:stylesheet>