From 7e19d1a9d2dc0d5db5f0015257554281b1e5be2e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Apr 2021 08:03:34 +1000 Subject: [PATCH 01/14] v5.1.42 --- app/Http/Controllers/SelfUpdateController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 1d27e5d5d7c3..ffb28cd13e94 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -16,7 +16,6 @@ use Cz\Git\GitException; use Cz\Git\GitRepository; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Artisan; class SelfUpdateController extends BaseController { From 5adc39b06cc3601e44a781927542e9e21b213acf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Apr 2021 08:11:17 +1000 Subject: [PATCH 02/14] minor fixes --- app/Http/Controllers/SelfUpdateController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index ffb28cd13e94..bda8a87ad38f 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -83,7 +83,7 @@ class SelfUpdateController extends BaseController Artisan::call('config:clear'); $output = $repo->execute('stash'); - $output = $repo->execute('reset hard origin/v5-stable'); + $output = $repo->execute('reset --hard origin/v5-stable'); $output = $repo->execute('pull origin'); } catch (GitException $e) { From 37f662e2f3bdafb9733113b02af195aebfb3cc8a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Apr 2021 08:16:43 +1000 Subject: [PATCH 03/14] remove duplicate artisan command --- app/Http/Controllers/SelfUpdateController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index 1d27e5d5d7c3..ffb28cd13e94 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -16,7 +16,6 @@ use Cz\Git\GitException; use Cz\Git\GitRepository; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Support\Facades\Artisan; -use Illuminate\Support\Facades\Artisan; class SelfUpdateController extends BaseController { From 4b3fe82ba2ff87ad329f6ae8e01f8a8b36dbd62d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Apr 2021 08:35:00 +1000 Subject: [PATCH 04/14] minor fixes --- app/Http/Controllers/SelfUpdateController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SelfUpdateController.php b/app/Http/Controllers/SelfUpdateController.php index bda8a87ad38f..0f48d86bada8 100644 --- a/app/Http/Controllers/SelfUpdateController.php +++ b/app/Http/Controllers/SelfUpdateController.php @@ -82,8 +82,8 @@ class SelfUpdateController extends BaseController Artisan::call('view:clear'); Artisan::call('config:clear'); - $output = $repo->execute('stash'); - $output = $repo->execute('reset --hard origin/v5-stable'); + // $output = $repo->execute('stash'); + // $output = $repo->execute('reset --hard origin/v5-stable'); $output = $repo->execute('pull origin'); } catch (GitException $e) { From 8ef9f570aa97258d91bc8a7780ef4c08a1a957e9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 15 May 2021 07:25:06 +1000 Subject: [PATCH 05/14] Update VERSION.txt --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 3b4031cf5226..4d6aa045def6 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.1.61 \ No newline at end of file +5.1.62 From 3b6a18e38bb770e93ddccc92c8db2e6206127b1f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 16 Jun 2021 07:04:44 +1000 Subject: [PATCH 06/14] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 630a4e8252aa..a60549185e62 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,7 +76,7 @@ jobs: id: upload-release-asset uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{secrets.PAT}} with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./invoiceninja.zip From 16e03024b797f38695944cdb225b319216cfc475 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 16 Jun 2021 07:19:31 +1000 Subject: [PATCH 07/14] Fixes for release --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 047437105ffb..8525e3980003 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,13 +65,13 @@ jobs: - name: Create Release id: create_release uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.PAT }} with: tag_name: ${{ steps.get_tag_name.outputs.VERSION }} release_name: Release ${{ steps.get_tag_name.outputs.VERSION }} draft: false prerelease: false + token: ${{ secrets.PAT }} + - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 @@ -82,3 +82,4 @@ jobs: asset_path: ./invoiceninja.zip asset_name: invoiceninja.zip asset_content_type: application/zip + token: ${{ secrets.PAT }} \ No newline at end of file From 3d5dc68a2837538035380a11eeae188e4ac4a349 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Jun 2021 07:53:37 +1000 Subject: [PATCH 08/14] Default shown tasks = invoices --- app/DataMapper/CompanySettings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index 1d0e3b0ca559..c63386a26e4f 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -28,7 +28,7 @@ class CompanySettings extends BaseSettings public $lock_invoices = 'off'; //off,when_sent,when_paid //@implemented public $enable_client_portal_tasks = false; //@ben to implement - public $show_all_tasks_client_portal = 'all'; // all, uninvoiced, invoiced + public $show_all_tasks_client_portal = 'invoiced'; // all, uninvoiced, invoiced public $enable_client_portal_password = false; //@implemented public $enable_client_portal = true; //@implemented public $enable_client_portal_dashboard = false; // @TODO There currently is no dashboard so this is pending From 5b1b88b0647791402c24978884664087ca1a7fbb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 3 Jul 2021 14:47:08 +1000 Subject: [PATCH 09/14] Update VERSION.txt --- VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.txt b/VERSION.txt index 0a9e374797e7..879fd975146b 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.2.7 \ No newline at end of file +5.2.9 From 066666f5bc1c69536a17deb1d627e41af3d866c1 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 8 Sep 2021 20:20:58 +1000 Subject: [PATCH 10/14] Remove redundant logging --- app/Observers/InvoiceObserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Observers/InvoiceObserver.php b/app/Observers/InvoiceObserver.php index 869a0310364e..606d37c50a80 100644 --- a/app/Observers/InvoiceObserver.php +++ b/app/Observers/InvoiceObserver.php @@ -46,7 +46,7 @@ class InvoiceObserver * @return void */ public function updated(Invoice $invoice) - {nlog("updated"); + { $subscriptions = Webhook::where('company_id', $invoice->company->id) ->where('event_id', Webhook::EVENT_UPDATE_INVOICE) ->exists(); From 711db89061fe95c019a7eeb3e45ca2d925c0ee98 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 11:59:09 +1000 Subject: [PATCH 11/14] Fixes for auto archiving --- app/Mail/TemplateEmail.php | 4 +++- app/PaymentDrivers/BaseDriver.php | 1 - app/Services/Payment/UpdateInvoicePayment.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index bbfabebc09d0..955e0d5de4d4 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -126,7 +126,9 @@ class TemplateEmail extends Mailable if($this->invitation->invoice && $settings->ubl_email_attachment && $this->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){ $ubl_string = CreateUbl::dispatchNow($this->invitation->invoice); - $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); + + if($ubl_string) + $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); } diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 45cd0b1c3e6c..be410cf1134c 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -205,7 +205,6 @@ class BaseDriver extends AbstractPaymentDriver $invoices->each(function ($invoice) use ($payment) { event(new InvoiceWasPaid($invoice, $payment, $payment->company, Ninja::eventVars())); - $invoice->service()->workFlow(); }); return $payment->service()->applyNumber()->save(); diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index e344050cfa63..88aa81856818 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -83,6 +83,7 @@ class UpdateInvoicePayment ->updatePaidToDate($paid_amount) ->updateStatus() ->deletePdf() + ->workFlow() ->save(); event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); From 1d4e36d2f1369d0479f9065e26c05e80db15e256 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 14:00:05 +1000 Subject: [PATCH 12/14] Fixes for ubl --- app/Mail/TemplateEmail.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 955e0d5de4d4..98d8609c2263 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -127,8 +127,7 @@ class TemplateEmail extends Mailable $ubl_string = CreateUbl::dispatchNow($this->invitation->invoice); - if($ubl_string) - $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); + $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); } From f0eb912e0703ac783386077cd406dd0720f63b9b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 15:14:05 +1000 Subject: [PATCH 13/14] fixes --- app/Console/Commands/S3Cleanup.php | 2 ++ app/Models/ClientGatewayToken.php | 2 ++ app/PaymentDrivers/WePay/CreditCard.php | 31 +++++++++++++++++-------- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/S3Cleanup.php b/app/Console/Commands/S3Cleanup.php index 6aa4d2d3b1d4..d20362c8f303 100644 --- a/app/Console/Commands/S3Cleanup.php +++ b/app/Console/Commands/S3Cleanup.php @@ -15,6 +15,8 @@ class S3Cleanup extends Command */ protected $signature = 'ninja:s3-cleanup'; + protected $log = ''; + /** * The console command description. * diff --git a/app/Models/ClientGatewayToken.php b/app/Models/ClientGatewayToken.php index a3928ce4bf79..2aed46bf9edc 100644 --- a/app/Models/ClientGatewayToken.php +++ b/app/Models/ClientGatewayToken.php @@ -13,10 +13,12 @@ namespace App\Models; use App\Utils\Traits\MakesDates; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class ClientGatewayToken extends BaseModel { use MakesDates; + use SoftDeletes; protected $casts = [ 'meta' => 'object', diff --git a/app/PaymentDrivers/WePay/CreditCard.php b/app/PaymentDrivers/WePay/CreditCard.php index 5cb3567976b0..8209c71c3546 100644 --- a/app/PaymentDrivers/WePay/CreditCard.php +++ b/app/PaymentDrivers/WePay/CreditCard.php @@ -60,12 +60,18 @@ use WePayCommon; 'method' => '1', */ - $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( - 'client_id' => config('ninja.wepay.client_id'), - 'client_secret' => config('ninja.wepay.client_secret'), - 'credit_card_id' => (int)$data['credit_card_id'], - )); + try { + + $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( + 'client_id' => config('ninja.wepay.client_id'), + 'client_secret' => config('ninja.wepay.client_secret'), + 'credit_card_id' => (int)$data['credit_card_id'], + )); + } + catch(\Exception $e){ + return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e); + } // display the response // nlog($response); @@ -116,11 +122,16 @@ use WePayCommon; { nlog("authorize the card first!"); - $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( - 'client_id' => config('ninja.wepay.client_id'), - 'client_secret' => config('ninja.wepay.client_secret'), - 'credit_card_id' => (int)$request->input('credit_card_id'), - )); + try { + $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( + 'client_id' => config('ninja.wepay.client_id'), + 'client_secret' => config('ninja.wepay.client_secret'), + 'credit_card_id' => (int)$request->input('credit_card_id'), + )); + } + catch(\Exception $e){ + return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e); + } $credit_card_id = (int)$response->credit_card_id; From c26d092346192af0a57abf52a53f243ea0684fd5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 16:59:23 +1000 Subject: [PATCH 14/14] Fixes for S3 --- app/Http/Controllers/ClientPortal/NinjaPlanController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientPortal/NinjaPlanController.php b/app/Http/Controllers/ClientPortal/NinjaPlanController.php index 433663923f86..70b66f087791 100644 --- a/app/Http/Controllers/ClientPortal/NinjaPlanController.php +++ b/app/Http/Controllers/ClientPortal/NinjaPlanController.php @@ -18,10 +18,10 @@ use App\Libraries\MultiDB; use App\Models\ClientContact; use App\Models\Company; use App\Utils\Ninja; -use Auth; use Illuminate\Contracts\Routing\ResponseFactory; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Illuminate\Support\Facades\Auth; class NinjaPlanController extends Controller {