-
Notifications
You must be signed in to change notification settings - Fork 7
Ledger Working Release #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
231 commits
Select commit
Hold shift + click to select a range
53fd9a4
Working on first ledger release
roncodes af8ee78
feat: Complete backend implementation for Ledger module
roncodes b3233ff
Merge pull request #3 from fleetbase/feature/backend-implementation
roncodes abac1b1
New extension structure
roncodes 91e723c
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 3856dc0
feat(ledger): implement Milestone 1 — core backend stabilisation
67412f0
feat(payment-gateways): implement full payment gateway abstraction la…
a87b3a4
feat(wallet): Milestone 3 — complete wallet system for drivers and cu…
b5b63cc
feat(reports): implement Milestone 4 — full financial reporting suite
0083f43
feat(frontend): implement complete Milestone 5 frontend UI
9cc366e
fix(frontend+backend): correct fetch namespace pattern and replace pu…
3b8d3b0
fix engine.js and extension.js
roncodes e5b3841
fixed up
roncodes d2b06af
fix(frontend): correct sidebar to use separate Layout::Sidebar::Panel…
a675a65
fix template
roncodes 5ab86f2
fix(frontend): add adapters, correct dashboard widget system, fix sid…
a781afe
fix(frontend): correct fetch service call signature to use 3 args (ur…
d0f919f
Fix: add TYPE_* constants to Account model (resolves undefined consta…
67b7e55
Fix: remove namespace from all route model() store.query/findRecord c…
8e8aad7
Refactor: adopt HasApiControllerBehavior pattern for all internal con…
d5cfb7e
Fix: extend core-api Transaction model in Ledger; remove findRecord o…
5c7b7b2
Fix: remove duplicate unique index declarations from all migrations
52b2f1d
Fix: add softDeletes to all ledger tables and models
e6d271b
Refactor: prefix all Ember models/adapters with ledger-, add serializ…
66ee359
Fix: update all store.query/findRecord/createRecord to use ledger- pr…
19c7984
refactor: restructure navigation to Receivables/Payments/Accounting/R…
4303566
rename: receivables -> billing throughout (future-proofs for AP/payab…
5bf6137
feat: add action services, fix parent templates to outlet, use Layout…
c66f06e
fix: use valid camelCase param name in wallet-transaction-actions tra…
7efb91e
fix: reorganise all route files and app re-exports to match new navig…
294bae4
ran ptettier
roncodes f65e767
fix: correct stale route class names to match new file paths
59e8bb1
fix: correct all index controllers - limit=30, getter order, whitespace
2780d1b
feat: update models to new Transaction schema, improve columns and fi…
965a0f8
feat: implement full transactions table columns getter with filters a…
56cad0e
feat: add computed date properties to all models; fix transactions co…
d560825
feat: add complete translations for all resource, common, column, and…
4df65c1
fix: action services - correct panel method indentation, blank lines …
d189dbb
feat(frontend): update all detail panel templates and controllers to …
4001522
fix(frontend): correct Handlebars syntax in all detail panel templates
6003331
fix(frontend): replace all format-date usages with correct helpers/co…
736e14b
feat(frontend): rewrite all resource details and panel-header compone…
a34e53f
fixed controller app rexports and ran prettier
roncodes 1cce964
fix(app): correct re-export paths for payments controllers
201a712
feat(frontend): add Layout::Resource::Panel::HeaderActions to all pan…
da5d42d
fixed transaction panel-header
roncodes 3c9b844
feat(frontend): add Spacer @height=200px to bottom of all resource de…
c425b1c
fix backend controller namings
roncodes 70f6ea8
fix(backend): call parent::__construct() in WalletController and Gate…
275a014
refactor(wallet): remove WalletTransaction in favour of core Transact…
468f026
feat(columns): implement full columns getter for wallets and gateways…
6f024e4
few minor fixes
roncodes 3014618
feat(forms): implement complete form components for all 6 Ledger doma…
3ee830b
feat(routes): add new/edit routes, controllers, templates and app re-…
1d65f18
feat(ledger): auto-provision accounts and wallets on company/user cre…
51f632b
fix(ledger): add name, description, is_frozen columns to ledger_wallets
ed97277
fix(ledger): correct panel-header markup and remove wallet new button
02606ad
fix(templates): replace all formatted_ amount properties with format-…
e62ee96
fix(ledger): fix user wallet provisioning and add helpText to all act…
141d4aa
fix(provisioning): add user wallet backfill to provision command, ren…
fa4b777
fix(wallets): provision personal wallet for every user regardless of …
f96dbaa
fix(seeder): require LedgerSeeder file directly to avoid container re…
5eaff8a
revert: remove require_once hack, use clean new LedgerSeeder() instan…
1eaec89
fix(wallets): keep company wallets, fix model fields and type filter
cbf3bcb
fix(dashboard): replace is_active with status=active in LedgerService
916d9a4
fix(migration): do not restore old unique(subject_uuid, subject_type)…
88b73a7
fix(seeder): use deterministic public_id in LedgerSeeder to prevent c…
4f4339f
fix: transactions direction/items/relationships, wallet owner column,…
ffd1b63
ran linter
roncodes a835abb
fix(wallets): owner column/details display, status badge, type label,…
be0dbf0
few tweaks for balance columns
roncodes b5939ba
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 6821248
feat(wallets): add funds & transfer modals; fix gateway form placehol…
fea0074
fix(transactions): add direction_sign/direction_color computed props;…
420f493
minor tweaks
roncodes 6ffbe6c
fix(wallets): use MoneyInput for amount fields; update monetary model…
f2e336c
fix(models): change all monetary @attr('number') to @attr('string') a…
6d760de
fix(wallets): fix getTransactions return type error; add Freeze/Unfre…
74b0cf2
fix(wallets): fix Freeze/Unfreeze button reactivity after action
4a498ca
fix: is_frozen as computed accessor from status; clean up wallet mode…
e7a7cbd
refactor: use Table component in wallet transaction-history; remove p…
6556f97
ran prettier
roncodes b22a4f0
fix: rename journal date column to entry_date across backend
dcd9723
fix: journal entries missing fields and column definition corrections
23cbb37
fix: remove named parameter calls in WalletController — use positiona…
4900a20
Use proper transaction resource collection for response
roncodes 7f5dabe
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 468db04
ran formatters
roncodes 103252b
fix: extract Transaction model from transfer result array in WalletCo…
e1b4128
set journal type value
roncodes 92d23a7
fix: journal form MoneyInput, all detail panels open, journal account…
495de58
titleize the type property for journal entry
roncodes 9d2fc1b
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 9aa89be
feat: implement General Ledger page
76019de
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 3edb543
fix: general ledger UI and 302 redirect issues
34b7241
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 5e81ec0
fix: use task.isRunning instead of manual isLoading; Spinner not Load…
0250637
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes b026329
minor template tweaks on general ledger
roncodes 75c4046
Zfix: general ledger UI polish — range datepicker, toggle icon, scrol…
79d8868
general ledger working correctly
roncodes f75c58a
fix: remove public_id from $appends in all Ledger models
66a79a9
fix: dashboard widgets — titled containers, format-currency, skeleton…
1986fe7
fix: widgets — full border, no container on overview, companyCurrency…
74c9f9c
fix: wallet widgets — all-owner wallet summary, correct data paths, f…
36a664a
fix: wallet topUp controller — correct paymentData arg and status key
6af2ba0
feat: overhaul all 6 report pages - styling, data integrity, trial ba…
d007a07
fix: report styling - remove max-w-4xl, round tfoot corners, darken d…
48c33a9
fix: add @buttons={{array "clear"}} to DatePicker in cash-flow, incom…
b988cfe
fix: use wrapper div border pattern for all report tables to fix miss…
ec41837
fix: replace LoadingIndicator with Spinner and remove p-4 from compon…
d014fb9
fix: move namespace to 3rd options arg in all fetch() calls; refactor…
c65795f
fix: replace non-existent table/cell/boolean with table/cell/base via…
1229396
fix: add edit action to GatewayActionsService to transition to edit r…
f676e4b
fix: replace all modals/gateway-form references with route transitions
8f0e6e7
feat: add comprehensive navigation shortcuts with icons to Ledger hea…
02e36ae
feat: improve Ledger extension and Transactions shortcut descriptions
f50d865
also register widgets to main dashboard
roncodes c17b67f
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes d0a14f7
refactor: trim all shortcut descriptions to one sentence, remove sect…
e922553
fix: remove non-existent Billing Transactions shortcut
f6b2fe7
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 11f09ec
ran prettier
roncodes 2d36934
ran formatter
roncodes 0893aba
fix: gateway environment column, eliminate duplicate transactions fro…
f66baeb
feat: add invoice templates section under Billing
049a3ce
feat: register ledger-invoice context type with TemplateRenderService
c12b577
feat: render invoice template builder in full-viewport wormhole overlay
db0b980
fix: move wormhole target div to invoice-templates/index.hbs
6d83b4f
fix: use position:absolute for template builder overlay, scoped to se…
d7e5ca3
feat: wire close button with unsaved-changes guard in invoice-templat…
f24ca2b
feat: wire close button with unsaved-changes guard in invoice-templat…
b29af64
remove app re-export for instance-initializer `register-template-reso…
roncodes 90e4b66
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 42d049e
fix: normalise context-schemas API response before passing to Templat…
507ee07
fix: remove incorrect namespace option from fetch calls; wire queries…
59fad61
fix: remove non-existent table/cell/boolean cellComponent from invoic…
63eface
refactor: replace inline controller actions with InvoiceTemplateActio…
377de5b
fixed editing and preview
roncodes 2072241
feat: display template preview in modal using modalsManager.show
b3fddb7
ran prettier fixed preview
roncodes da51aee
fix: add missing re-export for modals/template-preview component
1080407
feat: complete invoice form overhaul with line items, customer select…
c501885
minor fix on invoice template actions service
roncodes 4f52249
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 47a2061
fix: invoice creation — date NOT NULL constraint and line items missi…
61cf802
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 8bb2e04
fix: use company default currency instead of hardcoded USD; use items…
4ff59ac
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 5405543
refactor: use proper Ember Data serializers for invoice saving instea…
bef62fa
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 362e4ae
fix: send fleet-ops:customer as customer_type instead of bare Ember m…
db8aa35
fix: set customer_type to fleet-ops:contact (not fleet-ops:customer)
3440c92
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 70a9224
feat: serialise customer in Invoice resource using same pattern as Fl…
roncodes cb0b0c7
refactor: overhaul Invoice and InvoiceItem HTTP resources
roncodes 59ba54d
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 114485e
feat: invoice preview modal, PDF download, and edit improvements
roncodes 379bcac
fix: invoice details — correct field refs, inline line items, remove …
roncodes 99366a2
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 2143b68
fix: remove named :footer block from invoice-preview modal
roncodes b11550a
fix: use footerComponent pattern for invoice-preview modal custom footer
roncodes a1e01de
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 008bfb2
fix: eager-load customer/items/template and make relationships async
roncodes e9c005a
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 4274d44
minor tweaks
roncodes 2349a79
fix: translations, print/pdf download, record-payment modal, helpText…
roncodes cf36e1b
fix: use dompdf directly for PDF render, fix print via popup window f…
roncodes 4837685
revert: remove dompdf hack, restore TemplateRenderService::renderToPd…
roncodes a64565b
fix: add missing bare app/components re-exports so resource-context-p…
roncodes a0210d3
fix: edit routes to route not overlay, 900px panel width, line-item f…
roncodes d05c9bb
fix: add column.orientation translation, resource.invoice-template ke…
roncodes 61b530e
fix: correct customer_type derivation, line-item totals reactivity, D…
roncodes b6d2169
fix: simplify onCustomerChange, move customer_type to serializer, fix…
roncodes a166412
fix: add placeholder to invoice date DatePicker fields
roncodes 43e952f
fix: break MoneyInput feedback loop, fix customer_type double-prefix …
roncodes 6972440
fix: remove erroneous 'customer-' prefix from setCustomerType in Invo…
roncodes dba5556
fix: date persistence, invoice totals, and tax input reset
roncodes 8c9b8aa
fix(invoice): fix line items duplicate/reset bug via registerRef pattern
roncodes 154578c
fix(invoice): fix formRef crash and tax-input total reset
roncodes b570de8
fix(invoice/line-items): rewrite with tracked fields and getter totals
roncodes de7e038
fix(invoice/line-items): restore MoneyInput, fix feedback loop via no…
roncodes 4ea5f59
fix(invoice/line-items): isolate MoneyInput row from tracked re-rende…
roncodes 7e024e4
refactor(invoice/line-items): use ledger-invoice-item records directl…
roncodes 384785e
fix: description validation, duplicate after save, @onChange restored…
roncodes 7176b8e
fix invoice item computed calculations getter to use correct utils
roncodes 67b96b5
fix: unload isNew stubs before resetItems to prevent duplicate line i…
roncodes e6c587f
fix: payment method dropdown, title click, DatePicker, add actions co…
roncodes 23b5c37
fix: restore correct transitionTo calls for view/edit/create in invoi…
roncodes e285aed
fix: transaction recording, revenue recognition, AR aging frontend fi…
245674a
refactor(invoice/transactions): full rewrite using store.query + Tabl…
1285a9d
fix: translation, transaction direction, actions label, date format
c56ab09
feat: status badges, overview $0 fix, public customer invoice view
4098789
fix public invoice route
roncodes c6cc203
fix: correct public invoice URL to use host console virtual route
dd16bd4
fix: use fetch service with namespace:'ledger' for public invoice API…
0f3ec96
fix: correct fetch namespace to 'ledger/public' for public invoice API
3ca184e
fix: clean up customer-invoice component
0547d0b
fix: backfill missing revenue journal entries and heal NULL account s…
b0d6ef4
feat: add Ledger-owned observers for Fleet-Ops and Storefront revenue…
4790604
fix: storefront detection, remove invoice creation, robust invoice UU…
cf28cad
feat: copy invoice URL, dropdown action buttons, invoice URL in details
9c4716a
fix: line item totals, ClickToCopy for invoice URL, Stripe checkout s…
43b293e
fix: webhook URL full path + Stripe null client guard
8694265
feat: fix webhook URL, remove is_default, implement settings routes
f7602b9
fix: correct fetch namespace pattern and replace hardcoded currencies…
b6db5f3
fix: fall back to company default currency in invoice and accounting …
ed1ff60
ran formatters
roncodes 910b6de
fix: resolve Glimmer mutation-during-render error and doubled route name
cd3edad
fix: use currentUser.currency instead of getCompany() in settings con…
8cd3bc7
fix: read organisation currency from currentUser.organizations, not w…
9643203
fix: auto-generate invoice number from settings prefix; wire invoice …
856d644
fix: use Utils::consoleUrl for Stripe checkout success/cancel redirec…
9fa840a
fix: webhook duplicate inserts, invoice not updating after checkout.s…
386f938
fix: restore missing 000008 creation migration for ledger_gateway_tra…
3584372
fix: WebhookController firstOrCreate returns model not tuple
e899950
feat: public invoice status gate, viewed tracking, and overdue automa…
2dd0b15
fix: remove hardcoded 30-day due date default on new invoices
a64692d
added lint step to ember ci and create release workflow
roncodes 38e7a3d
fix: resolve all lint errors in ledger addon
d79d269
Potential fix for code scanning alert no. 5: Workflow does not contai…
roncodes 51a329d
upgraded dependencies
roncodes 0039205
Merge branch 'dev-v0.0.1' of github.com:fleetbase/ledger into dev-v0.0.1
roncodes 07c3fb7
fix: resolve invoice line items, prefix, revenue chart, and gateway t…
2e51453
feat: add order-invoice component for Fleet-Ops order details tab
410fdeb
feat: add default invoice template setting and fix order-invoice tran…
333658c
fix(order-invoice): remove invoiceActions service dependency to preve…
77373c7
ran formatters - upgraded ember-core
roncodes e13abdf
feat: add Ledger permission schema with resources, policies, and roles
5e20437
upgraded dependencies improved widgets
roncodes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Create Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| jobs: | ||
| create: | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Publish GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ github.ref_name }} | ||
| name: ${{ github.ref_name }} | ||
| generate_release_notes: true | ||
| draft: false | ||
| prerelease: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default } from './ledger'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import ApplicationAdapter from '@fleetbase/ember-core/adapters/application'; | ||
| import { pluralize } from 'ember-inflector'; | ||
| import { dasherize } from '@ember/string'; | ||
|
|
||
| export default class LedgerAdapter extends ApplicationAdapter { | ||
| namespace = 'ledger/int/v1'; | ||
|
|
||
| /** | ||
| * Strip the 'ledger-' prefix from the model name before building the URL path. | ||
| * e.g. 'ledger-account' -> 'accounts', 'ledger-transaction' -> 'transactions' | ||
| */ | ||
| pathForType(modelName) { | ||
| return pluralize(dasherize(modelName)).replace('ledger-', ''); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| <div class="details-wrapper" ...attributes> | ||
| {{! ACCOUNT DETAILS }} | ||
| <ContentPanel @title="Account Details" @open={{true}} @wrapperClass="bordered-top"> | ||
| <div class="grid grid-cols-1 lg:grid-cols-2 gap-2 text-xs dark:text-gray-100"> | ||
|
|
||
| <div class="col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-1"> | ||
| Account Information | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Account Name</div> | ||
| <div class="field-value">{{n-a @resource.name}}</div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Account Code</div> | ||
| <div class="field-value font-mono">{{n-a @resource.code}}</div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Type</div> | ||
| <div class="field-value">{{n-a (titleize @resource.type)}}</div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Status</div> | ||
| <div class="field-value"> | ||
| <Badge @status={{@resource.status}}>{{titleize @resource.status}}</Badge> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Currency</div> | ||
| <div class="field-value">{{n-a @resource.currency}}</div> | ||
| </div> | ||
|
|
||
| {{#if @resource.description}} | ||
| <div class="field-info-container col-span-2"> | ||
| <div class="field-name">Description</div> | ||
| <div class="field-value">{{@resource.description}}</div> | ||
| </div> | ||
| {{/if}} | ||
|
|
||
| <div class="col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-3"> | ||
| Balance | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Current Balance</div> | ||
| <div class="field-value text-xl font-bold text-gray-900 dark:text-white">{{format-currency @resource.balance @resource.currency}}</div> | ||
| </div> | ||
|
|
||
| </div> | ||
| </ContentPanel> | ||
|
|
||
| {{! RECORD INFO }} | ||
| <ContentPanel @title="Record Info" @open={{true}} @wrapperClass="bordered-top"> | ||
| <div class="grid grid-cols-1 lg:grid-cols-2 gap-2 text-xs dark:text-gray-100"> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Internal ID</div> | ||
| <div class="field-value font-mono">{{n-a @resource.public_id}}</div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Created</div> | ||
| <div class="field-value">{{n-a @resource.createdAt}}</div> | ||
| </div> | ||
|
|
||
| <div class="field-info-container"> | ||
| <div class="field-name">Last Updated</div> | ||
| <div class="field-value">{{n-a @resource.updatedAt}}</div> | ||
| </div> | ||
|
|
||
| </div> | ||
| </ContentPanel> | ||
| <Spacer @height="200px" /> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| <div class="form-wrapper" ...attributes> | ||
| {{! ACCOUNT DETAILS }} | ||
| <ContentPanel @title="Account Details" @open={{true}} @wrapperClass="bordered-top"> | ||
| <div class="grid grid-cols-1 gap-2 lg:grid-cols-2 lg:gap-2 no-input-group-padding text-xs"> | ||
|
|
||
| {{! Identification }} | ||
| <div class="col-span-1 lg:col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-1"> | ||
| Account Information | ||
| </div> | ||
|
|
||
| <InputGroup @name="Account Name" @wrapperClass="col-span-2"> | ||
| <Input @value={{@resource.name}} @type="text" class="w-full form-input" placeholder="e.g. Cash and Cash Equivalents" disabled={{cannot-write @resource}} /> | ||
| </InputGroup> | ||
|
|
||
| <InputGroup @name="Account Code"> | ||
| <Input @value={{@resource.code}} @type="text" class="w-full form-input" placeholder="e.g. 1000" disabled={{cannot-write @resource}} /> | ||
| </InputGroup> | ||
|
|
||
| <InputGroup @name="Account Type"> | ||
| <div class="fleetbase-model-select fleetbase-power-select ember-model-select"> | ||
| <PowerSelect | ||
| @options={{array "asset" "liability" "equity" "revenue" "expense"}} | ||
| @selected={{@resource.type}} | ||
| @onChange={{fn (mut @resource.type)}} | ||
| @placeholder="Select account type" | ||
| @triggerClass="form-select form-input" | ||
| @disabled={{cannot-write @resource}} | ||
| as |option| | ||
| > | ||
| <div class="capitalize text-sm">{{option}}</div> | ||
| </PowerSelect> | ||
| </div> | ||
| </InputGroup> | ||
|
|
||
| <InputGroup @name="Currency"> | ||
| <div class="fleetbase-model-select fleetbase-power-select ember-model-select"> | ||
| <PowerSelect | ||
| @options={{array | ||
| "USD" | ||
| "EUR" | ||
| "GBP" | ||
| "AED" | ||
| "SAR" | ||
| "QAR" | ||
| "KWD" | ||
| "BHD" | ||
| "OMR" | ||
| "JOD" | ||
| "EGP" | ||
| "NGN" | ||
| "KES" | ||
| "GHS" | ||
| "ZAR" | ||
| "INR" | ||
| "PKR" | ||
| "BDT" | ||
| "MYR" | ||
| "SGD" | ||
| "IDR" | ||
| "PHP" | ||
| "THB" | ||
| "CNY" | ||
| "JPY" | ||
| "KRW" | ||
| "AUD" | ||
| "CAD" | ||
| "NZD" | ||
| "CHF" | ||
| "SEK" | ||
| "NOK" | ||
| "DKK" | ||
| "BRL" | ||
| "MXN" | ||
| }} | ||
| @selected={{@resource.currency}} | ||
| @onChange={{fn (mut @resource.currency)}} | ||
| @placeholder="Select currency" | ||
| @triggerClass="form-select form-input" | ||
| @disabled={{cannot-write @resource}} | ||
| as |option| | ||
| > | ||
| <div class="text-sm">{{option}}</div> | ||
| </PowerSelect> | ||
| </div> | ||
| </InputGroup> | ||
|
|
||
| <InputGroup @name="Status"> | ||
| <div class="fleetbase-model-select fleetbase-power-select ember-model-select"> | ||
| <PowerSelect | ||
| @options={{array "active" "inactive" "archived"}} | ||
| @selected={{@resource.status}} | ||
| @onChange={{fn (mut @resource.status)}} | ||
| @placeholder="Select status" | ||
| @triggerClass="form-select form-input" | ||
| @disabled={{cannot-write @resource}} | ||
| as |option| | ||
| > | ||
| <div class="capitalize text-sm">{{option}}</div> | ||
| </PowerSelect> | ||
| </div> | ||
| </InputGroup> | ||
|
|
||
| {{! Description }} | ||
| <div class="col-span-1 lg:col-span-2 text-[11px] uppercase tracking-wide text-gray-500 font-semibold mt-3"> | ||
| Description | ||
| </div> | ||
|
|
||
| <InputGroup @name="Description" @wrapperClass="col-span-2"> | ||
| <Textarea @value={{@resource.description}} class="w-full form-input" rows="3" placeholder="Optional description of this account..." disabled={{cannot-write @resource}} /> | ||
| </InputGroup> | ||
|
|
||
| </div> | ||
| </ContentPanel> | ||
|
|
||
| <Spacer @height="100px" /> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <div ...attributes> | ||
| {{#if this.loadLedger.isRunning}} | ||
| <div class="flex items-center justify-center py-8"> | ||
| <Spinner /> | ||
| </div> | ||
| {{else}} | ||
| {{#if this.summary}} | ||
| <div class="grid grid-cols-3 gap-3 p-4 border-b border-gray-200 dark:border-gray-700"> | ||
| <div class="bg-gray-50 dark:bg-gray-700 rounded p-3 text-center"> | ||
| <p class="text-xs text-gray-500 mb-1">Total Debits</p> | ||
| <p class="text-sm font-semibold text-gray-900 dark:text-white">{{format-currency this.summary.total_debits @resource.currency}}</p> | ||
| </div> | ||
| <div class="bg-gray-50 dark:bg-gray-700 rounded p-3 text-center"> | ||
| <p class="text-xs text-gray-500 mb-1">Total Credits</p> | ||
| <p class="text-sm font-semibold text-gray-900 dark:text-white">{{format-currency this.summary.total_credits @resource.currency}}</p> | ||
| </div> | ||
| <div class="bg-gray-50 dark:bg-gray-700 rounded p-3 text-center"> | ||
| <p class="text-xs text-gray-500 mb-1">Net Balance</p> | ||
| <p class="text-sm font-semibold text-gray-900 dark:text-white">{{format-currency this.summary.net_balance @resource.currency}}</p> | ||
| </div> | ||
| </div> | ||
| {{/if}} | ||
| <Table @rows={{this.entries}} @columns={{this.columns}} /> | ||
| {{/if}} | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import Component from '@glimmer/component'; | ||
| import { tracked } from '@glimmer/tracking'; | ||
| import { inject as service } from '@ember/service'; | ||
| import { task } from 'ember-concurrency'; | ||
|
|
||
| export default class AccountGeneralLedgerComponent extends Component { | ||
| @service fetch; | ||
| @service intl; | ||
| @tracked entries = []; | ||
| @tracked summary = null; | ||
|
|
||
| constructor(owner, args) { | ||
| super(owner, args); | ||
| this.loadLedger.perform(); | ||
| } | ||
|
|
||
| get columns() { | ||
| return [ | ||
| { | ||
| label: this.intl.t('column.date'), | ||
| valuePath: 'date', | ||
| cellComponent: 'table/cell/anchor', | ||
| resizable: true, | ||
| sortable: false, | ||
| }, | ||
| { | ||
| label: this.intl.t('column.description'), | ||
| valuePath: 'description', | ||
| resizable: true, | ||
| sortable: false, | ||
| }, | ||
| { | ||
| label: 'Debit', | ||
| valuePath: 'debit_amount', | ||
| cellComponent: 'table/cell/currency', | ||
| resizable: true, | ||
| sortable: false, | ||
| }, | ||
| { | ||
| label: 'Credit', | ||
| valuePath: 'credit_amount', | ||
| cellComponent: 'table/cell/currency', | ||
| resizable: true, | ||
| sortable: false, | ||
| }, | ||
| { | ||
| label: 'Balance', | ||
| valuePath: 'running_balance', | ||
| cellComponent: 'table/cell/currency', | ||
| resizable: true, | ||
| sortable: false, | ||
| }, | ||
| ]; | ||
| } | ||
|
|
||
| @task *loadLedger() { | ||
| const account = this.args.account; | ||
| if (!account?.id) return; | ||
| try { | ||
| const result = yield this.fetch.get(`accounts/${account.id}/general-ledger`, {}, { namespace: 'ledger/int/v1' }); | ||
| this.entries = result?.entries ?? []; | ||
| this.summary = result?.summary ?? null; | ||
| } catch { | ||
| this.entries = []; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <div class="px-4 py-2" ...attributes> | ||
| <div class="flex flex-1 flex-row items-start justify-between"> | ||
| <div class="flex flex-col"> | ||
| <h1 class="text-gray-900 dark:text-white font-semibold text-lg">{{n-a @resource.name}}</h1> | ||
| <div class="flex flex-row items-center space-x-2 mt-0.5"> | ||
| <span class="text-sm text-gray-500 dark:text-gray-400">{{n-a @resource.code}}</span> | ||
| <Badge @status="info" @hideStatusDot={{true}}>{{titleize @resource.type}}</Badge> | ||
| <Badge @status={{@resource.status}}>{{titleize @resource.status}}</Badge> | ||
| </div> | ||
| </div> | ||
| <div class="next-view-header-right f-child-items-start"> | ||
| <Layout::Resource::Panel::HeaderActions | ||
| @resource={{@resource}} | ||
| @saveTask={{@saveTask}} | ||
| @saveOptions={{@saveOptions}} | ||
| @saveDisabled={{@saveDisabled}} | ||
| @pojoResource={{@pojoResource}} | ||
| @authSchema={{@authSchema}} | ||
| @actionButtons={{@actionButtons}} | ||
| @onPressCancel={{@onPressCancel}} | ||
| > | ||
| <div class="flex flex-col items-end mr-2"> | ||
| <span class="text-lg font-bold text-gray-900 dark:text-white">{{format-currency @resource.balance @resource.currency}}</span> | ||
| <span class="text-xs text-gray-500">{{n-a @resource.currency}}</span> | ||
| </div> | ||
| </Layout::Resource::Panel::HeaderActions> | ||
| </div> | ||
| </div> | ||
| </div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.