Problems with JournalEntry via REST API

Hello there,

I’m new to this forum and I’m having a problem posting Journal Entries via the REST API.

JSON-Body:

{ “title”:“GS-2024, Barkunde”,
“posting_date”:“2009-12-14T00:00:00”,
“InvoiceNumberFromTitle”:null,
“total_debit”:29.75,
“total_credit”:29.75,
“difference”:0.0,
“root_type”:“Journal Entry”,
“write_off_based_on”:“Accounts Receivable”,
“company”:“K&K Software AG”,
“is_opening”:“No”,
“accounts”:[ {
“account”:“10 - Entgeltlich erworbene Konzessionen und gewerbl. Schutzrechte - K&K”,
“against_account”:“11 - Entgeltlich erworbene Konzessionen und - K&K”,
“debit”:29.75,
“credit”:0.0,
“cost_center”:“Haupt - K&K”,
“is_advance”:“Yes”,
“doctype”:“Journal Entry Account”

},
{
“account”:“11 - Entgeltlich erworbene Konzessionen und - K&K”,
“against_account”:“10 - Entgeltlich erworbene Konzessionen und gewerbl. Schutzrechte - K&K”,
“debit”:0.0,
“credit”:29.75,
“cost_center”:“Haupt - K&K”,
“is_advance”:“Yes”,
“doctype”:“Journal Entry Account”

}

]
}

No errors @creation. Document is there, but:

sorry, can’t post the result, but credit and debit = 0.0, but should be 29.75.

The result:

{ “data”:{ “name”:“ACC-JV-2020-00010”,

  "title":"GS-2024, Barkunde",
  "voucher_type":"Journal Entry",
  "naming_series":"ACC-JV-.YYYY.-",
  "posting_date":"2009-12-14",
  "company":"K&K Software AG",
  "total_debit":0.0,
  "total_credit":0.0,
  "difference":0.0,
  "multi_currency":0,
  "total_amount":0.0,
  "total_amount_in_words":"EUR Zero only.",
  "write_off_based_on":"Accounts Receivable",
  "write_off_amount":0.0,
  "is_opening":"No",
  "doctype":"Journal Entry",
  "accounts":[         {
        "name":"4a36562e79",

        "parent":"ACC-JV-2020-00010",
        "parentfield":"accounts",
        "parenttype":"Journal Entry",
        "idx":1,
        "docstatus":0,
        "account":"10 - Entgeltlich erworbene Konzessionen und gewerbl. Schutzrechte - K&K",
        "account_type":"",
        "balance":0.0,
        "party_balance":0.0,
        "cost_center":"Haupt - K&K",
        "account_currency":"EUR",
        "exchange_rate":1.0,
        "debit_in_account_currency":0.0,
        "debit":0.0,
        "credit_in_account_currency":0.0,
        "credit":0.0,
        "is_advance":"Yes",
        "against_account":"11 - Entgeltlich erworbene Konzessionen und - K&K",
        "doctype":"Journal Entry Account"

},
{
“name”:“e0365d8529”,

“parent”:“ACC-JV-2020-00010”,
“parentfield”:“accounts”,
“parenttype”:“Journal Entry”,
“idx”:2,
“docstatus”:0,
“account”:“11 - Entgeltlich erworbene Konzessionen und - K&K”,
“account_type”:"",
“balance”:0.0,
“party_balance”:0.0,
“cost_center”:“Haupt - K&K”,
“account_currency”:“EUR”,
“exchange_rate”:1.0,
“debit_in_account_currency”:0.0,
“debit”:0.0,
“credit_in_account_currency”:0.0,
“credit”:0.0,
“is_advance”:“Yes”,
“against_account”:“10 - Entgeltlich erworbene Konzessionen und gewerbl. Schutzrechte - K&K”,
“doctype”:“Journal Entry Account”

}

]

}
}

Problem solved … damn multi currency mechanism has no single currency fallback:

“debit”:29.75
“debit_in_account_currency”:29.75
“exchange_rate”:1.0

… And it works. Thanks anyway, though nobody has answered.

{“title”:“GS-2024, Barkunde”,“posting_date”:“2009-12-14T00:00:00”,“total_debit”:29.75,“total_credit”:29.75,“difference”:0.0,“root_type”:“Journal Entry”,“write_off_based_on”:“Accounts Receivable”,“company”:“K&K Software AG”,“is_opening”:“No”,“accounts”:[{“account”:“10 - Entgeltlich erworbene Konzessionen und gewerbl. Schutzrechte - K&K”,“debit”:29.75,“credit”:0.0,“debit_in_account_currency”:29.75,“credit_in_account_currency”:0.0,“exchange_rate”:1.0,“is_advance”:“No”,“doctype”:“Journal Entry Account”},{“account”:“11 - Entgeltlich erworbene Konzessionen und - K&K”,“debit”:0.0,“credit”:29.75,“debit_in_account_currency”:0.0,“credit_in_account_currency”:29.75,“exchange_rate”:1.0,“is_advance”:“No”,“doctype”:“Journal Entry Account”}]}

1 Like

NEVER TWIST WORDS COMING OUT OF MY MOUTH.

Thank you !

Please maintain the decorum here https://discuss.erpnext.com/faq

Welcome to the ERPNext forum…

wilco, as good as possible for the future.

I live in Germany and have no problems respecting other culture’s habbits (though I disagree, … ), although the tone is a bit rougher here (and I love it).

However, I dislike when words I’ve said become undone, no matter how unpleasant they are understood on the receipient’s side.

I hope we are just being petty here.

You will find this community is particularly tolerant and helpful.

cheers

1 Like

My personal situation and the comon situation in Europe is currently a bit tense.

I’m easy to upset. It’s time for spring break.

Forgive me, we all surely face an extraodinary crisis - you will find this community is a caring one.

not ur fault.

Far worse things have been said on these forums.

I strongly disagree with censoring words, or editing other people’s posts. If a post seriously violates forum policy, fine. Flag and delete it then.

But modifying people’s posts is dangerous. Tiny, innocent edits lead to smallish edits. Which lead to slightly larger edits. Which lead to even larger omissions, substitutions, and censorship.

It destroys trust. How can you be certain anything you read is Truth, if moderators get into the habit of “fixing” posts.

This was an innocent mistake, with good intention. But this is a dangerous path, and I hope this is the last I see of it.

Thank you Brian for holding me to account, your message rings loud and clear.

I have learned my lesson and appreciate now how my abuse of authority is unacceptable.

Please accept my apologies Karsten

1 Like

Can we stop it here. It’s not worth the discussion.

I will watch my wording in the future, made my point clear, so it’s not worth discussing it.

Sorry, I’m currently a bit on the edge. This makes me a bit stubborn and in the end it’s about the API problem.

Everything ok.
The whole thing is a thing of the past. My code works (so far) and I found the problem on my own.
All the rest is cultural discrepancy - we had worse in Germany the past couple of years and are still alive :smiley: