a.binder před 8 roky
rodič
revize
0e749d26df

+ 193 - 10
SE/schema/default_db_xml_cache.public/default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_tree_to_dita.xsl

@@ -55,6 +55,22 @@
             </xsl:otherwise>
         </xsl:choose>
     </xsl:function> 
+    
+    <xsl:function name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key">
+        <xsl:param name="nazwisko"/>
+        <xsl:param name="imiona"/>
+        <xsl:param name="pesel"/>
+        <xsl:param name="nip"/>
+        <xsl:variable name="group_name" select="'MSIG_person'"/>
+        <xsl:choose>
+            <xsl:when test="$pesel">
+                <xsl:value-of select="concat($group_name,'_',$pesel)"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:value-of select="concat($group_name,'_',$imiona,'_',$nazwisko,'_',$nip)"/>
+            </xsl:otherwise>
+        </xsl:choose>
+    </xsl:function>
    
     <xsl:function name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_ENERGA_PRACOWNICY.key">
         <xsl:param name="ID"/>
@@ -77,6 +93,11 @@
         <xsl:value-of select="concat($group_name,'_',$ID)"/>
     </xsl:function>
     
+    <xsl:function name="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key">
+        <xsl:param name="krs"/>
+        <xsl:variable name="group_name" select="'MSIG'"/>
+        <xsl:value-of select="concat($group_name,'_',$krs)"/>
+    </xsl:function>
     
     <xsl:template match="RelatedFeatureRoot" mode="preprocess_root_BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA">
         <xsl:message>#37 template match="RelatedFeatureRoot" mode="preprocess_root_BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA"</xsl:message>
@@ -473,8 +494,6 @@
                             </xsl:for-each>
                         </topichead>
                     </xsl:for-each>
-                    
-                    
                 </topichead>
                 
                 
@@ -549,7 +568,6 @@
                 </topichead>-->
                 
                 <topichead navtitle="Powiązania do kontrahentów z KRS ogólnie (podział na źródła)">
-                    
                     <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs_uniq">
                         <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs_uniq>
                             <xsl:for-each select="$sources/sources/source">
@@ -606,9 +624,84 @@
                     </xsl:for-each>
                 </topichead>
                 
+                <topichead navtitle="Powiązania do kontrahentów z MSIG (podział na źródła)">
+                    
+                    <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed">
+                        <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source= current()]/object/BI_audit_MSIG" >
+                                    <person>
+                                        <xsl:attribute name="key" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs)"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </person>
+                                </xsl:for-each>
+                            </xsl:for-each>
+                        </BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed>
+                    </xsl:variable>
+                    
+                    <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq">
+                        <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each-group select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@source=$source]" group-by="@key">
+                                    <person>
+                                        <xsl:attribute name="key" select="@key"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </person>
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq>
+                    </xsl:variable>
+                    
+                    <xsl:for-each select="$sources/sources/source">
+                        <xsl:variable name="source" select="."/>
+                        <xsl:message>#MSIG_286_F Powiązania do person z KRS ogólnie (podział na źródła) = <xsl:value-of select="."/></xsl:message>
+                        <topichead navtitle="żródło:{.}  Powiązania do firm z MSIG ogólnie">
+                            <xsl:for-each select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq//person[@source=$source]">
+                                
+                                <xsl:for-each-group select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source= $source]/object/BI_audit_MSIG[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs) = current()/@key ]"  group-by=" system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs)">
+                                    <xsl:variable name="group_name" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs)"/>
+                                    <!--<topichead navtitle="{object[position() = last()]/*/concat(Pelna_nazwa_kontrahenta,' ',Miejscowosc,' ',NIP)} powiązań ({ count( current-group())}) ">-->
+                                    
+                                    <!--<xsl:choose>
+                                        <xsl:when test="//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/object[ position() = last()]/BI_audit_ENERGA_RUM_KONTRAHENCI/ID=$BI_audit_ENERGA_RUM_KONTRAHENCI.ID">-->
+                                    <xsl:message>#MSIG_533_F counting ile person <xsl:value-of select="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@key = $group_name])"/></xsl:message>
+                                    <xsl:choose> <!-- testowanie czy jest w roznych zrodlach ten sam pesel -->
+                                        <xsl:when test="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@key = $group_name]) &gt; 1">
+                                            <!-- pierwszy vs obecny _row powiazania z danym PESEL-->
+                                            <xsl:variable name="min" select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ object/BI_audit_MSIG[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs) = $group_name ]][1]/@pos"/>
+                                            <xsl:variable name="curr" select="../.././@pos"/>
+                                            <xsl:message>#MSIG_538_F pozycja $min = <xsl:value-of select="$min"/> ; curr = <xsl:value-of select="$curr"/> $group_name = <xsl:value-of select="$group_name"/> ; position()=<xsl:value-of select="position()"/> </xsl:message>
+                                            <xsl:choose>
+                                                <xsl:when test="$curr = $min and position() = 1">
+                                                    <xsl:message>#MSIG_547_F - generating first occurence of <xsl:value-of select="$group_name"/></xsl:message>
+                                                    <xsl:comment>#MSIG_538_F pos <xsl:value-of select="$curr"/></xsl:comment>
+                                                    <!--<xsl:copy-of select="../../."/>-->
+                                                    <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs" select="." >
+                                                        <xsl:with-param name="group_name" select="$group_name"/>
+                                                    </xsl:apply-templates>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
+                                                    <topicref href="{$group_name}/{$refpos}.dita"/>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <xsl:message>#MSIG_522_F otherwise</xsl:message>
+                                            <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs" select="." >
+                                                <xsl:with-param name="group_name" select="$group_name"/>
+                                            </xsl:apply-templates>
+                                        </xsl:otherwise>
+                                    </xsl:choose> 
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </topichead>
+                    </xsl:for-each>
+                </topichead>  
                 
