• Ana Maria Naranjo
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
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>
Dear all,
We are trying to deploy in production a trigger that capitalize the first letter of a name and a last name of a contact (even when there is a compound given name) and that the last name is in capital letters (example: Jean-Pierre DEBOIS). We tested in Sandbox and everything worked. But when we tried to deploy in production, we get the following errors and the test class has 0% code coverage (please see image below). Could anyone please help us to resolve this problem? 
Thank you! 

Trigger that we are trying to implement: 
trigger CapitalizeName on Contact( before insert , before update)
{
for(Contact c : Trigger.new)
{
if(c.FirstName != null)
{
String prev='';
String response='';
for (Integer i=0;i<c.FirstName.length();i++)
{
String cur=c.FirstName.subString(i ,i+1);
if (prev=='' || prev==' ' || prev=='-')
response+=cur.toUpperCase();
else
response+=cur.toLowerCase();
prev=cur;
}
c.FirstName = response;
}
c.LastName = c.LastName.ToUpperCase() ;
}
}


User-added image

 
Dear all,
We are trying to deploy in production a trigger that capitalize the first letter of a name and a last name of a contact (even when there is a compound given name) and that the last name is in capital letters (example: Jean-Pierre DEBOIS). We tested in Sandbox and everything worked. But when we tried to deploy in production, we get the following errors and the test class has 0% code coverage (please see image below). Could anyone please help us to resolve this problem? 
Thank you! 

Trigger that we are trying to implement: 
trigger CapitalizeName on Contact( before insert , before update)
{
for(Contact c : Trigger.new)
{
if(c.FirstName != null)
{
String prev='';
String response='';
for (Integer i=0;i<c.FirstName.length();i++)
{
String cur=c.FirstName.subString(i ,i+1);
if (prev=='' || prev==' ' || prev=='-')
response+=cur.toUpperCase();
else
response+=cur.toLowerCase();
prev=cur;
}
c.FirstName = response;
}
c.LastName = c.LastName.ToUpperCase() ;
}
}


User-added image