API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Contra account in DebtorPayment

0
We need to import debtorpayments registered in e-conomic to our system.  We're using Debtor_GetEntries but we can't figure out how to get the contra account specified when the payment was registered.  The data we get is:
(DebtorEntryData){
   Handle =
      (DebtorEntryHandle){
         SerialNumber = 2064
      }
   SerialNumber = 2064
   Type = DebtorPayment
   Date = 2012-03-12 000000
   DebtorHandle =
      (DebtorHandle){
         Number = 1
      }
   AccountHandle =
      (AccountHandle){
         Number = 1510
      }
   VoucherNumber = 4026
   Text = Inbet 20116 - CompanyName AB
   AmountDefaultCurrency = -210
   CurrencyHandle =
      (CurrencyHandle){
         Code = SEK
      }
   Amount = -210
   InvoiceNumber = 20116
   DueDate = 0001-01-01 000000
   Remainder = 00
   RemainderDefaultCurrency = 00
 }


Is it possible to get the contra account some other way with InvoiceNumber? What we need is the amount, the contra account and the invoice number.
created Mar 12, 2012 by luk
0% Accept Rate
Q 1 A 2 C 0

5 Answers

0
Hi,

You cannot retrieve this in any easy way at this time - it's 'a different entry'.

What exactly are you trying to achieve? Perhaps we can find another way for you to get there.


Best regards,
answered Mar 13, 2012 by Christian Estrup
0
Hi Christian,

Thank you for your quick reply.

We basically need to know how much of the amount of the invoice was actually paid. Given an invoice we need to subtract payments such as exchange rate losses etc and get the actual paid amount into our system. We were going to do this by going through all debtorpayments and discarding certain entries based on the contra account.
answered Mar 15, 2012 by luk
0
Hi,

We actually have a bit of syntactic sugar for you for just that:

The IInvoice interface contains the properties Remainder and RemainderDefaultCurrency - these are really 'shortcuts' to the remainder amounts on the corresponding debtor entry


Best regards,
answered Mar 15, 2012 by Christian Estrup
0
We've looked at Remainder on IInvoice but I do not think we can use it unfortunately. If we for example make two bookings on an invoice. One for the paid amount towards a contra account and another small one for exchange rate difference on another contra account. We need only the amount from the first booking and skip the second one with the exchange rate loss.
answered Mar 15, 2012 by luk
0
Hi,

In the vast majority of cases, you don't actually book en exchange rate difference entry manually. Rather, e-conomic makes this for you automatically when the invoice and payment are matched.

Furthermore, the exchange rate difference entry - at least when made by e-conomic automatically - is of type SystemEntry, whereas the payment is of type DebtorPayment. Consequently, you should be able to rather easily make out which is which.

As a final note: Exchange rate differences typically occur when the full currency amount has been paid, but with a different base currency amount, due to... exchange rate differences. Therefore, the invoice's Remainder - which is, by definition, in the invoice currency - won't be affected by exchange rate differences.


Best regards,
answered Mar 19, 2012 by Christian Estrup
Visma e-conomic A/S
...