When you make an invoice with Include Payment, Update Stock and stuff (POS Invoice) and so long as the Rounding Adjustment is a negative value, the invoice is going through. However if the Rounding Adjustment is a Positive Value, you get the following error.
I’m guessing that the code is missing functions to move post the positive value as you submit the invoice.
Same here, I have this issue since V11, but it also happens for negative rounding (not systematically).
I’m investigating.
ERPNext and Frappe v.11.1.5
Python 3.5 env
for d in gl_map:
if d.account == round_off_account:
round_off_gle = d
if d.debit_in_account_currency:
**debit_credit_diff -= flt(d.debit_in_account_currency)**
else:
debit_credit_diff += flt(d.credit_in_account_currency)
round_off_account_exists = True
[....]
round_off_gle.update({
"account": round_off_account,
"debit_in_account_currency": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,
"credit_in_account_currency": debit_credit_diff if debit_credit_diff > 0 else 0,
**"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,**
"credit": debit_credit_diff if debit_credit_diff > 0 else 0,
"cost_center": round_off_cost_center,
"party_type": None,
"party": None,
"against_voucher_type": None,
"against_voucher": None
})
In my case, debit_credit_diff and debit_in_account_currency are equal at first, so debit_credit_diff -= flt(d.debit_in_account_currency) makes debit_credit_diff = 0
“debit”: abs(debit_credit_diff) if debit_credit_diff < 0 else 0
debit, then, equals 0 which is unauthorized.