fix: UI/UX issues in new banking module (#54824)

* fix: enforce user permissions on bank account get_list

* feat: auto-select last used bank account

* fix: skeleton loaders in bank balance

* fix: show empty state for no bank transactions

* chore: add Stripe and PayPal logos

* fix: alignment of header text in list-view

* fix: wrap words in transaction description

* fix: change file-dropzone color on hover
This commit is contained in:
Nikhil Kothari
2026-05-11 13:02:11 +05:30
committed by GitHub
parent 03acbc3dc9
commit f4008adc16
11 changed files with 99 additions and 66 deletions

View File

@@ -12,7 +12,6 @@ from frappe.contacts.address_and_contact import (
)
from frappe.model.document import Document
from frappe.utils import comma_and, get_link_to_form
from pypika import Order
class BankAccount(Document):
@@ -139,38 +138,35 @@ def get_list(company: str, show_disabled: bool = False):
@return: A list of bank accounts
"""
frappe.has_permission("Bank Account", ptype="read", throw=True)
filters = {"is_company_account": 1, "company": company}
if not show_disabled:
filters["disabled"] = 0
bank_account = frappe.qb.DocType("Bank Account")
account = frappe.qb.DocType("Account")
query = (
frappe.qb.from_(bank_account)
.join(account)
.on(bank_account.account == account.name)
.select(
bank_account.name,
account.account_currency,
bank_account.account,
bank_account.company,
bank_account.account_name,
bank_account.is_default,
bank_account.bank,
bank_account.account_type,
bank_account.account_subtype,
bank_account.bank_account_no,
bank_account.last_integration_date,
bank_account.is_credit_card,
)
.where(bank_account.is_company_account == 1)
.where(bank_account.company == company)
.orderby(bank_account.is_default, order=Order.desc)
bank_accounts = frappe.get_list(
"Bank Account",
filters=filters,
order_by="is_default desc",
fields=[
"name",
"account",
"company",
"account_name",
"is_default",
"bank",
"account_type",
"account_subtype",
"bank_account_no",
"last_integration_date",
"is_credit_card",
],
)
if not show_disabled:
query = query.where(bank_account.disabled == 0)
for bank_account in bank_accounts:
bank_account.account_currency = frappe.get_cached_value(
"Account", bank_account.account, "account_currency"
)
return query.run(as_dict=True)
return bank_accounts
@frappe.whitelist(methods=["GET"])

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -0,0 +1,9 @@
<svg width="360" height="150" viewBox="0 0 360 150" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M360 77.4001C360 51.8001 347.6 31.6001 323.9 31.6001C300.1 31.6001 285.7 51.8001 285.7 77.2001C285.7 107.3 302.7 122.5 327.1 122.5C339 122.5 348 119.8 354.8 116V96.0001C348 99.4001 340.2 101.5 330.3 101.5C320.6 101.5 312 98.1001 310.9 86.3001H359.8C359.8 85.0001 360 79.8001 360 77.4001ZM310.6 67.9001C310.6 56.6001 317.5 51.9001 323.8 51.9001C329.9 51.9001 336.4 56.6001 336.4 67.9001H310.6Z" fill="#533AFD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M247.1 31.6001C237.3 31.6001 231 36.2001 227.5 39.4001L226.2 33.2001H204.2V149.8L229.2 144.5L229.3 116.2C232.9 118.8 238.2 122.5 247 122.5C264.9 122.5 281.2 108.1 281.2 76.4001C281.1 47.4001 264.6 31.6001 247.1 31.6001ZM241.1 100.5C235.2 100.5 231.7 98.4001 229.3 95.8001L229.2 58.7001C231.8 55.8001 235.4 53.8001 241.1 53.8001C250.2 53.8001 256.5 64.0001 256.5 77.1001C256.5 90.5001 250.3 100.5 241.1 100.5Z" fill="#533AFD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M169.8 25.7L194.9 20.3V0L169.8 5.3V25.7Z" fill="#533AFD"/>
<path d="M194.9 33.3H169.8V120.8H194.9V33.3Z" fill="#533AFD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M142.9 40.7L141.3 33.3H119.7V120.8H144.7V61.5C150.6 53.8 160.6 55.2 163.7 56.3V33.3C160.5 32.1 148.8 29.9 142.9 40.7Z" fill="#533AFD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M92.8999 11.6001L68.4999 16.8001L68.3999 96.9001C68.3999 111.7 79.4999 122.6 94.2999 122.6C102.5 122.6 108.5 121.1 111.8 119.3V99.0001C108.6 100.3 92.7999 104.9 92.7999 90.1001V54.6001H111.8V33.3001H92.7999L92.8999 11.6001Z" fill="#533AFD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.3 58.7001C25.3 54.8001 28.5 53.3001 33.8 53.3001C41.4 53.3001 51 55.6001 58.6 59.7001V36.2001C50.3 32.9001 42.1 31.6001 33.8 31.6001C13.5 31.6001 0 42.2001 0 59.9001C0 87.5001 38 83.1001 38 95.0001C38 99.6001 34 101.1 28.4 101.1C20.1 101.1 9.5 97.7001 1.1 93.1001V116.9C10.4 120.9 19.8 122.6 28.4 122.6C49.2 122.6 63.5 112.3 63.5 94.4001C63.4 64.6001 25.3 69.9001 25.3 58.7001Z" fill="#533AFD"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB