Payment Entry Has Been Modified After You Pulled It. Please Pull Again

Hi - I have several Purchase Invoices and Sales Invoices where amounts received are slightly different than the amount recorded my the document. One of these is because someone accidently checked the use rounded total checkbox and shouldn’t have.

Regardless of reason, we try to correct by doing a journal entry to clear the amount difference but we get this error:

What can we do to prevent this? Are we doing the wrong thing by using a journal entry? Is there another way?

One thing we thought of that might be the cause is because the original document is from a closed period?

I have read some posts on this topic but they seem to refer to advanced payments which this is not.

Thanks!

Mark

what is your erpnext version ?

Oh sorry it is 13.11.1 and Frappe 13.11.0.

Thanks,

Mark

Still hoping someone can help wit this problem!

Mark

This is a bug when some paymets you are trying to reconcile are being done using JOURNAL ENTRY. Try removing those and reconcile

I see you only have home and that seems to be JV. Can you not try making one from payment entry screen

Asoral - sorry I’m not sure what you mean by only having home and being JV? We are trying to apply the journal entry form the payments screen.

Thanks,

Mark

@smakheads I ran into this in v15 (details: see below).

I looked into the code throwing the error in apps/erpnext/erpnext/accounts/utils.py:

def check_if_advance_entry_modified(args):
    """
    check if there is already a voucher reference
    check if amount is same
    check if jv is submitted
    """
    if not args.get("unreconciled_amount"):
        args.update({"unreconciled_amount": args.get("unadjusted_amount")})

    ret = None
    if args.voucher_type == "Journal Entry":
        journal_entry = frappe.qb.DocType("Journal Entry")
        journal_acc = frappe.qb.DocType("Journal Entry Account")

        q = (
            frappe.qb.from_(journal_entry)
            .inner_join(journal_acc)
            .on(journal_entry.name == journal_acc.parent)
            .select(journal_acc[args.get("dr_or_cr")])
            .where(
                (journal_acc.account == args.get("account"))
                & ((journal_acc.party_type == args.get("party_type")))
                & ((journal_acc.party == args.get("party")))
                & (
                    (journal_acc.reference_type.isnull())
                    | (journal_acc.reference_type.isin(["", "Sales Order", "Purchase Order"]))
                )
                & ((journal_entry.name == args.get("voucher_no")))
                & ((journal_acc.name == args.get("voucher_detail_no")))
                & ((journal_entry.docstatus == 1))
            )
        )

    else:
       #### redacted out

    ret = q.run(as_dict=True)

    if not ret:
        throw(_("""Payment Entry has been modified after you pulled it. Please pull it again."""))

So it looked like a requirement having to do with the reference. I then trying messing with that, to no avail. I ended up creating a Sales Order and that led (won’t describe the detailed steps) to being able to submit the invoice. But what’s interesting is that even after cancelling, unlinking, etc. the Sales Order, the Advance Payments done via Journal Entry still work! So it seems more like some bug having to do with the database table containing Sales Orders being initially empty or non-existant. Maybe someone from the developers can have a look…

Anyhow, simple workaround attempt: Try to create a Sales Order and see if that helps.

system versions:

erpnext 15.19.0
erpnextswiss 1.23.2
frappe 15.20.0
hrms 15.16.0
payments 0.0.1