How to show the creditLimit balance under the invoice section in checkout page

We can show the creditLimit balance under invoice section by using the SuiteScript by extending the Profile Model

Here in this code , we are displaying the terms & Account Balance through it.
    _.extend(Profile,
        {
            getSubDivision: function getSubDivision() {
                var customFields;
                var subdivision;
                if (session.isLoggedIn2()) {
                    customFields = customFieldsParser(customer.getCustomFieldValues());
                    subdivision = customFields.custentity_tag_partner;
                } else {
                    subdivision = '';
                }
                return subdivision;
            }
        });
        Application.on('after:Profile.get', function afterProfileGet(Model, responseData) {
            responseData.paymentterms= responseData.paymentterms ? responseData.paymentterms: {name: Configuration.get('micrositeSolution.siteTermsName'), internalid: Configuration.get('micrositeSolution.siteTerms')}
            responseData.creditlimit_formatted = Utils.formatCurrency(
                responseData.creditlimit,
                responseData.currency.symbol
            )             
            responseData.subdivision = Model.getSubDivision();
    
        });

Leave a comment

Your email address will not be published. Required fields are marked *