<commit_before><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:common="http://exslt.org/common"
                xmlns:xalan="http://xml.apache.org" exclude-result-prefixes="common xalan"
                xmlns:i18n="java:iht.utils.pdf.MessagesTranslator"
>

    <xsl:param name="translator"/>
    <xsl:param name="pdfFormatter"/>
    <xsl:param name="versionParam" select="'1.0'"/>
    <xsl:param name="debtsTotal"/>

    <xsl:template name="debts">
        <xsl:param name="value"/>

        <xsl:choose>
            <xsl:when test="freeEstate/estateAssets != '' or freeEstate/estateLiabilities != ''">
                <fo:block font-family="OpenSans-Bold" font-size="16" font-weight="bold" space-before="1.5cm" space-after="0.5cm">
                    <xsl:value-of
                            select="i18n:getMessagesText($translator, 'iht.estateReport.debts.owedFromEstate')"/>
                </fo:block>
            </xsl:when>
        </xsl:choose>

        <xsl:choose>
            <xsl:when test="freeEstate/estateAssets != ''">
                <fo:block font-family="OpenSans" font-size="12pt" font-weight="normal">
                        <xsl:for-each select="freeEstate/estateAssets">
                            <xsl:if test="assetCode='0016'">
                            <fo:table>
                            <fo:table-column column-number="1" column-width="60%"/>
                            <fo:table-column column-number="2" column-width="40%"/>
                            <fo:table-body font-size="12pt">
                                <xsl:choose>
                                    <xsl:when test="./liabilities != ''">
                                        <xsl:call-template name="table-row-tall">
                                            <xsl:with-param name="label"
                                                            select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                            <xsl:with-param name="value" select="./liabilities/liabilityType"/>
                                        </xsl:call-template>

                                        <xsl:call-template name="table-row-money-tall">
                                            <xsl:with-param name="label"
                                                            select="i18n:getMessagesText($translator, 'iht.value')"/>
                                            <xsl:with-param name="value" select='format-number(number(./liabilities/liabilityAmount), "##,###.00")'/>
                                        </xsl:call-template>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>
                </fo:block>
            </xsl:when>
        </xsl:choose>

        <xsl:choose>
            <xsl:when test="freeEstate/estateLiabilities != ''">
                <fo:block font-family="OpenSans" font-size="12pt" font-weight="normal">
                    <fo:block>
                       <xsl:for-each select="freeEstate/estateLiabilities">
                            <xsl:if test="liabilityType='Funeral Expenses'">
                            <fo:table>
                                <fo:table-column column-number="1" column-width="60%"/>
                                <fo:table-column column-number="2" column-width="40%"/>
                                <fo:table-body font-size="12pt">

                                    <xsl:call-template name="table-row-tall-border-top-black-thin">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                        <xsl:with-param name="value" select="liabilityType"/>
                                    </xsl:call-template>

                                    <xsl:call-template name="table-row-money-tall">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'iht.value')"/>
                                        <xsl:with-param name="value" select='format-number(number(liabilityAmount), "##,###.00")'/>
                                    </xsl:call-template>

                                    <xsl:comment>Blank row to display line at end of section</xsl:comment>
                                    <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>

                        <xsl:for-each select="freeEstate/estateLiabilities">
                            <xsl:if test="liabilityType! ='Funeral Expenses'">
                            <fo:table>
                                <fo:table-column column-number="1" column-width="60%"/>
                                <fo:table-column column-number="2" column-width="40%"/>
                                <fo:table-body font-size="12pt">

                                    <xsl:call-template name="table-row-tall-border-top-black-thin">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                        <xsl:with-param name="value" select="liabilityType"/>
                                    </xsl:call-template>

                                    <xsl:call-template name="table-row-money-tall">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'iht.value')"/>
                                        <xsl:with-param name="value" select='format-number(number(liabilityAmount), "##,###.00")'/>
                                    </xsl:call-template>

                                    <xsl:comment>Blank row to display line at end of section</xsl:comment>
                                    <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>

                        <fo:table space-before="0.5cm">
                            <fo:table-column column-number="1" column-width="60%"/>
                            <fo:table-column column-number="2" column-width="40%"/>
                            <fo:table-body font-size="12pt">

                                <xsl:call-template name="table-row-money-short-vpad-no-border">
                                    <xsl:with-param name="label"<commit_msg>IHT-4554 Add message keys for debts on PDF<commit_after><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
                xmlns:common="http://exslt.org/common"
                xmlns:xalan="http://xml.apache.org" exclude-result-prefixes="common xalan"
                xmlns:i18n="java:iht.utils.pdf.MessagesTranslator"
