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
12 changes: 5 additions & 7 deletions addon/controllers/billing/invoices/index/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ export default class BillingInvoicesIndexNewController extends Controller {
defaults.terms = invoiceSettings.default_terms;
}

// Due date — calculate from today + offset only when the user
// has explicitly saved a non-zero value in Invoice Settings.
// A null/undefined/0 setting means "no default due date" so we
// leave the field empty rather than silently pre-filling 30 days.
const offset = invoiceSettings.due_date_offset_days;
if (offset != null && Number(offset) > 0) {
// Due date — payment_terms_days is canonical; due_date_offset_days
// remains a legacy alias for settings saved by older clients.
const terms = invoiceSettings.payment_terms_days ?? invoiceSettings.due_date_offset_days;
if (terms != null && Number(terms) > 0) {
const due = new Date();
due.setDate(due.getDate() + Number(offset));
due.setDate(due.getDate() + Number(terms));
defaults.due_date = due;
}
}
Expand Down
3 changes: 1 addition & 2 deletions addon/templates/settings/accounting.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@
/>
</InputGroup>
</ContentPanel>

</div>
<Spacer @height="600px" />
</div>
<Spacer @height="600px" />
</Layout::Section::Body>
3 changes: 1 addition & 2 deletions addon/templates/settings/invoice.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@
/>
</InputGroup>
</ContentPanel>

</div>
<Spacer @height="600px" />
</div>
<Spacer @height="600px" />
</Layout::Section::Body>
3 changes: 1 addition & 2 deletions addon/templates/settings/payment.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
/>
</InputGroup>
</ContentPanel>

</div>
<Spacer @height="600px" />
</div>
<Spacer @height="600px" />
</Layout::Section::Body>
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.6",
"version": "0.0.7",
"description": "Accounting & Invoicing Extension for Fleetbase",
"keywords": [
"fleetbase",
Expand Down
23 changes: 19 additions & 4 deletions docker/taler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,30 @@ To seed for a specific company:
docker compose exec -e TALER_DEMO_COMPANY_UUID=<company_uuid> application php artisan db:seed --class="Fleetbase\\Ledger\\Seeders\\Testing\\TalerDemoSeeder"
```

The seeder creates an idempotent FleetOps-style payload, order, service quote,
purchase rate, tracking number, core transaction, transaction items, and sent
Ledger invoice in `KUDOS`. The order should appear in FleetOps Orders as
`TALER-DEMO-KUDOS`. Open the seeded public payment link shown by the seeder:
The default demo invoice amount is `KUDOS 0.50`. To seed a specific invoice
amount, use a decimal `KUDOS` value:

```sh
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"
```

By default, each seeder run creates a fresh payable FleetOps-style payload,
order, service quote, purchase rate, tracking number, core transaction,
transaction items, and sent Ledger invoice in `KUDOS`. This lets you repeat the
wallet checkout flow without reusing a Taler order that has already been paid.
The order should appear in FleetOps Orders as `TALER-DEMO-KUDOS-<run_suffix>`.
Open the seeded public payment link shown by the seeder:

```txt
/~/invoice?id=<invoice_public_id>
```

To intentionally update the same demo fixture, provide a stable run id:

```sh
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"
```

## Wallet notes

The local bank suggests the local exchange to wallets. To add KUDOS to the GNU
Expand Down
2 changes: 1 addition & 1 deletion docker/taler/init-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ webhook_payload="$(jq -n \
url: $url,
http_method: "POST",
header_template: "Content-Type: application/json",
body_template: "{\"order_id\":\"${order_id}\",\"event_type\":\"pay\"}"
body_template: "{\"order_id\":\"${ORDER_ID}\",\"event_type\":\"pay\"}"
}')"

webhook_response="$(api POST "/instances/${INSTANCE_ID}/private/webhooks" "${webhook_payload}" "${auth_header}")"
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.6",
"version": "0.0.7",
"description": "Accounting & Invoicing Extension for Fleetbase",
"repository": "https://github.com/fleetbase/ledger",
"license": "AGPL-3.0-or-later",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/ledger-engine",
"version": "0.0.6",
"version": "0.0.7",
"description": "Accounting & Invoicing Extension for Fleetbase",
"keywords": [
"fleetbase-extension",
Expand Down Expand Up @@ -44,8 +44,8 @@
},
"dependencies": {
"@babel/core": "^7.23.2",
"@fleetbase/ember-core": "^0.3.22",
"@fleetbase/ember-ui": "^0.3.38",
"@fleetbase/ember-core": "^0.3.24",
"@fleetbase/ember-ui": "^0.3.39",
"@fleetbase/fleetops-data": "^0.1.37",
"@fortawesome/ember-fontawesome": "^2.0.0",
"@fortawesome/fontawesome-svg-core": "6.4.0",
Expand Down
Loading
Loading