mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #9923 from turbo124/v5-develop
Purchase Order Accept Webhook
This commit is contained in:
commit
827eb8de19
@ -11,23 +11,25 @@
|
||||
|
||||
namespace App\Http\Controllers\VendorPortal;
|
||||
|
||||
use App\Events\Misc\InvitationWasViewed;
|
||||
use App\Events\PurchaseOrder\PurchaseOrderWasAccepted;
|
||||
use App\Events\PurchaseOrder\PurchaseOrderWasViewed;
|
||||
use App\Utils\Ninja;
|
||||
use App\Models\Webhook;
|
||||
use Illuminate\View\View;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Jobs\Entity\CreateRawPdf;
|
||||
use App\Jobs\Util\WebhookHandler;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ProcessPurchaseOrdersInBulkRequest;
|
||||
use App\Jobs\Invoice\InjectSignature;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use App\Models\PurchaseOrderInvitation;
|
||||
use App\Events\Misc\InvitationWasViewed;
|
||||
use App\Events\PurchaseOrder\PurchaseOrderWasViewed;
|
||||
use App\Events\PurchaseOrder\PurchaseOrderWasAccepted;
|
||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrderRequest;
|
||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrdersRequest;
|
||||
use App\Jobs\Entity\CreateRawPdf;
|
||||
use App\Jobs\Invoice\InjectSignature;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\PurchaseOrderInvitation;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\View\View;
|
||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ProcessPurchaseOrdersInBulkRequest;
|
||||
|
||||
class PurchaseOrderController extends Controller
|
||||
{
|
||||
@ -187,6 +189,9 @@ class PurchaseOrderController extends Controller
|
||||
}
|
||||
|
||||
event(new PurchaseOrderWasAccepted($purchase_order, auth()->guard('vendor')->user(), $purchase_order->company, Ninja::eventVars()));
|
||||
|
||||
WebhookHandler::dispatch(Webhook::EVENT_ACCEPTED_PURCHASE_ORDER, $purchase_order, $purchase_order->company, 'vendor')->delay(0);
|
||||
|
||||
});
|
||||
|
||||
if ($purchase_count_query->count() == 1) {
|
||||
|
@ -298,7 +298,7 @@ class NinjaMailerJob implements ShouldQueue
|
||||
|
||||
/** Force free/trials onto specific mail driver */
|
||||
|
||||
if($this->mailer == 'default' && $this->company->account->isNewHostedAccount()) {
|
||||
if($this->nmo->settings->email_sending_method == 'default' && $this->company->account->isNewHostedAccount()) {
|
||||
$this->mailer = 'mailgun';
|
||||
$this->setHostedMailgunMailer();
|
||||
return $this;
|
||||
|
@ -176,7 +176,10 @@ class Webhook extends BaseModel
|
||||
|
||||
public const EVENT_REMIND_QUOTE = 64;
|
||||
|
||||
public const EVENT_ACCEPTED_PURCHASE_ORDER = 65;
|
||||
|
||||
public static $valid_events = [
|
||||
self::EVENT_ACCEPTED_PURCHASE_ORDER,
|
||||
self::EVENT_REMIND_QUOTE,
|
||||
self::EVENT_CREATE_PURCHASE_ORDER,
|
||||
self::EVENT_UPDATE_PURCHASE_ORDER,
|
||||
|
@ -526,7 +526,7 @@ class Email implements ShouldQueue
|
||||
{
|
||||
|
||||
/** Force free/trials onto specific mail driver */
|
||||
if($this->mailer == 'default' && $this->company->account->isNewHostedAccount()) {
|
||||
if($this->email_object->settings->email_sending_method == 'default' && $this->company->account->isNewHostedAccount()) {
|
||||
$this->mailer = 'mailgun';
|
||||
$this->setHostedMailgunMailer();
|
||||
return $this;
|
||||
@ -678,7 +678,6 @@ class Email implements ShouldQueue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ensure we discard any data that is not required
|
||||
*
|
||||
|
122
composer.lock
generated
122
composer.lock
generated
@ -535,16 +535,16 @@
|
||||
},
|
||||
{
|
||||
"name": "aws/aws-sdk-php",
|
||||
"version": "3.320.1",
|
||||
"version": "3.320.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||
"reference": "653549ab0e274747a46a96fd375df642704f21e2"
|
||||
"reference": "e6af3e760864d43a30d8b7deb4f9dc6a49a5f66a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/653549ab0e274747a46a96fd375df642704f21e2",
|
||||
"reference": "653549ab0e274747a46a96fd375df642704f21e2",
|
||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/e6af3e760864d43a30d8b7deb4f9dc6a49a5f66a",
|
||||
"reference": "e6af3e760864d43a30d8b7deb4f9dc6a49a5f66a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -627,9 +627,9 @@
|
||||
"support": {
|
||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.320.1"
|
||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.320.4"
|
||||
},
|
||||
"time": "2024-08-15T18:07:13+00:00"
|
||||
"time": "2024-08-20T18:20:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "bacon/bacon-qr-code",
|
||||
@ -2522,16 +2522,16 @@
|
||||
},
|
||||
{
|
||||
"name": "google/apiclient-services",
|
||||
"version": "v0.368.0",
|
||||
"version": "v0.369.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
||||
"reference": "edc08087aa3ca63d3b74f24d59f1d2caab39b5d9"
|
||||
"reference": "002f610e4c3acf0636b4fb1f46314a2097e1c8b4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/edc08087aa3ca63d3b74f24d59f1d2caab39b5d9",
|
||||
"reference": "edc08087aa3ca63d3b74f24d59f1d2caab39b5d9",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/002f610e4c3acf0636b4fb1f46314a2097e1c8b4",
|
||||
"reference": "002f610e4c3acf0636b4fb1f46314a2097e1c8b4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2560,9 +2560,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.368.0"
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.369.0"
|
||||
},
|
||||
"time": "2024-07-11T01:08:44+00:00"
|
||||
"time": "2024-08-14T20:31:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/auth",
|
||||
@ -4489,16 +4489,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/framework",
|
||||
"version": "v11.20.0",
|
||||
"version": "v11.21.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "3cd7593dd9b67002fc416b46616f4d4d1da3e571"
|
||||
"reference": "9d9d36708d56665b12185493f684abce38ad2d30"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/3cd7593dd9b67002fc416b46616f4d4d1da3e571",
|
||||
"reference": "3cd7593dd9b67002fc416b46616f4d4d1da3e571",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/9d9d36708d56665b12185493f684abce38ad2d30",
|
||||
"reference": "9d9d36708d56665b12185493f684abce38ad2d30",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -4691,7 +4691,7 @@
|
||||
"issues": "https://github.com/laravel/framework/issues",
|
||||
"source": "https://github.com/laravel/framework"
|
||||
},
|
||||
"time": "2024-08-06T14:39:21+00:00"
|
||||
"time": "2024-08-20T15:00:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/pint",
|
||||
@ -4761,16 +4761,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/prompts",
|
||||
"version": "v0.1.24",
|
||||
"version": "v0.1.25",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/prompts.git",
|
||||
"reference": "409b0b4305273472f3754826e68f4edbd0150149"
|
||||
"reference": "7b4029a84c37cb2725fc7f011586e2997040bc95"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/409b0b4305273472f3754826e68f4edbd0150149",
|
||||
"reference": "409b0b4305273472f3754826e68f4edbd0150149",
|
||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/7b4029a84c37cb2725fc7f011586e2997040bc95",
|
||||
"reference": "7b4029a84c37cb2725fc7f011586e2997040bc95",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -4813,9 +4813,9 @@
|
||||
"description": "Add beautiful and user-friendly forms to your command-line applications.",
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/prompts/issues",
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.1.24"
|
||||
"source": "https://github.com/laravel/prompts/tree/v0.1.25"
|
||||
},
|
||||
"time": "2024-06-17T13:58:22+00:00"
|
||||
"time": "2024-08-12T22:06:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
@ -4880,16 +4880,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/slack-notification-channel",
|
||||
"version": "v3.3.0",
|
||||
"version": "v3.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/slack-notification-channel.git",
|
||||
"reference": "8cd988fad1a08ed88dfd852f140477376c60217f"
|
||||
"reference": "fc8f931b9ae868945cf0c39aeda71f1cbe180484"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/8cd988fad1a08ed88dfd852f140477376c60217f",
|
||||
"reference": "8cd988fad1a08ed88dfd852f140477376c60217f",
|
||||
"url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/fc8f931b9ae868945cf0c39aeda71f1cbe180484",
|
||||
"reference": "fc8f931b9ae868945cf0c39aeda71f1cbe180484",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -4939,9 +4939,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/laravel/slack-notification-channel/issues",
|
||||
"source": "https://github.com/laravel/slack-notification-channel/tree/v3.3.0"
|
||||
"source": "https://github.com/laravel/slack-notification-channel/tree/v3.3.1"
|
||||
},
|
||||
"time": "2024-07-10T19:39:44+00:00"
|
||||
"time": "2024-08-17T20:57:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/socialite",
|
||||
@ -5283,16 +5283,16 @@
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "2.5.2",
|
||||
"version": "2.5.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/commonmark.git",
|
||||
"reference": "df09d5b6a4188f8f3c3ab2e43a109076a5eeb767"
|
||||
"reference": "b650144166dfa7703e62a22e493b853b58d874b0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/df09d5b6a4188f8f3c3ab2e43a109076a5eeb767",
|
||||
"reference": "df09d5b6a4188f8f3c3ab2e43a109076a5eeb767",
|
||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/b650144166dfa7703e62a22e493b853b58d874b0",
|
||||
"reference": "b650144166dfa7703e62a22e493b853b58d874b0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -5305,8 +5305,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"cebe/markdown": "^1.0",
|
||||
"commonmark/cmark": "0.31.0",
|
||||
"commonmark/commonmark.js": "0.31.0",
|
||||
"commonmark/cmark": "0.31.1",
|
||||
"commonmark/commonmark.js": "0.31.1",
|
||||
"composer/package-versions-deprecated": "^1.8",
|
||||
"embed/embed": "^4.4",
|
||||
"erusev/parsedown": "^1.0",
|
||||
@ -5385,7 +5385,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-08-14T10:56:57+00:00"
|
||||
"time": "2024-08-16T11:46:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/config",
|
||||
@ -5948,16 +5948,16 @@
|
||||
},
|
||||
{
|
||||
"name": "livewire/livewire",
|
||||
"version": "v3.5.4",
|
||||
"version": "v3.5.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/livewire/livewire.git",
|
||||
"reference": "b158c6386a892efc6c5e4682e682829baac1f933"
|
||||
"reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/livewire/livewire/zipball/b158c6386a892efc6c5e4682e682829baac1f933",
|
||||
"reference": "b158c6386a892efc6c5e4682e682829baac1f933",
|
||||
"url": "https://api.github.com/repos/livewire/livewire/zipball/597a2808d8d3001cc3ed5ce89a6ebab00f83b80f",
|
||||
"reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -5965,6 +5965,7 @@
|
||||
"illuminate/routing": "^10.0|^11.0",
|
||||
"illuminate/support": "^10.0|^11.0",
|
||||
"illuminate/validation": "^10.0|^11.0",
|
||||
"laravel/prompts": "^0.1.24",
|
||||
"league/mime-type-detection": "^1.9",
|
||||
"php": "^8.1",
|
||||
"symfony/console": "^6.0|^7.0",
|
||||
@ -5973,7 +5974,6 @@
|
||||
"require-dev": {
|
||||
"calebporzio/sushi": "^2.1",
|
||||
"laravel/framework": "^10.15.0|^11.0",
|
||||
"laravel/prompts": "^0.1.6",
|
||||
"mockery/mockery": "^1.3.1",
|
||||
"orchestra/testbench": "^8.21.0|^9.0",
|
||||
"orchestra/testbench-dusk": "^8.24|^9.1",
|
||||
@ -6012,7 +6012,7 @@
|
||||
"description": "A front-end framework for Laravel.",
|
||||
"support": {
|
||||
"issues": "https://github.com/livewire/livewire/issues",
|
||||
"source": "https://github.com/livewire/livewire/tree/v3.5.4"
|
||||
"source": "https://github.com/livewire/livewire/tree/v3.5.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -6020,7 +6020,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-15T18:27:32+00:00"
|
||||
"time": "2024-08-19T11:52:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "maennchen/zipstream-php",
|
||||
@ -6896,16 +6896,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "3.7.0",
|
||||
"version": "3.8.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139"
|
||||
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cb4374784c87d0a0294e8513a52eb63c0aff3139",
|
||||
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
|
||||
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -6998,7 +6998,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-16T22:29:20+00:00"
|
||||
"time": "2024-08-19T06:22:39+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nette/schema",
|
||||
@ -15126,26 +15126,26 @@
|
||||
},
|
||||
{
|
||||
"name": "composer/pcre",
|
||||
"version": "3.2.0",
|
||||
"version": "3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/composer/pcre.git",
|
||||
"reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90"
|
||||
"reference": "1637e067347a0c40bbb1e3cd786b20dcab556a81"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/ea4ab6f9580a4fd221e0418f2c357cdd39102a90",
|
||||
"reference": "ea4ab6f9580a4fd221e0418f2c357cdd39102a90",
|
||||
"url": "https://api.github.com/repos/composer/pcre/zipball/1637e067347a0c40bbb1e3cd786b20dcab556a81",
|
||||
"reference": "1637e067347a0c40bbb1e3cd786b20dcab556a81",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpstan/phpstan": "<1.11.8"
|
||||
"phpstan/phpstan": "<1.11.10"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^1.11.8",
|
||||
"phpstan/phpstan": "^1.11.10",
|
||||
"phpstan/phpstan-strict-rules": "^1.1",
|
||||
"phpunit/phpunit": "^8 || ^9"
|
||||
},
|
||||
@ -15185,7 +15185,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/composer/pcre/issues",
|
||||
"source": "https://github.com/composer/pcre/tree/3.2.0"
|
||||
"source": "https://github.com/composer/pcre/tree/3.3.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@ -15201,7 +15201,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-25T09:36:02+00:00"
|
||||
"time": "2024-08-19T19:43:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/semver",
|
||||
@ -16299,16 +16299,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.11.10",
|
||||
"version": "1.11.11",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "640410b32995914bde3eed26fa89552f9c2c082f"
|
||||
"reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/640410b32995914bde3eed26fa89552f9c2c082f",
|
||||
"reference": "640410b32995914bde3eed26fa89552f9c2c082f",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/707c2aed5d8d0075666e673a5e71440c1d01a5a3",
|
||||
"reference": "707c2aed5d8d0075666e673a5e71440c1d01a5a3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -16353,7 +16353,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-08-08T09:02:50+00:00"
|
||||
"time": "2024-08-19T14:37:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
|
@ -5315,6 +5315,7 @@ $lang = array(
|
||||
'payment_balance_on_file' => 'Payment Balance On File',
|
||||
'ubl_email_attachment_help' => 'For more e-invoice settings please navigate :here',
|
||||
'stop_task_to_add_task_entry' => 'You need to stop the task before adding a new item.',
|
||||
'xml_file' => 'XML File',
|
||||
);
|
||||
|
||||
return $lang;
|
||||
|
Loading…
x
Reference in New Issue
Block a user