Commit Graph

3388 Commits

Author SHA1 Message Date
David Bomba 132f053b02 Always update designs post self update 2025-01-15 12:11:49 +11:00
David Bomba bd6540992a Minor cleanup for session state 2025-01-15 11:47:40 +11:00
David Bomba 7304f01de6 Ensures that invalid props cannot be saves to settings 2025-01-13 17:59:38 +11:00
David Bomba 406cc52279 Adjustments for design and dom elements / attributes 2025-01-13 14:16:55 +11:00
David Bomba 5c60a3efed Revert latest nordigen commit 2025-01-11 18:25:54 +11:00
David Bomba 48e5e5ec59 Fixes for invoice terms display incorrectly 2025-01-10 10:47:57 +11:00
David Bomba 006f3aac37
Merge pull request #10425 from dshoreman/ds/nordigen-tx-days
Nordigen Transaction history UI
2025-01-08 18:32:31 +11:00
David Bomba 24ed1922fc Task Status Order tests 2025-01-03 21:27:14 +11:00
David Bomba 960ec0fc56 Refactor for bulk project invoicing 2024-12-31 11:52:35 +11:00
David Bomba 654993a776 Add defaults for the preview on recurring invoice 2024-12-27 11:03:22 +11:00
Dave Shoreman bea4ea3387
Show history selection screen instead of guessing
Removes all the guesswork for requisition renewals, instead opting for
the manual approach of simply redirecting to the form and updating its
handling such that it jumps straight to history selection when needed.

When the institution is preloaded (so we skip country/bank selection)
the cloned element is a country and not the bank so we need to replace
athe flag with its logo, but otherwise the code was all moved as-is.
2024-12-24 03:20:40 +00:00
Dave Shoreman 691478d3e7
Support setting custom Nordigen access duration
If agreements are already available and no custom `access_days` is
passed, it will simply take the first match regardless of duration.

When a new agreement is needed, it defaults to the max supported.
2024-12-23 20:31:31 +00:00
Dave Shoreman 5f75b6a9e1
Attempt to reuse existing agreements
Implements changes from #10410 but using `Arr::first()` rather than a
foreach loop to fix bugs returning invalid or expired agreements.

If an agreement exists with at least the requested `$txDays` then that
is used, otherwise a new one is created with the given parameters. If it
fails, we error out because `createRequisition()` would fail regardless.

Skips accepting EUAs: seems it's done automatically during requisition.
2024-12-23 20:09:52 +00:00
Dave Shoreman 3bac46d83f
Cleanup, add return types, normalise quotes 2024-12-22 17:38:54 +00:00
Dave Shoreman b9464c0c25
Fix error on token-invalid failure when expired
The cache data is set to expire after an hour, at which point the call
to `$request->getCompany()` will fail because it depends internally on
the `company_key` in the response of `getTokenContent()` which is null.

By moving the company *after* the context check, we avoid the exception
but need to manually set lang as there's no context for company data.
2024-12-22 17:38:54 +00:00
Dave Shoreman 88149bc39f
Find old EUA to get tx_days for new agreement
The end user agreement ID isn't stored with the bank integration, but it
*is* returned as part of the error for an expired account which works
perfectly for the case of renewing an expired requisition.

When `tx_days` isn't set in the request (i.e. it's a renewal) we instead
extract the EUA ID from the account error after getting the integration,
then once we have the EUA we're able to restore the old tx_days setting.

Since the BankIntegration query is used in both endpoints, this moves it
to a method with `firstOrFail()` rather than `first()` which also allows
for a cleanup of the integration saving code with try/catch/finally to
make it a little clearer which values apply to both new+existing cases.
2024-12-22 17:38:54 +00:00
Dave Shoreman 74344d1b88
Improve Nordigen error-handling code
All failures boil down to about 3 variations - one with reason/lang, one
that has context defined but no company data, and a full variant that
also fills the company and account keys in the view.

The only other difference is redirect url coming from config when it's
not available in the context, so to simplify things this commit merges
all the failure view responses into one unified `failed` method.
2024-12-22 17:38:54 +00:00
Dave Shoreman 6fde8c8f13
Allow setting number of days of transactions
If e.g. `&tx_days=365` is added to the URL, this will use it to set the
amount of history that's fetched from Nordigen on sync, with basic
safeguards to prevent it being set too low or above the bank's max.
2024-12-22 17:38:54 +00:00
Dave Shoreman fa54ef9830
Nordigen: Use institution max for bank integration
While we set the days in the agreement, how many we fetch when
processing transactions depends on the `from_date` of the bank
integration. We could call `getInstitution($id)` on the API, but
consistency would dictate adding a wrapper in the Nordigen class and
it's already being called within `$nordigen->getAccount()` so it makes
more sense to extract the data in the account transformer instead.

