Merge branch 'master' of https://github.com/brkcvn/akaunting into form-elements

This commit is contained in:
Burak Civan 2022-07-04 10:15:27 +03:00
commit 8fd3dad226
44 changed files with 935 additions and 192 deletions

View File

@ -91,7 +91,7 @@ abstract class Notification extends BaseNotification implements ShouldQueue
public function getFooter() public function getFooter()
{ {
$url = 'https://akaunting.com/lp/accounting-software?utm_source=email&utm_medium=software&utm_campaign=footer&utm_content=' . $this->template->alias; $url = 'https://akaunting.com/lp/accounting-software?utm_source=email&utm_medium=footer&utm_campaign=plg&utm_content=' . $this->template->alias;
$get_started = '<a href="' . $url . '" style="color: #676ba2; text-decoration: none;">' . trans('footer.get_started') . '</a>'; $get_started = '<a href="' . $url . '" style="color: #676ba2; text-decoration: none;">' . trans('footer.get_started') . '</a>';

View File

@ -63,7 +63,7 @@ abstract class Widget
'alias' => $alias, 'alias' => $alias,
'utm_source' => 'widget', 'utm_source' => 'widget',
'utm_medium' => 'app', 'utm_medium' => 'app',
'utm_campaign' => Str::snake(Str::camel($alias)), 'utm_campaign' => str_replace('-', '_', $alias),
]); ]);
} }

View File

@ -1,20 +0,0 @@
<?php
namespace App\Events\Auth;
use App\Abstracts\Event;
class InvitationCreated extends Event
{
public $invitation;
/**
* Create a new event instance.
*
* @param $invitation
*/
public function __construct($invitation)
{
$this->invitation = $invitation;
}
}

View File

@ -46,6 +46,10 @@ class Register extends Controller
{ {
$invitation = UserInvitation::token($request->get('token'))->first(); $invitation = UserInvitation::token($request->get('token'))->first();
if (!$invitation) {
abort(403);
}
$user = $invitation->user; $user = $invitation->user;
$this->dispatch(new DeleteInvitation($invitation)); $this->dispatch(new DeleteInvitation($invitation));

View File

@ -12,6 +12,7 @@ use App\Models\Setting\Currency;
use App\Utilities\Modules; use App\Utilities\Modules;
use App\Traits\Uploads; use App\Traits\Uploads;
use App\Traits\Transactions; use App\Traits\Transactions;
use Date;
class DocumentTransactions extends Controller class DocumentTransactions extends Controller
@ -58,6 +59,8 @@ class DocumentTransactions extends Controller
$document->grand_total = round($document->total - $paid, $currency->precision); $document->grand_total = round($document->total - $paid, $currency->precision);
} }
$document->paid_at = Date::now()->toDateString();
$buttons = [ $buttons = [
'cancel' => [ 'cancel' => [
'text' => trans('general.cancel'), 'text' => trans('general.cancel'),
@ -79,9 +82,11 @@ class DocumentTransactions extends Controller
], ],
]; ];
$method = 'POST';
$route = ['modals.documents.document.transactions.store', $document->id]; $route = ['modals.documents.document.transactions.store', $document->id];
$html = view('modals.documents.payment', compact('document', 'route', 'currency', 'number'))->render(); $html = view('modals.documents.payment', compact('document', 'method', 'route', 'currency', 'number'))->render();
return response()->json([ return response()->json([
'success' => true, 'success' => true,
@ -139,20 +144,11 @@ class DocumentTransactions extends Controller
$paid = $document->paid; $paid = $document->paid;
$number = $this->getNextTransactionNumber(); $number = $transaction->number;
// Get document Totals $document->grand_total = money($transaction->amount, $currency->code)->getAmount();
foreach ($document->totals as $document_total) {
$document->{$document_total->code} = $document_total->amount;
}
$total = money($document->total, $currency->code, true)->format(); $document->paid_at = $transaction->paid_at;
$document->grand_total = money($total, $currency->code)->getAmount();
if (! empty($paid)) {
$document->grand_total = round($document->total - $paid, $currency->precision);
}
$buttons = [ $buttons = [
'cancel' => [ 'cancel' => [
@ -170,9 +166,11 @@ class DocumentTransactions extends Controller
], ],
]; ];
$method = 'PATCH';
$route = ['modals.documents.document.transactions.update', $document->id, $transaction->id]; $route = ['modals.documents.document.transactions.update', $document->id, $transaction->id];
$html = view('modals.documents.payment', compact('document', 'transaction', 'route', 'currency', 'number'))->render(); $html = view('modals.documents.payment', compact('document', 'transaction', 'method', 'route', 'currency', 'number'))->render();
return response()->json([ return response()->json([
'success' => true, 'success' => true,

View File

@ -3,9 +3,11 @@
namespace App\Jobs\Auth; namespace App\Jobs\Auth;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Events\Auth\InvitationCreated;
use App\Models\Auth\UserInvitation; use App\Models\Auth\UserInvitation;
use App\Notifications\Auth\Invitation as Notification;
use Exception;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Symfony\Component\Mailer\Exception\TransportException;
class CreateInvitation extends Job class CreateInvitation extends Job
{ {
@ -13,31 +15,29 @@ class CreateInvitation extends Job
protected $user; protected $user;
protected $company; public function __construct($user)
public function __construct($user, $company)
{ {
$this->user = $user; $this->user = $user;
$this->company = $company;
} }
public function handle(): UserInvitation public function handle(): UserInvitation
{ {
\DB::transaction(function () { \DB::transaction(function () {
if ($this->user->hasPendingInvitation($this->company->id)) {
$pending_invitation = $this->user->getPendingInvitation($this->company->id);
$this->dispatch(new DeleteInvitation($pending_invitation));
}
$this->invitation = UserInvitation::create([ $this->invitation = UserInvitation::create([
'user_id' => $this->user->id, 'user_id' => $this->user->id,
'company_id' => $this->company->id,
'token' => (string) Str::uuid(), 'token' => (string) Str::uuid(),
]); ]);
});
event(new InvitationCreated($this->invitation)); $notification = new Notification($this->invitation);
try {
$this->dispatch(new NotifyUser($this->user, $notification));
} catch (TransportException $e) {
$message = trans('errors.title.500');
throw new Exception($message);
}
});
return $this->invitation; return $this->invitation;
} }

View File

@ -69,12 +69,10 @@ class CreateUser extends Job implements HasOwner, HasSource, ShouldCreate
'user' => $this->model->id, 'user' => $this->model->id,
'company' => $company->id, 'company' => $company->id,
]); ]);
if (app()->runningInConsole() || request()->isInstall()) {
continue;
} }
$this->dispatch(new CreateInvitation($this->model, $company)); if ((! app()->runningInConsole() && ! request()->isInstall()) || app()->runningUnitTests()) {
$this->dispatch(new CreateInvitation($this->model));
} }
}); });

