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)中的客戶付款配置文件詳細信息?
我還沒有機會嘗試此操作,但它看起來像我在找什麼。 –