-                
-                <topichead navtitle="Powiązania do osób (podział na źródła)">
+                <topichead navtitle="Powiązania do osób z KRS (podział na źródła)">
                     
                     <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed">
                         <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed>
@@ -686,6 +779,83 @@
                 </topichead>
                 
                 
+                <topichead navtitle="Powiązania do osób z MSIG (podział na źródła)">
+                    
+                    <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed">
+                        <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source= current()]/object/BI_audit_MSIG_person" >
+                                    <person>
+                                        <xsl:attribute name="key" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'')"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </person>
+                                </xsl:for-each>
+                            </xsl:for-each>
+                        </BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed>
+                    </xsl:variable>
+                    
+                    <xsl:variable name="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq">
+                        <BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq>
+                            <xsl:for-each select="$sources/sources/source">
+                                <xsl:variable name="source" select="."/>
+                                <xsl:for-each-group select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@source=$source]" group-by="@key">
+                                    <person>
+                                        <xsl:attribute name="key" select="@key"/>
+                                        <xsl:attribute name="source" select="$source"/>
+                                    </person>
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq>
+                    </xsl:variable>
+                    
+                    <xsl:for-each select="$sources/sources/source">
+                        <xsl:variable name="source" select="."/>
+                        <xsl:message>#MSIG_286 Powiązania do person z KRS ogólnie (podział na źródła) = <xsl:value-of select="."/></xsl:message>
+                        <topichead navtitle="żródło:{.}  Powiązania do osób z MSIG ogólnie">
+                            <xsl:for-each select="$BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_uniq//person[@source=$source]">
+                                
+                                <xsl:for-each-group select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[object[position() = 1]/*/source= $source]/object/BI_audit_MSIG_person[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'') = current()/@key ]"  group-by=" system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'')">
+                                    <xsl:variable name="group_name" select="system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'')"/>
+                                    <!--<topichead navtitle="{object[position() = last()]/*/concat(Pelna_nazwa_kontrahenta,' ',Miejscowosc,' ',NIP)} powiązań ({ count( current-group())}) ">-->
+                                    
+                                    <!--<xsl:choose>
+                                        <xsl:when test="//BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_old/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row/object[ position() = last()]/BI_audit_ENERGA_RUM_KONTRAHENCI/ID=$BI_audit_ENERGA_RUM_KONTRAHENCI.ID">-->
+                                    <xsl:message>#MSIG_533 counting ile person <xsl:value-of select="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@key = $group_name])"/></xsl:message>
+                                    <xsl:choose> <!-- testowanie czy jest w roznych zrodlach ten sam pesel -->
+                                        <xsl:when test="count($BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person_fixed//person[@key = $group_name]) &gt; 1">
+                                            <!-- pierwszy vs obecny _row powiazania z danym PESEL-->
+                                            <xsl:variable name="min" select="$interested_row/interested_row/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_row[ object/BI_audit_MSIG_person[ system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'') = $group_name ]][1]/@pos"/>
+                                            <xsl:variable name="curr" select="../.././@pos"/>
+                                            <xsl:message>#MSIG_538 pozycja $min = <xsl:value-of select="$min"/> ; curr = <xsl:value-of select="$curr"/> $group_name = <xsl:value-of select="$group_name"/> ; position()=<xsl:value-of select="position()"/> </xsl:message>
+                                            <xsl:choose>
+                                                <xsl:when test="$curr = $min and position() = 1">
+                                                    <xsl:message>#MSIG_547 - generating first occurence of <xsl:value-of select="$group_name"/></xsl:message>
+                                                    <xsl:comment>#MSIG_538 pos <xsl:value-of select="$curr"/></xsl:comment>
+                                                    <!--<xsl:copy-of select="../../."/>-->
+                                                    <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person" select="." >
+                                                        <xsl:with-param name="group_name" select="$group_name"/>
+                                                    </xsl:apply-templates>
+                                                </xsl:when>
+                                                <xsl:otherwise>
+                                                    <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
+                                                    <topicref href="{$group_name}/{$refpos}.dita"/>
+                                                </xsl:otherwise>
+                                            </xsl:choose>
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <xsl:message>#MSIG_522 otherwise</xsl:message>
+                                            <xsl:apply-templates mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person" select="." >
+                                                <xsl:with-param name="group_name" select="$group_name"/>
+                                            </xsl:apply-templates>
+                                        </xsl:otherwise>
+                                    </xsl:choose> 
+                                </xsl:for-each-group>
+                            </xsl:for-each>
+                        </topichead>
+                    </xsl:for-each>
+                </topichead>
+                
                 <!--<topichead navtitle="Do wykonania - błędne numery NIP w kontrahentach wskazujące na spółkę ENERGII!"></topichead>-->
                 
                 
