Discussões
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
SuiteScript > Definir valor Valor inicial na Tabela de faturamento com Taxa do item selecionada
Aplica-se a
Produto: NetSuite 2020.2
Cenário
O usuário cria o Pedido de vendas usando a Tabela de faturamento. No entanto, quando eles Faturam o Pedido de vendas, ela deve cobrar ao Cliente a Tarifa do item no Pedido de vendas, em vez do valor inicial na Tabela de faturamento.
Solução
O cenário acima pode ser obtido atualizando o valor do campo Valor Inicial na Tabela de faturamento selecionada com a Taxa do item via SuiteScript. Veja abaixo o exemplo de script:
SuiteScript 1.0:
function afterSubmit() {
// getting rate of the item
var rate = nlapiGetLineItemValue('item', 'rate', 1);
// Get the value of the billing schedule
var bill = nlapiGetLineItemValue('item', 'billingschedule', 1);
// load billing schedule
var rec = nlapiLoadRecord('billingschedule', bill);
// Set initial amount value with the item rate
rec.setFieldValue('initialamount', rate);
nlapiSubmitRecord(rec);
}
Rotulado:
0
Olá, bem-vind@!
Faça login
Para ver todos os detalhes, faça o login.
Cadastre-se
Não tem uma conta? Clique aqui para começar!