Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 199 additions & 0 deletions addon/controllers/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
import Controller from '@ember/controller';
import { action } from '@ember/object';
import { inject as service } from '@ember/service';

export default class ApplicationController extends Controller {
@service fetch;

get navigationItems() {
return [
{
label: 'Dashboard',
description: 'Ledger dashboard and financial overview.',
icon: 'chart-simple',
route: 'console.ledger.home',
keywords: ['overview', 'metrics', 'finance dashboard'],
},
{
label: 'Billing',
description: 'Invoices and reusable invoice templates.',
icon: 'file-invoice-dollar',
children: [
{
label: 'Invoices',
description: 'Create, send, and manage customer invoices.',
icon: 'file-invoice-dollar',
route: 'console.ledger.billing.invoices.index',
keywords: ['receivables', 'customers', 'payments due'],
},
{
label: 'Invoice Templates',
description: 'Design reusable invoice templates.',
icon: 'file-code',
route: 'console.ledger.billing.invoice-templates.index',
keywords: ['templates', 'invoice design', 'documents'],
},
],
},
{
label: 'Payments',
description: 'Transactions, wallets, and payment gateways.',
icon: 'money-bill-transfer',
children: [
{
label: 'Transactions',
description: 'Review payment and wallet transaction history.',
icon: 'money-bill-transfer',
route: 'console.ledger.payments.transactions.index',
keywords: ['payments', 'charges', 'refunds', 'settlements'],
},
{
label: 'Wallets',
description: 'Manage company, customer, and driver wallets.',
icon: 'wallet',
route: 'console.ledger.payments.wallets.index',
keywords: ['balances', 'top ups', 'payouts'],
},
{
label: 'Gateways',
description: 'Configure payment gateway integrations.',
icon: 'credit-card',
route: 'console.ledger.payments.gateways.index',
keywords: ['stripe', 'payment providers', 'checkout'],
},
],
},
{
label: 'Accounting',
description: 'Chart of accounts, journals, and general ledger.',
icon: 'calculator',
children: [
{
label: 'Chart of Accounts',
description: 'Manage the ledger account structure.',
icon: 'sitemap',
route: 'console.ledger.accounting.accounts.index',
keywords: ['accounts', 'coa', 'accounting'],
},
{
label: 'Journal Entries',
description: 'Browse and create double-entry journal entries.',
icon: 'book',
route: 'console.ledger.accounting.journal.index',
keywords: ['journals', 'debits', 'credits'],
},
{
label: 'General Ledger',
description: 'Review posted activity across accounts.',
icon: 'scroll',
route: 'console.ledger.accounting.general-ledger',
keywords: ['ledger', 'posted transactions', 'account activity'],
},
],
},
{
label: 'Reports',
description: 'Financial statements and operational reports.',
icon: 'chart-line',
children: [
{
label: 'Income Statement',
description: 'Revenue, expenses, and net income.',
icon: 'chart-line',
route: 'console.ledger.reports.income-statement',
keywords: ['profit and loss', 'pnl', 'revenue', 'expenses'],
},
{
label: 'Balance Sheet',
description: 'Assets, liabilities, and equity.',
icon: 'scale-balanced',
route: 'console.ledger.reports.balance-sheet',
keywords: ['assets', 'liabilities', 'equity'],
},
{
label: 'Trial Balance',
description: 'Debit and credit balances by account.',
icon: 'list-check',
route: 'console.ledger.reports.trial-balance',
keywords: ['debits', 'credits', 'balances'],
},
{
label: 'Cash Flow',
description: 'Cash movement over the selected period.',
icon: 'water',
route: 'console.ledger.reports.cash-flow',
keywords: ['cash', 'inflow', 'outflow'],
},
{
label: 'AR Aging',
description: 'Outstanding receivables by age bucket.',
icon: 'clock',
route: 'console.ledger.reports.ar-aging',
keywords: ['receivables', 'overdue invoices', 'aging'],
},
{
label: 'Wallet Summary',
description: 'Wallet balances and activity summary.',
icon: 'wallet',
route: 'console.ledger.reports.wallet-summary',
keywords: ['wallet report', 'balances'],
},
],
},
{
label: 'Settings',
description: 'Ledger billing, payment, and accounting settings.',
icon: 'gear',
children: [
{
label: 'Invoice Settings',
description: 'Configure invoice numbering, defaults, and templates.',
icon: 'file-invoice',
route: 'console.ledger.settings.invoice',
keywords: ['invoice defaults', 'numbering', 'template'],
},
{
label: 'Payment Settings',
description: 'Configure payment defaults and gateway behavior.',
icon: 'gear',
route: 'console.ledger.settings.payment',
keywords: ['payments', 'gateway defaults'],
},
{
label: 'Accounting Settings',
description: 'Configure accounting automation and posting behavior.',
icon: 'calculator',
route: 'console.ledger.settings.accounting',
keywords: ['journal automation', 'posting', 'accounts'],
},
],
},
];
}

@action
async searchNavigation({ query, limit = 12 }) {
const trimmedQuery = query?.trim();

if (!trimmedQuery) {
return [];
}

try {
const response = await this.fetch.get(
'search',
{
query: trimmedQuery,
limit,
},
{
namespace: 'ledger/int/v1',
}
);

return response.results ?? [];
} catch (_) {
return [];
}
}
}
36 changes: 2 additions & 34 deletions addon/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
<EmberWormhole @to="sidebar-menu-items">
<Layout::Sidebar::Item @route="console.ledger.home" @icon="chart-simple">Dashboard</Layout::Sidebar::Item>