@@ -1061,7 +1231,7 @@
                     <title>Analiza podpisywanych umow w RUM [] - Osoby merytoryczne (1). </title>
                     <xsl:message>#1106 Analiza podpisywanych umow w RUM - Osoby merytoryczne. </xsl:message>
                     <body>
-                        <simpletable frame="all"  id="simpgletablesss_inaaz_fwf_{generate-id()}" system_cache__dita:width_cols="auto"  > <!-- system_cache__dita:width_cols="10" system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true" -->
+                        <simpletable frame="all"  id="simpgletablesss_inaaz_fwf_{generate-id()}" system_cache__dita:width_cols="auto"  system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true"> <!-- system_cache__dita:width_cols="10" system_cache__dita:bypass_rows_with_zero="true" system_cache__dita:bypass_rows_empty="true" -->
                             
                             <sthead>
                                 <stentry>Osoba</stentry>
@@ -1229,7 +1399,7 @@
     
     
     
-    <xsl:template match="BI_audit_KRS_person" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person">
+    <xsl:template match="BI_audit_KRS_person|BI_audit_MSIG_person|BI_audit_MSIG" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_person">
         <xsl:param name="group_name" required="yes"/>
         <xsl:variable name="refpos" select="concat($group_name,'_', position())"/>
         <xsl:variable name="position" select="position()"/>
@@ -1285,8 +1455,6 @@
                 </topic>
             </xsl:result-document>
         </topicref>
-        
-        
     </xsl:template>
     
     
@@ -1415,6 +1583,12 @@
                             KRS:  <xsl:value-of select="../../object[ position() = last()]/*[ position() = 1]/concat(nazwa,' ',S_miejscowosc, ' ',nip)"/>
                         </xref>
                     </xsl:when>
+                    <xsl:when test="object[ position() = last()]/BI_audit_MSIG">
+                        <xsl:variable name="krs" select="../../object[ position() = last()]/*[ position() = 1]/krs"/>
+                        <xref href="../{system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key($krs)}/{$krs}_1.dita">
+                            MSIG:  <xsl:value-of select="../../object[ position() = last()]/*[ position() = 1]/concat(nazwa,' ',S_miejscowosc, ' ',nip)"/>
+                        </xref>
+                    </xsl:when>
                     <xsl:when test="object[ position() = last()]/BI_audit_KRS_company">
                         KRS:  <xsl:value-of select="../../object[ position() = last()]/*[ position() = 1]/concat(nazwa,' ',S_miejscowosc, ' ',nip)"/>
                     </xsl:when>
@@ -1430,7 +1604,7 @@
     </xsl:template>
     
     
-    <xsl:template match="BI_audit_KRS" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs">
+    <xsl:template match="BI_audit_KRS|BI_audit_MSIG" mode="BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA_krs">
         <xsl:param name="group_name" required="yes"/>
         <xsl:variable name="refpos" select="concat(krs,'_', position())"/>
         <xsl:variable name="position" select="position()"/>
@@ -2350,12 +2524,21 @@
                                                                         <xsl:when test="BI_audit_KRS_person">
                                                                             <xref href="../{BI_audit_KRS_person/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_KRS_person.key(nazwisko,imiona,pesel,'')}/{BI_audit_KRS_person/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_KRS_person.key(nazwisko,imiona,pesel,'')}_1.dita"/>
                                                                         </xsl:when>