View File

@ -16,6 +16,8 @@ class DeleteUser extends Job implements ShouldDelete
event(new UserDeleting($this->model)); event(new UserDeleting($this->model));
\DB::transaction(function () { \DB::transaction(function () {
$this->deleteRelationships($this->model, ['invitation']);
$this->model->delete(); $this->model->delete();
$this->model->flushCache(); $this->model->flushCache();

View File

@ -67,20 +67,6 @@ class UpdateUser extends Job implements ShouldUpdate
'user' => $this->model->id, 'user' => $this->model->id,
'company' => $company->id, 'company' => $company->id,
]); ]);
$this->dispatch(new CreateInvitation($this->model, $company));
}
}
if (isset($sync) && !empty($sync['detached'])) {
foreach ($sync['detached'] as $id) {
$company = Company::find($id);
if ($this->model->hasPendingInvitation($company->id)) {
$pending_invitation = $this->model->getPendingInvitation($company->id);
$this->dispatch(new DeleteInvitation($pending_invitation));
}
} }
} }
}); });

View File

@ -3,7 +3,7 @@
namespace App\Jobs\Banking; namespace App\Jobs\Banking;
use App\Abstracts\Job; use App\Abstracts\Job;
use App\Jobs\Banking\CreateTransaction; use App\Jobs\Banking\UpdateTransaction;
use App\Jobs\Document\CreateDocumentHistory; use App\Jobs\Document\CreateDocumentHistory;
use App\Events\Document\PaidAmountCalculated; use App\Events\Document\PaidAmountCalculated;
use App\Interfaces\Job\ShouldUpdate; use App\Interfaces\Job\ShouldUpdate;
@ -21,7 +21,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->model = $model; $this->model = $model;
$this->transaction = $transaction; $this->transaction = $transaction;
parent::__construct($request); $this->request = $this->getRequestInstance($request);
} }
public function handle(): Transaction public function handle(): Transaction
@ -31,7 +31,7 @@ class UpdateBankingDocumentTransaction extends Job implements ShouldUpdate
$this->checkAmount(); $this->checkAmount();
\DB::transaction(function () { \DB::transaction(function () {
$this->transaction = $this->dispatch(new CreateTransaction($this->request)); $this->transaction = $this->dispatch(new UpdateTransaction($this->transaction, $this->request));
// Upload attachment // Upload attachment
if ($this->request->file('attachment')) { if ($this->request->file('attachment')) {

View File

@ -1,28 +0,0 @@
<?php
namespace App\Listeners\Auth;
use App\Events\Auth\UserDeleted as Event;
use App\Jobs\Auth\DeleteInvitation;
use App\Models\Auth\UserInvitation;
use App\Traits\Jobs;
class DeleteUserInvitation
{
use Jobs;
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
$invitations = UserInvitation::where('user_id', $event->user->id)->get();
foreach ($invitations as $invitation) {
$this->dispatch(new DeleteInvitation($invitation));
}
}
}

View File

@ -1,22 +0,0 @@
<?php
namespace App\Listeners\Auth;
use App\Events\Auth\InvitationCreated as Event;
use App\Notifications\Auth\Invitation as Notification;
class SendUserInvitation
{
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
$invitation = $event->invitation;
$invitation->user->notify(new Notification($invitation));
}
}

View File

@ -62,8 +62,8 @@ class ShowInNotifications
$app_url = route('apps.app.show', [ $app_url = route('apps.app.show', [
'alias' => $new_app->alias, 'alias' => $new_app->alias,
'utm_source' => 'notification', 'utm_source' => 'notification',
'utm_medium' => 'software', 'utm_medium' => 'app',
'utm_campaign' => str_replace('-', '', $new_app->alias), 'utm_campaign' => str_replace('-', '_', $new_app->alias),
]); ]);
$new = new DatabaseNotification(); $new = new DatabaseNotification();

View File

@ -0,0 +1,70 @@
<?php
namespace App\Listeners\Update\V30;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
class Version304 extends Listener
{
const ALIAS = 'core';
const VERSION = '3.0.4';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stderr')->info('Starting the Akaunting 3.0.4 update...');
$this->updateDatabase();
$this->deleteOldFiles();
Log::channel('stderr')->info('Akaunting 3.0.4 update finished.');
}
public function updateDatabase()
{
Log::channel('stderr')->info('Updating database...');
DB::table('migrations')->insert([
'id' => DB::table('migrations')->max('id') + 1,
'migration' => '2022_06_28_000000_core_v304',
'batch' => DB::table('migrations')->max('batch') + 1,
]);
Artisan::call('migrate', ['--force' => true]);
Log::channel('stderr')->info('Database updated.');
}
public function deleteOldFiles()
{
Log::channel('stderr')->info('Deleting old files...');
$files = [
'app/Events/Auth/InvitationCreated.php',
'app/Listeners/Auth/SendUserInvitation.php',
'app/Listeners/Auth/DeleteUserInvitation.php',
];
foreach ($files as $file) {
File::delete(base_path($file));
}
Log::channel('stderr')->info('Old files deleted.');
}
}

View File

@ -89,6 +89,11 @@ class User extends Authenticatable implements HasLocalePreference
return $this->belongsToMany('App\Models\Common\Dashboard', 'App\Models\Auth\UserDashboard'); return $this->belongsToMany('App\Models\Common\Dashboard', 'App\Models\Auth\UserDashboard');
} }
public function invitation()
{
return $this->hasOne('App\Models\Auth\UserInvitation', 'user_id', 'id');
}
/** /**
* Always capitalize the name when we retrieve it * Always capitalize the name when we retrieve it
*/ */
@ -311,14 +316,12 @@ class User extends Authenticatable implements HasLocalePreference
return $actions; return $actions;
} }
if (! $this->hasPendingInvitation()) {
$actions[] = [ $actions[] = [
'title' => trans('general.edit'), 'title' => trans('general.edit'),
'icon' => 'edit', 'icon' => 'edit',
'url' => route('users.edit', $this->id), 'url' => route('users.edit', $this->id),
'permission' => 'update-auth-users', 'permission' => 'update-auth-users',
]; ];
}
if ($this->hasPendingInvitation()) { if ($this->hasPendingInvitation()) {
$actions[] = [ $actions[] = [

View File

@ -20,7 +20,7 @@ class UserInvitation extends Model
* *
* @var string[] * @var string[]
*/ */
protected $fillable = ['user_id', 'company_id', 'token']; protected $fillable = ['user_id', 'token'];
public function user() public function user()
{ {

View File

@ -17,6 +17,7 @@ class Event extends Provider
'App\Listeners\Module\UpdateExtraModules', 'App\Listeners\Module\UpdateExtraModules',
'App\Listeners\Update\V30\Version300', 'App\Listeners\Update\V30\Version300',
'App\Listeners\Update\V30\Version303', 'App\Listeners\Update\V30\Version303',
'App\Listeners\Update\V30\Version304',
], ],
'Illuminate\Auth\Events\Login' => [ 'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login', 'App\Listeners\Auth\Login',
@ -31,12 +32,6 @@ class Event extends Provider
'App\Events\Auth\LandingPageShowing' => [ 'App\Events\Auth\LandingPageShowing' => [
'App\Listeners\Auth\AddLandingPages', 'App\Listeners\Auth\AddLandingPages',
], ],
'App\Events\Auth\InvitationCreated' => [
'App\Listeners\Auth\SendUserInvitation',
],
'App\Events\Auth\UserDeleted' => [
'App\Listeners\Auth\DeleteUserInvitation',
],
'App\Events\Document\DocumentCreated' => [ 'App\Events\Document\DocumentCreated' => [
'App\Listeners\Document\CreateDocumentCreatedHistory', 'App\Listeners\Document\CreateDocumentCreatedHistory',
'App\Listeners\Document\IncreaseNextDocumentNumber', 'App\Listeners\Document\IncreaseNextDocumentNumber',

View File

@ -15,10 +15,10 @@ trait Cloud
return request()->getHost() == $this->cloud_host; return request()->getHost() == $this->cloud_host;
} }
public function getCloudRolesPageUrl() public function getCloudRolesPageUrl($location = 'user')
{ {
if (! $this->isCloud()) { if (! $this->isCloud()) {
return 'https://akaunting.com/plans?utm_source=user_role&utm_medium=software&utm_campaign=plg'; return 'https://akaunting.com/apps/roles?utm_source=software&utm_medium=' . $location . '&utm_campaign=roles';
} }
if ($this->moduleIsEnabled('roles')) { if ($this->moduleIsEnabled('roles')) {
@ -26,20 +26,20 @@ trait Cloud
} }
return route('cloud.plans.index', [ return route('cloud.plans.index', [
'utm_source' => 'user', 'utm_source' => $location,
'utm_medium' => 'app', 'utm_medium' => 'app',
'utm_campaign' => 'roles', 'utm_campaign' => 'roles',
]); ]);
} }
public function getCloudBankFeedsUrl() public function getCloudBankFeedsUrl($location = 'widget')
{ {
if (! $this->isCloud()) { if (! $this->isCloud()) {
return 'https://akaunting.com/features/connect-your-bank?utm_source=bank_feeds_widget&utm_medium=software&utm_campaign=plg'; return 'https://akaunting.com/apps/bank-feeds?utm_source=software&utm_medium=' . $location . '&utm_campaign=bank_feeds';
} }
return route('cloud.plans.index', [ return route('cloud.plans.index', [
'utm_source' => 'widget', 'utm_source' => $location,
'utm_medium' => 'app', 'utm_medium' => 'app',
'utm_campaign' => 'bank_feeds', 'utm_campaign' => 'bank_feeds',
]); ]);

View File

@ -110,31 +110,25 @@ trait Users
} }
/** /**
* Checks if the given user has a pending invitation for the * Checks if the given user has a pending invitation.
* provided Company.
* *
* @return bool * @return bool
*/ */
public function hasPendingInvitation($company_id = null) public function hasPendingInvitation()
{ {
$company_id = $company_id ?: company_id(); $invitation = UserInvitation::where('user_id', $this->id)->first();
$invitation = UserInvitation::where('user_id', $this->id)->where('company_id', $company_id)->first();
return $invitation ? true : false; return $invitation ? true : false;
} }
/** /**
* Returns if the given user has a pending invitation for the * Returns if the given user has a pending invitation.
* provided Company.
* *
* @return null|UserInvitation * @return null|UserInvitation
*/ */
public function getPendingInvitation($company_id = null) public function getPendingInvitation()
{ {
$company_id = $company_id ?: company_id(); $invitation = UserInvitation::where('user_id', $this->id)->first();
$invitation = UserInvitation::where('user_id', $this->id)->where('company_id', $company_id)->first();
return $invitation; return $invitation;
} }

View File

@ -15,7 +15,7 @@ class GetPaid extends Component
*/ */
public function render() public function render()
{ {
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount, $this->document->currency_code, true) . '</span>'; $this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code, true) . '</span>';
return view('components.documents.show.get-paid'); return view('components.documents.show.get-paid');
} }

View File

@ -15,7 +15,7 @@ class MakePayment extends Component
*/ */
public function render() public function render()
{ {
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount, $this->document->currency_code, true) . '</span>'; $this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount_due, $this->document->currency_code, true) . '</span>';
return view('components.documents.show.make-payment'); return view('components.documents.show.make-payment');
} }

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('user_invitations', function (Blueprint $table) {
$table->dropColumn('company_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};

View File

@ -2,7 +2,7 @@
/** /**
* @package Akaunting * @package Akaunting
* @copyright 2017-2021 Akaunting. All rights reserved. * @copyright 2017-2022 Akaunting. All rights reserved.
* @license GNU GPL version 3; see LICENSE.txt * @license GNU GPL version 3; see LICENSE.txt
* @link https://akaunting.com * @link https://akaunting.com
*/ */

607
public/css/app.css vendored
View File

@ -9,6 +9,7 @@
.ql-editor p { .ql-editor p {
color: #424242; color: #424242;
display: inline;
} }
.ql-toolbar { .ql-toolbar {
@ -28,13 +29,14 @@
color: rgb(199 201 217 / var(--tw-text-opacity)); color: rgb(199 201 217 / var(--tw-text-opacity));
display: block; display: block;
width: 100%; width: 100%;
padding: .625rem .75rem; padding: 12px 9px !important;
background-color: #fff; background-color: #fff;
background-clip: padding-box; background-clip: padding-box;
border: 1px solid; border: 1px solid;
border-top: unset; border-top: unset;
border-bottom-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;
font-size: 14px !important;
} }
.ql-toolbar button:hover { .ql-toolbar button:hover {
@ -36205,6 +36207,209 @@ input[type="date"]::-webkit-inner-spin-button,
color: rgb(245 158 11 / var(--tw-placeholder-opacity)); color: rgb(245 158 11 / var(--tw-placeholder-opacity));
} }
.placeholder-amber-50::-webkit-input-placeholder{ .placeholder-amber-50::-webkit-input-placeholder{
<<<<<<< HEAD
--tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity));
}
.placeholder-amber-50::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity));
}
.placeholder-amber-50:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity));
}
.placeholder-amber-50::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity));
}
.placeholder-amber-50::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity));
}
.placeholder-amber-100::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(254 243 199 / var(--tw-placeholder-opacity));
}
.placeholder-amber-100::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(254 243 199 / var(--tw-placeholder-opacity));
}
.placeholder-amber-100:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(254 243 199 / var(--tw-placeholder-opacity));
}
.placeholder-amber-100::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(254 243 199 / var(--tw-placeholder-opacity));
}
.placeholder-amber-100::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(254 243 199 / var(--tw-placeholder-opacity));
}
.placeholder-amber-200::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(253 230 138 / var(--tw-placeholder-opacity));
}
.placeholder-amber-200::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(253 230 138 / var(--tw-placeholder-opacity));
}
.placeholder-amber-200:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(253 230 138 / var(--tw-placeholder-opacity));
}
.placeholder-amber-200::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(253 230 138 / var(--tw-placeholder-opacity));
}
.placeholder-amber-200::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(253 230 138 / var(--tw-placeholder-opacity));
}
.placeholder-amber-300::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(252 211 77 / var(--tw-placeholder-opacity));
}
.placeholder-amber-300::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(252 211 77 / var(--tw-placeholder-opacity));
}
.placeholder-amber-300:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(252 211 77 / var(--tw-placeholder-opacity));
}
.placeholder-amber-300::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(252 211 77 / var(--tw-placeholder-opacity));
}
.placeholder-amber-300::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(252 211 77 / var(--tw-placeholder-opacity));
}
.placeholder-amber-400::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(251 191 36 / var(--tw-placeholder-opacity));
}
.placeholder-amber-400::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(251 191 36 / var(--tw-placeholder-opacity));
}
.placeholder-amber-400:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(251 191 36 / var(--tw-placeholder-opacity));
}
.placeholder-amber-400::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(251 191 36 / var(--tw-placeholder-opacity));
}
.placeholder-amber-400::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(251 191 36 / var(--tw-placeholder-opacity));
}
.placeholder-amber-500::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(245 158 11 / var(--tw-placeholder-opacity));
}
.placeholder-amber-500::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(245 158 11 / var(--tw-placeholder-opacity));
}
.placeholder-amber-500:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(245 158 11 / var(--tw-placeholder-opacity));
}
.placeholder-amber-500::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(245 158 11 / var(--tw-placeholder-opacity));
}
.placeholder-amber-500::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(245 158 11 / var(--tw-placeholder-opacity));
}
.placeholder-amber-600::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(217 119 6 / var(--tw-placeholder-opacity));
}
.placeholder-amber-600::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(217 119 6 / var(--tw-placeholder-opacity));
}
.placeholder-amber-600:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(217 119 6 / var(--tw-placeholder-opacity));
}
.placeholder-amber-600::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(217 119 6 / var(--tw-placeholder-opacity));
}
.placeholder-amber-600::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(217 119 6 / var(--tw-placeholder-opacity));
}
.placeholder-amber-700::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(180 83 9 / var(--tw-placeholder-opacity));
}
.placeholder-amber-700::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(180 83 9 / var(--tw-placeholder-opacity));
}
.placeholder-amber-700:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(180 83 9 / var(--tw-placeholder-opacity));
}
.placeholder-amber-700::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(180 83 9 / var(--tw-placeholder-opacity));
}
.placeholder-amber-700::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(180 83 9 / var(--tw-placeholder-opacity));
}
.placeholder-amber-800::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(146 64 14 / var(--tw-placeholder-opacity));
}
.placeholder-amber-800::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(146 64 14 / var(--tw-placeholder-opacity));
}
.placeholder-amber-800:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(146 64 14 / var(--tw-placeholder-opacity));
}
.placeholder-amber-800::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(146 64 14 / var(--tw-placeholder-opacity));
}
.placeholder-amber-800::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(146 64 14 / var(--tw-placeholder-opacity));
}
.placeholder-amber-900::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(120 53 15 / var(--tw-placeholder-opacity));
}
.placeholder-amber-900::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(120 53 15 / var(--tw-placeholder-opacity));
}
.placeholder-amber-900:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(120 53 15 / var(--tw-placeholder-opacity));
}
.placeholder-amber-900::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(120 53 15 / var(--tw-placeholder-opacity));
}
.placeholder-amber-900::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(120 53 15 / var(--tw-placeholder-opacity));
}
.placeholder-yellow-50::-webkit-input-placeholder{
=======
>>>>>>> 78a2d87fc0a334e495dc2c8a4a752829cd408a14
--tw-placeholder-opacity: 1; --tw-placeholder-opacity: 1;
color: rgb(255 251 235 / var(--tw-placeholder-opacity)); color: rgb(255 251 235 / var(--tw-placeholder-opacity));
} }
@ -37824,6 +38029,406 @@ input[type="date"]::-webkit-inner-spin-button,
--tw-placeholder-opacity: 1; --tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity)); color: rgb(12 74 110 / var(--tw-placeholder-opacity));
} }
.placeholder-cyan-50::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(236 254 255 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-50::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(236 254 255 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-50:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(236 254 255 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-50::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(236 254 255 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-50::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(236 254 255 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-100::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(207 250 254 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-100::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(207 250 254 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-100:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(207 250 254 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-100::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(207 250 254 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-100::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(207 250 254 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-200::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(165 243 252 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-200::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(165 243 252 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-200:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(165 243 252 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-200::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(165 243 252 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-200::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(165 243 252 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-300::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(103 232 249 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-300::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(103 232 249 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-300:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(103 232 249 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-300::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(103 232 249 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-300::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(103 232 249 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-400::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(34 211 238 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-400::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(34 211 238 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-400:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(34 211 238 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-400::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(34 211 238 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-400::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(34 211 238 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-500::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(6 182 212 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-500::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(6 182 212 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-500:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(6 182 212 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-500::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(6 182 212 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-500::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(6 182 212 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-600::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(8 145 178 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-600::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(8 145 178 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-600:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(8 145 178 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-600::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(8 145 178 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-600::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(8 145 178 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-700::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 116 144 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-700::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 116 144 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-700:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 116 144 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-700::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 116 144 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-700::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 116 144 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-800::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(21 94 117 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-800::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(21 94 117 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-800:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(21 94 117 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-800::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(21 94 117 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-800::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(21 94 117 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-900::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(22 78 99 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-900::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(22 78 99 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-900:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(22 78 99 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-900::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(22 78 99 / var(--tw-placeholder-opacity));
}
.placeholder-cyan-900::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(22 78 99 / var(--tw-placeholder-opacity));
}
.placeholder-sky-50::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(240 249 255 / var(--tw-placeholder-opacity));
}
.placeholder-sky-50::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(240 249 255 / var(--tw-placeholder-opacity));
}
.placeholder-sky-50:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(240 249 255 / var(--tw-placeholder-opacity));
}
.placeholder-sky-50::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(240 249 255 / var(--tw-placeholder-opacity));
}
.placeholder-sky-50::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(240 249 255 / var(--tw-placeholder-opacity));
}
.placeholder-sky-100::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(224 242 254 / var(--tw-placeholder-opacity));
}
.placeholder-sky-100::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(224 242 254 / var(--tw-placeholder-opacity));
}
.placeholder-sky-100:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(224 242 254 / var(--tw-placeholder-opacity));
}
.placeholder-sky-100::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(224 242 254 / var(--tw-placeholder-opacity));
}
.placeholder-sky-100::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(224 242 254 / var(--tw-placeholder-opacity));
}
.placeholder-sky-200::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(186 230 253 / var(--tw-placeholder-opacity));
}
.placeholder-sky-200::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(186 230 253 / var(--tw-placeholder-opacity));
}
.placeholder-sky-200:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(186 230 253 / var(--tw-placeholder-opacity));
}
.placeholder-sky-200::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(186 230 253 / var(--tw-placeholder-opacity));
}
.placeholder-sky-200::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(186 230 253 / var(--tw-placeholder-opacity));
}
.placeholder-sky-300::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(125 211 252 / var(--tw-placeholder-opacity));
}
.placeholder-sky-300::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(125 211 252 / var(--tw-placeholder-opacity));
}
.placeholder-sky-300:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(125 211 252 / var(--tw-placeholder-opacity));
}
.placeholder-sky-300::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(125 211 252 / var(--tw-placeholder-opacity));
}
.placeholder-sky-300::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(125 211 252 / var(--tw-placeholder-opacity));
}
.placeholder-sky-400::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(56 189 248 / var(--tw-placeholder-opacity));
}
.placeholder-sky-400::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(56 189 248 / var(--tw-placeholder-opacity));
}
.placeholder-sky-400:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(56 189 248 / var(--tw-placeholder-opacity));
}
.placeholder-sky-400::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(56 189 248 / var(--tw-placeholder-opacity));
}
.placeholder-sky-400::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(56 189 248 / var(--tw-placeholder-opacity));
}
.placeholder-sky-500::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 165 233 / var(--tw-placeholder-opacity));
}
.placeholder-sky-500::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 165 233 / var(--tw-placeholder-opacity));
}
.placeholder-sky-500:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 165 233 / var(--tw-placeholder-opacity));
}
.placeholder-sky-500::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 165 233 / var(--tw-placeholder-opacity));
}
.placeholder-sky-500::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(14 165 233 / var(--tw-placeholder-opacity));
}
.placeholder-sky-600::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(2 132 199 / var(--tw-placeholder-opacity));
}
.placeholder-sky-600::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(2 132 199 / var(--tw-placeholder-opacity));
}
.placeholder-sky-600:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(2 132 199 / var(--tw-placeholder-opacity));
}
.placeholder-sky-600::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(2 132 199 / var(--tw-placeholder-opacity));
}
.placeholder-sky-600::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(2 132 199 / var(--tw-placeholder-opacity));
}
.placeholder-sky-700::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(3 105 161 / var(--tw-placeholder-opacity));
}
.placeholder-sky-700::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(3 105 161 / var(--tw-placeholder-opacity));
}
.placeholder-sky-700:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(3 105 161 / var(--tw-placeholder-opacity));
}
.placeholder-sky-700::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(3 105 161 / var(--tw-placeholder-opacity));
}
.placeholder-sky-700::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(3 105 161 / var(--tw-placeholder-opacity));
}
.placeholder-sky-800::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(7 89 133 / var(--tw-placeholder-opacity));
}
.placeholder-sky-800::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(7 89 133 / var(--tw-placeholder-opacity));
}
.placeholder-sky-800:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(7 89 133 / var(--tw-placeholder-opacity));
}
.placeholder-sky-800::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(7 89 133 / var(--tw-placeholder-opacity));
}
.placeholder-sky-800::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(7 89 133 / var(--tw-placeholder-opacity));
}
.placeholder-sky-900::-webkit-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity));
}
.placeholder-sky-900::-moz-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity));
}
.placeholder-sky-900:-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity));
}
.placeholder-sky-900::-ms-input-placeholder{
--tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity));
}
.placeholder-sky-900::placeholder{
--tw-placeholder-opacity: 1;
color: rgb(12 74 110 / var(--tw-placeholder-opacity));
}
.placeholder-blue-50::-webkit-input-placeholder{ .placeholder-blue-50::-webkit-input-placeholder{
--tw-placeholder-opacity: 1; --tw-placeholder-opacity: 1;
color: rgb(242 248 251 / var(--tw-placeholder-opacity)); color: rgb(242 248 251 / var(--tw-placeholder-opacity));

View File

@ -9,6 +9,7 @@
.ql-editor p { .ql-editor p {
color: #424242; color: #424242;
display: inline;
} }
.ql-toolbar { .ql-toolbar {
@ -24,13 +25,14 @@
@apply text-sm text-light-gray; @apply text-sm text-light-gray;
display: block; display: block;
width: 100%; width: 100%;
padding: .625rem .75rem; padding: 12px 9px !important;
background-color: #fff; background-color: #fff;
background-clip: padding-box; background-clip: padding-box;
border: 1px solid; border: 1px solid;
border-top: unset; border-top: unset;
border-bottom-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem;
border-bottom-right-radius: 0.5rem; border-bottom-right-radius: 0.5rem;
font-size: 14px !important;
} }
.ql-toolbar button:hover { .ql-toolbar button:hover {

View File

@ -30,5 +30,22 @@ const app = new Vue({
form: new Form('company'), form: new Form('company'),
bulk_action: new BulkAction('companies') bulk_action: new BulkAction('companies')
} }
},
methods: {
// Form Submit
onSubmit() {
this.form.loading = true;
if (this.form.country === "") {
this.form.errors.set('country', [country_validation_required_message]);
this.form.loading = false;
return;
}
this.form.submit();
},
} }
}); });

