Quotes - Defaulting the tax rate in tax rate select

Hi,

How can I default the tax rate for a quote? We have only 1 tax rate and want it displayed by default.

I've looked in studio and dropdowns, but cannot see an obvious way to default it - I thought 'Tax Rate' would have been a field in Studio that I could default, but this is not the case. So I'm suspecting that I need to look elsewhere or make a code-level change.

Could someone please point me in the right direction?

We're on SugarCRM 7.9.2.0

Thanks in advance,

Gary.

  • Tax Rate is its own module, not a dropdown.

    You can set your available tax rates from the Admin module.

    Admin->TaxRates

    It's a BWC module. Use the Create button to create your one tax rate. You can enable/disable tax rates.

    I assume that if you have only one it will automatically default into your Quote.

    HTH

    FrancescaS

  • Thanks Francesca,

    We only have the one entry in Admin->TaxRates, though it does not default on Quotes. Now that Quotes is sidecar, I think i'll just need to default it via some javascript.

    Regards

    Gary.

  • Hi Gary Smart 

    I believe you can default the TaxRate on Quotes by a SugarLogic formula.

    Kind regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Gary,

    The capability to default the first Tax Rate in the Tax Rate list was omitted in 7.9 - I have logged a case with SugarCRM (as have others) and we hope it will be fixed very soon. SugarCRM have indicated it is a priority as it is functionality that existed that is missing.

    Regards

    Greg Barrass

  • Thanks Greg.

    I wish I was aware of that before I coded the defaulting in JS!

    Regards,

    Gary.

  • SOLUTION(S)

    Here's my solution anyhow to re-default the tax rate in javascript. Thanks @andopes for the suggestion of altering the SugarLogic field. Had I have known it was a bug this would have been a simpler temp workaround. Without that knowledge, I didn't want to hardcode the rate into a formula.

    This solution tested on 7.10.0.0

    Added file custom/modules/Quotes/clients/base/views/create/create.js

    ({
        extendsFrom: 'CreateView',

        initialize: function (options) {
            this._super('initialize', [options]);

            console.log("Custom Quotes Create View JS create.js loaded.");

           //
           // Default tax rate to first found tax rate in TaxRates module.
           //
           var trId = this.model.get("taxrate_id"); // current tax rate id. Will be empty for a new Quote.
           var self = this;

           if (_.isEmpty(trId)) {

               // Get All Tax Rates
               var taxrateBeanCollection = app.data.createBeanCollection("TaxRates");

               taxrateBeanCollection.fetch({
                   success: function() {

                   if (taxrateBeanCollection.models.length > 0) {
                       var taxRateBeanModel = taxrateBeanCollection.models[0];

                       var trId = taxRateBeanModel.get("id"); // field name as it is in TaxRates
                       var trName = taxRateBeanModel.get("name"); // field name as it is in TaxRates
                       var trValue = taxRateBeanModel.get("value"); // field name as it is in TaxRates

                       console.log("First discovered TaxRate", trId, trName, trValue);

                       self.model.set("taxrate_id", trId); // field name as it is in Quotes
                       self.model.set("taxrate_name", trName); // field name as it is in Quotes
                       self.model.set("taxrate_value", trValue); // field name as it is in Quotes
                   }

               }}, this);

           }
       }
    })
  • Can we please bring this back as a default and/or add the ability to set tax based on a client status? I know, I know, I can pay a developer to make it happen but somethings should be base functionality. This is one of them. 

  • Hello,

    Update on the 29.04.2020 : in v10 the default tax rate is still missing on Quotes. The good news is that the workaround from Gary Smart is still working.

  • Very sad this is still missing Sob

    CRM Business Consultant