+                                                                        <xsl:when test="BI_audit_MSIG_person">
+                                                                            <xref href="../{BI_audit_MSIG_person/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'')}/{BI_audit_MSIG_person/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG_person.key(nazwisko,imiona,pesel,'')}_1.dita"/>
+                                                                        </xsl:when>
                                                                         <xsl:when test="BI_audit_KRS">
                                                                             <xref href="../KRSY_{BI_audit_KRS/krs}/{BI_audit_KRS/krs}_1.dita">
                                                                                 <xsl:value-of select="BI_audit_KRS/nazwa"/><xsl:text> </xsl:text>
                                                                                 <xsl:value-of select="BI_audit_KRS/S_miejscowosc"/><xsl:text> </xsl:text>
                                                                             </xref>
                                                                         </xsl:when>
+                                                                        <xsl:when test="BI_audit_MSIG">
+                                                                            <xref href="../{BI_audit_MSIG/system_cache__dita:BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA.BI_audit_MSIG.key(krs)}/{BI_audit_MSIG/krs}_1.dita">
+                                                                                <xsl:value-of select="BI_audit_MSIG/nazwa"/><xsl:text> </xsl:text>
+                                                                                <xsl:value-of select="BI_audit_MSIG/S_miejscowosc"/><xsl:text> </xsl:text>
+                                                                            </xref>
+                                                                        </xsl:when>
                                                                         <xsl:otherwise>
                                                                             <xsl:for-each select="*/*">
                                                                                 <xsl:if test="text() and not(name()='A_STATUS') and not(name()='A_ADM_COMPANY') and not(name()='A_CLASSIFIED') and not(name()='cached') and not(name()='TERYT_SYM') and not(name()='TERYT_SYM_UL') ">

+ 17 - 13
SE/schema/default_db_xml_cache.public/default_db/Benford.xsl

@@ -278,20 +278,24 @@
             <xsl:when test="$Benford:force_raport">
                 <topic id="{$id}" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd">
-                    <title>Nie wykryto anomalii Benford dla <xsl:value-of select="@Benford:subject"/> w <xsl:value-of select="@Benford:year"/> dla liczby <xsl:value-of select="@Benford:digit"/>   liczone dla <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value])"/> pozycji.
+                    <title>
+                        bez anomalii Benford dla <xsl:value-of select="@Benford:subject"/> w <xsl:value-of select="@Benford:year"/>, liczone dla <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value])"/> poz.
                         <!--Wartość: <xsl:value-of select="sum($Benford:subject.xml [ node()[name()=$Benford:subject] = $Benford:table_analys_exceed/@Benford:subject and substring(node()[name()=$Benford:subject.value],1,1)=$Benford:table_analys_exceed/@Benford:digit and  node()[name()=$Benford:year]=$Benford:table_analys_exceed/@Benford:year  ]/node()[name()=$Benford:subject.value])"/>-->
-                        Wartość: <xsl:value-of select="sum($Benford:subject.xml[substring(node()[name()=$Benford:subject.value],1,1)=$Benford:table_analys_exceed/@Benford:digit ] /node()[name()=$Benford:subject.value]) div 1000000"/> [mln]
-                        
+                        Wartość: <xsl:value-of select="system_cache__dita:big_values_format(sum($Benford:subject.xml/node()[name()=$Benford:subject.value]))"/> 
                     </title>
                     <body>
                         
                         
                         <p>
-                            <xsl:value-of select="round(sum($Benford:subject.xml/node()[name()=$Benford:subject.value]) div 1000)"/> [tys] - ogólna wartość transakcji 
-                            
-                        </p>
-                        <p>
-                            <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value]) "/> -  ogólna ilość transakcji 
+                          <sup>
+                            <ph>
+                                <xsl:value-of select="system_cache__dita:big_values_format(sum($Benford:subject.xml/node()[name()=$Benford:subject.value]) )"/> - ogólna wartość transakcji 
+                            </ph>
+                        
+                            <ph>
+                            <xsl:value-of select="count($Benford:subject.xml/node()[name()=$Benford:subject.value]) "/> -  ogólna ilość transakcji
+                            </ph>
+                           </sup>
                         </p>
                         
                         
@@ -330,11 +334,11 @@
                                     <xsl:variable name="current" select="current()"/>
                                     <stentry>
                                         <!--<xsl:value-of select="current()/node()[name()='default_db:Numer_rejestrowy']"/>-->
-                                        <xsl:for-each select=" tokenize($Benford:subject.description,' ')">
-                                            <xsl:variable name="nname" select="."/>
-                                            <!--<xsl:comment>#171 checking for name '<xsl:value-of select="$nname"/>'</xsl:comment>-->
-                                            <p><xsl:value-of select="$nname"/>: <xsl:value-of select="$current//node()[name()=$nname]"/></p>
-                                        </xsl:for-each>
+                                            <xsl:for-each select=" tokenize($Benford:subject.description,' ')">
+                                                <xsl:variable name="nname" select="."/>
+                                                <!--<xsl:comment>#171 checking for name '<xsl:value-of select="$nname"/>'</xsl:comment>-->
+                                                <p><xsl:value-of select="$nname"/>: <xsl:value-of select="$current//node()[name()=$nname]"/></p>
+                                            </xsl:for-each>
                                     </stentry>
                                     <stentry><xsl:value-of select="current()/node()[name()=$Benford:year]"/></stentry>
                                     <stentry><xsl:value-of select="system_cache__dita:big_values_format(current()/node()[name()=$Benford:subject.value])"/></stentry>

