Skip to content

Commit 98cdb60

Browse files
authored
Merge pull request #12 from fleetbase/dev-v0.0.7
v0.0.7 ~ Complete invoice settings functionality
2 parents 3d9b769 + e2225d4 commit 98cdb60

16 files changed

Lines changed: 586 additions & 228 deletions

File tree

addon/controllers/billing/invoices/index/new.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ export default class BillingInvoicesIndexNewController extends Controller {
5151
defaults.terms = invoiceSettings.default_terms;
5252
}
5353

54-
// Due date — calculate from today + offset only when the user
55-
// has explicitly saved a non-zero value in Invoice Settings.
56-
// A null/undefined/0 setting means "no default due date" so we
57-
// leave the field empty rather than silently pre-filling 30 days.
58-
const offset = invoiceSettings.due_date_offset_days;
59-
if (offset != null && Number(offset) > 0) {
54+
// Due date — payment_terms_days is canonical; due_date_offset_days
55+
// remains a legacy alias for settings saved by older clients.
56+
const terms = invoiceSettings.payment_terms_days ?? invoiceSettings.due_date_offset_days;
57+
if (terms != null && Number(terms) > 0) {
6058
const due = new Date();
61-
due.setDate(due.getDate() + Number(offset));
59+
due.setDate(due.getDate() + Number(terms));
6260
defaults.due_date = due;
6361
}
6462
}

addon/templates/settings/accounting.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@
147147
/>
148148
</InputGroup>
149149
</ContentPanel>
150-
151150
</div>
151+
<Spacer @height="600px" />
152152
</div>
153-
<Spacer @height="600px" />
154153
</Layout::Section::Body>

addon/templates/settings/invoice.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
/>
110110
</InputGroup>
111111
</ContentPanel>
112-
113112
</div>
113+
<Spacer @height="600px" />
114114
</div>
115-
<Spacer @height="600px" />
116115
</Layout::Section::Body>

addon/templates/settings/payment.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@
8080
/>
8181
</InputGroup>
8282
</ContentPanel>
83-
8483
</div>
84+
<Spacer @height="600px" />
8585
</div>
86-
<Spacer @height="600px" />
8786
</Layout::Section::Body>

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.6",
3+
"version": "0.0.7",
44
"description": "Accounting & Invoicing Extension for Fleetbase",
55
"keywords": [
66
"fleetbase",

docker/taler/README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,30 @@ To seed for a specific company:
6868
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
6969
```
7070

71-
The seeder creates an idempotent FleetOps-style payload, order, service quote,
72-
purchase rate, tracking number, core transaction, transaction items, and sent
73-
Ledger invoice in `KUDOS`. The order should appear in FleetOps Orders as
74-
`TALER-DEMO-KUDOS`. Open the seeded public payment link shown by the seeder:
71+
The default demo invoice amount is `KUDOS 0.50`. To seed a specific invoice
72+
amount, use a decimal `KUDOS` value:
73+
74+
```sh
75+
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> -e TALER_DEMO_AMOUNT=5.00 application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
76+
```
77+
78+
By default, each seeder run creates a fresh payable FleetOps-style payload,
79+
order, service quote, purchase rate, tracking number, core transaction,
80+
transaction items, and sent Ledger invoice in `KUDOS`. This lets you repeat the
81+
wallet checkout flow without reusing a Taler order that has already been paid.
82+
The order should appear in FleetOps Orders as `TALER-DEMO-KUDOS-<run_suffix>`.
83+
Open the seeded public payment link shown by the seeder:
7584

7685
```txt
7786
/~/invoice?id=<invoice_public_id>
7887
```
7988

89+
To intentionally update the same demo fixture, provide a stable run id:
90+
91+
```sh
92+
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> -e TALER_DEMO_RUN_ID=nlnet-demo-001 application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
93+
```
94+
8095
## Wallet notes
8196

8297
The local bank suggests the local exchange to wallets. To add KUDOS to the GNU

docker/taler/init-instance.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ webhook_payload="$(jq -n \
133133
url: $url,
134134
http_method: "POST",
135135
header_template: "Content-Type: application/json",
136-
body_template: "{\"order_id\":\"${order_id}\",\"event_type\":\"pay\"}"
136+
body_template: "{\"order_id\":\"${ORDER_ID}\",\"event_type\":\"pay\"}"
137137
}')"
138138

139139
webhook_response="$(api POST "/instances/${INSTANCE_ID}/private/webhooks" "${webhook_payload}" "${auth_header}")"

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.6",
3+
"version": "0.0.7",
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fleetbase/ledger-engine",
3-
"version": "0.0.6",
3+
"version": "0.0.7",
44
"description": "Accounting & Invoicing Extension for Fleetbase",
55
"keywords": [
66
"fleetbase-extension",
@@ -44,8 +44,8 @@
4444
},
4545
"dependencies": {
4646
"@babel/core": "^7.23.2",
47-
"@fleetbase/ember-core": "^0.3.22",
48-
"@fleetbase/ember-ui": "^0.3.38",
47+
"@fleetbase/ember-core": "^0.3.24",
48+
"@fleetbase/ember-ui": "^0.3.39",
4949
"@fleetbase/fleetops-data": "^0.1.37",
5050
"@fortawesome/ember-fontawesome": "^2.0.0",
5151
"@fortawesome/fontawesome-svg-core": "6.4.0",

0 commit comments

Comments
 (0)