0
A
回答
1
如果你仍在努力应对存款对于特定的销售订单,你可以做一个简单的搜索:
nlapiSearchRecord('customerdeposit', null, new nlobjSearchFilter('createdfrom', null, 'is', 1217));
//1217 is internal id of original sales order
但是如果你还在追问到退还特定的存款你也应该知道,创建客户退款正确的方式仍然是无证的:
var cr = nlapiCreateRecord('customerrefund',{entity:127}); // id of customer
cr.setFieldValue('paymentmethod', 1);
//may need to cycle through deposit lines to find the right one(s)
//cr.setLineItemValue('deposit', 'doc', 1, '1226');
//cr.setLineItemValue('deposit', 'amount', 1, 500);
cr.setLineItemValue('deposit', 'apply', 1, 'T'); // need this for at least one line.
nlapiSubmitRecord(cr);
然后,如果你想要再次找到受影响的存款,这很奇怪。如果您可以从退款的凭证编号开始,那么您将收集应用该凭证的交易的ID,然后获取适用的交易ID:
var appliedIds = nlapiSearchRecord('customerrefund', null, [new nlobjSearchFilter('tranid', null, 'is', '2073'),
new nlobjSearchFilter('applyingtransaction', null, 'noneof', ['@[email protected]'])
], [
new nlobjSearchColumn('tranid'),
new nlobjSearchColumn('applyingtransaction'),
new nlobjSearchColumn('applyinglinktype')
]).map(function(cr) {
console.log(cr.getValue('deposit', 'applying'));
console.log(cr.getValue('applyinglinktype'));
if ('payment' == cr.getValue('applyinglinktype')) {
return cr.getValue('applyingtransaction');
}
return null;
}).filter(function(id) {
return id;
});
nlapiSearchRecord('depositapplication', null, [
new nlobjSearchFilter('internalid', null, 'anyof', appliedIds),
new nlobjSearchFilter('appliedtolinktype', null, 'anyof', ['DepAppl'])
], new nlobjSearchColumn('appliedtotransaction')).
forEach(function(da) {
console.log(da.getValue('appliedtotransaction'));
});
相关问题
- 1. 找到客户在多次付款中花费最多的钱
- 2. 电子商务客户信用存款和付款
- 3. 从退货授权创建客户退款
- 4. 如何使用Braintree在客户端显示客户的付款方式?
- 5. Paypal API - 客户接受来自其客户的PayPal付款
- 6. 如何关联客户和付款细节
- 7. 如何在Acumatica中检索客户的付款方式?
- 8. PayPal付款客户端REST脚本
- 9. 通过PayPal向客户汇款
- 10. Mysql查询:查找客户W /订单,但没有付款
- 11. PayPal - 客户付款中的“每个收款人”是什么意思?
- 12. 在客户端上创建付款并在服务器上执行付款
- 13. 当客户没有在Paypal中完成付款时的通知
- 14. Braintree PAyment创建客户并保存付款方式
- 15. 如何更新Braintree客户默认付款方式
- 16. 如何使用Paypal客户端rest api创建订阅付款?
- 17. ActiveMerchant with Authorize.net CIM - 如何更新客户付款资料
- 18. 在客户类别中存储当前选定的付款信息
- 19. 如何通过submerchant账户在Braintree MarketPlace中退款?
- 20. PayPal客户结帐用于沙箱中的定期付款
- 21. Odoo:自定义模块中的客户付款
- 22. C#银行帐户存款
- 23. 使用PayPal休息API退款用户
- 24. 如何在“定期付款仪表板”中添加客户字段?
- 25. 生成用户帐户存款地址
- 26. PayPal客户如何在不设定新付款的情况下重试每月订购付款?
- 27. 汇款到用户的Apple Pay帐户
- 28. 链接付款和退款
- 29. SQL查询向客户显示这些帐户在其账户中有10个存款或更多
- 30. 如何更新Authorize.NET(CIM)中的客户付款配置文件详细信息?
我还没有机会尝试此操作,但它看起来像我在找什么。 –