+ 63 - 9
SE/schema/default_db_xml_cache.public/default_db/tree_to_dita.xsl

@@ -125,6 +125,7 @@
     <!--<xsl:import href="../dita_enter_to_ph.xsl"/>-->
     <xsl:include href="../default_db/enter_to_ph.xsl"/>
     <xsl:include href="../truncate_special_and_do_uppercase.xsl"/>
+    <xsl:include href="big_values_format.xsl"/>
     
     <xsl:include href="extract_text.xsl"/>
     <xsl:include href="images/images.xsl"/>
@@ -458,10 +459,16 @@
         <xsl:param name="header_cols" required="yes"/>
         <xsl:param name="max_strings" required="yes"/>
         <xsl:param name="system_cache__dita:header_cols.relcolwidth"/> <!-- to be set from attribute optionaly -->
+        <xsl:param name="position" required="yes"/>
+        <xsl:param name="add_to_once" required="yes"/>
+        <xsl:param name="start_col" required="yes"/>
+        <xsl:param name="simpletable" required="yes"/>
+        <xsl:param name="width_cols" required="yes"/>
         <xsl:message>#372 @id=<xsl:value-of select=".././@id"/> @system_cache__dita:header_cols.relcolwidth run. $cols_count=<xsl:value-of select="$cols_count"/>; $header_cols=<xsl:value-of select="$header_cols"/>;</xsl:message>
         <xsl:attribute name="relcolwidth">
             <!--<xsl:value-of select="concat($cols_count,'_',.)"/>-->
-            <xsl:for-each select="1 to $cols_count">
+            
+            <xsl:for-each select="1 to $header_cols"><!-- naglowki -->
                 <xsl:choose>
                     <xsl:when test=" current() &lt;= $header_cols and $system_cache__dita:header_cols.relcolwidth">
                         <xsl:value-of select="$system_cache__dita:header_cols.relcolwidth"/><xsl:text> </xsl:text>
@@ -475,6 +482,37 @@
                     </xsl:otherwise>
                 </xsl:choose>
             </xsl:for-each>
+            <xsl:for-each select="$start_col + $header_cols + xs:integer($add_to_once) to $start_col + $header_cols + $width_cols + xs:integer($add_to_once)">
+                <xsl:if test="$simpletable/sthead/stentry[ position() = current()]">
+                    <xsl:choose>
+                        <xsl:when test=" current() &lt;= $header_cols and $system_cache__dita:header_cols.relcolwidth">
+                            <xsl:value-of select="$system_cache__dita:header_cols.relcolwidth"/><xsl:text> </xsl:text>
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:value-of select="concat(ceiling($max_strings//stentry[@pos = current()]/@max.string.ph.len.max),'*')"/>
+                            <xsl:choose>
+                                <xsl:when test="current() = $cols_count"></xsl:when>
+                                <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:if>
+            </xsl:for-each>
+            
+            <!--<xsl:for-each select="1 to $cols_count">
+                <xsl:choose>
+                    <xsl:when test=" current() &lt;= $header_cols and $system_cache__dita:header_cols.relcolwidth">
+                        <xsl:value-of select="$system_cache__dita:header_cols.relcolwidth"/><xsl:text> </xsl:text>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:value-of select="concat(ceiling($max_strings//stentry[@pos = current()]/@max.string.ph.len.max),'*')"/>
+                        <xsl:choose>
+                            <xsl:when test="current() = $cols_count"></xsl:when>
+                            <xsl:otherwise><xsl:text> </xsl:text></xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>-->
         </xsl:attribute>
     </xsl:template>
 
@@ -482,11 +520,24 @@
         <xsl:param name="cols_count" required="yes"/>
         <xsl:param name="header_cols" required="yes"/>
         <xsl:param name="max_strings" required="yes"/>
+        
+        <xsl:param name="position" required="yes"/>
+        <xsl:param name="add_to_once" required="yes"/>
+        <xsl:param name="start_col" required="yes"/>
+        <xsl:param name="simpletable" required="yes"/>
+        <xsl:param name="width_cols" required="yes"/>
         <xsl:call-template name="system_cache__dita:header_cols.relcolwidth">
