Skip to content

Commit 964f4b5

Browse files
authored
Merge pull request #10 from fleetbase/dev-v0.0.5
v0.0.5
2 parents 8dd3b0e + f0ceda0 commit 964f4b5

11 files changed

Lines changed: 859 additions & 238 deletions

File tree

addon/controllers/application.js

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
import Controller from '@ember/controller';
2+
import { action } from '@ember/object';
3+
import { inject as service } from '@ember/service';
4+
5+
export default class ApplicationController extends Controller {
6+
@service fetch;
7+
8+
get navigationItems() {
9+
return [
10+
{
11+
label: 'Dashboard',
12+
description: 'Ledger dashboard and financial overview.',
13+
icon: 'chart-simple',
14+
route: 'console.ledger.home',
15+
keywords: ['overview', 'metrics', 'finance dashboard'],
16+
},
17+
{
18+
label: 'Billing',
19+
description: 'Invoices and reusable invoice templates.',
20+
icon: 'file-invoice-dollar',
21+
children: [
22+
{
23+
label: 'Invoices',
24+
description: 'Create, send, and manage customer invoices.',
25+
icon: 'file-invoice-dollar',
26+
route: 'console.ledger.billing.invoices.index',
27+
keywords: ['receivables', 'customers', 'payments due'],
28+
},
29+
{
30+
label: 'Invoice Templates',
31+
description: 'Design reusable invoice templates.',
32+
icon: 'file-code',
33+
route: 'console.ledger.billing.invoice-templates.index',
34+
keywords: ['templates', 'invoice design', 'documents'],
35+
},
36+
],
37+
},
38+
{
39+
label: 'Payments',
40+
description: 'Transactions, wallets, and payment gateways.',
41+
icon: 'money-bill-transfer',
42+
children: [
43+
{
44+
label: 'Transactions',
45+
description: 'Review payment and wallet transaction history.',
46+
icon: 'money-bill-transfer',
47+
route: 'console.ledger.payments.transactions.index',
48+
keywords: ['payments', 'charges', 'refunds', 'settlements'],
49+
},
50+
{
51+
label: 'Wallets',
52+
description: 'Manage company, customer, and driver wallets.',
53+
icon: 'wallet',
54+
route: 'console.ledger.payments.wallets.index',
55+
keywords: ['balances', 'top ups', 'payouts'],
56+
},
57+
{
58+
label: 'Gateways',
59+
description: 'Configure payment gateway integrations.',
60+
icon: 'credit-card',
61+
route: 'console.ledger.payments.gateways.index',
62+
keywords: ['stripe', 'payment providers', 'checkout'],
63+
},
64+
],
65+
},
66+
{
67+
label: 'Accounting',
68+
description: 'Chart of accounts, journals, and general ledger.',
69+
icon: 'calculator',
70+
children: [
71+
{
72+
label: 'Chart of Accounts',
73+
description: 'Manage the ledger account structure.',
74+
icon: 'sitemap',
75+
route: 'console.ledger.accounting.accounts.index',
76+
keywords: ['accounts', 'coa', 'accounting'],
77+
},
78+
{
79+
label: 'Journal Entries',
80+
description: 'Browse and create double-entry journal entries.',
81+
icon: 'book',
82+
route: 'console.ledger.accounting.journal.index',
83+
keywords: ['journals', 'debits', 'credits'],
84+
},
85+
{
86+
label: 'General Ledger',
87+
description: 'Review posted activity across accounts.',
88+
icon: 'scroll',
89+
route: 'console.ledger.accounting.general-ledger',
90+
keywords: ['ledger', 'posted transactions', 'account activity'],
91+
},
92+
],
93+
},
94+
{
95+
label: 'Reports',
96+
description: 'Financial statements and operational reports.',
97+
icon: 'chart-line',
98+
children: [
99+
{
100+
label: 'Income Statement',
101+
description: 'Revenue, expenses, and net income.',
102+
icon: 'chart-line',
103+
route: 'console.ledger.reports.income-statement',
104+
keywords: ['profit and loss', 'pnl', 'revenue', 'expenses'],
105+
},
106+
{
107+
label: 'Balance Sheet',
108+
description: 'Assets, liabilities, and equity.',
109+
icon: 'scale-balanced',
110+
route: 'console.ledger.reports.balance-sheet',
111+
keywords: ['assets', 'liabilities', 'equity'],
112+
},
113+
{
114+
label: 'Trial Balance',
115+
description: 'Debit and credit balances by account.',
116+
icon: 'list-check',
117+
route: 'console.ledger.reports.trial-balance',
118+
keywords: ['debits', 'credits', 'balances'],
119+
},
120+
{
121+
label: 'Cash Flow',
122+
description: 'Cash movement over the selected period.',
123+
icon: 'water',
124+
route: 'console.ledger.reports.cash-flow',
125+
keywords: ['cash', 'inflow', 'outflow'],
126+
},
127+
{
128+
label: 'AR Aging',
129+
description: 'Outstanding receivables by age bucket.',
130+
icon: 'clock',
131+
route: 'console.ledger.reports.ar-aging',
132+
keywords: ['receivables', 'overdue invoices', 'aging'],
133+
},
134+
{
135+
label: 'Wallet Summary',
136+
description: 'Wallet balances and activity summary.',
137+
icon: 'wallet',
138+
route: 'console.ledger.reports.wallet-summary',
139+
keywords: ['wallet report', 'balances'],
140+
},
141+
],
142+
},
143+
{
144+
label: 'Settings',
145+
description: 'Ledger billing, payment, and accounting settings.',
146+
icon: 'gear',
147+
children: [
148+
{
149+
label: 'Invoice Settings',
150+
description: 'Configure invoice numbering, defaults, and templates.',
151+
icon: 'file-invoice',
152+
route: 'console.ledger.settings.invoice',
153+
keywords: ['invoice defaults', 'numbering', 'template'],
154+
},
155+
{
156+
label: 'Payment Settings',
157+
description: 'Configure payment defaults and gateway behavior.',
158+
icon: 'gear',
159+
route: 'console.ledger.settings.payment',
160+
keywords: ['payments', 'gateway defaults'],
161+
},
162+
{
163+
label: 'Accounting Settings',
164+
description: 'Configure accounting automation and posting behavior.',
165+
icon: 'calculator',
166+
route: 'console.ledger.settings.accounting',
167+
keywords: ['journal automation', 'posting', 'accounts'],
168+
},
169+
],
170+
},
171+
];
172+
}
173+
174+
@action
175+
async searchNavigation({ query, limit = 12 }) {
176+
const trimmedQuery = query?.trim();
177+
178+
if (!trimmedQuery) {
179+
return [];
180+
}
181+
182+
try {
183+
const response = await this.fetch.get(
184+
'search',
185+
{
186+
query: trimmedQuery,
187+
limit,
188+
},
189+
{
190+
namespace: 'ledger/int/v1',
191+
}
192+
);
193+
194+
return response.results ?? [];
195+
} catch (_) {
196+
return [];
197+
}
198+
}
199+
}

addon/templates/application.hbs

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
11
<EmberWormhole @to="sidebar-menu-items">
2-
<Layout::Sidebar::Item @route="console.ledger.home" @icon="chart-simple">Dashboard</Layout::Sidebar::Item>
3-
4-
<Layout::Sidebar::Panel @open={{true}} @title="Billing">
5-
<Layout::Sidebar::Item @route="console.ledger.billing.invoices.index" @icon="file-invoice-dollar">Invoices</Layout::Sidebar::Item>
6-
<Layout::Sidebar::Item @route="console.ledger.billing.invoice-templates.index" @icon="file-code">Invoice Templates</Layout::Sidebar::Item>
7-
</Layout::Sidebar::Panel>
8-
9-
<Layout::Sidebar::Panel @open={{true}} @title="Payments">
10-
<Layout::Sidebar::Item @route="console.ledger.payments.transactions.index" @icon="money-bill-transfer">Transactions</Layout::Sidebar::Item>
11-
<Layout::Sidebar::Item @route="console.ledger.payments.wallets.index" @icon="wallet">Wallets</Layout::Sidebar::Item>
12-
<Layout::Sidebar::Item @route="console.ledger.payments.gateways.index" @icon="credit-card">Gateways</Layout::Sidebar::Item>
13-
</Layout::Sidebar::Panel>
14-
15-
<Layout::Sidebar::Panel @open={{true}} @title="Accounting">
16-
<Layout::Sidebar::Item @route="console.ledger.accounting.accounts.index" @icon="sitemap">Chart of Accounts</Layout::Sidebar::Item>
17-
<Layout::Sidebar::Item @route="console.ledger.accounting.journal.index" @icon="book">Journal Entries</Layout::Sidebar::Item>
18-
<Layout::Sidebar::Item @route="console.ledger.accounting.general-ledger" @icon="scroll">General Ledger</Layout::Sidebar::Item>
19-
</Layout::Sidebar::Panel>
20-
21-
<Layout::Sidebar::Panel @open={{true}} @title="Reports">
22-
<Layout::Sidebar::Item @route="console.ledger.reports.income-statement" @icon="chart-line">Income Statement</Layout::Sidebar::Item>
23-
<Layout::Sidebar::Item @route="console.ledger.reports.balance-sheet" @icon="scale-balanced">Balance Sheet</Layout::Sidebar::Item>
24-
<Layout::Sidebar::Item @route="console.ledger.reports.trial-balance" @icon="list-check">Trial Balance</Layout::Sidebar::Item>
25-
<Layout::Sidebar::Item @route="console.ledger.reports.cash-flow" @icon="water">Cash Flow</Layout::Sidebar::Item>
26-
<Layout::Sidebar::Item @route="console.ledger.reports.ar-aging" @icon="clock">AR Aging</Layout::Sidebar::Item>
27-
<Layout::Sidebar::Item @route="console.ledger.reports.wallet-summary" @icon="wallet">Wallet Summary</Layout::Sidebar::Item>
28-
</Layout::Sidebar::Panel>
29-
30-
<Layout::Sidebar::Panel @open={{true}} @title="Settings">
31-
<Layout::Sidebar::Item @route="console.ledger.settings.invoice" @icon="file-invoice">Invoice Settings</Layout::Sidebar::Item>
32-
<Layout::Sidebar::Item @route="console.ledger.settings.payment" @icon="gear">Payment Settings</Layout::Sidebar::Item>
33-
<Layout::Sidebar::Item @route="console.ledger.settings.accounting" @icon="calculator">Accounting Settings</Layout::Sidebar::Item>
34-
</Layout::Sidebar::Panel>
2+
<Layout::Sidebar::Navigator @items={{this.navigationItems}} @searchPlaceholder="Search Ledger..." @searchProvider={{this.searchNavigation}} />
353
</EmberWormhole>
364
<Layout::Section::Container>
375
{{outlet}}
38-
</Layout::Section::Container>
6+
</Layout::Section::Container>

