How to transfer payment line into Sage 50?

91 views Asked by At

I'm using sagecrmErp2008feeds to the integration with my application. I'm able to create SalesCredit and SalesInvoice data. But I would like to transfer payment data from my application to 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. Here I'm using salesInvoiceFeedEntry feed entry.

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;
        }
1

There are 1 answers

0
Letoncse On

As per my understanding, "payment transfer" is not possible from 3rd party to sage50, as the Sage 50 Accounts does not support this.