+            <xsl:with-param name="system_cache__dita:header_cols.relcolwidth" select="@system_cache__dita:header_cols.relcolwidth"/>
             <xsl:with-param name="max_strings" select="$max_strings"/>
             <xsl:with-param name="header_cols" select="$header_cols"/>
             <xsl:with-param name="cols_count" select="$cols_count"/>
-            <xsl:with-param name="system_cache__dita:header_cols.relcolwidth" select="@system_cache__dita:header_cols.relcolwidth"/>
+            
+            <xsl:with-param name="position" select="$position"/>
+            <xsl:with-param name="add_to_once" select="$add_to_once"/>
+            <xsl:with-param name="start_col" select="$start_col"/>
+            <xsl:with-param name="simpletable" select="$simpletable"/>
+            <xsl:with-param name="width_cols" select="$width_cols"/>
+            
         </xsl:call-template>
     </xsl:template>
     
@@ -551,6 +602,11 @@
                         <xsl:with-param name="max_strings" select="$max_strings"/>
                         <xsl:with-param name="cols_count" select="$cols_count" />
                         <xsl:with-param name="header_cols" select="$header_cols"/>
+                        <xsl:with-param name="position" select="$position"/>
+                        <xsl:with-param name="add_to_once" select="$add_to_once"/>
+                        <xsl:with-param name="start_col" select="$start_col"/>
+                        <xsl:with-param name="simpletable" select="$simpletable"/>
+                        <xsl:with-param name="width_cols" select="$width_cols"/>
                     </xsl:call-template>
                 </xsl:if>
                 <xsl:if test="$start_row = 1">
@@ -600,14 +656,14 @@
                             <!--<xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty">
                                 <xsl:message terminate="yes">#598 @system_cache__dita:bypass_rows_empty for <xsl:value-of select="@id"/> ;</xsl:message>
                             </xsl:when>-->
-                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and $simpletable/@system_cache__dita:bypass_rows_with_zero and $strow_test//stentry[ position() &gt; $header_cols and ( text() and not( number(text())=0)  )]">
+                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and $simpletable/@system_cache__dita:bypass_rows_with_zero and $strow_test//stentry[ position() &gt; $header_cols and ( text() and not( number(text())=0) and not( text()='0.0' ) )]">
                                 <xsl:comment>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:comment>
                                 <xsl:message>#549c not ignored @system_cache__dita:bypass_rows_empty and @system_cache__dita:bypass_rows_with_zero </xsl:message>
                                 <xsl:copy-of select="$strow_test"/>
                             </xsl:when>
-                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero and not($simpletable/@system_cache__dita:bypass_rows_empty) and $strow_test//stentry[ position() &gt; $header_cols and  not( number(text())=0 )  ]">
+                            <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_with_zero and not($simpletable/@system_cache__dita:bypass_rows_empty) and $strow_test//stentry[ position() &gt; $header_cols and  not( number(text())=0 ) and not( text()='0.0') ]">
                                 <xsl:comment>#549a not ignored @system_cache__dita:bypass_rows_with_zero  </xsl:comment>
-                                <xsl:message>#549a not ignored @system_cache__dita:bypass_rows_with_zero <xsl:value-of select="$strow_test//stentry[ position() &gt; $header_cols and not( text()='0')]"/> </xsl:message>
+                                <xsl:message>#549a not ignored @system_cache__dita:bypass_rows_with_zero <xsl:value-of select="$strow_test//stentry[ position() &gt; $header_cols and not( text()='0') and not( text()='0.0')]"/> </xsl:message>
                                 <xsl:copy-of select="$strow_test"/>
                             </xsl:when>
                             <xsl:when test="$simpletable/@system_cache__dita:bypass_rows_empty and not($simpletable/@system_cache__dita:bypass_rows_with_zero ) and $strow_test//stentry[ position() &gt; $header_cols and  text() ]">
@@ -866,7 +922,7 @@
     </xsl:function>
     
     
-    <xsl:function name="system_cache__dita:big_values_format">
+    <!--<xsl:function name="system_cache__dita:big_values_format">
         <xsl:param name="value"/>
         <xsl:choose>
             <xsl:when test="$value &lt; 1000">
@@ -879,9 +935,7 @@
                 <xsl:value-of select='format-number($value div 100000, "#.0")'/> m
             </xsl:otherwise>
         </xsl:choose>
-        
-        
-    </xsl:function>
+    </xsl:function>-->
     
     
 </xsl:stylesheet>

+ 20 - 4
SE/schema/default_db_xml_cache.public/xlsx.xsl

@@ -118,10 +118,19 @@
         <xsl:param name="name"/>
         <xsl:param name="document-uri" select="document-uri(/)"/>
         
-        <xsl:comment>#102 worksheet <xsl:value-of select="$document-uri"/>;</xsl:comment>
         
