Closed jon-nfc closed 1 year ago
After further investigation, it appears that the GL entries are incomplete. with nothing within the purchase invoice interface that I noticed where I could change it to correct the GL entries.
Account 2-1110-01 is a liability, 1-7121-99 is an asset account with 6-0510 being an expense account.
Is there a configuration setting somewhere that I have missed? It appears as though the additional charge does not get charged against a supplier, for example a postage company.
Since no comment was left after label "can't-reproduce" please see screen grab of the unhelpful error. FYI, the debug changes from my previous comment are still implemented and visible.
@yadavyk
Bump. For review. This issue is still outstanding and preventing use of additional charges.
I have simulated the invoice creation on the demo erpnext site, (without full access to the backend) it appears that my issue is that the additional charges are not being added to the ledger entries, preventing submission of the invoice. Further to the issue, any failed validation of configuration does not denote an error to the user which is left only with the above catch all exception(debit credit not equal). There are only two reasons for this to occur, improper validation or no validation. Either way this needs to be fixed. A simple message to the user with the actual cause of the issue would suffice as the end user could then rectify the misconfiguration/error.
however this issue has also occured creating the invoice in the company currency.
I have simulated the invoice creation on the demo erpnext site.
If this was on ERPNext.com / Frappe cloud then share the site and document details and I'll take a look. This seems like a rather peculiar issue and we can't reproduce this. FYI "Additional Charges" are used by hundreds of our users every day, so it's not such a basic issue TBH!
@ankush The invoice creation on the demo erpnext site worked as it should, however has been deleted. (Assuming data was reset). It demonstrated that the additional charges were being added as part of the invoice creation. (Confirmed by viewing the general ledger)
I can recreate the invoice on the demo erpnext site if required, please advise.
I'm unable to share or provide access to my erpnext site as it has live data on it.
Understand that others have got it working so may not be an important issue to work on, however I clearly have done something different that any validation has failed to notify the cause of the issue. As such additional charges are in a non-usable state.
I have full access to the server erpnext is hosted on and am happy to assist with any information you or any of the devs require.
I am also having this problem. I was able to figure out that if I enable Capital Works In Progress Accounting for the Asset Category in question, then it calls get_asset_gl_entry in purchase_invoice.py and everything works correctly. I think this is probably related to the problem. I would take a stab at it except I don't understand what's supposed to be happening or why it's implemented the way it is.
I don't understand why line 469-470 in purchase_invoice.py checks for CWIP to be enabled in order to call get_asset_gl_entry. It seems like we want to create those entries for all assets whenever they're on the invoice and then handle CWIP checking as part of get_asset_gl_entry, since nothing above the "else" statement at line 781 touches CWIP.
There's also some confusing control flow going on in get_asset_gl_entry that makes it difficult to understand what's actually supposed to be going on. I would be happy to help solve this problem if someone could offer some guidance.
@matthewdwatkins
Thank you for looking into and replying!!
I made the necessary adjustments as you suggested, however the problem still persists. This does raise a question though, why does cwip accounting need to be enabled for a fixed asset? I too attempted to code dive to find the issue, but it's a rats nest.
I'm still perplexed as to why no dev has actually looked at this issue, being a significant issue that renders this software unusable. A full stack trace was provided!
Agreed, the code is all over the place with no software design document to be found which makes it harder to fault find or even document what should happen. Not even the user docs are helpful in this regard.
My two cents is as follows. This software requires some serious adjustments to how the project is managed. There is a common theme with frappe/erpnext, being look at the code and figure it out. This makes frappe/erpnext a dev driven project that in the end increases project liabilities (bugs, breaking things, security issues, regression etc) which will ultimately lead to unstable software that no one not even the devs can figure out. An example is provided in the issues that are being raised in both frappe/erpnext and the clear lack of documentation in relation to developing and what has been developed.
@jon-nfc I'll try and fix this, will share updates shortly
Description of the issue
When I create a purchase invoice (in USD company currency is AUD), and add 'additional charges' in this case shipping. I can save the invoice however I'm unable to submit the invoice as a message pops up saying
Debit and Credit not equal for Purchase Invoice #ACC-PINV-2021-00093. Difference is 7.77.
7.77 is the value in AUD for the additional charges. however this issue has also occured creating the invoice in the company currency. if no additional charges are added the invoice will submit.I'm unable to submit any of these invoices that have additional charges included in them. currently this prevents us from progressing on a large number of invoices.
I have looked through all options in the PI interface in an attempt to check if I have caused the error, however it appears everything is correct.
Context information (for bug reports)
Output of
bench version
Steps to reproduce the issue
Observed result
message pop-up
Debit and Credit not equal for Purchase Invoice #ACC-PINV-2021-00093. Difference is 7.77.
and the invoice is not submitted.Expected result
Stacktrace / full error message
stack trace below is one single action, clicking on the 'Submit' button for the PI.
Additional information
My setup consists of using docker images see below for details on debian 10. I use the frappe images as the base images and build images that include all of the required apps in them.
OS version / distribution,
ERPNext
install method, etc.