How to set up the Comma separator for money fields in printables

If you print from Orders section, the resulting money value is as follows without a comma [,] and we need such a comma in order to send money amounts to the customers. It should be $16,200.00 instead of the current $16200.00

How can we change the money format in the printable?

 

File attachments

Like

2 comments

You can change the output value with the macros. 

Please check the following manual on how to add the macros and use it in printable forms.

  1. Go to the configuration and create a new Source Code schema.

http://prntscr.com/duwfia

2. Insert the following code and publish the schema.

namespace Terrasoft.Configuration
{
    using System;
    using System.CodeDom.Compiler;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Runtime.Serialization;
    using System.ServiceModel;
    using System.ServiceModel.Web;
    using System.ServiceModel.Activation;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;
    using Terrasoft.Common;
    using Terrasoft.Core;
    using Terrasoft.Core.DB;
    using Terrasoft.Core.Entities;
    using Terrasoft.Core.Packages;
    using Terrasoft.Core.Factories;
    using System.Globalization;
     
    [ExpressionConverterAttribute("Money")]
    public class GbDateTimeNoSecondsConveter : IExpressionConverter
    {
        public string Evaluate(object value, string arguments = "") {
            string result = ConvertValue(value);
            return result;
        }
        static string ConvertValue(object value)
        {
            string result = string.Empty;
            if (value != null)
            {
                result = value.ToString();
                double number;
                if (Double.TryParse(result, out number))
                {
                    result = number.ToString("N", new CultureInfo("en-US"));
                }
            }
            return result;
        }
    }
}

http://prntscr.com/duwfz7

3. Go to the ms word designer and add the [#Money#] macros to the fields that you need to change.

http://prntscr.com/duwg86

http://prntscr.com/duwgcm

4. Save the printable form.

Great fix, thank you Eugene Podkovka

Show all comments