-        <xsl:variable name="sheet_id" select="replace(replace(substring-after(document-uri(/),'/worksheets/'),'.xml',''),'sheet','')"/>
-        <xsl:variable name="sheet_name" select="$Types__x3A__xlsx:docs/workbook/sheets/sheet[@sheetId = $sheet_id ]/@name"  xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" />
+        
+        <!--<xsl:variable name="sheet_id" select="replace(replace(substring-after(document-uri(/),'/worksheets/'),'.xml',''),'sheet','')"/>-->
+        <xsl:variable name="document-uri-after" select="substring-after( document-uri(/),'worksheets/')"/>
+        
+        <xsl:variable name="sheet_id" select="$Types__x3A__xlsx:docs/Relationships/Relationship[ contains(@Target,concat('/',$document-uri-after))]/@Id" xpath-default-namespace="http://schemas.openxmlformats.org/package/2006/relationships"/>
+        
+        <xsl:variable name="sheet_name" select="$Types__x3A__xlsx:docs/workbook/sheets/sheet[@r:id = $sheet_id ]/@name"  xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main" />
+        
+        <xsl:comment>#102 worksheet=<xsl:value-of select="$document-uri"/>; $document-uri-after=<xsl:value-of select="$document-uri-after"/>; $sheet_id=<xsl:value-of select="$sheet_id"/>;</xsl:comment>
+        <!--<DEBUG.131>
+            <xsl:copy-of select="$Types__x3A__xlsx:docs/Relationships" xpath-default-namespace="http://schemas.openxmlformats.org/package/2006/relationships"/>
+        </DEBUG.131>-->
         
        <!-- <xsl:choose>
             <xsl:when test=" substring-after( document-uri(/),'worksheets/')=concat('sheet',$sheetId,'.xml')">-->
@@ -146,10 +155,17 @@
         <sheetData>
             <xsl:attribute name="sheet_name" select="$sheet_name"/>
             <xsl:attribute name="document-uri" select="substring-after( document-uri(/),'worksheets/')"/>
+            <xsl:attribute name="sheetId" select="@sheetId"/>
+            <xsl:attribute name="r:id" select="@r:id"/>
            <xsl:apply-templates mode="Types__x3A__xlsx:sheetData"/>
         </sheetData>
     </xsl:template>
     
+    <!--<xsl:template match="row[ count(c) &lt; 2 and position() = 1]" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
+        <xsl:comment>#154 bypassed by row[ count(c) &lt; 2] - todo unknown structure</xsl:comment>
+        <xsl:message>#154  TODO WARNING bypassed by row[ count(c) &lt; 2] - todo unknown structure</xsl:message>
+    </xsl:template>-->
+    
     <xsl:template match="row" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
         <row>
             <xsl:copy-of select="@r"/>
@@ -158,7 +174,7 @@
     </xsl:template>
     
     <xsl:template match="c[@t='s']" mode="Types__x3A__xlsx:sheetData" xpath-default-namespace="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
-        <xsl:variable name="v" select="v/text()"/>
+        <xsl:variable name="v" select="number(v/text())"/>
         <xsl:variable name="r" select="@r"/>
         <c><xsl:copy-of select="@*"/>
             <xsl:attribute name="v_deb_nr" select="$v"/>

+ 16 - 16
SE/stuff/dita-ot-2.3.3/plugins/org.dita.pdf2/cfg/fo/attrs/commons-attr.xsl

@@ -110,7 +110,7 @@ See the accompanying license.txt file for applicable licenses.
     <xsl:attribute-set name="topic.title" use-attribute-sets="common.title common.border__bottom">
     <xsl:attribute name="border-after-width">3pt</xsl:attribute>
         <xsl:attribute name="space-before">0pt</xsl:attribute>
-        <xsl:attribute name="space-after">10.8pt</xsl:attribute>
+        <xsl:attribute name="space-after">5.8pt</xsl:attribute>
         <xsl:attribute name="font-size">10pt</xsl:attribute>
         <xsl:attribute name="font-weight">bold</xsl:attribute>
         <xsl:attribute name="padding-top">10.8pt</xsl:attribute>
@@ -125,7 +125,7 @@ See the accompanying license.txt file for applicable licenses.
     </xsl:attribute-set>
 
     <xsl:attribute-set name="topic.topic.title" use-attribute-sets="common.title common.border__bottom">
-        <xsl:attribute name="space-before">10pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
         <xsl:attribute name="space-before">6pt</xsl:attribute>
         <xsl:attribute name="space-after">5pt</xsl:attribute>
         <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -140,7 +140,7 @@ See the accompanying license.txt file for applicable licenses.
     </xsl:attribute-set>
 
     <xsl:attribute-set name="topic.topic.topic.title" use-attribute-sets="common.title">
