For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho Deluge: Adding / Removing Total Tax from a Quote Record

Zoho Deluge: Adding / Removing Total Tax from a Quote Record

What?
A quick reminder on when I want to apply overall Tax or remove Tax from a quotes product line items.

Why?
I would apply the standard update function and although the response would say it modified the record, the tax wouldn't apply both visually and programmatically.

How?
A little undocumented this "feature" but the gist is if you want to add tax, it has to be built up in the tax options, if you want this to be zero, you need to pass the option of tax as zero and remove all other options.

Take the following code for example, this will add 20% tax to the overall Tax on this record (where p_QuoteID is the ID of the quote):
copyraw
// init Map
m_UpdateQuote = Map();
//  
r_QuoteDetails = zoho.crm.getRecordById("Quotes", p_QuoteID);
v_SubTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 0.2;
v_GrandTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1.2;
v_TotalTax = v_GrandTotal * 0.2;
m_UpdateQuote.put("Tax",round(v_TotalTax,2));
m_UpdateQuote.put("Grand_Total",round(v_GrandTotal ,2));
//  
// build up tax options
l_TaxOptions = List();
m_TaxOption1 = Map();
m_TaxOption1.put("percentage",20);
m_TaxOption1.put("name","VAT");
m_TaxOption1.put("value",v_TotalTax);
l_TaxOptions.add(m_TaxOption1);
m_TaxOption2 = Map();
m_TaxOption2.put("percentage",0);
m_TaxOption2.put("name","No VAT");
m_TaxOption2.put("value",0);
l_TaxOptions.add(m_TaxOption2);
m_UpdateQuote.put("$line_tax",l_TaxOptions);
//  
// update record
r_Update = zoho.crm.updateRecord("Quotes", p_QuoteID, m_UpdateQuote);
  1.  // init Map 
  2.  m_UpdateQuote = Map()
  3.  // 
  4.  r_QuoteDetails = zoho.crm.getRecordById("Quotes", p_QuoteID)
  5.  v_SubTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 0.2
  6.  v_GrandTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1.2
  7.  v_TotalTax = v_GrandTotal * 0.2
  8.  m_UpdateQuote.put("Tax",round(v_TotalTax,2))
  9.  m_UpdateQuote.put("Grand_Total",round(v_GrandTotal ,2))
  10.  // 
  11.  // build up tax options 
  12.  l_TaxOptions = List()
  13.  m_TaxOption1 = Map()
  14.  m_TaxOption1.put("percentage",20)
  15.  m_TaxOption1.put("name","VAT")
  16.  m_TaxOption1.put("value",v_TotalTax)
  17.  l_TaxOptions.add(m_TaxOption1)
  18.  m_TaxOption2 = Map()
  19.  m_TaxOption2.put("percentage",0)
  20.  m_TaxOption2.put("name","No VAT")
  21.  m_TaxOption2.put("value",0)
  22.  l_TaxOptions.add(m_TaxOption2)
  23.  m_UpdateQuote.put("$line_tax",l_TaxOptions)
  24.  // 
  25.  // update record 
  26.  r_Update = zoho.crm.updateRecord("Quotes", p_QuoteID, m_UpdateQuote)

To set it to zero, simply remove any other options:
copyraw
// init Map
m_UpdateQuote = Map();
//  
r_QuoteDetails = zoho.crm.getRecordById("Quotes", p_QuoteID);
v_SubTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1;
v_GrandTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1;
m_UpdateQuote.put("Tax",0);
m_UpdateQuote.put("Grand_Total",round(v_GrandTotal ,2));
//  
// build up tax options
l_TaxOptions = List();
m_TaxOption2 = Map();
m_TaxOption2.put("percentage",0);
m_TaxOption2.put("name","No VAT");
m_TaxOption2.put("value",0);
l_TaxOptions.add(m_TaxOption2);
m_UpdateQuote.put("$line_tax",l_TaxOptions);
//  
// update record
r_Update = zoho.crm.updateRecord("Quotes", p_QuoteID, m_UpdateQuote);
  1.  // init Map 
  2.  m_UpdateQuote = Map()
  3.  // 
  4.  r_QuoteDetails = zoho.crm.getRecordById("Quotes", p_QuoteID)
  5.  v_SubTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1
  6.  v_GrandTotal = r_QuoteDetails.get("Sub_Total").toDecimal() * 1
  7.  m_UpdateQuote.put("Tax",0)
  8.  m_UpdateQuote.put("Grand_Total",round(v_GrandTotal ,2))
  9.  // 
  10.  // build up tax options 
  11.  l_TaxOptions = List()
  12.  m_TaxOption2 = Map()
  13.  m_TaxOption2.put("percentage",0)
  14.  m_TaxOption2.put("name","No VAT")
  15.  m_TaxOption2.put("value",0)
  16.  l_TaxOptions.add(m_TaxOption2)
  17.  m_UpdateQuote.put("$line_tax",l_TaxOptions)
  18.  // 
  19.  // update record 
  20.  r_Update = zoho.crm.updateRecord("Quotes", p_QuoteID, m_UpdateQuote)
Category: Zoho Deluge :: Article: 244

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com