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
6 changes: 4 additions & 2 deletions addon/components/order-invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ export default class OrderInvoiceComponent extends Component {
const results = yield this.store.query('ledger-invoice', {
order_uuid: order.id,
with: 'items',
limit: 1,
sort: '-created_at',
limit: 10,
});

this.invoice = results.firstObject ?? null;
const invoices = results.toArray();
this.invoice = invoices.find((invoice) => !['void', 'cancelled'].includes(invoice.status)) ?? invoices[0] ?? null;
} catch {
this.invoice = null;
}
Expand Down
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.2",
"version": "0.0.3",
"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.2",
"version": "0.0.3",
"description": "Accounting & Invoicing Extension for Fleetbase",
"repository": "https://github.com/fleetbase/ledger",
"license": "AGPL-3.0-or-later",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/ledger-engine",
"version": "0.0.2",
"version": "0.0.3",
"description": "Accounting & Invoicing Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@babel/core": "^7.23.2",
"@fleetbase/ember-core": "^0.3.17",
"@fleetbase/ember-ui": "^0.3.25",
"@fleetbase/fleetops-data": "^0.1.25",
"@fleetbase/fleetops-data": "^0.1.30",
"@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