mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-14 18:51:21 +00:00
* feat: initial SPA setup for banking * wip: bring over new banking module * feat: added Espresso design tokens * feat: button styles * fix: add all ink colors * wip: espresso design system changes * feat: button and badge espresso components * fix: button styling for reconcile * feat: Espresso progress bar * feat: Espresso toggle switch * feat: Espresso tabs design * fix: vertical tab support * fix: button sizing across modals * feat: Espresso style table layout * feat: Espresso tooltip * feat: Espresso elevations and checkbox * feat: Dialog with Espresso styles * feat: Espresso textarea * fix: input styles * fix: colors on bank picker * fix: breadcrumb styling * fix: bank picker styling * feat: create doctypes and fields for bank reconciliation * feat: APIs for banking * fix: use date format parser * fix: font styling to match Espresso * wip: settings modal * feat: settings dialog component * fix: icons and invalid requests * feat: preferences tab * fix: adjust icon stroke width to 1.5 * feat: rule configuration in settings * fix: remove sheet component * feat: alert and error banner component * feat: dropdown in Espresso * feat: popover and select in Espresso * fix: cleanup more styles * fix: match size of link fields * feat: command styling * fix: remove unused style tokens * fix: styles for global date picker dropdown * fix: styles for match and reconcile * feat: table Espresso component * feat: remove all other design tokens * fix: remove unused tokens * fix: form elements * fix: remove unused styles and fix filters in bank transaction list * feat: fetch bank rec doctypes for filtering * fix: record payment modal * feat: support for dark mode switching * fix: move bank logos to public folder * feat: add support for RTL * feat: support for RTL * chore: send layout direction in dev boot * fix: make checkbox work in RTL * feat: dark mode support * fix: dark mode style * feat: bank logos in dark mode * feat: dark mode bank logos * chore: use dark mode bank logos everywhere * chore: move rule evaluation to controller * chore: add tests for bank transaction rules * fix: move deps to fix actions errors * fix: move tw-animate-css to deps * fix: remove shadcn * fix: do not open modal if no transactions selected * fix: add translation strings * feat: add banner on existing bank reconciliation tool * feat: bank statement import * fix: translations and layout directions * fix: validation for transaction matching rule * fix: styles * fix: show conflicting transactions in alert * fix: show help text for new banking module forms * feat: show total debits and credits * fix: dark mode colors in automatic config * feat: add keyboard shortcuts help * feat: added keyboard shortcut for settings * fix: decrease size of progress bar * chore: bump packages * feat: add tests for statement import * fix: settings dialog * fix: show banner on small screens * fix: show banner when no bank account set
140 lines
6.6 KiB
TypeScript
140 lines
6.6 KiB
TypeScript
import BankBalance from "@/components/features/BankReconciliation/BankBalance"
|
|
import BankClearanceSummary from "@/components/features/BankReconciliation/BankClearanceSummary"
|
|
import BankPicker from "@/components/features/BankReconciliation/BankPicker"
|
|
import BankRecDateFilter from "@/components/features/BankReconciliation/BankRecDateFilter"
|
|
import BankReconciliationStatement from "@/components/features/BankReconciliation/BankReconciliationStatement"
|
|
import BankTransactions from "@/components/features/BankReconciliation/BankTransactionList"
|
|
import BankTransactionUnreconcileModal from "@/components/features/BankReconciliation/BankTransactionUnreconcileModal"
|
|
import CompanySelector from "@/components/features/BankReconciliation/CompanySelector"
|
|
import IncorrectlyClearedEntries from "@/components/features/BankReconciliation/IncorrectlyClearedEntries"
|
|
import MatchAndReconcile from "@/components/features/BankReconciliation/MatchAndReconcile"
|
|
import Settings from "@/components/features/Settings/Settings"
|
|
import ActionLog from "@/components/features/ActionLog/ActionLog"
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
|
import { TooltipProvider } from "@/components/ui/tooltip"
|
|
import _ from "@/lib/translate"
|
|
import { useLayoutEffect, useRef, useState } from "react"
|
|
import { AlertTriangleIcon, CheckCircleIcon, HomeIcon, LandmarkIcon, ListIcon, ScrollTextIcon, ShuffleIcon } from "lucide-react"
|
|
import { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "@/components/ui/breadcrumb"
|
|
import { Badge } from "@/components/ui/badge"
|
|
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/ui/empty"
|
|
import { Button } from "@/components/ui/button"
|
|
import { useAtomValue } from "jotai"
|
|
import { selectedBankAccountAtom } from "@/components/features/BankReconciliation/bankRecAtoms"
|
|
|
|
|
|
const BankReconciliation = () => {
|
|
|
|
const [headerHeight, setHeaderHeight] = useState(0)
|
|
|
|
const ref = useRef<HTMLDivElement>(null)
|
|
|
|
useLayoutEffect(() => {
|
|
if (ref.current) {
|
|
setHeaderHeight(ref.current.clientHeight)
|
|
}
|
|
}, [])
|
|
|
|
const remainingHeightAfterTabs = window.innerHeight - headerHeight - 270
|
|
|
|
return (
|
|
<div>
|
|
<div className="p-4 flex-col gap-4 md:flex hidden">
|
|
<div ref={ref} className="flex flex-col gap-4">
|
|
<div className="flex justify-between">
|
|
<div className="flex items-center gap-6">
|
|
<Breadcrumb>
|
|
<BreadcrumbList>
|
|
<BreadcrumbItem>
|
|
<a href="/desk" className="text-ink-gray-7">
|
|
<HomeIcon size={16} />
|
|
</a>
|
|
</BreadcrumbItem>
|
|
<BreadcrumbSeparator />
|
|
<BreadcrumbItem>
|
|
<BreadcrumbPage>
|
|
<div className="flex gap-1 items-center">
|
|
{_("Banking")} <Badge theme="violet" variant="subtle">{_("Beta")}</Badge>
|
|
</div>
|
|
|
|
</BreadcrumbPage>
|
|
</BreadcrumbItem>
|
|
</BreadcrumbList>
|
|
</Breadcrumb>
|
|
<CompanySelector />
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
<TooltipProvider>
|
|
<Settings />
|
|
<ActionLog />
|
|
</TooltipProvider>
|
|
<BankRecDateFilter />
|
|
</div>
|
|
</div>
|
|
<BankPicker />
|
|
<BankBalance />
|
|
</div>
|
|
<BankRecTabs remainingHeightAfterTabs={remainingHeightAfterTabs} />
|
|
<BankTransactionUnreconcileModal />
|
|
</div>
|
|
<div className="md:hidden flex h-screen items-center justify-between">
|
|
<Empty>
|
|
<EmptyMedia>
|
|
<LandmarkIcon />
|
|
</EmptyMedia>
|
|
<EmptyHeader>
|
|
<EmptyTitle>
|
|
{_("Banking")}
|
|
</EmptyTitle>
|
|
<EmptyDescription>
|
|
{_("This screen is not supported on mobile devices.")}
|
|
</EmptyDescription>
|
|
</EmptyHeader>
|
|
<EmptyContent>
|
|
<Button asChild>
|
|
<a href="/desk">
|
|
{_("Go to Desktop")}
|
|
</a>
|
|
</Button>
|
|
</EmptyContent>
|
|
</Empty>
|
|
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
const BankRecTabs = ({ remainingHeightAfterTabs }: { remainingHeightAfterTabs: number }) => {
|
|
const selectedBankAccount = useAtomValue(selectedBankAccountAtom)
|
|
|
|
if (!selectedBankAccount) {
|
|
return null
|
|
}
|
|
|
|
return <Tabs defaultValue="Match and Reconcile">
|
|
<TabsList>
|
|
<TabsTrigger value="Match and Reconcile"><ShuffleIcon /> {_("Match and Reconcile")}</TabsTrigger>
|
|
<TabsTrigger value="Bank Reconciliation Statement"><ScrollTextIcon /> {_("Bank Reconciliation Statement")}</TabsTrigger>
|
|
<TabsTrigger value="Bank Transactions"><ListIcon />{_("Bank Transactions")}</TabsTrigger>
|
|
<TabsTrigger value="Bank Clearance Summary"><CheckCircleIcon />{_("Bank Clearance Summary")}</TabsTrigger>
|
|
<TabsTrigger value="Incorrectly Cleared Entries"><AlertTriangleIcon /> {_("Incorrectly Cleared Entries")}</TabsTrigger>
|
|
</TabsList>
|
|
<TabsContent value="Match and Reconcile">
|
|
<MatchAndReconcile contentHeight={remainingHeightAfterTabs} />
|
|
</TabsContent>
|
|
<TabsContent value="Bank Reconciliation Statement">
|
|
<BankReconciliationStatement />
|
|
</TabsContent>
|
|
<TabsContent value="Bank Transactions">
|
|
<BankTransactions />
|
|
</TabsContent>
|
|
<TabsContent value="Bank Clearance Summary">
|
|
<BankClearanceSummary />
|
|
</TabsContent>
|
|
<TabsContent value="Incorrectly Cleared Entries">
|
|
<IncorrectlyClearedEntries />
|
|
</TabsContent>
|
|
</Tabs>
|
|
}
|
|
|
|
export default BankReconciliation |