alyf-de / banking

An Open Banking Integration with ERPNext
GNU General Public License v3.0
38 stars 18 forks source link

Update Party Everywhere #47

Closed barredterra closed 5 months ago

barredterra commented 11 months ago

Problem

After syncing transactions for three months, there will be at least three Bank Transactions for each employee as well as for all recurring customers and suppliers. If we manually set the party details of a Bank Transaction, we'd have to set them 3+ times for every party. This becomes time consuming very quickly.

Proposed Solution

In the "Details" tab below the Party field, add a checkbox Update Party In All Transactions. If this is enabled, the party details should also be updated in all unreconciled Bank Transactions with the same IBAN, that don't have a party set already. Approximately like this:

if not current_iban:
    throw("We don't have an IBAN so we cannot match anything")

frappe.db.update(
    "Bank Transaction",
    filters=[
        ["iban", "=", current_iban],
        ["party", "is", "not set"],
        ["status", "=", "Unreconciled"]
    ],
    {
        "party": new_party,
        "party_type": new_party_type,
    }
)
marination commented 9 months ago

@barredterra We will still have to set it for every new transaction right ? This seems like a good opportunity to utilise party matching. In the Bank Transaction list we could add a menu item to auto set party for all transactions that don't have it (older transactions). Essentially, make way to trigger party matching. For every new transaction party matching should work.

If party matching isn't working for some cases, it's a good time to introduce party matching rules with fixed mappings by user (e.g if description has "MAX MUELLER 1034" then party is "Maximillan Mueller")