Invoice Terms Not Included In Order Details

This topic applies to

Applies to

SuiteCommerce Advanced

In Reference My Account v1.05, if a shopper checks out using Invoice (Terms), the order in My Account does not include the invoice terms under Payment Method in the order details.

This patch updates the setPaymentMethod function in Models.js . To implement this patch, make a copy of Models.js and update it to use the terms object to set the payment terms in Reference My Account.

To customize the Models.js file:

  1. If you have not done so already, copy the Models.js file from the reference folder to your custom folder in the NetSuite File Cabinet.

    Models.js is located in the File Cabinet at My Account 1.05 > Reference My Account > ssp_libraries.

  2. Update the setPaymentMethod function in the Models.js file from your custom folder:

    Locate the following code in Models.js:

    if (record.getFieldValue('terms'))
      {
        paymentmethod.type = 'invoice';
    
        paymentmethod.purchasenumber = record.getFieldValue('otherrefnum');
    
        paymentmethod.paymentterms = {
          internalid: record.getFieldValue('terms')
          ,   name: record.getFieldText('terms')
        };
      }

    Replace these lines with the following code:

    if (terms)
      {
        paymentmethod.type = 'invoice';
    
        paymentmethod.purchasenumber = record.getFieldValue('otherrefnum');
    
        paymentmethod.paymentterms = {
           internalid: record.getFieldValue('terms') || terms 
            , name: record.getFieldText('terms') || nlapiLookupField(record.recordType
            , record.getFieldValue('id'), 'terms', true)  
        };
      }
  3. Configure your SSP Application to use the custom Models.js file.

    1. Open the My Account SSP application record at Setup > SuiteCommerce Advanced > SSP Applications.

    2. On the Scripts subtab, update the Libraries list to include the Models.js file from your custom folder.

      This file must maintain the correct position at the bottom of the list of library files.

    3. Click Save.

  4. Verify that the customization was successful.

    If a shopper checks out with Invoice (Terms) for an order, the payment method appears correctly under Payment Method for the order details in My Account.