app/controllers/application.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '@fleetbase/ledger-engine/controllers/application';

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fleetbase/ledger-api",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Accounting & Invoicing Extension for Fleetbase",
55
"keywords": [
66
"fleetbase",

extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Ledger",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Accounting & Invoicing Extension for Fleetbase",
55
"repository": "https://github.com/fleetbase/ledger",
66
"license": "AGPL-3.0-or-later",

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleetbase/ledger-engine",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Accounting & Invoicing Extension for Fleetbase",
55
"keywords": [
66
"fleetbase-extension",
@@ -44,9 +44,9 @@
4444
},
4545
"dependencies": {
4646
"@babel/core": "^7.23.2",
47-
"@fleetbase/ember-core": "^0.3.21",
48-
"@fleetbase/ember-ui": "^0.3.33",
49-
"@fleetbase/fleetops-data": "^0.1.36",
47+
"@fleetbase/ember-core": "^0.3.22",
48+
"@fleetbase/ember-ui": "^0.3.34",
49+
"@fleetbase/fleetops-data": "^0.1.37",
5050
"@fortawesome/ember-fontawesome": "^2.0.0",
5151
"@fortawesome/fontawesome-svg-core": "6.4.0",
5252
"@fortawesome/free-brands-svg-icons": "6.4.0",

0 commit comments

Comments
 (0)