function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ana Maria NaranjoAna Maria Naranjo 

Problem to take out a multiple currency from the invoice pdf

Dear all,
In the organization I’m working, the invoices (pdf) were configured to bring prices in the currency that the user wrote it into the system (for instance SGD) + the currency of the company (Euros). We need to take out this from the invoice pdf and to only show the currency that the user entered (for instance SGD).
I tried to modify the code from the visualforce page; and I also deactivated the option “  Multiple Currencies “, but I keep having both currencies in the invoice. You will find below the part of the visualforce page that I need to modify to be able to show only the currency used by the user. Could anyone give me suggestions of what should I do or modify?
Thank you!!

<table id="lignedefacture" width="100%" style="table-layout:fixed">
        <thead>
            <tr>
                <th width="25%">{!$Label.VFP07_Designation}</th>
                <th width="14%">{!$ObjectType.Ligne_de_Facture__c.fields.Prix_Unitaire__c.label}</th>
                <th width="8%">{!$ObjectType.Ligne_de_Facture__c.fields.TVA__c.label}</th>
                <th width="10%">{!$ObjectType.Ligne_de_Facture__c.fields.Quantite__c.label}</th>
                <th width="8%" style="display: {!IF(hideDiscount, 'none', 'initial')}">{!$ObjectType.Ligne_de_Facture__c.fields.Remise__c.label}</th>
                <th width="12%" style="text-align: right;">{!$ObjectType.Ligne_de_Facture__c.fields.Total_HT__c.label}</th>
                <th width="14%" style="text-align: right;">{!$Label.VFP07_TotalTVA}</th>
                <th width="12%" style="text-align: right;">{!$ObjectType.Ligne_de_Facture__c.fields.Total_TTC__c.label}</th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="{!IF(hideDiscount, '4', '5')}">Total</td>
                <td style="text-align:right">
                    <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                        {!facture.CurrencyIsoCode}&nbsp;<apex:param value="{!facture.Total_HT_apres_remise__c}"/>
                    </apex:outputText>
                    <apex:outputField value="{!facture.Total_HT_apres_remise__c}" rendered="{!language == 'fr'}" />
                </td>
                <td style="text-align:right">
                    <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                        {!facture.CurrencyIsoCode}&nbsp;<apex:param value="{!facture.Montant_TVA__c}"/>
                    </apex:outputText>
                    <apex:outputField value="{!facture.Montant_TVA__c}" rendered="{!language == 'fr'}" />
                </td>
                <td style="text-align:right">
                    <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                        {!facture.CurrencyIsoCode}&nbsp;<apex:param value="{!facture.Total_TTC__c}"/>
                    </apex:outputText>
                    <apex:outputField value="{!facture.Total_TTC__c}" rendered="{!language == 'fr'}" />
                </td>
            </tr>
        </tfoot>
        <tbody>
            <apex:repeat value="{!facture.Lignes_de_facture__r}" var="lignedefacture">
                <tr > 
                    <td max-width="25%" width="25%">{!lignedefacture.Produit__r.Nom_commercial__c}<br/>{!lignedefacture.Description__c}</td>
                    <td>
                        <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                            {!lignedefacture.CurrencyIsoCode}&nbsp;<apex:param value="{!lignedefacture.Prix_Unitaire__c}"/>
                        </apex:outputText>
                        <apex:outputField value="{!lignedefacture.Prix_Unitaire__c}" rendered="{!language == 'fr'}" />
                    </td>
                    <td>
                        <apex:outputText value="{!IF(lignedefacture.TVA__c == null, '0', lignedefacture.TVA__c)}"/> %
                    </td>
                    <td><apex:outputField value="{!lignedefacture.Quantite__c}"/></td>
                    <td style="display: {!IF(hideDiscount, 'none', 'initial')}">
                        <apex:outputField value="{!lignedefacture.Remise__c}"/>
                    </td>
                    <td style="text-align:right">
                        <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                            {!lignedefacture.CurrencyIsoCode}&nbsp;<apex:param value="{!lignedefacture.Total_HT_apres_remise__c}"/>
                        </apex:outputText>
                        <apex:outputField value="{!lignedefacture.Total_HT_apres_remise__c}" rendered="{!language == 'fr'}" />
                    </td>
                    <td style="text-align:right">
                        <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                            {!lignedefacture.CurrencyIsoCode}&nbsp;<apex:param value="{!lignedefacture.Montant_TVA__c}"/>
                        </apex:outputText>
                        <apex:outputField value="{!lignedefacture.Montant_TVA__c}" rendered="{!language == 'fr'}" />
                    </td>
                    <td style="text-align:right">
                        <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                            {!lignedefacture.CurrencyIsoCode}&nbsp;<apex:param value="{!lignedefacture.Total_TTC__c}"/>
                        </apex:outputText>
                        <apex:outputField value="{!lignedefacture.Total_TTC__c}" rendered="{!language == 'fr'}" />
                    </td>
                </tr>
            </apex:repeat>
        </tbody>
    </table>

    <apex:outputPanel rendered="{!listReglement != null && listReglement.size > 0}">
        <table id="acompte" width="100%">
            <thead>
                <tr>
                    <td style="font-weight: bold" colspan="3">
                        {!$Label.VFP02_Acomptes}
                    </td>
                </tr>
                <tr>
                    <th>{!$ObjectType.Reglement__c.fields.Date_du_reglement__c.label}</th>
                    <th width="40%">{!$ObjectType.Reglement__c.fields.Montant__c.label}</th>
                </tr>
            </thead>
            <tbody>
                <apex:repeat value="{!listReglement}" var="reglement">
                    <tr>
                        <td>
                            <apex:outputText value="{0, date, dd'/'MM'/'yyyy}"><apex:param value="{!reglement.Date_du_reglement__c}" /></apex:outputText>
                        </td>
                        <td style="text-align:right">
                            <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                                {!reglement.CurrencyIsoCode}&nbsp;<apex:param value="{!reglement.Montant__c}"/>
                            </apex:outputText>
                            <apex:outputField value="{!reglement.Montant__c}" rendered="{!language == 'fr'}" />
                        </td>
                    </tr>
                </apex:repeat>
            </tbody>
        </table>
    </apex:outputPanel>

    <apex:outputPanel rendered="{!resteapayer != null}">
        <table id="resteapayer" width="100%">
            <tr>
                <td>{!$Label.VFP02_RestantAPayer}</td>
                <td  style="text-align:right">
                    <apex:outputPanel rendered="{!language == 'fr'}">
                        {!facture.CurrencyIsoCode} {!resteapayer}
                    </apex:outputPanel>
                    <apex:outputText value="{0,number}" rendered="{!language != 'fr'}">
                        {!facture.CurrencyIsoCode}&nbsp;<apex:param value="{!facture.TECH_Reste_a_payer__c}"/>
                    </apex:outputText>
                </td>
            </tr>
        </table>
    </apex:outputPanel>