Step 1: Creating a Custom Field

In MYOB Acumatica, a user can create a payment for an invoice by clicking the Pay button or command on the Invoices (SO303000) form. When the payment is created, it is opened on the Payments and Applications (AR302000) form.

The workflow for the Battery Replacement service involves one payment, which is made upon completion of the work. Conversely, the workflow for the Liquid Damage service involves both a prepayment before the repair work is assigned and a final payment after the work is complete.

For the creation of the prepayment, you now need to have the default prepayment percentage for the payment displayed on the Payments and Applications form to facilitate the entry of the prepayment amount, and to make it possible for a user to change that percentage for the current payment. To do that, you need to derive the value of the Prepayment Percent element on the Repair Work Order Preferences (RS101000) form and assign it to the corresponding custom field of the Payments and Applications form.

You will create the custom field in this step and derive the field value in the next step.

Adding a Custom Field to the Payments and Applications Form

To display and modify the prepayment percentage on the Payments and Applications (AR302000) form, you need to add the Prepayment Percent box to the form. Complete the following general tasks:

  1. By using the Element Inspector, learn the name of the DAC and graph that define the Summary area of the Payments and Applications form. In this case, the DAC is ARPayment and the graph is ARPaymentEntry. You need the DAC name to know which database table and DAC to extend. You will need the graph name in the next step.
  2. Add a column named UsrPrepaymentPercent to the ARPayment table with the same parameters as are specified for the PrepaymentPercent field of the RSSVSetup table. The data type of the column is decimal(9, 6).
  3. Create an extension of the ARPayment DAC, and add the UsrPrepaymentPercent field to the extension.
    Note: If you create a DAC extension by using the Customization Project Editor, it creates an extension of the base DAC. So in this case, the system will create an extension of the ARRegister DAC because the ARRegister DAC is the base DAC for the ARPayment DAC.

    The code for the field is shown below.

    #region PrepaymentPercent
    [PXDBDecimal()]
    [PXDefault(TypeCode.Decimal, "0.0", PersistingCheck = PXPersistingCheck.Nothing)]
    [PXUIField(DisplayName = "Prepayment Percent")]
    public Decimal? UsrPrepaymentPercent { get; set; }
    public abstract class usrPrepaymentPercent : PX.Data.BQL.BqlDecimal.Field<usrPrepaymentPercent> { }
    #endregion
  4. Add a box for the UsrPrepaymentPercent field to the Summary area of the Payments and Applications form. On the Customized Screens page, the location of the element appears as shown in the following screenshot.
    Figure 1. Prepayment Percent element


  5. Correct the width for the Prepayment Percent label. To do this, in the Column element that is the parent to the Prepayment Percent element, for the LabelsWidth property, specify the M value.
  6. Publish the customization project.