How to do word representation of amount field in A

2019-04-11 13:34发布

问题:

How to do word representation of amount field in Acumatica Invoice Report (AR.64.10.00)?

回答1:

Create an un-bound field in DAC Extension for ARInvoice DAC. And use PX.Objects.AP.ToWords attribute.

public class ARInvoicePXExt : PXCacheExtension<ARInvoice>
{
    #region UsrAmountToWords

    public abstract class usrAmountToWords : IBqlField { }


   [PX.Objects.AP.ToWords(typeof(ARInvoice.curyOrigDocAmt))]
    public virtual string UsrAmountToWords { get; set; }

    #endregion
}

Use UsrAmountToWords field in AR.64.10.00 report.

The word representation happens through attribute PX.Objects.AP.ToWords. And this out-of-box word representation is English only. For non-English word representation, create your own attribute. Implementation of PX.Objects.AP.ToWords can be found in …\App_Data\CodeRepository\PX.Objects\AP\Descriptor\Attribute.cs.



标签: c# acumatica