View File

@ -696,7 +696,7 @@ const app = new Vue({
let payment = { let payment = {
modal: false, modal: false,
url: url + '/modals/documents/' + document_id + '/transactions/edit/' + transaction_id, url: url + '/modals/documents/' + document_id + '/transactions/' + transaction_id + '/edit',
title: '', title: '',
html: '', html: '',
buttons:{} buttons:{}

View File

@ -13,7 +13,7 @@
<div class="sm:col-span-3 grid gap-x-8 gap-y-6 {{ user()->id == $user->id ? 'grid-rows-3' : 'grid-rows-2' }}"> <div class="sm:col-span-3 grid gap-x-8 gap-y-6 {{ user()->id == $user->id ? 'grid-rows-3' : 'grid-rows-2' }}">
<x-form.group.text name="name" label="{{ trans('general.name') }}" /> <x-form.group.text name="name" label="{{ trans('general.name') }}" />
<x-form.group.email name="email" label="{{ trans('general.email') }}" /> <x-form.group.email name="email" label="{{ trans('general.email') }}" ::disabled="{{ $user->hasPendingInvitation() ? 'true' : 'false' }}" />
@if (user()->id == $user->id) @if (user()->id == $user->id)
<x-form.group.checkbox name="change_password" :options="['1' => trans('auth.change_password')]" form-group-class="sm:col-span-3" @input="onChangePassword($event)" /> <x-form.group.checkbox name="change_password" :options="['1' => trans('auth.change_password')]" form-group-class="sm:col-span-3" @input="onChangePassword($event)" />

View File

@ -48,15 +48,11 @@
@foreach($users as $item) @foreach($users as $item)
<x-table.tr href="{{ route('users.edit', $item->id) }}"> <x-table.tr href="{{ route('users.edit', $item->id) }}">
<x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class"> <x-table.td class="ltr:pr-6 rtl:pl-6 hidden sm:table-cell" override="class">
@if (user()->id != $item->id)
<x-index.bulkaction.single <x-index.bulkaction.single
id="{{ $item->id }}" id="{{ $item->id }}"
name="{{ $item->name }}" name="{{ $item->name }}"
:disabled="($item->hasPendingInvitation() || $item->multiplexed) ? true : false" :disabled="($item->hasPendingInvitation() || user()->id == $item->id) ? true : false"
/> />
@else
<x-index.bulkaction.single id="{{ $item->id }}" name="{{ $item->name }}" disabled />
@endif
</x-table.td> </x-table.td>
<x-table.td class="w-4/12 sm:w-5/12"> <x-table.td class="w-4/12 sm:w-5/12">

View File

@ -44,7 +44,7 @@
</x-slot> </x-slot>
<x-slot name="body"> <x-slot name="body">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" /> <x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required />
@ -65,5 +65,11 @@
</x-form.container> </x-form.container>
</x-slot> </x-slot>
@push('scripts_end')
<script type="text/javascript">
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
</script>
@endpush
<x-script folder="common" file="companies" /> <x-script folder="common" file="companies" />
</x-layouts.admin> </x-layouts.admin>

View File

@ -69,5 +69,11 @@
</x-form.container> </x-form.container>
</x-slot> </x-slot>
@push('scripts_end')
<script type="text/javascript">
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
</script>
@endpush
<x-script folder="common" file="companies" /> <x-script folder="common" file="companies" />
</x-layouts.admin> </x-layouts.admin>

View File

@ -24,7 +24,7 @@
@endif @endif
@if (! $hideCountry) @if (! $hideCountry)
<x-form.group.country form-group-class="sm:col-span-3 el-select-tags-pl-38" /> <x-form.group.country form-group-class="sm:col-span-3 el-select-tags-pl-38" not-required />
@endif @endif
</x-slot> </x-slot>
</x-form.section> </x-form.section>

View File

@ -3,7 +3,8 @@
label="{!! trans_choice('general.countries', 1) !!}" label="{!! trans_choice('general.countries', 1) !!}"
:options="trans('countries')" :options="trans('countries')"
:selected="setting('company.country')" :selected="setting('company.country')"
not-required required="{{ $required }}"
not-required="{{ $notRequired }}"
model="form.country" model="form.country"
form-group-class="{{ $formGroupClass }}" form-group-class="{{ $formGroupClass }}"
/> />

View File

@ -13,7 +13,7 @@
<div x-show="price_type == false" class="text-center text-sm mt-3 mb--2"> <div x-show="price_type == false" class="text-center text-sm mt-3 mb--2">
<span style="font-size: 12px;"> <span style="font-size: 12px;">
<span class="text-red">*</span> <a href="https://akaunting.com/features/why-akaunting-cloud?utm_source=app_show&utm_medium=software&utm_campaign={{ str_replace('-', '', $module->slug) }}" target="_blank">{!! trans('modules.information_monthly') !!}</a> <span class="text-red">*</span> <a href="https://akaunting.com/features/why-akaunting-cloud?utm_source=software&utm_medium=app_show&utm_campaign={{ str_replace('-', '_', $module->slug) }}" target="_blank">{!! trans('modules.information_monthly') !!}</a>
</span> </span>
</div> </div>
@else @else

View File

@ -7,7 +7,7 @@
</div> </div>
<div class="my-10"> <div class="my-10">
<a href="https://akaunting.com/lp/accounting-software?utm_source=invoice_payment&utm_medium=software&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700"> <a href="https://akaunting.com/lp/accounting-software?utm_source=software&utm_medium=invoice_payment&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700">
{{ trans('portal.get_started') }} {{ trans('portal.get_started') }}
</a> </a>
</div> </div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</div> </div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</div> </div>

View File

@ -1,4 +1,4 @@
<x-form id="form-transaction" :route="$route" :model="!empty($transaction) ? $transaction : false"> <x-form id="form-transaction" :method="$method" :route="$route" :model="!empty($transaction) ? $transaction : false">
<div class="rounded-xl px-5 py-3 mb-5 bg-red-100" v-if="typeof form.response !== 'undefined' && form.response.error"> <div class="rounded-xl px-5 py-3 mb-5 bg-red-100" v-if="typeof form.response !== 'undefined' && form.response.error">
<p class="text-sm mb-0 text-red-600" v-html="form.response.message"></p> <p class="text-sm mb-0 text-red-600" v-html="form.response.message"></p>
</div> </div>
@ -40,7 +40,7 @@
<div id="tab-general" data-tabs-content="general" x-show="active === 'general'"> <div id="tab-general" data-tabs-content="general" x-show="active === 'general'">
<div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5"> <div class="grid sm:grid-cols-6 gap-x-8 gap-y-6 my-3.5">
<x-form.group.date name="paid_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ Date::now()->toDateString() }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" form-group-class="col-span-6" /> <x-form.group.date name="paid_at" label="{{ trans('general.date') }}" icon="calendar_today" value="{{ $document->paid_at }}" show-date-format="{{ company_date_format() }}" date-format="Y-m-d" autocomplete="off" form-group-class="col-span-6" />
<x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="{{ $document->grand_total }}" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" form-group-class="col-span-6" /> <x-form.group.money name="amount" label="{{ trans('general.amount') }}" value="{{ $document->grand_total }}" autofocus="autofocus" :currency="$currency" dynamicCurrency="currency" form-group-class="col-span-6" />

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</div> </div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required /> <x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" /> <x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div> </div>
</div> </div>

View File

@ -158,7 +158,7 @@
</div> </div>
<div class="my-10"> <div class="my-10">
<a href="https://akaunting.com/lp/accounting-software?utm_source=invoice_index&utm_medium=software&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700"> <a href="https://akaunting.com/lp/accounting-software?utm_source=software&utm_medium=invoice_index&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700">
{{ trans('portal.get_started') }} {{ trans('portal.get_started') }}
</a> </a>
</div> </div>

View File

@ -66,7 +66,7 @@
</div> </div>
<div class="my-10"> <div class="my-10">
<a href="https://akaunting.com/lp/accounting-software?utm_source=payment_index&utm_medium=software&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700"> <a href="https://akaunting.com/lp/accounting-software?utm_source=software&utm_medium=payment_index&utm_campaign=plg" class="bg-purple text-white px-3 py-1.5 mb-3 sm:mb-0 rounded-xl text-sm font-medium leading-6 hover:bg-purple-700">
{{ trans('portal.get_started') }} {{ trans('portal.get_started') }}
</a> </a>
</div> </div>

View File

@ -48,7 +48,7 @@
<x-form.group.locale /> <x-form.group.locale />
<x-form.group.country :selected="$user->contact->country" /> <x-form.group.country :selected="$user->contact->country" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ $user->contact->city }}" not-required /> <x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ $user->contact->city }}" not-required />

View File

@ -4,6 +4,8 @@ namespace Tests\Feature\Auth;
use App\Jobs\Auth\CreateUser; use App\Jobs\Auth\CreateUser;
use App\Models\Auth\User; use App\Models\Auth\User;
use App\Notifications\Auth\Invitation;
use Illuminate\Support\Facades\Notification;
use Tests\Feature\FeatureTestCase; use Tests\Feature\FeatureTestCase;
class UsersTest extends FeatureTestCase class UsersTest extends FeatureTestCase
@ -16,6 +18,22 @@ class UsersTest extends FeatureTestCase
->assertSeeText(trans_choice('general.users', 2)); ->assertSeeText(trans_choice('general.users', 2));
} }
public function testItShouldSeePendingUserListPage()
{
$request = $this->getRequest();
$user = $this->dispatch(new CreateUser($request));
$this->loginAs()
->get(route('users.index'))
->assertOk()
->assertSeeTextInOrder([
$user->name,
trans('documents.statuses.pending')
])
->assertSee(route('users.invite', $user->id));
}
public function testItShouldSeeUserCreatePage() public function testItShouldSeeUserCreatePage()
{ {
$this->loginAs() $this->loginAs()
@ -26,15 +44,30 @@ class UsersTest extends FeatureTestCase
public function testItShouldCreateUser() public function testItShouldCreateUser()
{ {
Notification::fake();
$request = $this->getRequest(); $request = $this->getRequest();
$this->loginAs() $response = $this->loginAs()
->post(route('users.store'), $request) ->post(route('users.store'), $request)
->assertOk(); ->assertOk()
->assertJson([
'success' => true,
'error' => false,
'message' => '',
'redirect' => route('users.index'),
])
->json();
$user = User::findOrFail($response['data']['id']);
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
$this->assertDatabaseHas('users', $this->getAssertRequest($request)); $this->assertModelExists($user);
$this->assertModelExists($user->invitation);
Notification::assertSentTo([$user], Invitation::class);
} }
public function testItShouldSeeUserUpdatePage() public function testItShouldSeeUserUpdatePage()
@ -80,6 +113,8 @@ class UsersTest extends FeatureTestCase
$this->assertFlashLevel('success'); $this->assertFlashLevel('success');
$this->assertSoftDeleted('users', $this->getAssertRequest($request)); $this->assertSoftDeleted('users', $this->getAssertRequest($request));
$this->assertSoftDeleted('user_invitations', ['user_id' => $user->id]);
} }
public function testItShouldSeeLoginPage() public function testItShouldSeeLoginPage()
@ -127,6 +162,71 @@ class UsersTest extends FeatureTestCase
$this->assertGuest(); $this->assertGuest();
} }
public function testItShouldSeeRegisterPage()
{
$request = $this->getRequest();
$user = $this->dispatch(new CreateUser($request));
$this->get(route('register', ['token' => $user->invitation->token]))
->assertOk();
$this->assertGuest();
}
public function testItShouldNotSeeRegisterPage()
{
$this->withExceptionHandling()
->get(route('register', ['token' => $this->faker->uuid]))
->assertForbidden();
$this->assertGuest();
}
public function testItShouldRegisterUser()
{
$request = $this->getRequest();
$user = $this->dispatch(new CreateUser($request));
$password = $this->faker->password;
$data = [
'token' => $user->invitation->token,
'password' => $password,
'password_confirmation' => $password,
];
$this->post(route('register.store'), $data)
->assertOk()
->assertJson([
'redirect' => url('/'),
]);
$this->assertFlashLevel('success');
$this->assertSoftDeleted('user_invitations', ['user_id' => $user->id]);
$this->isAuthenticated($user->user);
}
public function testItShouldNotRegisterUser()
{
$password = $this->faker->password;
$data = [
'token' => $this->faker->uuid,
'password' => $password,
'password_confirmation' => $password,
];
$this->withExceptionHandling()
->post(route('register.store'), $data)
->assertForbidden();
$this->assertGuest();
}
public function getRequest() public function getRequest()
{ {
return User::factory()->enabled()->raw(); return User::factory()->enabled()->raw();