App\Jobs\Bank\ProcessBankTransactionsNordigen also sets a from date, but
that's only used when not set on the bank integration so it can be left
at the Nordigen default of 90 days worth of transaction history.
2024-12-22 17:38:54 +00:00
Dave Shoreman b723c9e16a
Nordigen: Pass custom agreement with max history
In order to change the total days of transactions we can request, a
custom end user agreement is needed. There *are* methods to find
existing agreements, but assuming nothing else breaks it's probably
fairly safe to just go ahead and create one.

If it works, it only runs once... as far as I can tell.
2024-12-22 17:38:50 +00:00
David Bomba 265f72369c Cleanup for peppol 2024-12-21 10:28:21 +11:00
David Bomba 1164507da7 Fixes for nordigen 2024-12-18 20:20:57 +11:00
Dave Shoreman 73166f422a
Fix nordigen account failsafe
This check was added at a time when `getAccount` would return `false`
for failures, but at some point it was updated to always return arrays.

This fixes the check to avoid issues like #10396 where the following
line triggers a missing 'id' key error.
2024-12-18 00:05:32 +00:00
Dave Shoreman 365a908b20
Fix ref to wrong type of `$account`
There was a time when `$account` served two purposes depending how far
through the code you got. Commit e349f151 changed that, introducing a
dedicated `$nordigen_account` variable, but it missed some references.

This commit fixes them so they no longer point to the *company* account.
2024-12-17 23:59:28 +00:00
paulwer 9aae89416d minor code cleanups 2024-12-16 16:09:52 +01:00
paulwer d1a34e752a fixes 2024-12-16 11:35:03 +01:00
paulwer 2344b659dc changes for mailgun 2024-12-16 11:32:45 +01:00
paulwer 8495aab790 fix: allow checking blocked state before querying database in webhooks 2024-12-16 11:24:47 +01:00
David Bomba 1aca8fa49f Active global search across all entities 2024-12-12 11:57:33 +11:00
David Bomba 90c3da574a V5.11.0 2024-12-09 08:44:27 +11:00
David Bomba 9c4cbc4c14 Fixes for client portal login 2024-12-05 10:31:04 +11:00
David Bomba 5d3ecbc7de Updates for tax model 2024-12-04 08:24:53 +11:00
David Bomba 85f8d37f54 Annotations for default design 2024-12-03 12:18:09 +11:00
David Bomba 3f766d3c23 Refactor for retrieving backups 2024-12-02 16:43:32 +11:00
David Bomba 76351b95fd Enforce disk to write to for backups 2024-12-01 15:54:20 +11:00
David Bomba 9cd9bc9833 Updated translations 2024-11-30 15:55:31 +11:00
David Bomba fd2f556dfb Updates for node search 2024-11-29 20:56:41 +11:00
David Bomba 2f634d41bf Adjustments for contact registration 2024-11-28 16:49:28 +11:00
David Bomba ca9d8947d9 Tests for routes 2024-11-28 12:10:59 +11:00
David Bomba 0b63876e29 Improve contact register resiliency 2024-11-28 11:42:23 +11:00
David Bomba 6b126cffbc Refactor contact login 2024-11-28 09:07:05 +11:00
David Bomba a3a3f6a1d2 Add in turnstile to protect client register routes 2024-11-27 16:10:04 +11:00
David Bomba 2b5728c6d0 Improve sort order in client portal tables 2024-11-26 14:55:42 +11:00
David Bomba eb1475a451 Improvements for timing of Postmark webhooks 2024-11-25 17:32:23 +11:00
David Bomba 61e71a43ca Welcome EInvoice email 2024-11-25 15:36:28 +11:00
David Bomba 2d1e02daf2 Coalesce reminder resolution for invoices and quotes 2024-11-25 11:24:36 +11:00
David Bomba 0d415c5766 Additional nodes for scout search 2024-11-24 16:32:32 +11:00
David Bomba d8f3895f99 Add additonal filesystem for docker 2024-11-24 16:13:59 +11:00
David Bomba 4007ccb26f Add additional models to searchable(); 2024-11-24 12:40:32 +11:00
David Bomba b5a3abdb36
Merge pull request #10303 from turbo124/v5-develop
v5.10.55
2024-11-23 15:37:15 +11:00