Tripletex / tripletex-api2

Tripletex API 2 resources and examples
MIT License
38 stars 43 forks source link

/v2/ledger/voucher bug? #87

Closed zaenkhilji closed 1 year ago

zaenkhilji commented 1 year ago

Hei,

Forsøker å opprette Leverandørfaktura med POST forespørsel til /v2/ledger/voucher med følgende JSON payload (side til tjenesten: api.tripletex.io/execute/incomingInvoiceMenu):

{
   "date":"2023-11-02",
   "description":"test",
   "postings":[
      {
         "project":{
            "id":2600512
         },
         "supplier":{
            "id":12795114
         },
         "product":{
            "id":21630320
         },
         "account":{
            "id":"33017209"
         },
         "type":"INVOICE_EXPENSE",
         "description":"test",
         "amountGross":"2000",
         "amountGrossCurrency":"2000",
         "row":1
      }
   ]
}

Men tjenesten returnerer følgende feilmelding: [ledger/voucher]: Validering feilet: Summen av posteringene for 2023-11-02 er ikke lik 0.

tlxVidar commented 1 year ago

1) "execute/incomingInvoiceMenu" is a completely different backend from the API, you cannot expect that /v2/ledger/voucher should accept the same input

2) The error message that you get from /v2/ledger/voucher is correct, you only send in one posting, and then the sum of the postings is obviously not 0.

3) /v2/ledger/voucher only supports creating standard accounting vouchers, there is currently no support for creating supplier invoices ("leverandørfaktura") from the API. We are likely to add this on a future date though.