import glob

target = """        <a href="/dashboard/invoices" class="erp-navlink">
          <span>🧾</span> Hóa Đơn & Thuế
        </a>"""

replacement = (
    target
    + """
        <a href="/dashboard/banking" class="erp-navlink">
          <span>🏦</span> Đối Soát Ngân Hàng
        </a>"""
)

files = glob.glob("app/static/*.html")
for f in files:
    with open(f, "r", encoding="utf-8") as file:
        content = file.read()

    if target in content:
        content = content.replace(target, replacement)
        with open(f, "w", encoding="utf-8") as file:
            file.write(content)
        print(f"Updated {f}")
    elif '<a href="/dashboard/invoices"' in content:
        print(f"Found invoices link in {f} but format mismatched")
