Who can help me with that Tax Suite plugin? I want...
# suitescript
w
Who can help me with that Tax Suite plugin? I want to view the debugging logs in the console, but they don't appear when I upload the plugin
Copy code
/**
 * Copyright (c) 2020, Oracle NetSuite and/or its affiliates. All rights reserved.
*
* @NApiVersion 2.x
* @NModuleScope Public
* @NScriptType plugintypeimpl
*/
/* eslint-disable */
define(["require", "exports", "N/log", "../../fteShared/lib/nexusRoundingLib"], function (require, exports, log, nexusRoundingLib_1) {
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.calculateTax = void 0;
  function calculateTax(context) {
      log.debug("FTECO RETEFUENTE context", context);

      var inputLine = context.inputLine;
      log.debug('inputLine', inputLine);
      var taxDeterminationRule = context.rule;
      log.debug('taxDeterminationRule', taxDeterminationRule);
      var taxCode = context.taxCode;
      log.debug('taxCode', taxCode)
      var itemNetAmount = Number(inputLine.netAmount);
      log.debug('itemNetAmount', itemNetAmount)
      var taxRate = taxDeterminationRule.TaxRates[taxCode.Id];
      log.debug('taxRate', taxRate)


      var taxAmount = nexusRoundingLib_1.multiply(itemNetAmount, taxRate);


      var minimumCollectionAmount = Number(context.taxCode.Parameters['baseminima']);


      var shouldAddToTaxDetail = itemNetAmount > minimumCollectionAmount;

      return {
          taxCode: taxCode.Id,
          taxationType: taxCode.TaxType,
          taxRate: taxRate,
          taxAmount: taxAmount,
          taxBasis: itemNetAmount,
          shouldAddToTaxDetail: shouldAddToTaxDetail, 
          taxCalculationDetail: ""
      };
  }
  exports.calculateTax = calculateTax;
});