frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
22.01k stars 7.38k forks source link

Purchase Invoice - Marked Paid but still shows unpaid against Supplier Account #35002

Open jukkis69 opened 1 year ago

jukkis69 commented 1 year ago

Information about bug

Base currency : Pound GBP Purchase Invoice includes VAT Amount Entering Purchasing Invoice in Euros 11.9833 + 2.3967 = 14.38 The purchase invoice was marked as 'Paid' at the time of entering But payment entry was recorded as 12.6527 Euros = 11.1329 Pound On the purchase invoice the currency was manually changed from GBP to EUR (supplier Miscellaneous does not have default currency set) --> The Purchase invoice records only partial payment --> There is outstanding amount on the supplier Account --> Shows payment overdue image1 Image4

image2

image3

Module

accounts

Version

Frappe: 14.32.1 ERPNext V14.21

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

jukkis69 commented 1 year ago

I think there is a bug when the payment is recorded. Maybe it is because the ERPNext records the Miscellaneous account balance in GBP and it does not handle GBP/EUR conversion correctly, when Purchase invoice is entered with 'Paid' flag.

If you look at the above image, the payment is recorded as 12.6527 Euros = £11.1329 GBP. The payment should have been recorded as 14.38 Euros = 12.6527 GBP ! (exchange rate 1.13675) So because at the time of the payment, the payment is selected to be in Euros (and invoice was in Euros) and the base currency is not in Euros (in general for sure, for the supplier Account not selected but seems to default to GBP), then ERPnext records GBP payment amount in the Euros field (and then recorders other GBP/Eur conversion of this to the supplier ledger).

If I post the invoice without payment, and then create 'Payment Entry' you can see the amount entered to the ledger is £12.65 which is about correct - seemingly confirming the above theory.

Image5

jukkis69 commented 1 year ago

On my test server V13 ERPNext 13.49.5 the same issue happens.

Figured out two possible V14 workarounds:

  1. Post the invoice first and then create separately the Payment Entry by adjusting the amounts
  2. Create the Purchase Invoice - and Save it. The system then pulls the GBP and EUR amounts to the Payments tab (incorrectly). Go back there before Submit. Then manually adjust the Euro amount to match the invoice amount. Save and Submit.
jukkis69 commented 1 month ago

Updating to the below version, this problem seems to go away. So perhaps fixed along the way, although bug has not been cleared. ERPNext: v14.74.3 (version-14) Frappe Framework: v14.81.6 (version-14)