我们在行项目级别有“在税前采购账单上应用折扣”的要求。为此,我们在行项目级别创建了一个折扣字段。费率值应根据“折扣”自定义字段中的值进行折扣。金额值将根据数量和费率进行更新。
我已经尝试了工作流程,但它不起作用。有人能帮我编写脚本吗?
发布于 2019-04-03 13:47:06
假设您将使用客户端脚本,则可以使用validateLine函数,该函数将在单击Item Sublist上的Add按钮后触发。
function checkDiscount(type){
var getDiscount = nlapiGetCurrentLineItemValue('item', 'internalID of discount field');
var currRate = nlapiGetCurrentLineItemValue('item', 'rate');
var newRate = currRate * getDiscount; // depending on the value stored in Discount, you may need to modify this further
nlapiSetCurrentLineItemValue('item', 'rate');
return true;
}https://stackoverflow.com/questions/55476419
复制相似问题