Commit Graph

23346 Commits

Author SHA1 Message Date
Dave Shoreman 3204163e70
Cleanup, add return types, normalise quotes 2025-01-13 19:09:02 +00:00
Dave Shoreman 66f197b857
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.
2025-01-13 19:06:40 +00:00
Dave Shoreman fb47c29c91
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.
2025-01-13 19:06:01 +00:00
Dave Shoreman d87d4580be
Fix back/close button display in Nordigen modal
When the country filtering mode is enabled, it adds a "Go back" button
but the close button is right on top of it. This moves the close button
to the right to avoid any click conflicts.

To fix an annoying display bug with the top offset, an observer is used
to override the default `display: none` of the back button to keep its
flex mode but with a hidden visibility so the UI doesn't move around.
2025-01-13 19:05:02 +00:00
Dave Shoreman 029f547dcc
Fine-tune transaction history options
Replaces 360 days with 365, skips the last auto-generated option to
avoid getting e.g. 720 and 730 as options when it's close to max, and
gradually increases the accumulator so options aren't so overwhelming.

Since the loop will no longer generate the final option (0 < 15), this
commit also removes the `% 30` check so the real max is always used.
2025-01-13 19:04:28 +00:00
Dave Shoreman f501f250f4
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.
2025-01-13 19:01:04 +00:00
Dave Shoreman fb53d340f9
Add selection screen for transaction history
Instead of directing the user straight to GoCardless, when a bank is
selected this will replace the institution list with a list of options
from 30 days—up to the bank's transaction limit—in 30 day increments.
2025-01-13 18:50:12 +00:00
Dave Shoreman 2501ca17c9
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.
2025-01-13 18:49:10 +00:00
Dave Shoreman 480794bb76
Enable country filtering for Nordigen bank list
Enabling the country filter stops the selector loop from working because
instead of a `.ob-list-institution` it starts with `.ob-country-list`
items which then get replaced on click so banks don't exist on load.

By wrapping the institution loop in an observer it'll automatically
attach the events when a country is selected and it works wonderfully.
2025-01-13 18:46:25 +00:00
Dave Shoreman e825bb0895
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.
2025-01-13 18:45:24 +00:00
Dave Shoreman d51e1527e6
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.
2025-01-13 18:44:40 +00:00
David Bomba 3d2ba32c7d
Merge pull request #10522 from turbo124/v5-develop
Update invoice event when matching on invoice transactions
2025-01-13 16:36:04 +11:00
David Bomba f10ae14b3f
Merge pull request #10517 from benbrummer/v5-develop
Integrate octane in preload.php
2025-01-13 16:35:27 +11:00
David Bomba f87cac3583 Update invoice event when matching on invoice transactions 2025-01-13 16:01:57 +11:00
David Bomba 2e97cc84ea
Merge pull request #10521 from turbo124/v5-develop
Fixes for show/hide elements
2025-01-13 14:23:12 +11:00
David Bomba 80a8398c26 v5.11.23 2025-01-13 14:21:25 +11:00
David Bomba 167bef9a06 Fixes for delivery notes 2025-01-13 14:20:03 +11:00
David Bomba 406cc52279 Adjustments for design and dom elements / attributes 2025-01-13 14:16:55 +11:00
benbrummer 2494d2c4a4
added classes to ignore list again, execpt \Illuminate\Http\Testing\File::class,
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-01-12 09:44:39 +01:00
David Bomba 8ce6e6a44e
Merge pull request #10518 from turbo124/v5-develop
v5.11.22
2025-01-12 12:18:22 +11:00
David Bomba 2751b95f51 v5.11.22 2025-01-12 12:17:43 +11:00
David Bomba 8916457879 Fixes for xinvoice attachments 2025-01-12 12:17:30 +11:00
benbrummer 8abb714500
comment echo
reduce noise

Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-01-12 02:16:41 +01:00
benbrummer e7bfc05be9
Integrate octane in preload.php
Signed-off-by: benbrummer <info@benjamin-brummer.de>
2025-01-11 22:21:56 +01:00
David Bomba 2f6293329c
Merge pull request #10511 from turbo124/v5-develop
v5.11.21
2025-01-11 23:25:24 +11:00
David Bomba 9e8badc3de v5.11.21 2025-01-11 23:24:50 +11:00
David Bomba e79eab340b Minor Fixes 2025-01-11 23:24:34 +11:00
David Bomba 79cfb63de8
Merge pull request #10510 from turbo124/v5-develop
v5.11.20
2025-01-11 23:20:06 +11:00
David Bomba 4652317805 v5.11.20 2025-01-11 23:19:36 +11:00
David Bomba bfab145345 Fixes for division by zero 2025-01-11 23:19:16 +11:00
David Bomba bfc2c6edec
Merge pull request #10506 from turbo124/v5-develop
v5.11.19
2025-01-11 21:48:17 +11:00
David Bomba e3360fa8c7 v5.11.19 2025-01-11 21:47:28 +11:00
David Bomba 6a4a0b69ec Fixes for pdf conversion issues and hidden SVG elements 2025-01-11 21:47:12 +11:00
David Bomba 399091cb5f Fixes for QR codes in PDFs 2025-01-11 19:19:32 +11:00
David Bomba 5c60a3efed Revert latest nordigen commit 2025-01-11 18:25:54 +11:00
David Bomba 95b8454c15 Minor fixes for storecove testS 2025-01-11 16:42:30 +11:00
David Bomba 9180b7abb3 Cleanup 2025-01-11 16:38:09 +11:00
David Bomba 19e3c11bae Hide shipping address if none is configured 2025-01-11 16:37:37 +11:00
David Bomba 910aa653dd
Merge pull request #10504 from turbo124/v5-develop
v5.11.18
2025-01-11 16:31:00 +11:00
David Bomba 675f25d531 v5.11.18 2025-01-11 16:29:50 +11:00
David Bomba 929824d20f Fixes for peppol routing/tax scheme 2025-01-11 16:29:33 +11:00
David Bomba ebe7476d97 minor fixes 2025-01-11 09:19:31 +11:00
David Bomba 09fda9867f Adjustments for importing customers with auth.net 2025-01-10 16:14:20 +11:00
David Bomba 0f1d96ef34 Fixes for static analysis 2025-01-10 15:49:21 +11:00
David Bomba 31688256dd Clean up for HTML purifier 2025-01-10 15:46:36 +11:00
David Bomba 699784ed00 Fixes for bcc on payment failure mails 2025-01-10 15:41:01 +11:00
David Bomba 7d4989a4b1 Fixes for company imports 2025-01-10 11:50:12 +11:00
David Bomba 783db81d2b Fixes for typo in test 2025-01-10 10:53:28 +11:00
David Bomba 48e5e5ec59 Fixes for invoice terms display incorrectly 2025-01-10 10:47:57 +11:00
David Bomba 05a24301b9
Merge pull request #10495 from benbrummer/v5-develop
do not mv invoiceninjar.tar.gz into invoiceninja folder
2025-01-10 10:31:59 +11:00