>

    <xsl:param name="translator"/>
    <xsl:param name="pdfFormatter"/>
    <xsl:param name="versionParam" select="'1.0'"/>
    <xsl:param name="debtsTotal"/>

    <xsl:template name="debts">
        <xsl:param name="value"/>

        <xsl:choose>
            <xsl:when test="freeEstate/estateAssets != '' or freeEstate/estateLiabilities != ''">
                <fo:block font-family="OpenSans-Bold" font-size="16" font-weight="bold" space-before="1.5cm" space-after="0.5cm">
                    <xsl:value-of
                            select="i18n:getMessagesText($translator, 'iht.estateReport.debts.owedFromEstate')"/>
                </fo:block>
            </xsl:when>
        </xsl:choose>

        <xsl:choose>
            <xsl:when test="freeEstate/estateAssets != ''">
                <fo:block font-family="OpenSans" font-size="12pt" font-weight="normal">
                        <xsl:for-each select="freeEstate/estateAssets">
                            <xsl:if test="assetCode='0016'">
                            <fo:table>
                            <fo:table-column column-number="1" column-width="60%"/>
                            <fo:table-column column-number="2" column-width="40%"/>
                            <fo:table-body font-size="12pt">
                                <xsl:choose>
                                    <xsl:when test="./liabilities != ''">
                                        <xsl:call-template name="table-row-tall">
                                            <xsl:with-param name="label"
                                                            select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                            <xsl:with-param name="value" select="i18n:getMessagesText($translator, 'iht.estateReport.debts.mortgages')"/>
                                        </xsl:call-template>

                                        <xsl:call-template name="table-row-money-tall">
                                            <xsl:with-param name="label"
                                                            select="i18n:getMessagesText($translator, 'iht.value')"/>
                                            <xsl:with-param name="value" select='format-number(number(./liabilities/liabilityAmount), "##,###.00")'/>
                                        </xsl:call-template>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                    </xsl:otherwise>
                                </xsl:choose>

                            </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>
                </fo:block>
            </xsl:when>
        </xsl:choose>

        <xsl:choose>
            <xsl:when test="freeEstate/estateLiabilities != ''">
                <fo:block font-family="OpenSans" font-size="12pt" font-weight="normal">
                    <fo:block>
                       <xsl:for-each select="freeEstate/estateLiabilities">
                            <xsl:if test="liabilityType='Funeral Expenses'">
                            <fo:table>
                                <fo:table-column column-number="1" column-width="60%"/>
                                <fo:table-column column-number="2" column-width="40%"/>
                                <fo:table-body font-size="12pt">

                                    <xsl:call-template name="table-row-tall-border-top-black-thin">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                        <xsl:with-param name="value" select="i18n:getMessagesText($translator, 'iht.estateReport.debts.funeralExpenses.title')"/>
                                    </xsl:call-template>

                                    <xsl:call-template name="table-row-money-tall">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'iht.value')"/>
                                        <xsl:with-param name="value" select='format-number(number(liabilityAmount), "##,###.00")'/>
                                    </xsl:call-template>

                                    <xsl:comment>Blank row to display line at end of section</xsl:comment>
                                    <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>

                        <xsl:for-each select="freeEstate/estateLiabilities">
                            <xsl:if test="liabilityType! ='Funeral Expenses'">
                            <fo:table>
                                <fo:table-column column-number="1" column-width="60%"/>
                                <fo:table-column column-number="2" column-width="40%"/>
                                <fo:table-body font-size="12pt">

                                    <xsl:call-template name="table-row-tall-border-top-black-thin">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'pdf.liabilityType.text')"/>
                                        <xsl:with-param name="value" select="i18n:getMessagesText($translator, 'pdf.debts.other')"/>
                                    </xsl:call-template>

                                    <xsl:call-template name="table-row-money-tall">
                                        <xsl:with-param name="label"
                                                        select="i18n:getMessagesText($translator, 'iht.value')"/>
                                        <xsl:with-param name="value" select='format-number(number(liabilityAmount), "##,###.00")'/>
                                    </xsl:call-template>

                                    <xsl:comment>Blank row to display line at end of section</xsl:comment>
                                    <xsl:call-template name="table-row-blank-tall-border-both-grey-thin"/>
                                </fo:table-body>
                            </fo:table>
                            </xsl:if>
                        </xsl:for-each>

                        <fo:table space-before="0.5cm">
                            <fo:table-column column-number="1" column-width="60%"/>
                            <fo:table-column column-number="2" column-width="40%"/>
                            <fo:table-body font-size="12pt">

                                <xsl:call-template name="table-row-money-short-vpad-no-border">
                                    <xsl:with-param name="label"
{'fraction_non_alphanumeric': 0.1321056845476381, 'fraction_numerical': 0.012276487856952229, 'mean_word_length': 1.1057881427367238, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 2, '>': 197, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 100, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3737597', 'n_tokens_mistral': 3981, 'n_tokens_neox': 3574, 'n_words': 453}