<Layout::Sidebar::Panel @open={{true}} @title="Billing">
<Layout::Sidebar::Item @route="console.ledger.billing.invoices.index" @icon="file-invoice-dollar">Invoices</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.billing.invoice-templates.index" @icon="file-code">Invoice Templates</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>

<Layout::Sidebar::Panel @open={{true}} @title="Payments">
<Layout::Sidebar::Item @route="console.ledger.payments.transactions.index" @icon="money-bill-transfer">Transactions</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.payments.wallets.index" @icon="wallet">Wallets</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.payments.gateways.index" @icon="credit-card">Gateways</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>

<Layout::Sidebar::Panel @open={{true}} @title="Accounting">
<Layout::Sidebar::Item @route="console.ledger.accounting.accounts.index" @icon="sitemap">Chart of Accounts</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.accounting.journal.index" @icon="book">Journal Entries</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.accounting.general-ledger" @icon="scroll">General Ledger</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>

<Layout::Sidebar::Panel @open={{true}} @title="Reports">
<Layout::Sidebar::Item @route="console.ledger.reports.income-statement" @icon="chart-line">Income Statement</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.reports.balance-sheet" @icon="scale-balanced">Balance Sheet</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.reports.trial-balance" @icon="list-check">Trial Balance</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.reports.cash-flow" @icon="water">Cash Flow</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.reports.ar-aging" @icon="clock">AR Aging</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.reports.wallet-summary" @icon="wallet">Wallet Summary</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>

<Layout::Sidebar::Panel @open={{true}} @title="Settings">
<Layout::Sidebar::Item @route="console.ledger.settings.invoice" @icon="file-invoice">Invoice Settings</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.settings.payment" @icon="gear">Payment Settings</Layout::Sidebar::Item>
<Layout::Sidebar::Item @route="console.ledger.settings.accounting" @icon="calculator">Accounting Settings</Layout::Sidebar::Item>
</Layout::Sidebar::Panel>
<Layout::Sidebar::Navigator @items={{this.navigationItems}} @searchPlaceholder="Search Ledger..." @searchProvider={{this.searchNavigation}} />
</EmberWormhole>
<Layout::Section::Container>
{{outlet}}
</Layout::Section::Container>
</Layout::Section::Container>
1 change: 1 addition & 0 deletions app/controllers/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from '@fleetbase/ledger-engine/controllers/application';
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fleetbase/ledger-api",
"version": "0.0.4",
"version": "0.0.5",
"description": "Accounting & Invoicing Extension for Fleetbase",
"keywords": [
"fleetbase",
Expand Down
2 changes: 1 addition & 1 deletion extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Ledger",
"version": "0.0.4",
"version": "0.0.5",
"description": "Accounting & Invoicing Extension for Fleetbase",
"repository": "https://github.com/fleetbase/ledger",
"license": "AGPL-3.0-or-later",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/ledger-engine",
"version": "0.0.4",
"version": "0.0.5",
"description": "Accounting & Invoicing Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand Down Expand Up @@ -44,9 +44,9 @@
},
"dependencies": {
"@babel/core": "^7.23.2",
"@fleetbase/ember-core": "^0.3.21",
"@fleetbase/ember-ui": "^0.3.33",
"@fleetbase/fleetops-data": "^0.1.36",
"@fleetbase/ember-core": "^0.3.22",
"@fleetbase/ember-ui": "^0.3.34",
"@fleetbase/fleetops-data": "^0.1.37",
"@fortawesome/ember-fontawesome": "^2.0.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
"@fortawesome/free-brands-svg-icons": "6.4.0",
Expand Down
Loading
Loading