-        <xsl:attribute name="space-before">8pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
         <xsl:attribute name="space-after">2pt</xsl:attribute>
         <xsl:attribute name="font-size">8pt</xsl:attribute>
         <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -151,7 +151,7 @@ See the accompanying license.txt file for applicable licenses.
     </xsl:attribute-set>
 
     <xsl:attribute-set name="topic.topic.topic.topic.title" use-attribute-sets="base-font common.title">
-        <xsl:attribute name="space-before">10pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
         <xsl:attribute name="start-indent"><xsl:value-of select="$side-col-width"/></xsl:attribute>
         <xsl:attribute name="font-weight">bold</xsl:attribute>
         <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
@@ -180,7 +180,7 @@ See the accompanying license.txt file for applicable licenses.
 
     <xsl:attribute-set name="section.title" use-attribute-sets="common.title">
         <xsl:attribute name="font-weight">bold</xsl:attribute>
-        <xsl:attribute name="space-before">15pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
         <xsl:attribute name="keep-with-next.within-column">always</xsl:attribute>
     </xsl:attribute-set>
 
@@ -196,7 +196,7 @@ See the accompanying license.txt file for applicable licenses.
     <xsl:attribute-set name="fig.title" use-attribute-sets="base-font common.title">
         <xsl:attribute name="font-weight">bold</xsl:attribute>
         <xsl:attribute name="space-before">5pt</xsl:attribute>
-        <xsl:attribute name="space-after">10pt</xsl:attribute>
+        <xsl:attribute name="space-after">5pt</xsl:attribute>
         <xsl:attribute name="keep-with-previous.within-page">always</xsl:attribute>
     </xsl:attribute-set>
 
@@ -265,7 +265,7 @@ See the accompanying license.txt file for applicable licenses.
     </xsl:attribute-set>
 
     <xsl:attribute-set name="prolog" use-attribute-sets="base-font">
-        <xsl:attribute name="start-indent">72pt</xsl:attribute>
+        <xsl:attribute name="start-indent">30pt</xsl:attribute>
     </xsl:attribute-set>
 
     <xsl:attribute-set name="div">
@@ -276,32 +276,32 @@ See the accompanying license.txt file for applicable licenses.
     </xsl:attribute-set>
 
     <xsl:attribute-set name="lq" use-attribute-sets="base-font common.border">
-        <xsl:attribute name="space-before">10pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
         <xsl:attribute name="padding-left">6pt</xsl:attribute>
-        <xsl:attribute name="start-indent">92pt</xsl:attribute>
-        <xsl:attribute name="end-indent">92pt</xsl:attribute>
+        <xsl:attribute name="start-indent">30pt</xsl:attribute>
+        <xsl:attribute name="end-indent">30pt</xsl:attribute>
         <xsl:attribute name="text-align">start</xsl:attribute>
     </xsl:attribute-set>
 
     <xsl:attribute-set name="lq_simple" use-attribute-sets="base-font common.border">
-        <xsl:attribute name="space-before">10pt</xsl:attribute>
-        <xsl:attribute name="space-after">10pt</xsl:attribute>
+        <xsl:attribute name="space-before">5pt</xsl:attribute>
+        <xsl:attribute name="space-after">5pt</xsl:attribute>
         <xsl:attribute name="padding-left">6pt</xsl:attribute>
-        <xsl:attribute name="start-indent">92pt</xsl:attribute>
-        <xsl:attribute name="end-indent">92pt</xsl:attribute>
+        <xsl:attribute name="start-indent">50pt</xsl:attribute>
+        <xsl:attribute name="end-indent">50pt</xsl:attribute>
         <xsl:attribute name="text-align">start</xsl:attribute>
     </xsl:attribute-set>
 
     <xsl:attribute-set name="lq_link" use-attribute-sets="base-font common.link">
         <xsl:attribute name="space-after">10pt</xsl:attribute>
-        <xsl:attribute name="end-indent">92pt</xsl:attribute>
+        <xsl:attribute name="end-indent">50pt</xsl:attribute>
         <xsl:attribute name="text-align">end</xsl:attribute>
         <xsl:attribute name="font-weight">bold</xsl:attribute>
     </xsl:attribute-set>
 
     <xsl:attribute-set name="lq_title" use-attribute-sets="base-font">
         <xsl:attribute name="space-after">10pt</xsl:attribute>
-        <xsl:attribute name="end-indent">92pt</xsl:attribute>
+        <xsl:attribute name="end-indent">50pt</xsl:attribute>
         <xsl:attribute name="text-align">end</xsl:attribute>
         <xsl:attribute name="font-weight">bold</xsl:attribute>
         <xsl:attribute name="font-style">italic</xsl:attribute>