diff --git a/VERSION.txt b/VERSION.txt index 01959b109939..cf5136119071 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.57 \ No newline at end of file +5.9.0 \ No newline at end of file diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 9e0cd93078b6..75a4a010c951 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -70,12 +70,10 @@ class StartupCheck private function buildTemplates($name = 'templates') { $data = [ - 'invoice' => [ 'subject' => EmailTemplateDefaults::emailInvoiceSubject(), 'body' => EmailTemplateDefaults::emailInvoiceTemplate(), ], - 'quote' => [ 'subject' => EmailTemplateDefaults::emailQuoteSubject(), 'body' => EmailTemplateDefaults::emailQuoteTemplate(), diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 04edfe884073..595e6fb8ace1 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -112,6 +112,7 @@ class NinjaMailerJob implements ShouldQueue ->mailable ->withSymfonyMessage(function ($message) { $message->getHeaders()->addTextHeader('x-invitation', $this->nmo->invitation->key); + // $message->getHeaders()->addTextHeader('List-Unsubscribe', $this->nmo->mailable->viewData->email_preferences); }); } diff --git a/app/Models/Client.php b/app/Models/Client.php index c34c16bf67ea..def568c651f1 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -51,6 +51,7 @@ use Laracasts\Presenter\PresentableTrait; * @property int|null $last_login * @property int|null $industry_id * @property int|null $size_id + * @property object|null $e_invoice * @property string|null $address1 * @property string|null $address2 * @property string|null $city @@ -185,6 +186,7 @@ class Client extends BaseModel implements HasLocalePreference 'deleted_at' => 'timestamp', 'last_login' => 'timestamp', 'tax_data' => 'object', + 'e_invoice' => 'object', ]; protected $touches = []; diff --git a/app/Providers/StaticServiceProvider.php b/app/Providers/StaticServiceProvider.php new file mode 100644 index 000000000000..211275bc7c79 --- /dev/null +++ b/app/Providers/StaticServiceProvider.php @@ -0,0 +1,100 @@ +singleton('currencies', function ($app) { + return Currency::query()->orderBy('name')->get(); + }); + + app()->singleton('languages', function ($app) { + return Language::query()->orderBy('name')->get(); + }); + + app()->singleton('countries', function ($app) { + return Country::query()->orderBy('name')->get(); + }); + + app()->singleton('payment_types', function ($app) { + return PaymentTerm::query()->orderBy('num_days')->get(); + }); + + app()->singleton('industries', function ($app) { + return Industry::query()->orderBy('name')->get(); + }); + + app()->singleton('banks', function ($app){ + return Bank::query()->orderBy('name')->get(); + }); + + app()->singleton('templates', function ($app){ + return [ + 'invoice' => [ + 'subject' => EmailTemplateDefaults::emailInvoiceSubject(), + 'body' => EmailTemplateDefaults::emailInvoiceTemplate(), + ], + 'quote' => [ + 'subject' => EmailTemplateDefaults::emailQuoteSubject(), + 'body' => EmailTemplateDefaults::emailQuoteTemplate(), + ], + 'payment' => [ + 'subject' => EmailTemplateDefaults::emailPaymentSubject(), + 'body' => EmailTemplateDefaults::emailPaymentTemplate(), + ], + 'reminder1' => [ + 'subject' => EmailTemplateDefaults::emailReminder1Subject(), + 'body' => EmailTemplateDefaults::emailReminder1Template(), + ], + 'reminder2' => [ + 'subject' => EmailTemplateDefaults::emailReminder2Subject(), + 'body' => EmailTemplateDefaults::emailReminder2Template(), + ], + 'reminder3' => [ + 'subject' => EmailTemplateDefaults::emailReminder3Subject(), + 'body' => EmailTemplateDefaults::emailReminder3Template(), + ], + 'reminder_endless' => [ + 'subject' => EmailTemplateDefaults::emailReminderEndlessSubject(), + 'body' => EmailTemplateDefaults::emailReminderEndlessTemplate(), + ], + 'statement' => [ + 'subject' => EmailTemplateDefaults::emailStatementSubject(), + 'body' => EmailTemplateDefaults::emailStatementTemplate(), + ], + ]; + + }); + } + + public function boot() + { + + } +} \ No newline at end of file diff --git a/app/Services/Email/EmailDefaults.php b/app/Services/Email/EmailDefaults.php index 718ac515dc6b..1053632b4328 100644 --- a/app/Services/Email/EmailDefaults.php +++ b/app/Services/Email/EmailDefaults.php @@ -11,19 +11,20 @@ namespace App\Services\Email; -use App\DataMapper\EmailTemplateDefaults; -use App\Jobs\Entity\CreateRawPdf; -use App\Jobs\Invoice\CreateUbl; +use App\Models\Task; +use App\Utils\Ninja; +use App\Models\Quote; use App\Models\Account; use App\Models\Expense; use App\Models\Invoice; use App\Models\PurchaseOrder; -use App\Models\Quote; -use App\Models\Task; -use App\Utils\Ninja; +use App\Jobs\Invoice\CreateUbl; use App\Utils\Traits\MakesHash; -use Illuminate\Mail\Mailables\Address; +use App\Jobs\Entity\CreateRawPdf; use Illuminate\Support\Facades\App; +use Illuminate\Support\Facades\URL; +use Illuminate\Mail\Mailables\Address; +use App\DataMapper\EmailTemplateDefaults; use League\CommonMark\CommonMarkConverter; class EmailDefaults @@ -388,6 +389,7 @@ class EmailDefaults { if ($this->email->email_object->invitation_key) { $this->email->email_object->headers = array_merge($this->email->email_object->headers, ['x-invitation' => $this->email->email_object->invitation_key]); + // $this->email->email_object->headers = array_merge($this->email->email_object->headers, ['x-invitation' => $this->email->email_object->invitation_key,'List-Unsubscribe' => URL::signedRoute('client.email_preferences', ['entity' => $this->email->email_object->invitation->getEntityString(), 'invitation_key' => $this->email->email_object->invitation->key])]); } return $this; diff --git a/app/Transformers/ClientTransformer.php b/app/Transformers/ClientTransformer.php index 84442fb3629a..4211fc450f21 100644 --- a/app/Transformers/ClientTransformer.php +++ b/app/Transformers/ClientTransformer.php @@ -164,6 +164,7 @@ class ClientTransformer extends EntityTransformer 'routing_id' => (string) $client->routing_id, 'tax_info' => $client->tax_data ?: new \stdClass(), 'classification' => $client->classification ?: '', + 'e_invoice' => $client->e_invoice ?: new \stdClass(), ]; } } diff --git a/app/Transformers/Shop/CompanyShopProfileTransformer.php b/app/Transformers/Shop/CompanyShopProfileTransformer.php index 2cb26eeb21a2..0ae0d3033827 100644 --- a/app/Transformers/Shop/CompanyShopProfileTransformer.php +++ b/app/Transformers/Shop/CompanyShopProfileTransformer.php @@ -72,6 +72,9 @@ class CompanyShopProfileTransformer extends EntityTransformer 'email' => $company->settings->email, 'country_id' => $company->settings->country_id, 'vat_number' => $company->settings->vat_number, + 'product' => $company->settings->translations->product ?? ctrans('texts.product'), + 'products' => $company->settings->translations->products ?? ctrans('texts.products'), + 'client_registration_fields' => $company->client_registration_fields, ]; $new_settings = new stdClass(); diff --git a/composer.lock b/composer.lock index 9fa157960e63..8349af9cccf5 100644 --- a/composer.lock +++ b/composer.lock @@ -1385,16 +1385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.308.6", + "version": "3.308.7", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "d119265faba226b3fab1514b6fa27a2986b91453" + "reference": "97074bd8cdd9fe498570821cefa4868fa3353cf3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d119265faba226b3fab1514b6fa27a2986b91453", - "reference": "d119265faba226b3fab1514b6fa27a2986b91453", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/97074bd8cdd9fe498570821cefa4868fa3353cf3", + "reference": "97074bd8cdd9fe498570821cefa4868fa3353cf3", "shasum": "" }, "require": { @@ -1474,9 +1474,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.308.6" + "source": "https://github.com/aws/aws-sdk-php/tree/3.308.7" }, - "time": "2024-05-30T18:08:56+00:00" + "time": "2024-05-31T18:17:12+00:00" }, { "name": "bacon/bacon-qr-code", @@ -3646,16 +3646,16 @@ }, { "name": "google/auth", - "version": "v1.39.0", + "version": "v1.40.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "23e8e696d87f8d7dfefbd347ca1c99ce17ecb368" + "reference": "bff9f2d01677e71a98394b5ac981b99523df5178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/23e8e696d87f8d7dfefbd347ca1c99ce17ecb368", - "reference": "23e8e696d87f8d7dfefbd347ca1c99ce17ecb368", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/bff9f2d01677e71a98394b5ac981b99523df5178", + "reference": "bff9f2d01677e71a98394b5ac981b99523df5178", "shasum": "" }, "require": { @@ -3700,9 +3700,9 @@ "support": { "docs": "https://googleapis.github.io/google-auth-library-php/main/", "issues": "https://github.com/googleapis/google-auth-library-php/issues", - "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.39.0" + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.40.0" }, - "time": "2024-05-02T16:03:51+00:00" + "time": "2024-05-31T19:16:15+00:00" }, { "name": "graham-campbell/result-type", @@ -4630,16 +4630,16 @@ }, { "name": "horstoeko/zugferd", - "version": "v1.0.49", + "version": "v1.0.51", "source": { "type": "git", "url": "https://github.com/horstoeko/zugferd.git", - "reference": "bc4f9180c455deae20fb0281b519a550cbfbd1ea" + "reference": "9e036d4a9660638b4f51d2babb397fcff29ef046" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/bc4f9180c455deae20fb0281b519a550cbfbd1ea", - "reference": "bc4f9180c455deae20fb0281b519a550cbfbd1ea", + "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/9e036d4a9660638b4f51d2babb397fcff29ef046", + "reference": "9e036d4a9660638b4f51d2babb397fcff29ef046", "shasum": "" }, "require": { @@ -4699,9 +4699,9 @@ ], "support": { "issues": "https://github.com/horstoeko/zugferd/issues", - "source": "https://github.com/horstoeko/zugferd/tree/v1.0.49" + "source": "https://github.com/horstoeko/zugferd/tree/v1.0.51" }, - "time": "2024-05-30T14:58:49+00:00" + "time": "2024-05-31T17:20:07+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -16788,16 +16788,16 @@ }, { "name": "brianium/paratest", - "version": "v7.4.4", + "version": "v7.4.5", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "bfe354e71aca261cf37bf70bf47791081100000d" + "reference": "d4de825332842a7dee1ff350f0fd6caafa930d79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/bfe354e71aca261cf37bf70bf47791081100000d", - "reference": "bfe354e71aca261cf37bf70bf47791081100000d", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/d4de825332842a7dee1ff350f0fd6caafa930d79", + "reference": "d4de825332842a7dee1ff350f0fd6caafa930d79", "shasum": "" }, "require": { @@ -16813,19 +16813,19 @@ "phpunit/php-timer": "^6.0.0 || ^7.0.0", "phpunit/phpunit": "^10.5.20 || ^11.1.3", "sebastian/environment": "^6.1.0 || ^7.1.0", - "symfony/console": "^6.4.7 || ^7.0.7", - "symfony/process": "^6.4.7 || ^7.0.7" + "symfony/console": "^6.4.7 || ^7.1.0", + "symfony/process": "^6.4.7 || ^7.1.0" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^1.10.67", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.16", - "phpstan/phpstan-strict-rules": "^1.5.5", - "squizlabs/php_codesniffer": "^3.9.2", - "symfony/filesystem": "^6.4.3 || ^7.0.7" + "phpstan/phpstan": "^1.11.2", + "phpstan/phpstan-deprecation-rules": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "squizlabs/php_codesniffer": "^3.10.1", + "symfony/filesystem": "^6.4.3 || ^7.1.0" }, "bin": [ "bin/paratest", @@ -16866,7 +16866,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.4.4" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.5" }, "funding": [ { @@ -16878,7 +16878,7 @@ "type": "paypal" } ], - "time": "2024-05-03T13:01:49+00:00" + "time": "2024-05-31T13:59:20+00:00" }, { "name": "clue/ndjson-react", @@ -16946,16 +16946,16 @@ }, { "name": "composer/class-map-generator", - "version": "1.1.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/composer/class-map-generator.git", - "reference": "8286a62d243312ed99b3eee20d5005c961adb311" + "reference": "acd227952154850d0bb7d65caa4f9edf9cd806a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/8286a62d243312ed99b3eee20d5005c961adb311", - "reference": "8286a62d243312ed99b3eee20d5005c961adb311", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/acd227952154850d0bb7d65caa4f9edf9cd806a7", + "reference": "acd227952154850d0bb7d65caa4f9edf9cd806a7", "shasum": "" }, "require": { @@ -16999,7 +16999,7 @@ ], "support": { "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.1.1" + "source": "https://github.com/composer/class-map-generator/tree/1.3.2" }, "funding": [ { @@ -17015,7 +17015,7 @@ "type": "tidelift" } ], - "time": "2024-03-15T12:53:41+00:00" + "time": "2024-05-31T19:45:56+00:00" }, { "name": "composer/pcre", @@ -18240,16 +18240,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.11.2", + "version": "1.11.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec" + "reference": "e64220a05c1209fc856d58e789c3b7a32c0bb9a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0d5d4294a70deb7547db655c47685d680e39cfec", - "reference": "0d5d4294a70deb7547db655c47685d680e39cfec", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e64220a05c1209fc856d58e789c3b7a32c0bb9a5", + "reference": "e64220a05c1209fc856d58e789c3b7a32c0bb9a5", "shasum": "" }, "require": { @@ -18294,7 +18294,7 @@ "type": "github" } ], - "time": "2024-05-24T13:23:04+00:00" + "time": "2024-05-31T13:53:37+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/config/app.php b/config/app.php index 225f88c32d82..1bef51091a75 100644 --- a/config/app.php +++ b/config/app.php @@ -201,6 +201,7 @@ return [ App\Providers\MultiDBProvider::class, App\Providers\ClientPortalServiceProvider::class, App\Providers\NinjaTranslationServiceProvider::class, + // App\Providers\StaticServiceProvider::class, ], /* diff --git a/config/ninja.php b/config/ninja.php index 0d4f30250d7c..98dbe497a3af 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.58'), - 'app_tag' => env('APP_TAG', '5.8.58'), + 'app_version' => env('APP_VERSION', '5.9.0'), + 'app_tag' => env('APP_TAG', '5.9.0'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), diff --git a/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php b/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php index 5fca9a9feb95..b9183d0c753a 100644 --- a/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php +++ b/database/migrations/2024_05_19_215103_2024_05_20_einvoice_columns.php @@ -36,7 +36,6 @@ return new class extends Migration $table->mediumText('e_invoice')->nullable(); }); - Schema::table('accounts', function (Blueprint $table) { $table->integer('email_quota')->default(20)->nullable(); }); diff --git a/database/migrations/2024_06_02_083543_2024_06_01_add_einvoice_to_client_table.php b/database/migrations/2024_06_02_083543_2024_06_01_add_einvoice_to_client_table.php new file mode 100644 index 000000000000..f905b1de5fca --- /dev/null +++ b/database/migrations/2024_06_02_083543_2024_06_01_add_einvoice_to_client_table.php @@ -0,0 +1,27 @@ +mediumText('e_invoice')->nullable(); + }); + + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + } +}; diff --git a/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php b/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php index ab2acb24397b..a4ff003c359a 100644 --- a/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/tasks-table.blade.php @@ -15,22 +15,22 @@ - - - - @foreach($tasks as $task) - - - - @@ -68,17 +68,17 @@
+ {{ ctrans('texts.description') }} + {{ ctrans('texts.project') }} + {{ ctrans('texts.status') }} + {{ ctrans('texts.duration') }} @@ -40,13 +40,13 @@
+ {{ \Illuminate\Support\Str::limit($task->description, 80) }} + {{ $task->project?->name }} +
{!! $task->stringStatus() !!} @@ -59,7 +59,7 @@ @endif
+ {{ \Carbon\CarbonInterval::seconds($task->calcDuration())->cascade()->forHumans() }}
- - - - - - diff --git a/tests/Feature/BankIntegrationApiTest.php b/tests/Feature/BankIntegrationApiTest.php index fc69c8f8f2f1..616cecaf0bca 100644 --- a/tests/Feature/BankIntegrationApiTest.php +++ b/tests/Feature/BankIntegrationApiTest.php @@ -28,6 +28,8 @@ class BankIntegrationApiTest extends TestCase use DatabaseTransactions; use MockAccountData; + protected $faker; + protected function setUp() :void { parent::setUp(); diff --git a/tests/Feature/DesignApiTest.php b/tests/Feature/DesignApiTest.php index 48811d7f7a00..06bbc8e04a6c 100644 --- a/tests/Feature/DesignApiTest.php +++ b/tests/Feature/DesignApiTest.php @@ -60,6 +60,7 @@ class DesignApiTest extends TestCase $q = Design::query() ->where('is_template', true) + ->where('company_id', $this->company->id) ->whereRaw('FIND_IN_SET( ? ,entities)', [$searchable]); $this->assertEquals(1, $q->count()); diff --git a/tests/Feature/Notify/NotificationTest.php b/tests/Feature/Notify/NotificationTest.php index 50818f9299b0..4b3f4aa19c4a 100644 --- a/tests/Feature/Notify/NotificationTest.php +++ b/tests/Feature/Notify/NotificationTest.php @@ -11,17 +11,18 @@ namespace Tests\Feature\Notify; -use App\DataMapper\CompanySettings; -use App\Models\CompanyToken; -use App\Models\CompanyUser; -use App\Models\Invoice; -use App\Models\InvoiceInvitation; -use App\Models\Product; -use App\Models\User; -use App\Utils\Traits\Notifications\UserNotifies; -use Illuminate\Support\Str; -use Tests\MockAccountData; use Tests\TestCase; +use App\Models\User; +use App\Models\Invoice; +use App\Models\Product; +use Tests\MockAccountData; +use App\Models\CompanyUser; +use Illuminate\Support\Str; +use App\Models\CompanyToken; +use App\Models\InvoiceInvitation; +use App\DataMapper\CompanySettings; +use App\Utils\Traits\Notifications\UserNotifies; +use Illuminate\Routing\Middleware\ThrottleRequests; /** * @test @@ -32,6 +33,8 @@ class NotificationTest extends TestCase use UserNotifies; use MockAccountData; + protected $faker; + protected function setUp() :void { parent::setUp(); diff --git a/tests/Feature/Shop/ShopInvoiceTest.php b/tests/Feature/Shop/ShopInvoiceTest.php index 9bc064fd1d2f..197b94f987f5 100644 --- a/tests/Feature/Shop/ShopInvoiceTest.php +++ b/tests/Feature/Shop/ShopInvoiceTest.php @@ -27,6 +27,7 @@ class ShopInvoiceTest extends TestCase { use MakesHash; use MockAccountData; + protected $faker; protected function setUp() :void { diff --git a/tests/Unit/Shop/ShopProfileTest.php b/tests/Unit/Shop/ShopProfileTest.php index 6e6e773c3103..51ce81779c24 100644 --- a/tests/Unit/Shop/ShopProfileTest.php +++ b/tests/Unit/Shop/ShopProfileTest.php @@ -48,4 +48,60 @@ class ShopProfileTest extends TestCase $this->assertArrayHasKey('custom_value1', $arr['data']['settings']); $this->assertEquals($this->company->company_key, $arr['data']['company_key']); } + + public function testProfileSettingsUpdate() + { + + $this->company->enable_shop_api = true; + + $settings = $this->company->settings; + + $trans = new \stdClass; + $trans->product = "Service"; + $trans->products = "Services"; + + $settings->translations = $trans; + $this->company->settings = $settings; + + $this->company->save(); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-COMPANY-KEY' => $this->company->company_key, + ])->getJson('/api/v1/shop/profile'); + + + $response->assertStatus(200); + + $arr = $response->json(); + + $this->assertEquals("Service", $arr['data']['settings']['product']); + $this->assertEquals("Services", $arr['data']['settings']['products']); + + } + + public function testProfileSettingsUpdate2() + { + + $this->company->enable_shop_api = true; + + $this->company->save(); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-COMPANY-KEY' => $this->company->company_key, + ])->getJson('/api/v1/shop/profile'); + + + $response->assertStatus(200); + + $arr = $response->json(); + + $this->assertEquals("Product", $arr['data']['settings']['product']); + $this->assertEquals("Products", $arr['data']['settings']['products']); + $this->assertIsArray($arr['data']['settings']['client_registration_fields']); + + } + + } diff --git a/tests/Unit/ValidationRules/UniqueInvoiceNumberValidationTest.php b/tests/Unit/ValidationRules/UniqueInvoiceNumberValidationTest.php index 923b092a4c19..a3b6b7d5795a 100644 --- a/tests/Unit/ValidationRules/UniqueInvoiceNumberValidationTest.php +++ b/tests/Unit/ValidationRules/UniqueInvoiceNumberValidationTest.php @@ -11,12 +11,13 @@ namespace Tests\Unit\ValidationRules; -use App\Http\Requests\Invoice\StoreInvoiceRequest; +use Tests\TestCase; use App\Models\Invoice; +use Tests\MockAccountData; use App\Utils\Traits\MakesHash; use Illuminate\Support\Facades\Validator; -use Tests\MockAccountData; -use Tests\TestCase; +use App\Http\Requests\Invoice\StoreInvoiceRequest; +use Illuminate\Routing\Middleware\ThrottleRequests; /** * @test
+ {{ ctrans('texts.date') }} + {{ ctrans('texts.duration') }} + {{ ctrans('texts.description') }} @@ -89,13 +89,13 @@ @foreach($task->processLogsExpandedNotation() as $log) @if(strlen($log['description']) > 1)
+ {{ $log['start_date']}} + {{ $log['duration']}} + {!! nl2br(e($log['description'])) !!}