[英]How to transfer payment line into Sage 50?
I'm using sagecrmErp2008feeds
to the integration with my application.我正在使用sagecrmErp2008feeds
与我的应用程序集成。 I'm able to create SalesCredit and SalesInvoice data.我能够创建 SalesCredit 和 SalesInvoice 数据。 But I would like to transfer payment data from my application to Sage50.但我想将支付数据从我的应用程序转移到 Sage50。
Which feed Entry should I use for that for payment transfer ?我应该使用哪个提要条目来进行付款转账? Please see my Invoice code example.请参阅我的发票代码示例。 I would like to use the same way to transfer payment but I'm not getting feedentry for that.我想使用相同的方式进行转账,但我没有为此获得 feedentry。 Here I'm using salesInvoiceFeedEntry
feed entry.在这里,我使用的是salesInvoiceFeedEntry
提要条目。
public IResult<string> CreateSalesInvoice(Sage50Transaction data)
{
var result = new Result<string>();
try
{
var tradingAccount = GetCustomer(data.CustomerGuid);
if (tradingAccount == null)
{
throw new Exception("Customer not found in Sage");
}
var salesInvoice = new salesInvoiceFeedEntry
{
tradingAccount = tradingAccount
};
salesInvoice.reference = data.ReferenceId;
salesInvoice.reference2 = data.OurRef;
salesInvoice.customerReference = data.YourRef;
salesInvoice.netTotal = data.NetSub;
salesInvoice.taxDate = data.TransactionDate;
salesInvoice.date = data.TransactionDate;
salesInvoice.salesInvoiceLines = new salesInvoiceLineFeed();
if (data.Lines != null)
{
foreach (var item in data.Lines)
{
salesInvoice.salesInvoiceLines.Entries.Add(GetInvoiceLineItem(item));
}
}
var invoiceRequest = new SDataRequest(uri.Uri, salesInvoice, Sage.Integration.Messaging.Model.RequestVerb.POST);
invoiceRequest.Username = Username;
invoiceRequest.Password = Password;
salesInvoiceFeedEntry savedSalesInvoice = new salesInvoiceFeedEntry();
invoiceRequest.RequestFeedEntry<salesInvoiceFeedEntry>(savedSalesInvoice);
result.Data = savedSalesInvoice.UUID.ToString();
result.HasData = !string.IsNullOrEmpty(result.Data);
}
catch (Exception ex)
{
result.HasData = false;
result.Data = null;
result.Error = ex;
result.FailMessage = ex.Message;
}
return result;
}
根据我的理解,从 3rd 方到 sage50 的“付款转账”是不可能的,因为 Sage 50 账户不支持这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.