From 7e19d1a9d2dc0d5db5f0015257554281b1e5be2e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Apr 2021 08:03:34 +1000 Subject: [PATCH 01/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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/17] 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 d905329611164fa95d62bb75e48ce6d7c57c0e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 8 Sep 2021 13:20:29 +0200 Subject: [PATCH 10/17] Fixes for `Bold` design logo --- resources/views/pdf-designs/bold.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/resources/views/pdf-designs/bold.html b/resources/views/pdf-designs/bold.html index 81f9d580fec3..689c6cbb06a0 100644 --- a/resources/views/pdf-designs/bold.html +++ b/resources/views/pdf-designs/bold.html @@ -36,7 +36,8 @@ } .company-logo { - max-width: 55%; + height: 100%; + padding-right: 120px; } #company-details, @@ -251,6 +252,10 @@ [data-ref*=".line_total-td"] { white-space: nowrap; } + + .logo-container { + max-height: 160px; + } /** Useful snippets, uncomment to enable. **/ @@ -288,7 +293,9 @@ From 0661216998d636d79aeeb9598755e114836aeeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 8 Sep 2021 13:20:51 +0200 Subject: [PATCH 11/17] Migration file --- ...19_update_designs.php => 2021_09_08_115919_update_designs.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename database/migrations/{2021_09_02_115919_update_designs.php => 2021_09_08_115919_update_designs.php} (100%) diff --git a/database/migrations/2021_09_02_115919_update_designs.php b/database/migrations/2021_09_08_115919_update_designs.php similarity index 100% rename from database/migrations/2021_09_02_115919_update_designs.php rename to database/migrations/2021_09_08_115919_update_designs.php From 711db89061fe95c019a7eeb3e45ca2d925c0ee98 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 11:59:09 +1000 Subject: [PATCH 12/17] 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 13/17] 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 14/17] 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 15/17] 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 { From 42c27d1cac04aa971cbc6732fa31f10190efa386 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 17:23:47 +1000 Subject: [PATCH 16/17] Fixes for Triggered Actions --- app/Mail/TemplateEmail.php | 5 ++++- app/Notifications/BaseNotification.php | 2 ++ app/Services/Invoice/TriggeredActions.php | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index 98d8609c2263..222d767d0cc4 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -127,7 +127,10 @@ class TemplateEmail extends Mailable $ubl_string = CreateUbl::dispatchNow($this->invitation->invoice); - $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); + nlog($ubl_string); + + if($ubl_string) + $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); } diff --git a/app/Notifications/BaseNotification.php b/app/Notifications/BaseNotification.php index edf6d94bf431..d87385525181 100644 --- a/app/Notifications/BaseNotification.php +++ b/app/Notifications/BaseNotification.php @@ -11,6 +11,8 @@ namespace App\Notifications; +use App\Jobs\Invoice\CreateUbl; +use App\Models\Invoice; use App\Utils\TempFile; use App\Utils\Traits\MakesInvoiceHtml; use Illuminate\Bus\Queueable; diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 2516a59999ed..2169a63df6a3 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -63,8 +63,8 @@ class TriggeredActions extends AbstractService private function sendEmail() { - //$reminder_template = $this->invoice->calculateTemplate('invoice'); - $reminder_template = 'payment'; + $reminder_template = $this->invoice->calculateTemplate('invoice'); + //$reminder_template = 'payment'; $this->invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($reminder_template) { EmailEntity::dispatch($invitation, $this->invoice->company, $reminder_template); From b0510ad680bd7e0554a6b14c9d60ed08eb788889 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 9 Sep 2021 20:59:58 +1000 Subject: [PATCH 17/17] Fixes for support message --- app/Mail/SupportMessageSent.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Mail/SupportMessageSent.php b/app/Mail/SupportMessageSent.php index e88251389091..7ea23586ef73 100644 --- a/app/Mail/SupportMessageSent.php +++ b/app/Mail/SupportMessageSent.php @@ -62,9 +62,10 @@ class SupportMessageSent extends Mailable $company = auth()->user()->company(); $user = auth()->user(); $db = str_replace("db-ninja-", "", $company->db); - + $is_large = $company->is_large ? "L" : ""; + if(Ninja::isHosted()) - $subject = "{$priority}Hosted-{$db}-[{$company->is_large}] :: {$plan} :: ".date('M jS, g:ia'); + $subject = "{$priority}Hosted-{$db}{$is_large} :: {$plan} :: ".date('M jS, g:ia'); else $subject = "{$priority}Self Hosted :: {$plan} :: ".date('M jS, g:ia');