From 7150fdf66cdca0d02dc6e0af41cf5d51365af46e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 15:12:50 +1100 Subject: [PATCH 01/51] Bank Transaction Rules --- app/Factory/BankTransactionRuleFactory.php | 30 ++ app/Filters/BankTransactionRuleFilters.php | 133 +++++ .../BankTransactionRuleController.php | 504 ++++++++++++++++++ .../CreateBankTransactionRuleRequest.php | 28 + .../DestroyBankTransactionRuleRequest.php | 27 + .../EditBankTransactionRuleRequest.php | 27 + .../ShowBankTransactionRuleRequest.php | 27 + .../StoreBankTransactionRuleRequest.php | 63 +++ .../UpdateBankTransactionRuleRequest.php | 60 +++ app/Models/BankTransactionRule.php | 69 +++ .../BankTransactionRuleRepository.php | 34 ++ .../BankTransactionRuleTransformer.php | 91 ++++ ...13_034143_bank_transaction_rules_table.php | 53 ++ 13 files changed, 1146 insertions(+) create mode 100644 app/Factory/BankTransactionRuleFactory.php create mode 100644 app/Filters/BankTransactionRuleFilters.php create mode 100644 app/Http/Controllers/BankTransactionRuleController.php create mode 100644 app/Http/Requests/BankTransactionRule/CreateBankTransactionRuleRequest.php create mode 100644 app/Http/Requests/BankTransactionRule/DestroyBankTransactionRuleRequest.php create mode 100644 app/Http/Requests/BankTransactionRule/EditBankTransactionRuleRequest.php create mode 100644 app/Http/Requests/BankTransactionRule/ShowBankTransactionRuleRequest.php create mode 100644 app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php create mode 100644 app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php create mode 100644 app/Models/BankTransactionRule.php create mode 100644 app/Repositories/BankTransactionRuleRepository.php create mode 100644 app/Transformers/BankTransactionRuleTransformer.php create mode 100644 database/migrations/2022_11_13_034143_bank_transaction_rules_table.php diff --git a/app/Factory/BankTransactionRuleFactory.php b/app/Factory/BankTransactionRuleFactory.php new file mode 100644 index 000000000000..69aeb3ddb3bb --- /dev/null +++ b/app/Factory/BankTransactionRuleFactory.php @@ -0,0 +1,30 @@ +user_id = $user_id; + $bank_transaction_rule->company_id = $company_id; + + $bank_transaction_rule->name = ''; + $bank_transaction_rule->rules = []; + + return $bank_transaction_rule; + } +} diff --git a/app/Filters/BankTransactionRuleFilters.php b/app/Filters/BankTransactionRuleFilters.php new file mode 100644 index 000000000000..bda5158e2a16 --- /dev/null +++ b/app/Filters/BankTransactionRuleFilters.php @@ -0,0 +1,133 @@ +=1) + return $this->builder->where('name', 'like', '%'.$name.'%'); + + return $this->builder; + } + + /** + * Filter based on search text. + * + * @param string query filter + * @return Builder + * @deprecated + */ + public function filter(string $filter = '') : Builder + { + if (strlen($filter) == 0) { + return $this->builder; + } + + return $this->builder->where(function ($query) use ($filter) { + $query->where('bank_transaction_rules.name', 'like', '%'.$filter.'%'); + }); + + } + + /** + * Filters the list based on the status + * archived, active, deleted. + * + * @param string filter + * @return Builder + */ + public function status(string $filter = '') : Builder + { + if (strlen($filter) == 0) { + return $this->builder; + } + + $table = 'bank_transaction_rules'; + $filters = explode(',', $filter); + + return $this->builder->where(function ($query) use ($filters, $table) { + $query->whereNull($table.'.id'); + + if (in_array(parent::STATUS_ACTIVE, $filters)) { + $query->orWhereNull($table.'.deleted_at'); + } + + if (in_array(parent::STATUS_ARCHIVED, $filters)) { + $query->orWhere(function ($query) use ($table) { + $query->whereNotNull($table.'.deleted_at'); + + if (! in_array($table, ['users'])) { + $query->where($table.'.is_deleted', '=', 0); + } + }); + } + + if (in_array(parent::STATUS_DELETED, $filters)) { + $query->orWhere($table.'.is_deleted', '=', 1); + } + }); + } + + /** + * Sorts the list based on $sort. + * + * @param string sort formatted as column|asc + * @return Builder + */ + public function sort(string $sort) : Builder + { + $sort_col = explode('|', $sort); + + return $this->builder->orderBy($sort_col[0], $sort_col[1]); + } + + /** + * Returns the base query. + * + * @param int company_id + * @param User $user + * @return Builder + * @deprecated + */ + public function baseQuery(int $company_id, User $user) : Builder + { + + } + + /** + * Filters the query by the users company ID. + * + * @return Illuminate\Database\Query\Builder + */ + public function entityFilter() + { + //return $this->builder->whereCompanyId(auth()->user()->company()->id); + return $this->builder->company(); + } +} diff --git a/app/Http/Controllers/BankTransactionRuleController.php b/app/Http/Controllers/BankTransactionRuleController.php new file mode 100644 index 000000000000..c9c8b04f0d9e --- /dev/null +++ b/app/Http/Controllers/BankTransactionRuleController.php @@ -0,0 +1,504 @@ +bank_transaction_repo = $bank_transaction_repo; + } + + /** + * @OA\Get( + * path="/api/v1/bank_transaction_rules", + * operationId="getBankTransactionRules", + * tags={"bank_transaction_rules"}, + * summary="Gets a list of bank_transaction_rules", + * description="Lists all bank transaction rules", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter(ref="#/components/parameters/index"), + * @OA\Parameter( + * name="rows", + * in="query", + * description="The number of bank integrations to return", + * example="50", + * required=false, + * @OA\Schema( + * type="number", + * format="integer", + * ), + * ), + * @OA\Response( + * response=200, + * description="A list of bank integrations", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + * @param BankTransactionFilters $filter + * @return Response|mixed + */ + public function index(BankTransactionRuleFilters $filters) + { + + $bank_transaction_rules = BankTransactionRule::filter($filters); + + return $this->listResponse($bank_transaction_rules); + + } + + /** + * Display the specified resource. + * + * @param ShowBankTransactionRuleRequest $request + * @param BankTransactionRule $bank_transaction_rule + * @return Response + * + * + * @OA\Get( + * path="/api/v1/bank_transaction_rules/{id}", + * operationId="showBankTransactionRule", + * tags={"bank_transaction_rules"}, + * summary="Shows a bank_transaction", + * description="Displays a bank_transaction by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Bank Transaction RuleHashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the bank_transaction rule object", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function show(ShowBankTransactionRuleRequest $request, BankTransactionRule $bank_transaction_rule) + { + return $this->itemResponse($bank_transaction_rule); + } + + + /** + * Show the form for editing the specified resource. + * + * @param EditBankTransactionRuleRequest $request + * @param BankTransactionRule $bank_transaction_rule + * @return Response + * + * + * @OA\Get( + * path="/api/v1/bank_transaction_rules/{id}/edit", + * operationId="editBankTransactionRule", + * tags={"bank_transaction_rules"}, + * summary="Shows a bank_transaction for editing", + * description="Displays a bank_transaction by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Bank Transaction Rule Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the bank_transaction rule object", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function edit(EditBankTransactionRuleRequest $request, BankTransactionRule $bank_transaction_rule) + { + return $this->itemResponse($bank_transaction_rule); + } + + /** + * Update the specified resource in storage. + * + * @param UpdateBankTransactionRuleRequest $request + * @param BankTransactionRule $bank_transaction_rule + * @return Response + * + * + * + * @OA\Put( + * path="/api/v1/bank_transaction_rules/{id}", + * operationId="updateBankTransactionRule", + * tags={"bank_transaction_rules"}, + * summary="Updates a bank_transaction Rule", + * description="Handles the updating of a bank_transaction rule by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Bank Transaction Rule Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns the bank_transaction rule object", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function update(UpdateBankTransactionRuleRequest $request, BankTransactionRule $bank_transaction_rule) + { + + //stubs for updating the model + $bank_transaction = $this->bank_transaction_repo->save($request->all(), $bank_transaction_rule); + + return $this->itemResponse($bank_transaction_rule->fresh()); + } + + /** + * Show the form for creating a new resource. + * + * @param CreateBankTransactionRuleRequest $request + * @return Response + * + * + * + * @OA\Get( + * path="/api/v1/bank_transaction_rules/create", + * operationId="getBankTransactionRulesCreate", + * tags={"bank_transaction_rules"}, + * summary="Gets a new blank bank_transaction rule object", + * description="Returns a blank object with default values", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="A blank bank_transaction rule object", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function create(CreateBankTransactionRuleRequest $request) + { + $bank_transaction_rule = BankTransactionRuleFactory::create(auth()->user()->company()->id, auth()->user()->id, auth()->user()->account_id); + + return $this->itemResponse($bank_transaction_rule); + } + + /** + * Store a newly created resource in storage. + * + * @param StoreBankTransactionRuleRequest $request + * @return Response + * + * + * + * @OA\Post( + * path="/api/v1/bank_transaction_rules", + * operationId="storeBankTransaction", + * tags={"bank_transaction_rules"}, + * summary="Adds a bank_transaction rule", + * description="Adds an bank_transaction to a company", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Response( + * response=200, + * description="Returns the saved bank_transaction rule object", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function store(StoreBankTransactionRuleRequest $request) + { + //stub to store the model + $bank_transaction_rule = $this->bank_transaction_repo->save($request->all(), BankTransactionRuleFactory::create(auth()->user()->company()->id, auth()->user()->id, auth()->user()->account_id)); + + return $this->itemResponse($bank_transaction_rule); + } + + /** + * Remove the specified resource from storage. + * + * @param DestroyBankTransactionRuleRequest $request + * @param BankTransactionRule $bank_transaction_rule + * @return Response + * + * + * @throws \Exception + * @OA\Delete( + * path="/api/v1/bank_transaction_rules/{id}", + * operationId="deleteBankTransactionRule", + * tags={"bank_transaction_rules"}, + * summary="Deletes a bank_transaction rule", + * description="Handles the deletion of a bank_transaction rule by id", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/include"), + * @OA\Parameter( + * name="id", + * in="path", + * description="The Bank Transaction Rule Hashed ID", + * example="D2J234DFA", + * required=true, + * @OA\Schema( + * type="string", + * format="string", + * ), + * ), + * @OA\Response( + * response=200, + * description="Returns a HTTP status", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + * + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function destroy(DestroyBankTransactionRuleRequest $request, BankTransactionRule $bank_transaction_rule) + { + $this->bank_transaction_repo->delete($bank_transaction_rule); + + return $this->itemResponse($bank_transaction_rule->fresh()); + } + + + /** + * Perform bulk actions on the list view. + * + * @return Collection + * + * @OA\Post( + * path="/api/v1/bank_transation_rules/bulk", + * operationId="bulkBankTransactionRules", + * tags={"bank_transaction_rules"}, + * summary="Performs bulk actions on an array of bank_transation rules", + * description="", + * @OA\Parameter(ref="#/components/parameters/X-Api-Secret"), + * @OA\Parameter(ref="#/components/parameters/X-Api-Token"), + * @OA\Parameter(ref="#/components/parameters/X-Requested-With"), + * @OA\Parameter(ref="#/components/parameters/index"), + * @OA\RequestBody( + * description="Action paramters", + * required=true, + * @OA\MediaType( + * mediaType="application/json", + * @OA\Schema( + * type="array", + * @OA\Items( + * type="integer", + * description="Array of hashed IDs to be bulk 'actioned", + * example="[0,1,2,3]", + * ), + * ) + * ) + * ), + * @OA\Response( + * response=200, + * description="The Bulk Action response", + * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), + * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), + * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), + * ), + * @OA\Response( + * response=422, + * description="Validation error", + * @OA\JsonContent(ref="#/components/schemas/ValidationError"), + + * ), + * @OA\Response( + * response="default", + * description="Unexpected Error", + * @OA\JsonContent(ref="#/components/schemas/Error"), + * ), + * ) + */ + public function bulk() + { + $action = request()->input('action'); + + if(!in_array($action, ['archive', 'restore', 'delete'])) + return response()->json(['message' => 'Unsupported action.'], 400); + + $ids = request()->input('ids'); + + $bank_transaction_rules = BankTransactionRule::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()->get(); + + $bank_transaction_rules->each(function ($bank_transaction_rule, $key) use ($action) { + if (auth()->user()->can('edit', $bank_transaction_rule)) { + $this->bank_transaction_repo->{$action}($bank_transaction_rule); + } + }); + + /* Need to understand which permission are required for the given bulk action ie. view / edit */ + + return $this->listResponse(BankTransactionRule::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()); + } + +} \ No newline at end of file diff --git a/app/Http/Requests/BankTransactionRule/CreateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/CreateBankTransactionRuleRequest.php new file mode 100644 index 000000000000..24fa6e8e15c6 --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/CreateBankTransactionRuleRequest.php @@ -0,0 +1,28 @@ +user()->can('create', BankTransactionRule::class); + } +} diff --git a/app/Http/Requests/BankTransactionRule/DestroyBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/DestroyBankTransactionRuleRequest.php new file mode 100644 index 000000000000..b19f87fb009e --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/DestroyBankTransactionRuleRequest.php @@ -0,0 +1,27 @@ +user()->can('edit', $this->bank_transaction_rule); + } +} diff --git a/app/Http/Requests/BankTransactionRule/EditBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/EditBankTransactionRuleRequest.php new file mode 100644 index 000000000000..9edf1aaa164b --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/EditBankTransactionRuleRequest.php @@ -0,0 +1,27 @@ +user()->can('edit', $this->bank_transaction_rule); + } +} diff --git a/app/Http/Requests/BankTransactionRule/ShowBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/ShowBankTransactionRuleRequest.php new file mode 100644 index 000000000000..9a9eb6fc5d54 --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/ShowBankTransactionRuleRequest.php @@ -0,0 +1,27 @@ +user()->can('view', $this->bank_transaction_rule); + } +} diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php new file mode 100644 index 000000000000..158a59bf462e --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -0,0 +1,63 @@ +user()->can('create', BankTransactionRule::class); + } + + public function rules() + { + /* Ensure we have a client name, and that all emails are unique*/ + $rules = [ + 'name' => 'bail|required|string' + ]; + + if (isset($this->currency_id)) + $rules['category_Id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + + if(isset($this->vendor_id)) + $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + + if(isset($this->client_id)) + $rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + + + return $rules; + } + + public function prepareForValidation() + { + $input = $this->all(); + + $input = $this->decodePrimaryKeys($input); + + $this->replace($input); + } + + + +} diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php new file mode 100644 index 000000000000..3ccbc9565364 --- /dev/null +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -0,0 +1,60 @@ +user()->can('edit', $this->bank_transaction); + } + + public function rules() + { + /* Ensure we have a client name, and that all emails are unique*/ + $rules = [ + 'name' => 'bail|required|string' + ]; + + if (isset($this->currency_id)) + $rules['category_Id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + + if(isset($this->vendor_id)) + $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + + if(isset($this->client_id)) + $rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + + + return $rules; + } + + public function prepareForValidation() + { + $input = $this->all(); + + $input = $this->decodePrimaryKeys($input); + + $this->replace($input); + } + +} diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php new file mode 100644 index 000000000000..fa6cccd4cadc --- /dev/null +++ b/app/Models/BankTransactionRule.php @@ -0,0 +1,69 @@ +belongsTo(Company::class); + } + + public function vendor() + { + return $this->belongsTo(Vendor::class); + } + + public function client() + { + return $this->belongsTo(Client::class); + } + + public function user() + { + return $this->belongsTo(User::class)->withTrashed(); + } + + public function expense_cateogry() + { + return $this->belongsTo(ExpenseCategory::class)->withTrashed(); + } + +} \ No newline at end of file diff --git a/app/Repositories/BankTransactionRuleRepository.php b/app/Repositories/BankTransactionRuleRepository.php new file mode 100644 index 000000000000..cfc5d7579168 --- /dev/null +++ b/app/Repositories/BankTransactionRuleRepository.php @@ -0,0 +1,34 @@ +fill($data); + + $bank_transaction_rule->save(); + + return $bank_transaction_rule + } + +} diff --git a/app/Transformers/BankTransactionRuleTransformer.php b/app/Transformers/BankTransactionRuleTransformer.php new file mode 100644 index 000000000000..e2b709121e3c --- /dev/null +++ b/app/Transformers/BankTransactionRuleTransformer.php @@ -0,0 +1,91 @@ + (string) $this->encodePrimaryKey($bank_transaction_rule->id), + 'name' => (string) $bank_transaction_rule->name, + 'rules' => $bank_transaction_rule->rules ?: (array) [], + 'auto_convert' => (bool) $bank_transaction_rule->auto_convert, + 'matches_on_all' => (bool) $bank_transaction_rule->matches_on_all, + 'applies_to' => (string) $bank_transaction_rule->applies_to, + 'record_as' => (string) $bank_transaction_rule->record_as, + 'client_id' => $this->encodePrimaryKey($bank_transaction_rule->client_id) ?: '', + 'vendor_id' => $this->encodePrimaryKey($bank_transaction_rule->vendor_id) ?: '', + 'category_id' => $this->encodePrimaryKey($bank_transaction_rule->category_id) ?: '', + 'is_deleted' => (bool) $bank_transaction_rule->is_deleted, + 'created_at' => (int) $bank_transaction_rule->created_at, + 'updated_at' => (int) $bank_transaction_rule->updated_at, + 'archived_at' => (int) $bank_transaction_rule->deleted_at, + ]; + } + + public function includeCompany(BankTransactionRule $bank_transaction_rule) + { + $transformer = new CompanyTransformer($this->serializer); + + return $this->includeItem($bank_transaction_rule->company, $transformer, Company::class); + } + + public function includeClient(BankTransactionRule $bank_transaction_rule) + { + $transformer = new ClientTransformer($this->serializer); + + return $this->includeItem($bank_transaction_rule->expense, $transformer, Client::class); + } + + public function includeVendor(BankTransactionRule $bank_transaction_rule) + { + $transformer = new VendorTransformer($this->serializer); + + return $this->includeItem($bank_transaction_rule->vendor, $transformer, Vendor::class); + } + +} diff --git a/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php b/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php new file mode 100644 index 000000000000..6201e4e78e6c --- /dev/null +++ b/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php @@ -0,0 +1,53 @@ +id(); + $table->unsignedInteger('company_id'); + $table->unsignedInteger('user_id'); + + $table->string('name'); //name of rule + $table->mediumText('rules')->nullable(); //array of rule objects + $table->boolean('auto_convert')->default(false); //auto convert to match + $table->boolean('matches_on_all')->default(false); //match on all rules or just one + $table->string('applies_to')->default('CREDIT'); //CREDIT/DEBIT + $table->string('record_as')->default('CREDIT'); //CREDIT/DEBIT + + $table->unsignedInteger('client_id')->nullable(); + $table->unsignedInteger('vendor_id')->nullable(); + $table->unsignedInteger('category_id')->nullable(); + + $table->boolean('is_deleted')->default(0); + $table->timestamps(6); + $table->softDeletes('deleted_at', 6); + + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); + $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); + }); + + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; From 6ef21be16c6c1b9acb9cc61c63cfb3b133f9aeea Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 15:21:37 +1100 Subject: [PATCH 02/51] Bank transaction rules --- .../BankTransactionRuleController.php | 3 +- app/Policies/BankTransactionRulePolicy.php | 31 ++++++ app/Providers/AuthServiceProvider.php | 3 + .../BankTransactionRuleRepository.php | 2 +- .../factories/BankTransactionRuleFactory.php | 31 ++++++ routes/api.php | 6 +- tests/Feature/BankTransactionRuleApiTest.php | 102 ++++++++++++++++++ tests/MockAccountData.php | 11 ++ 8 files changed, 186 insertions(+), 3 deletions(-) create mode 100644 app/Policies/BankTransactionRulePolicy.php create mode 100644 database/factories/BankTransactionRuleFactory.php create mode 100644 tests/Feature/BankTransactionRuleApiTest.php diff --git a/app/Http/Controllers/BankTransactionRuleController.php b/app/Http/Controllers/BankTransactionRuleController.php index c9c8b04f0d9e..1f8ae13b2bd6 100644 --- a/app/Http/Controllers/BankTransactionRuleController.php +++ b/app/Http/Controllers/BankTransactionRuleController.php @@ -30,6 +30,7 @@ use App\Models\BankTransactionRule; use App\Repositories\BankTransactionRepository; use App\Repositories\BankTransactionRuleRepository; use App\Services\Bank\BankMatchingService; +use App\Transformers\BankTransactionRuleTransformer; use App\Transformers\BankTransactionTransformer; use App\Utils\Traits\MakesHash; use Illuminate\Http\Request; @@ -42,7 +43,7 @@ class BankTransactionRuleController extends BaseController protected $entity_type = BankTransactionRule::class; - protected $entity_transformer = BankTransactionTransformer::class; + protected $entity_transformer = BankTransactionRuleTransformer::class; protected $bank_transaction_repo; diff --git a/app/Policies/BankTransactionRulePolicy.php b/app/Policies/BankTransactionRulePolicy.php new file mode 100644 index 000000000000..933aed306f2e --- /dev/null +++ b/app/Policies/BankTransactionRulePolicy.php @@ -0,0 +1,31 @@ +isAdmin(); + } +} diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 9b9f779eeb9d..eef723dcaab3 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -15,6 +15,7 @@ use App\Models\Activity; use App\Models\Bank; use App\Models\BankIntegration; use App\Models\BankTransaction; +use App\Models\BankTransactionRule; use App\Models\Client; use App\Models\Company; use App\Models\CompanyGateway; @@ -45,6 +46,7 @@ use App\Models\Webhook; use App\Policies\ActivityPolicy; use App\Policies\BankIntegrationPolicy; use App\Policies\BankTransactionPolicy; +use App\Policies\BankTransactionRulePolicy; use App\Policies\ClientPolicy; use App\Policies\CompanyGatewayPolicy; use App\Policies\CompanyPolicy; @@ -86,6 +88,7 @@ class AuthServiceProvider extends ServiceProvider Activity::class => ActivityPolicy::class, BankIntegration::class => BankIntegrationPolicy::class, BankTransaction::class => BankTransactionPolicy::class, + BankTransactionRule::class => BankTransactionRulePolicy::class, Client::class => ClientPolicy::class, Company::class => CompanyPolicy::class, CompanyToken::class => CompanyTokenPolicy::class, diff --git a/app/Repositories/BankTransactionRuleRepository.php b/app/Repositories/BankTransactionRuleRepository.php index cfc5d7579168..52ae23dbdc8c 100644 --- a/app/Repositories/BankTransactionRuleRepository.php +++ b/app/Repositories/BankTransactionRuleRepository.php @@ -28,7 +28,7 @@ class BankTransactionRuleRepository extends BaseRepository $bank_transaction_rule->save(); - return $bank_transaction_rule + return $bank_transaction_rule; } } diff --git a/database/factories/BankTransactionRuleFactory.php b/database/factories/BankTransactionRuleFactory.php new file mode 100644 index 000000000000..24a5a38fb297 --- /dev/null +++ b/database/factories/BankTransactionRuleFactory.php @@ -0,0 +1,31 @@ +$this->faker->name(), + ]; + } +} diff --git a/routes/api.php b/routes/api.php index d601bf2bd942..e20d1315f290 100644 --- a/routes/api.php +++ b/routes/api.php @@ -14,9 +14,10 @@ use App\Http\Controllers\AccountController; use App\Http\Controllers\ActivityController; use App\Http\Controllers\Auth\ForgotPasswordController; use App\Http\Controllers\Auth\LoginController; -use App\Http\Controllers\Bank\YodleeController; use App\Http\Controllers\BankIntegrationController; use App\Http\Controllers\BankTransactionController; +use App\Http\Controllers\BankTransactionRuleController; +use App\Http\Controllers\Bank\YodleeController; use App\Http\Controllers\BaseController; use App\Http\Controllers\ChartController; use App\Http\Controllers\ClientController; @@ -119,6 +120,9 @@ Route::group(['middleware' => ['throttle:300,1', 'api_db', 'token_auth', 'locale Route::post('bank_transactions/bulk', [BankTransactionController::class, 'bulk'])->name('bank_transactions.bulk'); Route::post('bank_transactions/match', [BankTransactionController::class, 'match'])->name('bank_transactions.match'); + Route::resource('bank_transaction_rules', BankTransactionRuleController::class); // name = (clients. index / create / show / update / destroy / edit + Route::post('bank_transaction_rules/bulk', [BankTransactionRuleController::class, 'bulk'])->name('bank_transaction_rules.bulk'); + Route::post('check_subdomain', [SubdomainController::class, 'index'])->name('check_subdomain'); Route::get('ping', [PingController::class, 'index'])->name('ping'); Route::get('health_check', [PingController::class, 'health'])->name('health_check'); diff --git a/tests/Feature/BankTransactionRuleApiTest.php b/tests/Feature/BankTransactionRuleApiTest.php new file mode 100644 index 000000000000..30ff202c0644 --- /dev/null +++ b/tests/Feature/BankTransactionRuleApiTest.php @@ -0,0 +1,102 @@ +makeTestData(); + + Session::start(); + + $this->faker = \Faker\Factory::create(); + + Model::reguard(); + } + + public function testBankTransactionRuleGet() + { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->get('/api/v1/bank_transaction_rules/'.$this->encodePrimaryKey($this->bank_transaction_rule->id)); + + $response->assertStatus(200); + } + + public function testBankTransactionRuleArchived() + { + $data = [ + 'ids' => [$this->encodePrimaryKey($this->bank_transaction_rule->id)], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/bank_transaction_rules/bulk?action=archive', $data); + + $arr = $response->json(); + + $this->assertNotNull($arr['data'][0]['archived_at']); + } + + public function testBankTransactionRuleRestored() + { + $data = [ + 'ids' => [$this->encodePrimaryKey($this->bank_transaction_rule->id)], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/bank_transaction_rules/bulk?action=restore', $data); + + $arr = $response->json(); + + $this->assertEquals(0, $arr['data'][0]['archived_at']); + } + + public function testBankTransactionRuleDeleted() + { + $data = [ + 'ids' => [$this->encodePrimaryKey($this->bank_transaction_rule->id)], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/bank_transaction_rules/bulk?action=delete', $data); + + $arr = $response->json(); + + $this->assertTrue($arr['data'][0]['is_deleted']); + } +} diff --git a/tests/MockAccountData.php b/tests/MockAccountData.php index 0ccb86849bc7..2c62a670e04c 100644 --- a/tests/MockAccountData.php +++ b/tests/MockAccountData.php @@ -26,6 +26,7 @@ use App\Jobs\Company\CreateCompanyTaskStatuses; use App\Models\Account; use App\Models\BankIntegration; use App\Models\BankTransaction; +use App\Models\BankTransactionRule; use App\Models\Client; use App\Models\ClientContact; use App\Models\Company; @@ -153,6 +154,11 @@ trait MockAccountData */ public $bank_transaction; + /** + * @var + */ + public $bank_transaction_rule; + /** * @var */ @@ -572,6 +578,11 @@ trait MockAccountData 'bank_integration_id' => $this->bank_integration->id, ]); + $this->bank_transaction_rule = BankTransactionRule::factory()->create([ + 'user_id' => $user_id, + 'company_id' => $this->company->id, + ]); + $invitations = CreditInvitation::whereCompanyId($this->credit->company_id) ->whereCreditId($this->credit->id); From dc6aca74b2b1601241b0d55c092e35c82ebfdcee Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 15:41:34 +1100 Subject: [PATCH 03/51] Pad out operators for rules --- .../StoreBankTransactionRuleRequest.php | 7 ++++- .../UpdateBankTransactionRuleRequest.php | 7 ++++- app/Models/BankTransactionRule.php | 26 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php index 158a59bf462e..9641bfd1846f 100644 --- a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -33,7 +33,12 @@ class StoreBankTransactionRuleRequest extends Request { /* Ensure we have a client name, and that all emails are unique*/ $rules = [ - 'name' => 'bail|required|string' + 'name' => 'bail|required|string', + 'rules' => 'bail|array', + 'auto_convert' => 'bail|sometimes|bool', + 'matches_on_all' => 'bail|sometimes|bool', + 'applies_to' => 'bail|sometimes|bool', + 'record_as' => 'bail|sometimes|bool', ]; if (isset($this->currency_id)) diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index 3ccbc9565364..2955bf76796e 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -32,7 +32,12 @@ class UpdateBankTransactionRuleRequest extends Request { /* Ensure we have a client name, and that all emails are unique*/ $rules = [ - 'name' => 'bail|required|string' + 'name' => 'bail|required|string', + 'rules' => 'bail|array', + 'auto_convert' => 'bail|sometimes|bool', + 'matches_on_all' => 'bail|sometimes|bool', + 'applies_to' => 'bail|sometimes|bool', + 'record_as' => 'bail|sometimes|bool', ]; if (isset($this->currency_id)) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index fa6cccd4cadc..26d9bb68baee 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -36,6 +36,32 @@ class BankTransactionRule extends BaseModel protected $dates = [ ]; + /* Columns to search */ + protected array $search_keys = [ + 'client_id' => 'client', + 'vendor_id' => 'vendor', + 'description' => 'description', + 'transaction_reference' => 'transaction_reference', + 'amount' => 'amount', + ]; + + /* Amount */ + protected array $number_operators = [ + '=', + '>', + '>=', + '<', + '<=' + ]; + + /* Description, Client, Vendor, Reference Number */ + protected array $string_operators = [ + 'is', + 'contains', + 'starts_with', + 'is_empty', + ]; + public function getEntityType() { return self::class; From 229a11e009b50bd206b8daea03f9eb4575317208 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 15:52:57 +1100 Subject: [PATCH 04/51] Padd out rules --- app/Models/BankTransactionRule.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 26d9bb68baee..03a04372180c 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -62,6 +62,16 @@ class BankTransactionRule extends BaseModel 'is_empty', ]; + + // rule object looks like this: + //[ + // { + // 'search_key': 'client_id', + // 'operator' : 'is', + // 'value' : 'Sparky' + // } + //] + public function getEntityType() { return self::class; From 4f5a74dbd222e544f49605b5d3ad8f1db285403b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Nov 2022 16:46:14 +1100 Subject: [PATCH 05/51] Padd out rules --- app/Models/BankTransactionRule.php | 67 +++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 03a04372180c..3971bc2d7831 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -62,6 +62,7 @@ class BankTransactionRule extends BaseModel 'is_empty', ]; + private array $search_results = []; // rule object looks like this: //[ @@ -71,7 +72,70 @@ class BankTransactionRule extends BaseModel // 'value' : 'Sparky' // } //] - + + public function processRule(BankTransaction $bank_transaction) + { + foreach($this->rules as $key => $rule) + { + $this->search($rule, $key, $bank_transaction); + } + } + + private function search($rule, $key, $bank_transaction) + { + if($rule->search_key == 'amount') + { + //number search + } + else { + //string search + } + } + + private function findAmount($amount, $bank_transaction) + { + if($bank_transaction->base_type == 'CREDIT'){ + //search invoices + } + else{ + //search expenses + } + + } + + private function searchClient($rule, $bank_transaction) + { + if($bank_transaction->base_type == 'CREDIT'){ + //search invoices + } + else{ + //search expenses + } + + } + + private function searchVendor($rule, $bank_transaction) + { + //search expenses + + + } + + private function searchDescription($rule, $bank_transaction) + { + //search expenses public notes + } + + private function searchReference($rule, $bank_transaction) + { + if($bank_transaction->base_type == 'CREDIT'){ + //search invoices + } + else{ + //search expenses + } + } + public function getEntityType() { return self::class; @@ -101,5 +165,6 @@ class BankTransactionRule extends BaseModel { return $this->belongsTo(ExpenseCategory::class)->withTrashed(); } + } } \ No newline at end of file From b2c314d7c354e854af39a95467ba7cc73466a71e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Nov 2022 08:04:47 +1100 Subject: [PATCH 06/51] Remodelling bank transaction rules --- .../BankTransactionRule/StoreBankTransactionRuleRequest.php | 1 - .../BankTransactionRule/UpdateBankTransactionRuleRequest.php | 1 - app/Models/BankTransactionRule.php | 1 - app/Transformers/BankTransactionRuleTransformer.php | 1 - .../2022_11_13_034143_bank_transaction_rules_table.php | 1 - 5 files changed, 5 deletions(-) diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php index 9641bfd1846f..873aae6d8f38 100644 --- a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -38,7 +38,6 @@ class StoreBankTransactionRuleRequest extends Request 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', 'applies_to' => 'bail|sometimes|bool', - 'record_as' => 'bail|sometimes|bool', ]; if (isset($this->currency_id)) diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index 2955bf76796e..51701ffcb13f 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -37,7 +37,6 @@ class UpdateBankTransactionRuleRequest extends Request 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', 'applies_to' => 'bail|sometimes|bool', - 'record_as' => 'bail|sometimes|bool', ]; if (isset($this->currency_id)) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 3971bc2d7831..273dc524db5f 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -27,7 +27,6 @@ class BankTransactionRule extends BaseModel 'auto_convert', 'matches_on_all', 'applies_to', - 'record_as', 'client_id', 'vendor_id', 'category_id', diff --git a/app/Transformers/BankTransactionRuleTransformer.php b/app/Transformers/BankTransactionRuleTransformer.php index e2b709121e3c..cb8221c7312e 100644 --- a/app/Transformers/BankTransactionRuleTransformer.php +++ b/app/Transformers/BankTransactionRuleTransformer.php @@ -56,7 +56,6 @@ class BankTransactionRuleTransformer extends EntityTransformer 'auto_convert' => (bool) $bank_transaction_rule->auto_convert, 'matches_on_all' => (bool) $bank_transaction_rule->matches_on_all, 'applies_to' => (string) $bank_transaction_rule->applies_to, - 'record_as' => (string) $bank_transaction_rule->record_as, 'client_id' => $this->encodePrimaryKey($bank_transaction_rule->client_id) ?: '', 'vendor_id' => $this->encodePrimaryKey($bank_transaction_rule->vendor_id) ?: '', 'category_id' => $this->encodePrimaryKey($bank_transaction_rule->category_id) ?: '', diff --git a/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php b/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php index 6201e4e78e6c..7609d1a7d3fd 100644 --- a/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php +++ b/database/migrations/2022_11_13_034143_bank_transaction_rules_table.php @@ -24,7 +24,6 @@ return new class extends Migration $table->boolean('auto_convert')->default(false); //auto convert to match $table->boolean('matches_on_all')->default(false); //match on all rules or just one $table->string('applies_to')->default('CREDIT'); //CREDIT/DEBIT - $table->string('record_as')->default('CREDIT'); //CREDIT/DEBIT $table->unsignedInteger('client_id')->nullable(); $table->unsignedInteger('vendor_id')->nullable(); From 93ecb8790b287738eabd2bfd5e0ca98ffe51f971 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 14 Nov 2022 11:21:05 +1100 Subject: [PATCH 07/51] API Doc Blocks for Bank Transaction Rules --- .../BankTransactionRuleController.php | 12 ++++----- .../Controllers/OpenAPI/BTRulesSchema.php | 10 ++++++++ .../Controllers/OpenAPI/BankTransaction.php | 2 +- .../OpenAPI/BankTransactionRule.php | 25 +++++++++++++++++++ 4 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 app/Http/Controllers/OpenAPI/BTRulesSchema.php create mode 100644 app/Http/Controllers/OpenAPI/BankTransactionRule.php diff --git a/app/Http/Controllers/BankTransactionRuleController.php b/app/Http/Controllers/BankTransactionRuleController.php index 1f8ae13b2bd6..5e16a645e7e0 100644 --- a/app/Http/Controllers/BankTransactionRuleController.php +++ b/app/Http/Controllers/BankTransactionRuleController.php @@ -83,7 +83,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -143,7 +143,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -199,7 +199,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -255,7 +255,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -303,7 +303,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, @@ -349,7 +349,7 @@ class BankTransactionRuleController extends BaseController * @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"), * @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"), * @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"), - * @OA\JsonContent(ref="#/components/schemas/BankTransaction"), + * @OA\JsonContent(ref="#/components/schemas/BankTransactionRule"), * ), * @OA\Response( * response=422, diff --git a/app/Http/Controllers/OpenAPI/BTRulesSchema.php b/app/Http/Controllers/OpenAPI/BTRulesSchema.php new file mode 100644 index 000000000000..8c967291aae8 --- /dev/null +++ b/app/Http/Controllers/OpenAPI/BTRulesSchema.php @@ -0,0 +1,10 @@ +", description="The operator flag of the search"), + * @OA\Property(property="value", type="string" ,example="bob", description="The value to search for"), + * ) + */ diff --git a/app/Http/Controllers/OpenAPI/BankTransaction.php b/app/Http/Controllers/OpenAPI/BankTransaction.php index c3e5f3d19c13..184c24f30f4b 100644 --- a/app/Http/Controllers/OpenAPI/BankTransaction.php +++ b/app/Http/Controllers/OpenAPI/BankTransaction.php @@ -6,7 +6,7 @@ * @OA\Property(property="id", type="string", example="AS3df3A", description="The bank integration hashed id"), * @OA\Property(property="company_id", type="string", example="AS3df3A", description="The company hashed id"), * @OA\Property(property="user_id", type="string", example="AS3df3A", description="The user hashed id"), - * @OA\Property(property="transaction_id", type="integer", example=343434, description="The id of the transaction"), + * @OA\Property(property="transaction_id", type="integer", example=343434, description="The id of the transaction rule"), * @OA\Property(property="amount", type="number", example=10.00, description="The transaction amount"), * @OA\Property(property="currency_id", type="string", example="1", description="The currency ID of the currency"), * @OA\Property(property="account_type", type="string", example="creditCard", description="The account type"), diff --git a/app/Http/Controllers/OpenAPI/BankTransactionRule.php b/app/Http/Controllers/OpenAPI/BankTransactionRule.php new file mode 100644 index 000000000000..f62e0cf19a91 --- /dev/null +++ b/app/Http/Controllers/OpenAPI/BankTransactionRule.php @@ -0,0 +1,25 @@ + Date: Sun, 20 Nov 2022 11:13:46 +1100 Subject: [PATCH 08/51] Minor fixes for request forms --- .../BankTransactionRule/StoreBankTransactionRuleRequest.php | 4 ++-- .../UpdateBankTransactionRuleRequest.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php index 873aae6d8f38..5f8e8546d94c 100644 --- a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -40,8 +40,8 @@ class StoreBankTransactionRuleRequest extends Request 'applies_to' => 'bail|sometimes|bool', ]; - if (isset($this->currency_id)) - $rules['category_Id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + if(isset($this->category_id)) + $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; if(isset($this->vendor_id)) $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index 51701ffcb13f..8b45a061e4ae 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -25,7 +25,7 @@ class UpdateBankTransactionRuleRequest extends Request */ public function authorize() : bool { - return auth()->user()->can('edit', $this->bank_transaction); + return auth()->user()->can('edit', $this->bank_transaction_rule); } public function rules() @@ -39,8 +39,8 @@ class UpdateBankTransactionRuleRequest extends Request 'applies_to' => 'bail|sometimes|bool', ]; - if (isset($this->currency_id)) - $rules['category_Id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + if(isset($this->category_id)) + $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; if(isset($this->vendor_id)) $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; From 069568da6eb8b50e67315a3c3a3313524b90d900 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 11:16:38 +1100 Subject: [PATCH 09/51] Minor fixes for request forms --- app/Http/Requests/Request.php | 4 ++++ app/Models/BankTransactionRule.php | 1 - app/Repositories/BankTransactionRuleRepository.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/Request.php b/app/Http/Requests/Request.php index 141226755f78..c3ff61b48e61 100644 --- a/app/Http/Requests/Request.php +++ b/app/Http/Requests/Request.php @@ -125,6 +125,10 @@ class Request extends FormRequest $input['company_gateway_id'] = $this->decodePrimaryKey($input['company_gateway_id']); } + if (array_key_exists('category_id', $input) && is_string($input['category_id'])) { + $input['category_id'] = $this->decodePrimaryKey($input['category_id']); + } + if (isset($input['client_contacts'])) { foreach ($input['client_contacts'] as $key => $contact) { if (! array_key_exists('send_email', $contact) || ! array_key_exists('id', $contact)) { diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 273dc524db5f..2096072c4619 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -164,6 +164,5 @@ class BankTransactionRule extends BaseModel { return $this->belongsTo(ExpenseCategory::class)->withTrashed(); } - } } \ No newline at end of file diff --git a/app/Repositories/BankTransactionRuleRepository.php b/app/Repositories/BankTransactionRuleRepository.php index 52ae23dbdc8c..e5116ca6c0f6 100644 --- a/app/Repositories/BankTransactionRuleRepository.php +++ b/app/Repositories/BankTransactionRuleRepository.php @@ -29,6 +29,7 @@ class BankTransactionRuleRepository extends BaseRepository $bank_transaction_rule->save(); return $bank_transaction_rule; + } } From 3562c3376cba0dd11a5d0f6f9c0e0abe1c7bffe0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 11:25:57 +1100 Subject: [PATCH 10/51] Fixes for CRUD actions on bank transaction rules --- .../OpenAPI/BankTransactionRule.php | 2 +- .../StoreBankTransactionRuleRequest.php | 2 +- .../UpdateBankTransactionRuleRequest.php | 2 +- app/Models/BankTransactionRule.php | 7 ++ tests/Feature/BankTransactionRuleApiTest.php | 85 +++++++++++++++++++ 5 files changed, 95 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/OpenAPI/BankTransactionRule.php b/app/Http/Controllers/OpenAPI/BankTransactionRule.php index f62e0cf19a91..522b1764b265 100644 --- a/app/Http/Controllers/OpenAPI/BankTransactionRule.php +++ b/app/Http/Controllers/OpenAPI/BankTransactionRule.php @@ -17,7 +17,7 @@ * ), * @OA\Property(property="auto_convert", type="boolean", example=true, description="Flags whether the rule converts the transaction automatically"), * @OA\Property(property="matches_on_all", type="boolean", example=true, description="Flags whether all subrules are required for the match"), - * @OA\Property(property="applies_to", type="boolean", example="CREDIT", description="Flags whether the rule applies to a CREDIT or DEBIT"), + * @OA\Property(property="applies_to", type="string", example="CREDIT", description="Flags whether the rule applies to a CREDIT or DEBIT"), * @OA\Property(property="client_id", type="string", example="AS3df3A", description="The client hashed id"), * @OA\Property(property="vendor_id", type="string", example="AS3df3A", description="The vendor hashed id"), * @OA\Property(property="category_id", type="string", example="AS3df3A", description="The category hashed id"), diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php index 5f8e8546d94c..f62b7414c710 100644 --- a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -37,7 +37,7 @@ class StoreBankTransactionRuleRequest extends Request 'rules' => 'bail|array', 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', - 'applies_to' => 'bail|sometimes|bool', + 'applies_to' => 'bail|sometimes|string', ]; if(isset($this->category_id)) diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index 8b45a061e4ae..d198a3892eae 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -36,7 +36,7 @@ class UpdateBankTransactionRuleRequest extends Request 'rules' => 'bail|array', 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', - 'applies_to' => 'bail|sometimes|bool', + 'applies_to' => 'bail|sometimes|string', ]; if(isset($this->category_id)) diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index 2096072c4619..f2d1e62d905d 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -32,6 +32,13 @@ class BankTransactionRule extends BaseModel 'category_id', ]; + protected $casts = [ + 'rules' => 'array', + 'updated_at' => 'timestamp', + 'created_at' => 'timestamp', + 'deleted_at' => 'timestamp', + ]; + protected $dates = [ ]; diff --git a/tests/Feature/BankTransactionRuleApiTest.php b/tests/Feature/BankTransactionRuleApiTest.php index 30ff202c0644..e581788c659a 100644 --- a/tests/Feature/BankTransactionRuleApiTest.php +++ b/tests/Feature/BankTransactionRuleApiTest.php @@ -42,6 +42,91 @@ class BankTransactionRuleApiTest extends TestCase Model::reguard(); } +/* +$rules = [ + 'name' => 'bail|required|string', + 'rules' => 'bail|array', + 'auto_convert' => 'bail|sometimes|bool', + 'matches_on_all' => 'bail|sometimes|bool', + 'applies_to' => 'bail|sometimes|bool', +]; + +if(isset($this->category_id)) + $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + +if(isset($this->vendor_id)) + $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + +if(isset($this->client_id)) + $rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; +*/ + public function testBankRulePost() + { + + $data = [ + 'name' => 'The First Rule', + 'rules' => [], + 'auto_convert' => false, + 'matches_on_all' => false, + 'applies_to' => 'CREDIT', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/bank_transaction_rules/', $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $this->assertEquals('The First Rule', $arr['data']['name']); + + } + + public function testBankRulePut() + { + + $data = [ + 'name' => 'The First Rule', + 'rules' => [], + 'auto_convert' => false, + 'matches_on_all' => false, + 'applies_to' => 'CREDIT', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/bank_transaction_rules/', $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $this->assertEquals('The First Rule', $arr['data']['name']); + + $data = [ + 'name' => 'A New Name For The First Rule', + 'rules' => [], + 'auto_convert' => false, + 'matches_on_all' => false, + 'applies_to' => 'CREDIT', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/bank_transaction_rules/'. $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $this->assertEquals('A New Name For The First Rule', $arr['data']['name']); + + } + public function testBankTransactionRuleGet() { $response = $this->withHeaders([ From 9412760a25036992e009da7970f591d72d7a044d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 13:12:33 +1100 Subject: [PATCH 11/51] Matching Bank Transactions --- app/Models/BankTransaction.php | 1 + app/Models/BankTransactionRule.php | 112 +++++++------- app/Models/Company.php | 18 +++ app/Services/Bank/BankMatchingService.php | 175 +++++++++++++++++++++- 4 files changed, 241 insertions(+), 65 deletions(-) diff --git a/app/Models/BankTransaction.php b/app/Models/BankTransaction.php index 7092da3f89b1..6ccdd1250f0a 100644 --- a/app/Models/BankTransaction.php +++ b/app/Models/BankTransaction.php @@ -11,6 +11,7 @@ namespace App\Models; +use App\Models\BankTransactionRule; use App\Models\Filterable; use App\Models\Invoice; use App\Services\Bank\BankService; diff --git a/app/Models/BankTransactionRule.php b/app/Models/BankTransactionRule.php index f2d1e62d905d..b2ea0b015b64 100644 --- a/app/Models/BankTransactionRule.php +++ b/app/Models/BankTransactionRule.php @@ -42,13 +42,9 @@ class BankTransactionRule extends BaseModel protected $dates = [ ]; - /* Columns to search */ protected array $search_keys = [ - 'client_id' => 'client', - 'vendor_id' => 'vendor', - 'description' => 'description', - 'transaction_reference' => 'transaction_reference', - 'amount' => 'amount', + 'description' => 'string', + 'amount' => 'number', ]; /* Amount */ @@ -79,68 +75,68 @@ class BankTransactionRule extends BaseModel // } //] - public function processRule(BankTransaction $bank_transaction) - { - foreach($this->rules as $key => $rule) - { - $this->search($rule, $key, $bank_transaction); - } - } + // public function processRule(BankTransaction $bank_transaction) + // { + // foreach($this->rules as $key => $rule) + // { + // $this->search($rule, $key, $bank_transaction); + // } + // } - private function search($rule, $key, $bank_transaction) - { - if($rule->search_key == 'amount') - { - //number search - } - else { - //string search - } - } + // private function search($rule, $key, $bank_transaction) + // { + // if($rule->search_key == 'amount') + // { + // //number search + // } + // else { + // //string search + // } + // } - private function findAmount($amount, $bank_transaction) - { - if($bank_transaction->base_type == 'CREDIT'){ - //search invoices - } - else{ - //search expenses - } + // private function findAmount($amount, $bank_transaction) + // { + // if($bank_transaction->base_type == 'CREDIT'){ + // //search invoices + // } + // else{ + // //search expenses + // } - } + // } - private function searchClient($rule, $bank_transaction) - { - if($bank_transaction->base_type == 'CREDIT'){ - //search invoices - } - else{ - //search expenses - } + // private function searchClient($rule, $bank_transaction) + // { + // if($bank_transaction->base_type == 'CREDIT'){ + // //search invoices + // } + // else{ + // //search expenses + // } - } + // } - private function searchVendor($rule, $bank_transaction) - { - //search expenses + // private function searchVendor($rule, $bank_transaction) + // { + // //search expenses - } + // } - private function searchDescription($rule, $bank_transaction) - { - //search expenses public notes - } + // private function searchDescription($rule, $bank_transaction) + // { + // //search expenses public notes + // } - private function searchReference($rule, $bank_transaction) - { - if($bank_transaction->base_type == 'CREDIT'){ - //search invoices - } - else{ - //search expenses - } - } + // private function searchReference($rule, $bank_transaction) + // { + // if($bank_transaction->base_type == 'CREDIT'){ + // //search invoices + // } + // else{ + // //search expenses + // } + // } public function getEntityType() { diff --git a/app/Models/Company.php b/app/Models/Company.php index d878ee575b47..641add772796 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -13,6 +13,7 @@ namespace App\Models; use App\DataMapper\CompanySettings; use App\Models\BankTransaction; +use App\Models\BankTransactionRule; use App\Models\Language; use App\Models\Presenters\CompanyPresenter; use App\Models\PurchaseOrder; @@ -541,6 +542,23 @@ class Company extends BaseModel return $this->company_users()->withTrashed()->where('is_owner', true)->first()?->user; } + public function credit_rules() + { + return BankTransactionRule::query() + ->where('company_id', $this->id) + ->where('applies_to', 'CREDIT') + ->get(); + } + + public function debit_rules() + { + return BankTransactionRule::query() + ->where('company_id', $this->id) + ->where('applies_to', 'DEBIT') + ->get(); + } + + public function resolveRouteBinding($value, $field = null) { return $this->where('id', $this->decodePrimaryKey($value))->firstOrFail(); diff --git a/app/Services/Bank/BankMatchingService.php b/app/Services/Bank/BankMatchingService.php index b466a95cfcd8..c732a794c006 100644 --- a/app/Services/Bank/BankMatchingService.php +++ b/app/Services/Bank/BankMatchingService.php @@ -11,19 +11,26 @@ namespace App\Services\Bank; +use App\Factory\ExpenseCategoryFactory; +use App\Factory\ExpenseFactory; use App\Libraries\MultiDB; use App\Models\BankTransaction; use App\Models\Company; +use App\Models\ExpenseCategory; use App\Models\Invoice; +use App\Utils\Traits\GeneratesCounter; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; +use Illuminate\Queue\Middleware\WithoutOverlapping; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Cache; class BankMatchingService implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, GeneratesCounter; private $company_id; @@ -35,12 +42,23 @@ class BankMatchingService implements ShouldQueue public $deleteWhenMissingModels = true; + protected $credit_rules; + + protected $debit_rules; + + protected $categories; + public function __construct($company_id, $db) { $this->company_id = $company_id; $this->db = $db; } + public function middleware() + { + return [new WithoutOverlapping($this->company->company_key)]; + } + public function handle() { @@ -48,19 +66,162 @@ class BankMatchingService implements ShouldQueue $this->company = Company::find($this->company_id); + $this->categories = collect(Cache::get('bank_categories')); + + $this->matchCredits(); + + $this->matchDebits(); + + } + + private function matchDebits() + { + + $this->debit_rules = $this->company->debit_rules(); + + BankTransaction::where('company_id', $this->company->id) + ->where('status_id', BankTransaction::STATUS_UNMATCHED) + ->where('base_type', 'DEBIT') + ->cursor() + ->each(function ($bt){ + + $this->matchDebit($bt); + + }); + + } + + private function matchDebit(BankTransaction $bank_transaction) + { + $matches = 0; + + foreach($this->debit_rules as $rule) + { + $rule_count = count($this->debit_rules); + + if($rule['search_key'] == 'description') + { + + if($this->matchStringOperator($bank_transaction->description, 'description', $rule['operator'])){ + $matches++; + } + + } + + if($rule['search_key'] == 'amount') + { + + if($this->matchNumberOperator($bank_transaction->description, 'amount', $rule['operator'])){ + $matches++; + } + + } + + if(($rule['matches_on_all'] && ($matches == $rule_count)) || (!$rule['matches_on_all'] &&$matches > 0)) + { + + $bank_transaction->client_id = empty($rule['client_id']) ? null : $rule['client_id']; + $bank_transaction->vendor_id = empty($rule['vendor_id']) ? null : $rule['vendor_id']; + $bank_transaction->ninja_category_id = empty($rule['category_id']) ? null : $rule['category_id']; + $bank_transaction->status_id = BankTransaction::STATUS_MATCHED; + $bank_transaction->save(); + + if($rule['auto_convert']) + { + + $expense = ExpenseFactory::create($bank_transaction->company_id, $bank_transaction->user_id); + $expense->category_id = $bank_transaction->ninja_category_id ?: $this->resolveCategory($bank_transaction); + $expense->amount = $bank_transaction->amount; + $expense->number = $this->getNextExpenseNumber($expense); + $expense->currency_id = $bank_transaction->currency_id; + $expense->date = Carbon::parse($bank_transaction->date); + $expense->payment_date = Carbon::parse($bank_transaction->date); + $expense->transaction_reference = $bank_transaction->description; + $expense->transaction_id = $bank_transaction->id; + $expense->vendor_id = $bank_transaction->vendor_id; + $expense->invoice_documents = $this->company->invoice_expense_documents; + $expense->should_be_invoiced = $this->company->mark_expenses_invoiceable; + $expense->save(); + + $bank_transaction->expense_id = $expense->id; + $bank_transaction->status_id = BankTransaction::STATUS_CONVERTED; + $bank_transaction->save(); + + break; + + } + + } + + } + + } + + private function resolveCategory(BankTransaction $bank_transaction) + { + $category = $this->categories->firstWhere('highLevelCategoryId', $bank_transaction->category_id); + + $ec = ExpenseCategory::where('company_id', $this->company->id)->where('bank_category_id', $bank_transaction->category_id)->first(); + + if($ec) + return $ec->id; + + if($category) + { + $ec = ExpenseCategoryFactory::create($bank_transaction->company_id, $bank_transaction->user_id); + $ec->bank_category_id = $bank_transaction->category_id; + $ec->name = $category->highLevelCategoryName; + $ec->save(); + + return $ec->id; + } + } + + private function matchNumberOperator($bt_value, $rule_value, $operator) :bool + { + + return match ($operator) { + '>' => floatval($bt_value) > floatval($rule_value), + '>=' => floatval($bt_value) >= floatval($rule_value), + '=' => floatval($bt_value) == floatval($rule_value), + '<' => floatval($bt_value) < floatval($rule_value), + '<=' => floatval($bt_value) <= floatval($rule_value), + default => false, + }; + + } + + private function matchStringOperator($bt_value, $rule_value, $operator) :bool + { + $bt_value = strtolower(str_replace(" ", "", $bt_value)); + $rule_value = strtolower(str_replace(" ", "", $rule_value)); + $rule_length = iconv_strlen($rule_value); + + return match ($operator) { + 'is' => $bt_value == $rule_value, + 'contains' => str_contains($bt_value, $rule_value), + 'starts_with' => substr($bt_value, 0, $rule_length) == $rule_value, + 'is_empty' => empty($bt_value), + default => false, + }; + + } + + + + /* Currently we don't consider rules here, only matching on invoice number*/ + private function matchCredits() + { + $this->credit_rules = $this->company->credit_rules(); + $this->invoices = Invoice::where('company_id', $this->company->id) ->whereIn('status_id', [1,2,3]) ->where('is_deleted', 0) ->get(); - $this->match(); - } - - private function match() - { - BankTransaction::where('company_id', $this->company->id) ->where('status_id', BankTransaction::STATUS_UNMATCHED) + ->where('base_type', 'CREDIT') ->cursor() ->each(function ($bt){ From 0efaf80ceef0c85b55af8f77e1789c7c20f3bfd1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 13:55:19 +1100 Subject: [PATCH 12/51] Tests for matching expenses --- .../BankTransactionRepository.php | 10 +- app/Services/Bank/BankMatchingService.php | 175 +------------- app/Services/Bank/BankService.php | 6 +- app/Services/Bank/ProcessBankRule.php | 27 --- app/Services/Bank/ProcessBankRules.php | 214 ++++++++++++++++++ .../Feature/Bank/BankTransactionRuleTest.php | 88 +++++++ 6 files changed, 312 insertions(+), 208 deletions(-) delete mode 100644 app/Services/Bank/ProcessBankRule.php create mode 100644 app/Services/Bank/ProcessBankRules.php create mode 100644 tests/Feature/Bank/BankTransactionRuleTest.php diff --git a/app/Repositories/BankTransactionRepository.php b/app/Repositories/BankTransactionRepository.php index 390b8f56ffb2..1a5bfba1662e 100644 --- a/app/Repositories/BankTransactionRepository.php +++ b/app/Repositories/BankTransactionRepository.php @@ -28,17 +28,11 @@ class BankTransactionRepository extends BaseRepository $bank_transaction->bank_integration_id = $data['bank_integration_id']; $bank_transaction->fill($data); - $bank_transaction->save(); - if($bank_transaction->base_type == 'CREDIT' && $invoice = $bank_transaction->service()->matchInvoiceNumber()) - { - $bank_transaction->invoice_ids = $invoice->hashed_id; - $bank_transaction->status_id = BankTransaction::STATUS_MATCHED; - $bank_transaction->save(); - } + $bank_transaction->service()->processRules(); - return $bank_transaction; + return $bank_transaction->fresh(); } } diff --git a/app/Services/Bank/BankMatchingService.php b/app/Services/Bank/BankMatchingService.php index c732a794c006..bd95296d4fa0 100644 --- a/app/Services/Bank/BankMatchingService.php +++ b/app/Services/Bank/BankMatchingService.php @@ -18,6 +18,7 @@ use App\Models\BankTransaction; use App\Models\Company; use App\Models\ExpenseCategory; use App\Models\Invoice; +use App\Services\Bank\BankService; use App\Utils\Traits\GeneratesCounter; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -42,23 +43,12 @@ class BankMatchingService implements ShouldQueue public $deleteWhenMissingModels = true; - protected $credit_rules; - - protected $debit_rules; - - protected $categories; - public function __construct($company_id, $db) { $this->company_id = $company_id; $this->db = $db; } - public function middleware() - { - return [new WithoutOverlapping($this->company->company_key)]; - } - public function handle() { @@ -66,180 +56,27 @@ class BankMatchingService implements ShouldQueue $this->company = Company::find($this->company_id); - $this->categories = collect(Cache::get('bank_categories')); - - $this->matchCredits(); + $this->matchTransactions(); - $this->matchDebits(); } - private function matchDebits() + private function matchTransactions() { - $this->debit_rules = $this->company->debit_rules(); - BankTransaction::where('company_id', $this->company->id) ->where('status_id', BankTransaction::STATUS_UNMATCHED) - ->where('base_type', 'DEBIT') ->cursor() ->each(function ($bt){ - $this->matchDebit($bt); + (new BankService($bt))->processRules(); }); } - private function matchDebit(BankTransaction $bank_transaction) + public function middleware() { - $matches = 0; - - foreach($this->debit_rules as $rule) - { - $rule_count = count($this->debit_rules); - - if($rule['search_key'] == 'description') - { - - if($this->matchStringOperator($bank_transaction->description, 'description', $rule['operator'])){ - $matches++; - } - - } - - if($rule['search_key'] == 'amount') - { - - if($this->matchNumberOperator($bank_transaction->description, 'amount', $rule['operator'])){ - $matches++; - } - - } - - if(($rule['matches_on_all'] && ($matches == $rule_count)) || (!$rule['matches_on_all'] &&$matches > 0)) - { - - $bank_transaction->client_id = empty($rule['client_id']) ? null : $rule['client_id']; - $bank_transaction->vendor_id = empty($rule['vendor_id']) ? null : $rule['vendor_id']; - $bank_transaction->ninja_category_id = empty($rule['category_id']) ? null : $rule['category_id']; - $bank_transaction->status_id = BankTransaction::STATUS_MATCHED; - $bank_transaction->save(); - - if($rule['auto_convert']) - { - - $expense = ExpenseFactory::create($bank_transaction->company_id, $bank_transaction->user_id); - $expense->category_id = $bank_transaction->ninja_category_id ?: $this->resolveCategory($bank_transaction); - $expense->amount = $bank_transaction->amount; - $expense->number = $this->getNextExpenseNumber($expense); - $expense->currency_id = $bank_transaction->currency_id; - $expense->date = Carbon::parse($bank_transaction->date); - $expense->payment_date = Carbon::parse($bank_transaction->date); - $expense->transaction_reference = $bank_transaction->description; - $expense->transaction_id = $bank_transaction->id; - $expense->vendor_id = $bank_transaction->vendor_id; - $expense->invoice_documents = $this->company->invoice_expense_documents; - $expense->should_be_invoiced = $this->company->mark_expenses_invoiceable; - $expense->save(); - - $bank_transaction->expense_id = $expense->id; - $bank_transaction->status_id = BankTransaction::STATUS_CONVERTED; - $bank_transaction->save(); - - break; - - } - - } - - } - + return [new WithoutOverlapping($this->company->company_key)]; } - - private function resolveCategory(BankTransaction $bank_transaction) - { - $category = $this->categories->firstWhere('highLevelCategoryId', $bank_transaction->category_id); - - $ec = ExpenseCategory::where('company_id', $this->company->id)->where('bank_category_id', $bank_transaction->category_id)->first(); - - if($ec) - return $ec->id; - - if($category) - { - $ec = ExpenseCategoryFactory::create($bank_transaction->company_id, $bank_transaction->user_id); - $ec->bank_category_id = $bank_transaction->category_id; - $ec->name = $category->highLevelCategoryName; - $ec->save(); - - return $ec->id; - } - } - - private function matchNumberOperator($bt_value, $rule_value, $operator) :bool - { - - return match ($operator) { - '>' => floatval($bt_value) > floatval($rule_value), - '>=' => floatval($bt_value) >= floatval($rule_value), - '=' => floatval($bt_value) == floatval($rule_value), - '<' => floatval($bt_value) < floatval($rule_value), - '<=' => floatval($bt_value) <= floatval($rule_value), - default => false, - }; - - } - - private function matchStringOperator($bt_value, $rule_value, $operator) :bool - { - $bt_value = strtolower(str_replace(" ", "", $bt_value)); - $rule_value = strtolower(str_replace(" ", "", $rule_value)); - $rule_length = iconv_strlen($rule_value); - - return match ($operator) { - 'is' => $bt_value == $rule_value, - 'contains' => str_contains($bt_value, $rule_value), - 'starts_with' => substr($bt_value, 0, $rule_length) == $rule_value, - 'is_empty' => empty($bt_value), - default => false, - }; - - } - - - - /* Currently we don't consider rules here, only matching on invoice number*/ - private function matchCredits() - { - $this->credit_rules = $this->company->credit_rules(); - - $this->invoices = Invoice::where('company_id', $this->company->id) - ->whereIn('status_id', [1,2,3]) - ->where('is_deleted', 0) - ->get(); - - BankTransaction::where('company_id', $this->company->id) - ->where('status_id', BankTransaction::STATUS_UNMATCHED) - ->where('base_type', 'CREDIT') - ->cursor() - ->each(function ($bt){ - - $invoice = $this->invoices->first(function ($value, $key) use ($bt){ - - return str_contains($bt->description, $value->number); - - }); - - if($invoice) - { - $bt->invoice_ids = $invoice->hashed_id; - $bt->status_id = BankTransaction::STATUS_MATCHED; - $bt->save(); - } - - }); - } - - } diff --git a/app/Services/Bank/BankService.php b/app/Services/Bank/BankService.php index 7a7f50759191..5ff37a1ab6b1 100644 --- a/app/Services/Bank/BankService.php +++ b/app/Services/Bank/BankService.php @@ -40,11 +40,9 @@ class BankService } - public function processRule($rule) + public function processRules() { - (new ProcessBankRule($this->bank_transaction, $rule))->run(); - - return $this; + (new ProcessBankRules($this->bank_transaction))->run(); } } \ No newline at end of file diff --git a/app/Services/Bank/ProcessBankRule.php b/app/Services/Bank/ProcessBankRule.php deleted file mode 100644 index ffeedbb1f1fe..000000000000 --- a/app/Services/Bank/ProcessBankRule.php +++ /dev/null @@ -1,27 +0,0 @@ -bank_transaction->base_type == 'DEBIT') + $this->matchDebit(); + else + $this->matchCredit(); + } + + private function matchCredit() + { + $this->credit_rules = $this->bank_transaction->company->credit_rules(); + + $this->invoices = Invoice::where('company_id', $this->bank_transaction->company_id) + ->whereIn('status_id', [1,2,3]) + ->where('is_deleted', 0) + ->get(); + + $invoice = $this->invoices->first(function ($value, $key){ + + return str_contains($this->bank_transaction, $value->number); + + }); + + if($invoice) + { + $this->bank_transaction->invoice_ids = $invoice->hashed_id; + $this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED; + $this->bank_transaction->save(); + return; + } + + //stub for credit rules + foreach($this->credit_rules as $rule) + { + + } + + } + + private function matchDebit() + { + + $this->debit_rules = $this->bank_transaction->company->debit_rules(); + + $this->categories = collect(Cache::get('bank_categories')); + + foreach($this->debit_rules as $bank_transaction_rule) + { + + $matches = 0; + + foreach($bank_transaction_rule['rules'] as $rule) + { + $rule_count = count($bank_transaction_rule['rules']); + + +nlog($rule_count); +nlog($rule); + + if($rule['search_key'] == 'description') + { + nlog("searching key"); + + if($this->matchStringOperator($this->bank_transaction->description, $rule['value'], $rule['operator'])){ + nlog("found key"); + $matches++; + } + + } + + if($rule['search_key'] == 'amount') + { + + if($this->matchNumberOperator($this->bank_transaction->description, 'amount', $rule['operator'])){ + $matches++; + } + + } + + if(($bank_transaction_rule['matches_on_all'] && ($matches == $rule_count)) || (!$bank_transaction_rule['matches_on_all'] && $matches > 0)) + { + + // $this->bank_transaction->client_id = empty($rule['client_id']) ? null : $rule['client_id']; + $this->bank_transaction->vendor_id = empty($rule['vendor_id']) ? null : $rule['vendor_id']; + $this->bank_transaction->ninja_category_id = empty($rule['category_id']) ? null : $rule['category_id']; + $this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED; + $this->bank_transaction->save(); + + if($bank_transaction_rule['auto_convert']) + { + + $expense = ExpenseFactory::create($this->bank_transaction->company_id, $this->bank_transaction->user_id); + $expense->category_id = $this->bank_transaction->ninja_category_id ?: $this->resolveCategory(); + $expense->amount = $this->bank_transaction->amount; + $expense->number = $this->getNextExpenseNumber($expense); + $expense->currency_id = $this->bank_transaction->currency_id; + $expense->date = Carbon::parse($this->bank_transaction->date); + $expense->payment_date = Carbon::parse($this->bank_transaction->date); + $expense->transaction_reference = $this->bank_transaction->description; + $expense->transaction_id = $this->bank_transaction->id; + $expense->vendor_id = $this->bank_transaction->vendor_id; + $expense->invoice_documents = $this->bank_transaction->company->invoice_expense_documents; + $expense->should_be_invoiced = $this->bank_transaction->company->mark_expenses_invoiceable; + $expense->save(); + + $this->bank_transaction->expense_id = $expense->id; + $this->bank_transaction->status_id = BankTransaction::STATUS_CONVERTED; + $this->bank_transaction->save(); + + break; + + } + + } + } + + } + + } + + private function resolveCategory() + { + $category = $this->categories->firstWhere('highLevelCategoryId', $this->bank_transaction->category_id); + + $ec = ExpenseCategory::where('company_id', $this->bank_transaction->company_id)->where('bank_category_id', $this->bank_transaction->category_id)->first(); + + if($ec) + return $ec->id; + + if($category) + { + $ec = ExpenseCategoryFactory::create($this->bank_transaction->company_id, $this->bank_transaction->user_id); + $ec->bank_category_id = $this->bank_transaction->category_id; + $ec->name = $category->highLevelCategoryName; + $ec->save(); + + return $ec->id; + } + } + + private function matchNumberOperator($bt_value, $rule_value, $operator) :bool + { + + return match ($operator) { + '>' => floatval($bt_value) > floatval($rule_value), + '>=' => floatval($bt_value) >= floatval($rule_value), + '=' => floatval($bt_value) == floatval($rule_value), + '<' => floatval($bt_value) < floatval($rule_value), + '<=' => floatval($bt_value) <= floatval($rule_value), + default => false, + }; + + } + + private function matchStringOperator($bt_value, $rule_value, $operator) :bool + { + $bt_value = strtolower(str_replace(" ", "", $bt_value)); + $rule_value = strtolower(str_replace(" ", "", $rule_value)); + $rule_length = iconv_strlen($rule_value); + +nlog($bt_value); +nlog($rule_value); +nlog($rule_length); +nlog($operator); + + return match ($operator) { + 'is' => $bt_value == $rule_value, + 'contains' => str_contains($bt_value, $rule_value), + 'starts_with' => substr($bt_value, 0, $rule_length) == $rule_value, + 'is_empty' => empty($bt_value), + default => false, + }; + + } + + + + +} \ No newline at end of file diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php new file mode 100644 index 000000000000..8981bc0bf0ce --- /dev/null +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -0,0 +1,88 @@ +makeTestData(); + + $this->withoutMiddleware( + ThrottleRequests::class + ); + } + + public function testMatchingBankTransactionExpense() + { + // $this->expense->public_notes = "WaLLaBy"; + // $this->expense->save(); + + // $this->assertEquals('WaLLaBy', $this->expense->public_notes); + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'is', + 'value' => 'wallaby', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'WallABy', + 'base_type' => 'DEBIT', + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + +} \ No newline at end of file From b2dee8dd35dc44dbf80509225e1ae2f04532ebdb Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 14:19:35 +1100 Subject: [PATCH 13/51] Tests for rules --- app/Services/Bank/ProcessBankRules.php | 14 +- .../Feature/Bank/BankTransactionRuleTest.php | 272 +++++++++++++++++- 2 files changed, 271 insertions(+), 15 deletions(-) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index 3bfef47086a2..ef21459245ee 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -43,6 +43,7 @@ class ProcessBankRules extends AbstractService private function matchCredit() { + $this->credit_rules = $this->bank_transaction->company->credit_rules(); $this->invoices = Invoice::where('company_id', $this->bank_transaction->company_id) @@ -52,7 +53,7 @@ class ProcessBankRules extends AbstractService $invoice = $this->invoices->first(function ($value, $key){ - return str_contains($this->bank_transaction, $value->number); + return str_contains($this->bank_transaction->description, $value->number); }); @@ -88,10 +89,6 @@ class ProcessBankRules extends AbstractService { $rule_count = count($bank_transaction_rule['rules']); - -nlog($rule_count); -nlog($rule); - if($rule['search_key'] == 'description') { nlog("searching key"); @@ -193,14 +190,9 @@ nlog($rule); $rule_value = strtolower(str_replace(" ", "", $rule_value)); $rule_length = iconv_strlen($rule_value); -nlog($bt_value); -nlog($rule_value); -nlog($rule_length); -nlog($operator); - return match ($operator) { 'is' => $bt_value == $rule_value, - 'contains' => str_contains($bt_value, $rule_value), + 'contains' => stripos($bt_value, $rule_value) !== false, 'starts_with' => substr($bt_value, 0, $rule_length) == $rule_value, 'is_empty' => empty($bt_value), default => false, diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index 8981bc0bf0ce..21567187604e 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -39,12 +39,227 @@ class BankTransactionRuleTest extends TestCase ); } + + public function testMatchingBankTransactionExpenseStartsWithMiss() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'starts_with', + 'value' => 'chesst', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'ChESSSty coughs are terrible', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNull($bt->expense_id); + } + + + + public function testMatchingBankTransactionExpenseStartsWith() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'starts_with', + 'value' => 'chess', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'ChESSSty coughs are terrible', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + + public function testMatchingBankTransactionExpenseContainsMiss() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'contains', + 'value' => 'asdddfd', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'Something asd bizarre', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNull($bt->expense_id); + } + + + public function testMatchingBankTransactionExpenseContains() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'contains', + 'value' => 'asd', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'Something asd bizarre', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + public function testMatchingBankTransactionExpenseMiss() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'is', + 'value' => 'wallaby', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'Wall', + 'base_type' => 'DEBIT', + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNull($bt->expense_id); + } + public function testMatchingBankTransactionExpense() { - // $this->expense->public_notes = "WaLLaBy"; - // $this->expense->save(); - - // $this->assertEquals('WaLLaBy', $this->expense->public_notes); $br = BankTransactionRule::factory()->create([ 'company_id' => $this->company->id, @@ -85,4 +300,53 @@ class BankTransactionRuleTest extends TestCase $this->assertNotNull($bt->expense_id); } + + public function testMatchingBankTransactionInvoice() + { + + $this->invoice->number = "MUHMUH"; + $this->invoice->save(); + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'CREDIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'is', + 'value' => 'MUHMUH', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'MUHMUH', + 'base_type' => 'CREDIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertEquals(BankTransaction::STATUS_MATCHED, $bt->status_id); + } + + + } \ No newline at end of file From 054be4a8acc30e743dd5a344a0711d9fa77ad7c5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 14:21:35 +1100 Subject: [PATCH 14/51] Transaction rules tests --- .../Feature/Bank/BankTransactionRuleTest.php | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index 21567187604e..8ac6354eb58f 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -40,6 +40,96 @@ class BankTransactionRuleTest extends TestCase } + + + + public function testMatchingBankTransactionExpenseIsEmpty() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'is_empty', + 'value' => '', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + public function testMatchingBankTransactionExpenseIsEmptyMiss() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'is_empty', + 'value' => '', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'asdadsa', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNull($bt->expense_id); + } + + public function testMatchingBankTransactionExpenseStartsWithMiss() { From 4c72663940f5e109c3b5be96925de433f1fed63e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 14:31:30 +1100 Subject: [PATCH 15/51] Bank Transaction rule tests --- app/Services/Bank/ProcessBankRules.php | 4 +- .../Feature/Bank/BankTransactionRuleTest.php | 214 ++++++++++++++++++ 2 files changed, 215 insertions(+), 3 deletions(-) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index ef21459245ee..bb7591c53a05 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -91,10 +91,8 @@ class ProcessBankRules extends AbstractService if($rule['search_key'] == 'description') { - nlog("searching key"); if($this->matchStringOperator($this->bank_transaction->description, $rule['value'], $rule['operator'])){ - nlog("found key"); $matches++; } @@ -103,7 +101,7 @@ class ProcessBankRules extends AbstractService if($rule['search_key'] == 'amount') { - if($this->matchNumberOperator($this->bank_transaction->description, 'amount', $rule['operator'])){ + if($this->matchNumberOperator($this->bank_transaction->amount, $rule['value'] , $rule['operator'])){ $matches++; } diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index 8ac6354eb58f..f00cecbd20ee 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -39,9 +39,223 @@ class BankTransactionRuleTest extends TestCase ); } + public function testMatchingBankTransactionExpenseAmountLessThanEqualTo() + { + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '<=', + 'value' => 100, + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + + public function testMatchingBankTransactionExpenseAmountLessThan() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '<', + 'value' => 100, + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 99 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + public function testMatchingBankTransactionExpenseAmountGreaterThan() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '>', + 'value' => 100, + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 101 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + + + public function testMatchingBankTransactionExpenseAmountMiss() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '=', + 'value' => 100, + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 101 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNull($bt->expense_id); + } + + public function testMatchingBankTransactionExpenseAmount() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '=', + 'value' => 100, + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => '', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + } + public function testMatchingBankTransactionExpenseIsEmpty() { From d046989e84b08f2438f41cb73011d346ece58339 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 20 Nov 2022 17:00:22 +1100 Subject: [PATCH 16/51] Minor fixes for bank services, executing matching after imports --- app/Import/Providers/Csv.php | 3 +++ app/Services/Bank/BankMatchingService.php | 12 ++---------- app/Services/Bank/BankService.php | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/Import/Providers/Csv.php b/app/Import/Providers/Csv.php index ca100364f29f..ecc1f15dce7e 100644 --- a/app/Import/Providers/Csv.php +++ b/app/Import/Providers/Csv.php @@ -46,6 +46,7 @@ use App\Repositories\PaymentRepository; use App\Repositories\ProductRepository; use App\Repositories\QuoteRepository; use App\Repositories\VendorRepository; +use App\Services\Bank\BankMatchingService; use App\Utils\Traits\MakesHash; use Illuminate\Support\Facades\Validator; use Symfony\Component\HttpFoundation\ParameterBag; @@ -107,6 +108,8 @@ class Csv extends BaseImport implements ImportInterface $bank_transaction_count = $this->ingest($data, $entity_type); $this->entity_count['bank_transactions'] = $bank_transaction_count; + BankMatchingService::dispatchSync($this->company->id, $this->company->db); + } public function client() diff --git a/app/Services/Bank/BankMatchingService.php b/app/Services/Bank/BankMatchingService.php index bd95296d4fa0..4cdb3415c6af 100644 --- a/app/Services/Bank/BankMatchingService.php +++ b/app/Services/Bank/BankMatchingService.php @@ -33,21 +33,13 @@ class BankMatchingService implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, GeneratesCounter; - private $company_id; - private Company $company; - private $db; - private $invoices; public $deleteWhenMissingModels = true; - public function __construct($company_id, $db) - { - $this->company_id = $company_id; - $this->db = $db; - } + public function __construct(private int $company_id, private string $db){} public function handle() { @@ -77,6 +69,6 @@ class BankMatchingService implements ShouldQueue public function middleware() { - return [new WithoutOverlapping($this->company->company_key)]; + return [new WithoutOverlapping($this->company_id)]; } } diff --git a/app/Services/Bank/BankService.php b/app/Services/Bank/BankService.php index 5ff37a1ab6b1..3cb00fdb282c 100644 --- a/app/Services/Bank/BankService.php +++ b/app/Services/Bank/BankService.php @@ -13,7 +13,7 @@ namespace App\Services\Bank; use App\Models\BankTransaction; use App\Models\Invoice; -use App\Services\Bank\ProcessBankRule; +use App\Services\Bank\ProcessBankRules; class BankService { From 4b4e023cb345482fae765fef077cf5a9218a4d6d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 21 Nov 2022 21:49:33 +1100 Subject: [PATCH 17/51] Add rules to company transformer --- app/Models/Company.php | 5 +++++ app/Transformers/CompanyTransformer.php | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/Models/Company.php b/app/Models/Company.php index 641add772796..bb705a82841d 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -189,6 +189,11 @@ class Company extends BaseModel return $this->hasMany(BankTransaction::class); } + public function bank_transaction_rules() + { + return $this->hasMany(BankTransactionRule::class); + } + public function getCompanyIdAttribute() { return $this->encodePrimaryKey($this->id); diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 45ef466f87d2..a38aaed32194 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -43,6 +43,7 @@ use App\Models\TaxRate; use App\Models\User; use App\Models\Webhook; use App\Transformers\BankIntegrationTransformer; +use App\Transformers\BankTransactionRuleTransformer; use App\Transformers\BankTransactionTransformer; use App\Transformers\PurchaseOrderTransformer; use App\Transformers\RecurringExpenseTransformer; @@ -104,6 +105,7 @@ class CompanyTransformer extends EntityTransformer 'purchase_orders', 'bank_integrations', 'bank_transactions', + 'bank_transaction_rules', ]; /** @@ -231,6 +233,14 @@ class CompanyTransformer extends EntityTransformer return $this->includeCollection($company->bank_transactions, $transformer, BankTransaction::class); } + + public function includeBankTransactionRules(Company $company) + { + $transformer = new BankTransactionRuleTransformer($this->serializer); + + return $this->includeCollection($company->bank_transaction_rules, $transformer, BankTransactionRule::class); + } + public function includeBankIntegrations(Company $company) { $transformer = new BankIntegrationTransformer($this->serializer); From b3fefb3ac8ae27607cc00ef18f54f5f587c052b5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Nov 2022 07:10:17 +1100 Subject: [PATCH 18/51] Minor fixes for validation rules --- .../UpdateBankTransactionRuleRequest.php | 2 +- .../Feature/Bank/BankTransactionRuleTest.php | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index d198a3892eae..d5f7baa327a7 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -40,7 +40,7 @@ class UpdateBankTransactionRuleRequest extends Request ]; if(isset($this->category_id)) - $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; if(isset($this->vendor_id)) $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index f00cecbd20ee..a11b44b96e92 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -39,6 +39,53 @@ class BankTransactionRuleTest extends TestCase ); } + public function testUpdateValidationRules() + { + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'rules' => [ + [ + 'search_key' => 'amount', + 'operator' => '<=', + 'value' => 100, + ] + ] + ]); + + + $data = [ + "applies_to" => "DEBIT", + "archived_at" => 0, + "auto_convert" => False, + "category_id" => $this->expense_category, + "is_deleted" => False, + "isChanged" => True, + "matches_on_all" => True, + "name" => "TEST 22", + "updated_at" => 1669060432, + "vendor_id" => $this->vendor->hashed_id + ]; + + + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/bank_transaction_rules/'. $br->hashed_id, $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + } + public function testMatchingBankTransactionExpenseAmountLessThanEqualTo() { From 3fa0373abb5d0a4f0969666add34dbb94ca612f7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Nov 2022 07:14:00 +1100 Subject: [PATCH 19/51] bank rule testS --- .../Feature/Bank/BankTransactionRuleTest.php | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index a11b44b96e92..bd51bdf966f5 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -19,6 +19,7 @@ use App\Models\BankTransaction; use App\Models\BankTransactionRule; use App\Models\Invoice; use Illuminate\Foundation\Testing\DatabaseTransactions; +use Illuminate\Validation\ValidationException; use Tests\MockAccountData; use Tests\TestCase; @@ -37,6 +38,8 @@ class BankTransactionRuleTest extends TestCase $this->withoutMiddleware( ThrottleRequests::class ); + + $this->withoutExceptionHandling(); } public function testUpdateValidationRules() @@ -64,7 +67,7 @@ class BankTransactionRuleTest extends TestCase "applies_to" => "DEBIT", "archived_at" => 0, "auto_convert" => False, - "category_id" => $this->expense_category, + "category_id" => $this->expense_category->hashed_id, "is_deleted" => False, "isChanged" => True, "matches_on_all" => True, @@ -73,16 +76,25 @@ class BankTransactionRuleTest extends TestCase "vendor_id" => $this->vendor->hashed_id ]; + $response = null; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/bank_transaction_rules/'. $br->hashed_id, $data); + try { + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/bank_transaction_rules/'. $br->hashed_id, $data); - $arr = $response->json(); + } catch (ValidationException $e) { + $message = json_decode($e->validator->getMessageBag(), 1); + nlog($message); + } - $response->assertStatus(200); + if($response){ + $arr = $response->json(); + + $response->assertStatus(200); + } } From 9091951f4191a623fedb39c20a6deb0794d180cf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Nov 2022 08:42:53 +1100 Subject: [PATCH 20/51] Include bank transaction rules to first load --- app/Http/Controllers/BaseController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Http/Controllers/BaseController.php b/app/Http/Controllers/BaseController.php index 56400e7e1285..068168876a04 100644 --- a/app/Http/Controllers/BaseController.php +++ b/app/Http/Controllers/BaseController.php @@ -108,6 +108,7 @@ class BaseController extends Controller 'company.system_logs', 'company.bank_integrations', 'company.bank_transactions', + 'company.bank_transaction_rules', ]; private $mini_load = [ @@ -126,6 +127,7 @@ class BaseController extends Controller 'company.expense_categories', 'company.subscriptions', 'company.bank_integrations', + 'company.bank_transaction_rules', ]; public function __construct() @@ -456,6 +458,13 @@ class BaseController extends Controller $query->where('bank_transactions.user_id', $user->id); } }, + 'company.bank_transaction_rules'=> function ($query) use ($updated_at, $user) { + $query->where('updated_at', '>=', $updated_at); + + if (! $user->isAdmin()) { + $query->where('bank_transaction_rules.user_id', $user->id); + } + }, ] ); @@ -530,6 +539,12 @@ class BaseController extends Controller $query->where('bank_integrations.user_id', $user->id); } }, + 'company.bank_transaction_rules'=> function ($query) use ($updated_at, $user) { + + if (! $user->isAdmin()) { + $query->where('bank_transaction_rules.user_id', $user->id); + } + }, ] ); From 85c0dbe0e456073072787e755c13d95a8bcba5cc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 10:01:37 +1100 Subject: [PATCH 21/51] Inovice tasks lockijng --- app/Exceptions/Handler.php | 2 +- app/Http/Requests/Task/UpdateTaskRequest.php | 12 +++ app/Models/Company.php | 1 + app/Models/Task.php | 1 + app/Transformers/CompanyTransformer.php | 1 + app/Transformers/TaskTransformer.php | 2 +- ..._11_22_215618_lock_tasks_when_invoiced.php | 41 +++++++++ lang/en/texts.php | 5 ++ tests/Feature/TaskApiTest.php | 88 ++++++++++++++++++- 9 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 9e439a815e28..95f41705f6f4 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -182,7 +182,7 @@ class Handler extends ExceptionHandler } elseif ($exception instanceof FatalThrowableError && $request->expectsJson()) { return response()->json(['message'=>'Fatal error'], 500); } elseif ($exception instanceof AuthorizationException) { - return response()->json(['message'=>'You are not authorized to view or perform this action'], 401); + return response()->json(['message'=> $exception->getMessage()], 401); } elseif ($exception instanceof TokenMismatchException) { return redirect() ->back() diff --git a/app/Http/Requests/Task/UpdateTaskRequest.php b/app/Http/Requests/Task/UpdateTaskRequest.php index 7e4babdb3f08..3b4bf5416c8a 100644 --- a/app/Http/Requests/Task/UpdateTaskRequest.php +++ b/app/Http/Requests/Task/UpdateTaskRequest.php @@ -15,6 +15,7 @@ use App\Http\Requests\Request; use App\Models\Project; use App\Utils\Traits\ChecksEntityStatus; use App\Utils\Traits\MakesHash; +use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Validation\Rule; class UpdateTaskRequest extends Request @@ -29,6 +30,10 @@ class UpdateTaskRequest extends Request */ public function authorize() : bool { + //prevent locked tasks from updating + if($this->task->invoice_lock && $this->task->invoice_id) + return false; + return auth()->user()->can('edit', $this->task); } @@ -87,4 +92,11 @@ class UpdateTaskRequest extends Request $this->replace($input); } + + + protected function failedAuthorization() + { + throw new AuthorizationException(ctrans('texts.task_update_authorization_error')); + } + } diff --git a/app/Models/Company.php b/app/Models/Company.php index d878ee575b47..181f4dcf5ac5 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -123,6 +123,7 @@ class Company extends BaseModel 'enabled_expense_tax_rates', 'invoice_task_project', 'report_include_deleted', + 'invoice_task_lock', ]; protected $hidden = [ diff --git a/app/Models/Task.php b/app/Models/Task.php index 4e463e575c88..024bba00c154 100644 --- a/app/Models/Task.php +++ b/app/Models/Task.php @@ -40,6 +40,7 @@ class Task extends BaseModel 'number', 'is_date_based', 'status_order', + 'invoice_lock' ]; protected $touches = []; diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 45ef466f87d2..1cf9975f4991 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -186,6 +186,7 @@ class CompanyTransformer extends EntityTransformer 'enabled_expense_tax_rates' => (int) $company->enabled_expense_tax_rates, 'invoice_task_project' => (bool) $company->invoice_task_project, 'report_include_deleted' => (bool) $company->report_include_deleted, + 'invoice_task_lock' => (bool) $company->invoice_task_lock, ]; } diff --git a/app/Transformers/TaskTransformer.php b/app/Transformers/TaskTransformer.php index 047d10ecc1df..ed8b2700eb40 100644 --- a/app/Transformers/TaskTransformer.php +++ b/app/Transformers/TaskTransformer.php @@ -72,7 +72,6 @@ class TaskTransformer extends EntityTransformer 'user_id' => (string) $this->encodePrimaryKey($task->user_id), 'assigned_user_id' => (string) $this->encodePrimaryKey($task->assigned_user_id), 'number' => (string) $task->number ?: '', - // 'start_time' => (int) $task->start_time, 'description' => (string) $task->description ?: '', 'duration' => (int) $task->duration ?: 0, 'rate' => (float) $task->rate ?: 0, @@ -93,6 +92,7 @@ class TaskTransformer extends EntityTransformer 'status_sort_order' => (int) $task->status_sort_order, //deprecated 5.0.34 'is_date_based' => (bool) $task->is_date_based, 'status_order' => is_null($task->status_order) ? null : (int) $task->status_order, + 'invoice_lock' => (bool) $task->invoice_lock, ]; } } diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php new file mode 100644 index 000000000000..19f7f4b594a8 --- /dev/null +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -0,0 +1,41 @@ +boolean('invoice_lock')->default(false); + }); + + Schema::table('companies', function (Blueprint $table) + { + $table->boolean('invoice_task_lock')->default(false); + }); + + Schema::table('bank_transactions', function (Blueprint $table) + { + $table->bigInteger('bank_rule_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; diff --git a/lang/en/texts.php b/lang/en/texts.php index 3817b0d65129..9807483ad6d0 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -4843,6 +4843,11 @@ $LANG = array( 'refresh_accounts' => 'Refresh Accounts', 'upgrade_to_connect_bank_account' => 'Upgrade to Enterprise to connect your bank account', 'click_here_to_connect_bank_account' => 'Click here to connect your bank account', + 'task_update_authorization_error' => 'Insufficient permissions, or task may be locked', + 'cash_vs_accrual' => 'Accrual accounting', + 'cash_vs_accrual_help' => 'Turn on for accrual reporting, turn off for cash basis reporting.', + 'expense_paid_report' => 'Expensed reporting', + 'expense_paid_report_help' => 'Turn on for reporting all expense, turn off for reporting only paid expenses', ); return $LANG; diff --git a/tests/Feature/TaskApiTest.php b/tests/Feature/TaskApiTest.php index 0a7cd00545ba..b2bb253172cf 100644 --- a/tests/Feature/TaskApiTest.php +++ b/tests/Feature/TaskApiTest.php @@ -11,6 +11,7 @@ namespace Tests\Feature; +use App\Models\Task; use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Testing\DatabaseTransactions; @@ -42,6 +43,90 @@ class TaskApiTest extends TestCase Model::reguard(); } + + public function testTaskLockingGate() + { + $data = [ + 'timelog' => [[1,2],[3,4]], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks', $data); + + $arr = $response->json(); + $response->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/tasks/' . $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $task = Task::find($this->decodePrimaryKey($arr['data']['id'])); + $task->invoice_id = $this->invoice->id; + $task->save(); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/tasks/' . $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $task = Task::find($this->decodePrimaryKey($arr['data']['id'])); + $task->invoice_lock =true; + $task->invoice_id = $this->invoice->id; + $task->save(); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/tasks/' . $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(401); + + } + + + public function testTaskLocking() + { + $data = [ + 'timelog' => [[1,2],[3,4]], + 'invoice_lock' => true + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks', $data); + + $arr = $response->json(); + $response->assertStatus(200); + + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/tasks/' . $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + } + + + + public function testTimeLogValidation() { $data = [ @@ -75,9 +160,10 @@ class TaskApiTest extends TestCase $arr = $response->json(); $response->assertStatus(200); - } + + public function testTimeLogValidation2() { $data = [ From db3026df359127cb17840d83df36df77032ae1a4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 12:06:31 +1100 Subject: [PATCH 22/51] Translation strings for p/l reports --- lang/en/texts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lang/en/texts.php b/lang/en/texts.php index 9807483ad6d0..1bc294749e4a 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -4847,7 +4847,7 @@ $LANG = array( 'cash_vs_accrual' => 'Accrual accounting', 'cash_vs_accrual_help' => 'Turn on for accrual reporting, turn off for cash basis reporting.', 'expense_paid_report' => 'Expensed reporting', - 'expense_paid_report_help' => 'Turn on for reporting all expense, turn off for reporting only paid expenses', + 'expense_paid_report_help' => 'Turn on for reporting all expenses, turn off for reporting only paid expenses', ); return $LANG; From 15b4d17bcc8ca76b021ec6d3b83d131318f6fa58 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 12:26:52 +1100 Subject: [PATCH 23/51] enforce password protection across entire client portal if invoice passwords are required --- app/Console/Commands/DemoMode.php | 14 ++++++++++++++ app/Http/Middleware/ContactKeyLogin.php | 19 ++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 936734e8efe3..20324049db61 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -22,6 +22,8 @@ use App\Jobs\Company\CreateCompanyTaskStatuses; use App\Jobs\Ninja\CompanySizeCheck; use App\Jobs\Util\VersionCheck; use App\Models\Account; +use App\Models\BankIntegration; +use App\Models\BankTransaction; use App\Models\Client; use App\Models\ClientContact; use App\Models\Company; @@ -223,6 +225,18 @@ class DemoMode extends Command 'company_id' => $company->id, ]); + $bi = BankIntegration::factory()->create([ + 'account_id' => $account->id, + 'company_id' => $company->id, + 'user_id' => $user->id, + ]); + + BankTransaction::factory()->count(50)->create([ + 'bank_integration_id' => $bi->id, + 'user_id' => $user->id, + 'company_id' => $company->id, + ]); + $this->info('Creating '.$this->count.' clients'); for ($x = 0; $x < $this->count; $x++) { diff --git a/app/Http/Middleware/ContactKeyLogin.php b/app/Http/Middleware/ContactKeyLogin.php index 2f216de885ba..deb37428cc57 100644 --- a/app/Http/Middleware/ContactKeyLogin.php +++ b/app/Http/Middleware/ContactKeyLogin.php @@ -41,6 +41,7 @@ class ContactKeyLogin $request->session()->invalidate(); } + //magic links survive for 1 hour if ($request->segment(2) && $request->segment(2) == 'magic_link' && $request->segment(3)) { $payload = Cache::get($request->segment(3)); @@ -66,7 +67,11 @@ class ContactKeyLogin } } elseif ($request->segment(3) && config('ninja.db.multi_db_enabled')) { if (MultiDB::findAndSetDbByContactKey($request->segment(3))) { - if ($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()) { + if ($client_contact = ClientContact::with('company')->where('contact_key', $request->segment(3))->first()) { + + if($client_contact->company->settings->enable_client_portal_password) + return redirect()->route('client.login', ['company_key' => $client_contact->company->company_key]); + if (empty($client_contact->email)) { $client_contact->email = Str::random(6).'@example.com'; } @@ -82,7 +87,11 @@ class ContactKeyLogin } } } elseif ($request->segment(2) && $request->segment(2) == 'key_login' && $request->segment(3)) { - if ($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()) { + if ($client_contact = ClientContact::with('company')->where('contact_key', $request->segment(3))->first()) { + + if($client_contact->company->settings->enable_client_portal_password) + return redirect()->route('client.login', ['company_key' => $client_contact->company->company_key]); + if (empty($client_contact->email)) { $client_contact->email = Str::random(6).'@example.com'; $client_contact->save(); @@ -125,7 +134,11 @@ class ContactKeyLogin return redirect($this->setRedirectPath()); } } elseif ($request->segment(3)) { - if ($client_contact = ClientContact::where('contact_key', $request->segment(3))->first()) { + if ($client_contact = ClientContact::with('company')->where('contact_key', $request->segment(3))->first()) { + + if($client_contact->company->settings->enable_client_portal_password) + return redirect()->route('client.login', ['company_key' => $client_contact->company->company_key]); + if (empty($client_contact->email)) { $client_contact->email = Str::random(6).'@example.com'; $client_contact->save(); From 161b6a6466a623f2428e421b87e3f768a8ce4c0c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 12:37:39 +1100 Subject: [PATCH 24/51] Allow bulk email with selecting a template --- app/Http/Controllers/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 7a9a199a84e0..a322fce1a566 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -777,7 +777,7 @@ class InvoiceController extends BaseController case 'email': //check query parameter for email_type and set the template else use calculateTemplate - if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) { + if (request()->has('email_type') && in_array(request()->input('email_type'), ['reminder1', 'reminder2', 'reminder3', 'reminder_endless', 'custom1', 'custom2', 'custom3'])) { $this->reminder_template = $invoice->client->getSetting(request()->input('email_type')); } else { $this->reminder_template = $invoice->calculateTemplate('invoice'); From 9809b4ff670d980a7e4fb7e2c89aec817423c6a9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 12:47:15 +1100 Subject: [PATCH 25/51] Stubs for project-header CSS class --- resources/views/pdf-designs/plain.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/views/pdf-designs/plain.html b/resources/views/pdf-designs/plain.html index a1f2906f6aff..5075e7f3f646 100644 --- a/resources/views/pdf-designs/plain.html +++ b/resources/views/pdf-designs/plain.html @@ -249,6 +249,16 @@ opacity: 0.2; z-index:200 !important; position: fixed; + } + + .project-header { + font-size: 1.5em; + margin-top: 0.1em; + margin-bottom: 0.1em; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; } /** Useful snippets, uncomment to enable. **/ From 5223757c5256458460c50cc2a145b7bacf0bc2b0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 12:57:03 +1100 Subject: [PATCH 26/51] Add bank rule_id to bank transactions --- app/Services/Bank/ProcessBankRules.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index bb7591c53a05..686ee2cb0dde 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -68,6 +68,7 @@ class ProcessBankRules extends AbstractService //stub for credit rules foreach($this->credit_rules as $rule) { + // $this->bank_transaction->bank_rule_id = $bank_transaction_rule->id; } @@ -114,6 +115,7 @@ class ProcessBankRules extends AbstractService $this->bank_transaction->vendor_id = empty($rule['vendor_id']) ? null : $rule['vendor_id']; $this->bank_transaction->ninja_category_id = empty($rule['category_id']) ? null : $rule['category_id']; $this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED; + $this->bank_transaction->bank_rule_id = $bank_transaction_rule->id; $this->bank_transaction->save(); if($bank_transaction_rule['auto_convert']) From 7727b90cd57de113c7cdd4f894a52cbc4addcb9d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 13:02:41 +1100 Subject: [PATCH 27/51] Allow auto billing as a bulk action --- app/Http/Controllers/InvoiceController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index a322fce1a566..723cf5978ae7 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -28,6 +28,7 @@ use App\Http\Requests\Invoice\StoreInvoiceRequest; use App\Http\Requests\Invoice\UpdateInvoiceRequest; use App\Http\Requests\Invoice\UpdateReminderRequest; use App\Http\Requests\Invoice\UploadInvoiceRequest; +use App\Jobs\Cron\AutoBill; use App\Jobs\Entity\EmailEntity; use App\Jobs\Invoice\BulkInvoiceJob; use App\Jobs\Invoice\StoreInvoice; @@ -696,11 +697,14 @@ class InvoiceController extends BaseController { /*If we are using bulk actions, we don't want to return anything */ switch ($action) { + case 'auto_bill': + $invoice = AutoBill::dispatch($invoice->id, $invoice->company->db); + return $this->itemResponse($invoice); + case 'clone_to_invoice': $invoice = CloneInvoiceFactory::create($invoice, auth()->user()->id); - return $this->itemResponse($invoice); - break; + case 'clone_to_quote': $quote = CloneInvoiceToQuoteFactory::create($invoice, auth()->user()->id); From 82ec5a655b83ac5810194055be6c7fdfaa7f175b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 13:12:35 +1100 Subject: [PATCH 28/51] Expand functionality of Subscription by implementing Optional Products --- app/Models/Subscription.php | 3 +++ app/Transformers/BankTransactionTransformer.php | 1 + .../2022_11_22_215618_lock_tasks_when_invoiced.php | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 6bac62e44341..41ac945b2866 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -54,6 +54,9 @@ class Subscription extends BaseModel 'price', 'name', 'currency_id', + 'registration_required', + 'optional_product_ids', + 'optional_recurring_product_ids', ]; protected $casts = [ diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index ccd0de45687a..f633e050e8cd 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -67,6 +67,7 @@ class BankTransactionTransformer extends EntityTransformer 'invoice_ids' => (string) $bank_transaction->invoice_ids ?: '', 'expense_id'=> (string) $this->encodePrimaryKey($bank_transaction->expense_id) ?: '', 'vendor_id'=> (string) $this->encodePrimaryKey($bank_transaction->vendor_id) ?: '', + 'bank_rule_id' => (string) $this->encodePrimaryKey($bank_transaction->bank_rule_id) ?: '', 'is_deleted' => (bool) $bank_transaction->is_deleted, 'created_at' => (int) $bank_transaction->created_at, 'updated_at' => (int) $bank_transaction->updated_at, diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 19f7f4b594a8..52dea5fad0bc 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -27,6 +27,15 @@ return new class extends Migration { $table->bigInteger('bank_rule_id')->nullable(); }); + + Schema::table('subscriptions', function (Blueprint $table) + { + $table->boolean('registration_required')->default(false); + $table->text('optional_product_ids')->nullable(); + $table->text('optional_recurring_product_ids')->nullable(); + + }); + } /** From d2ea53b0a46c2aa14fbd8a318b70360fa1cc772b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 17:27:43 +1100 Subject: [PATCH 29/51] Subscriptions v2 --- .../SubscriptionPurchaseController.php | 22 + app/Http/Livewire/BillingPortalPurchasev2.php | 528 ++++++++++++++++++ .../Requests/Twilio/GenerateSmsRequest.php | 2 +- package-lock.json | 17 + package.json | 1 + public/css/app.css | 2 +- public/js/app.js | 2 +- public/js/setup/setup.js | 2 +- public/mix-manifest.json | 6 +- .../views/billing-portal/purchasev2.blade.php | 17 + .../billing-portal-purchasev2.blade.php | 43 ++ routes/client.php | 2 + 12 files changed, 637 insertions(+), 7 deletions(-) create mode 100644 app/Http/Livewire/BillingPortalPurchasev2.php create mode 100644 resources/views/billing-portal/purchasev2.blade.php create mode 100644 resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php diff --git a/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php b/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php index 09825123d32a..fb569df26c3d 100644 --- a/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php +++ b/app/Http/Controllers/ClientPortal/SubscriptionPurchaseController.php @@ -41,6 +41,25 @@ class SubscriptionPurchaseController extends Controller ]); } + public function upgrade(Subscription $subscription, Request $request) + { + /* Make sure the contact is logged into the correct company for this subscription */ + if (auth()->guard('contact')->user() && auth()->guard('contact')->user()->company_id != $subscription->company_id) { + auth()->guard('contact')->logout(); + $request->session()->invalidate(); + } + + if ($request->has('locale')) { + $this->setLocale($request->query('locale')); + } + + return view('billing-portal.purchasev2', [ + 'subscription' => $subscription, + 'hash' => Str::uuid()->toString(), + 'request_data' => $request->all(), + ]); + } + /** * Set locale for incoming request. * @@ -56,4 +75,7 @@ class SubscriptionPurchaseController extends Controller App::setLocale($record->locale); } } + + + } diff --git a/app/Http/Livewire/BillingPortalPurchasev2.php b/app/Http/Livewire/BillingPortalPurchasev2.php new file mode 100644 index 000000000000..9d062007fe10 --- /dev/null +++ b/app/Http/Livewire/BillingPortalPurchasev2.php @@ -0,0 +1,528 @@ + ['required', 'email'], + ]; + + /** + * Id for CompanyGateway record. + * + * @var string|integer + */ + public $company_gateway_id; + + /** + * Id for GatewayType. + * + * @var string|integer + */ + public $payment_method_id; + + private $user_coupon; + + /** + * List of steps that frontend form follows. + * + * @var array + */ + public $steps = [ + 'passed_email' => false, + 'existing_user' => false, + 'fetched_payment_methods' => false, + 'fetched_client' => false, + 'show_start_trial' => false, + 'passwordless_login_sent' => false, + 'started_payment' => false, + 'discount_applied' => false, + 'show_loading_bar' => false, + 'not_eligible' => null, + 'not_eligible_message' => null, + 'payment_required' => true, + ]; + + /** + * List of payment methods fetched from client. + * + * @var array + */ + public $methods = []; + + /** + * Instance of \App\Models\Invoice + * + * @var Invoice + */ + public $invoice; + + /** + * Coupon model for user input + * + * @var string + */ + public $coupon; + + /** + * Quantity for seats + * + * @var int + */ + public $quantity; + + /** + * First-hit request data (queries, locales...). + * + * @var array + */ + public $request_data; + + /** + * @var string + */ + public $price; + + /** + * Disabled state of passwordless login button. + * + * @var bool + */ + public $passwordless_login_btn = false; + + /** + * Instance of company. + * + * @var Company + */ + public $company; + + /** + * Campaign reference. + * + * @var string|null + */ + public $campaign; + + public function mount() + { + MultiDB::setDb($this->company->db); + + $this->quantity = 1; + + $this->price = $this->subscription->price; + + if (request()->query('coupon')) { + $this->coupon = request()->query('coupon'); + $this->handleCoupon(); + } + elseif(strlen($this->subscription->promo_code) == 0 && $this->subscription->promo_discount > 0){ + $this->price = $this->subscription->promo_price; + } + } + + /** + * Handle user authentication + * + * @return $this|bool|void + */ + public function authenticate() + { + $this->validate(); + + $contact = ClientContact::where('email', $this->email) + ->where('company_id', $this->subscription->company_id) + ->first(); + + if ($contact && $this->steps['existing_user'] === false) { + return $this->steps['existing_user'] = true; + } + + if ($contact && $this->steps['existing_user']) { + $attempt = Auth::guard('contact')->attempt(['email' => $this->email, 'password' => $this->password, 'company_id' => $this->subscription->company_id]); + + return $attempt + ? $this->getPaymentMethods($contact) + : session()->flash('message', 'These credentials do not match our records.'); + } + + $this->steps['existing_user'] = false; + + $contact = $this->createBlankClient(); + + if ($contact && $contact instanceof ClientContact) { + $this->getPaymentMethods($contact); + } + } + + /** + * Create a blank client. Used for new customers purchasing. + * + * @return mixed + * @throws \Laracasts\Presenter\Exceptions\PresenterException + */ + protected function createBlankClient() + { + $company = $this->subscription->company; + $user = $this->subscription->user; + $user->setCompany($company); + + $client_repo = new ClientRepository(new ClientContactRepository()); + + $data = [ + 'name' => '', + 'contacts' => [ + ['email' => $this->email], + ], + 'client_hash' => Str::random(40), + 'settings' => ClientSettings::defaults(), + ]; + + foreach ($this->request_data as $field => $value) { + if (in_array($field, Client::$subscriptions_fillable)) { + $data[$field] = $value; + } + + if (in_array($field, ClientContact::$subscription_fillable)) { + $data['contacts'][0][$field] = $value; + } + } + +// nlog($this->subscription->group_settings->settings); +// nlog($this->subscription->group_settings->settings->currency_id); + + if(array_key_exists('currency_id', $this->request_data)) { + + $currency = Cache::get('currencies')->filter(function ($item){ + return $item->id == $this->request_data['currency_id']; + })->first(); + + if($currency) + $data['settings']->currency_id = $currency->id; + + } + elseif($this->subscription->group_settings && property_exists($this->subscription->group_settings->settings, 'currency_id')) { + + $currency = Cache::get('currencies')->filter(function ($item){ + return $item->id == $this->subscription->group_settings->settings->currency_id; + })->first(); + + if($currency) + $data['settings']->currency_id = $currency->id; + + } + + if (array_key_exists('locale', $this->request_data)) { + $request = $this->request_data; + + $record = Cache::get('languages')->filter(function ($item) use ($request) { + return $item->locale == $request['locale']; + })->first(); + + if ($record) { + $data['settings']['language_id'] = (string)$record->id; + } + } + + $client = $client_repo->save($data, ClientFactory::create($company->id, $user->id)); + + return $client->fresh()->contacts->first(); + } + + /** + * Fetching payment methods from the client. + * + * @param ClientContact $contact + * @return $this + */ + protected function getPaymentMethods(ClientContact $contact): self + { + Auth::guard('contact')->loginUsingId($contact->id, true); + + $this->contact = $contact; + + if ($this->subscription->trial_enabled) { + $this->heading_text = ctrans('texts.plan_trial'); + $this->steps['show_start_trial'] = true; + + return $this; + } + + if ((int)$this->price == 0) + $this->steps['payment_required'] = false; + else + $this->steps['fetched_payment_methods'] = true; + + $this->methods = $contact->client->service()->getPaymentMethods($this->price); + + $this->heading_text = ctrans('texts.payment_methods'); + + return $this; + } + + /** + * Middle method between selecting payment method & + * submitting the from to the backend. + * + * @param $company_gateway_id + * @param $gateway_type_id + */ + public function handleMethodSelectingEvent($company_gateway_id, $gateway_type_id) + { + $this->company_gateway_id = $company_gateway_id; + $this->payment_method_id = $gateway_type_id; + + $this->handleBeforePaymentEvents(); + } + + /** + * Method to handle events before payments. + * + * @return void + */ + public function handleBeforePaymentEvents() + { + $this->steps['started_payment'] = true; + $this->steps['show_loading_bar'] = true; + + $data = [ + 'client_id' => $this->contact->client->id, + 'date' => now()->format('Y-m-d'), + 'invitations' => [[ + 'key' => '', + 'client_contact_id' => $this->contact->hashed_id, + ]], + 'user_input_promo_code' => $this->coupon, + 'coupon' => empty($this->subscription->promo_code) ? '' : $this->coupon, + 'quantity' => $this->quantity, + ]; + + $is_eligible = $this->subscription->service()->isEligible($this->contact); + + if (is_array($is_eligible) && $is_eligible['message'] != 'Success') { + $this->steps['not_eligible'] = true; + $this->steps['not_eligible_message'] = $is_eligible['message']; + $this->steps['show_loading_bar'] = false; + + return; + } + + $this->invoice = $this->subscription + ->service() + ->createInvoice($data, $this->quantity) + ->service() + ->markSent() + ->fillDefaults() + ->adjustInventory() + ->save(); + + Cache::put($this->hash, [ + 'subscription_id' => $this->subscription->id, + 'email' => $this->email ?? $this->contact->email, + 'client_id' => $this->contact->client->id, + 'invoice_id' => $this->invoice->id, + 'context' => 'purchase', + 'campaign' => $this->campaign, + ], now()->addMinutes(60)); + + $this->emit('beforePaymentEventsCompleted'); + } + + /** + * Proxy method for starting the trial. + * + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector + */ + public function handleTrial() + { + return $this->subscription->service()->startTrial([ + 'email' => $this->email ?? $this->contact->email, + 'quantity' => $this->quantity, + 'contact_id' => $this->contact->id, + 'client_id' => $this->contact->client->id, + ]); + } + + public function handlePaymentNotRequired() + { + + $is_eligible = $this->subscription->service()->isEligible($this->contact); + + if ($is_eligible['status_code'] != 200) { + $this->steps['not_eligible'] = true; + $this->steps['not_eligible_message'] = $is_eligible['message']; + $this->steps['show_loading_bar'] = false; + + return; + } + + + return $this->subscription->service()->handleNoPaymentRequired([ + 'email' => $this->email ?? $this->contact->email, + 'quantity' => $this->quantity, + 'contact_id' => $this->contact->id, + 'client_id' => $this->contact->client->id, + 'coupon' => $this->coupon, + ]); + } + + /** + * Update quantity property. + * + * @param string $option + * @return int + */ + public function updateQuantity(string $option): int + { + $this->handleCoupon(); + + if ($this->quantity == 1 && $option == 'decrement') { + $this->price = $this->price * 1; + return $this->quantity; + } + + if ($this->quantity > $this->subscription->max_seats_limit && $option == 'increment') { + $this->price = $this->price * $this->subscription->max_seats_limit; + return $this->quantity; + } + + if ($option == 'increment') { + $this->quantity++; + $this->price = $this->price * $this->quantity; + return $this->quantity; + } + + $this->quantity--; + $this->price = $this->price * $this->quantity; + + return $this->quantity; + } + + public function handleCoupon() + { + + if($this->steps['discount_applied']){ + $this->price = $this->subscription->promo_price; + return; + } + + if ($this->coupon == $this->subscription->promo_code) { + $this->price = $this->subscription->promo_price; + $this->quantity = 1; + $this->steps['discount_applied'] = true; + } + else + $this->price = $this->subscription->price; + } + + public function passwordlessLogin() + { + $this->passwordless_login_btn = true; + + $contact = ClientContact::query() + ->where('email', $this->email) + ->where('company_id', $this->subscription->company_id) + ->first(); + + $mailer = new NinjaMailerObject(); + $mailer->mailable = new ContactPasswordlessLogin($this->email, $this->subscription->company, (string)route('client.subscription.purchase', $this->subscription->hashed_id) . '?coupon=' . $this->coupon); + $mailer->company = $this->subscription->company; + $mailer->settings = $this->subscription->company->settings; + $mailer->to_user = $contact; + + NinjaMailerJob::dispatch($mailer); + + $this->steps['passwordless_login_sent'] = true; + $this->passwordless_login_btn = false; + } + + public function render() + { + if (array_key_exists('email', $this->request_data)) { + $this->email = $this->request_data['email']; + } + + if ($this->contact instanceof ClientContact) { + $this->getPaymentMethods($this->contact); + } + + return render('components.livewire.billing-portal-purchasev2'); + } +} diff --git a/app/Http/Requests/Twilio/GenerateSmsRequest.php b/app/Http/Requests/Twilio/GenerateSmsRequest.php index c22580dcf46f..9c25ec18ef3f 100644 --- a/app/Http/Requests/Twilio/GenerateSmsRequest.php +++ b/app/Http/Requests/Twilio/GenerateSmsRequest.php @@ -24,7 +24,7 @@ class GenerateSmsRequest extends Request */ public function authorize() : bool { - return auth()->user()->isAdmin(); + return auth()->user(); } diff --git a/package-lock.json b/package-lock.json index ed68ecd984a3..086f004eaba5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "devDependencies": { "@babel/compat-data": "7.15.0", "@babel/plugin-proposal-class-properties": "^7.14.5", + "@tailwindcss/aspect-ratio": "^0.4.2", "laravel-mix-purgecss": "^6.0.0", "vue-template-compiler": "^2.6.14" } @@ -1682,6 +1683,15 @@ "node": ">= 8" } }, + "node_modules/@tailwindcss/aspect-ratio": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/aspect-ratio/-/aspect-ratio-0.4.2.tgz", + "integrity": "sha512-8QPrypskfBa7QIMuKHg2TA7BqES6vhBrDLOv8Unb6FcFyd3TjKbc6lcmb9UPQHxfl24sXoJ41ux/H7qQQvfaSQ==", + "dev": true, + "peerDependencies": { + "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -10285,6 +10295,13 @@ "fastq": "^1.6.0" } }, + "@tailwindcss/aspect-ratio": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@tailwindcss/aspect-ratio/-/aspect-ratio-0.4.2.tgz", + "integrity": "sha512-8QPrypskfBa7QIMuKHg2TA7BqES6vhBrDLOv8Unb6FcFyd3TjKbc6lcmb9UPQHxfl24sXoJ41ux/H7qQQvfaSQ==", + "dev": true, + "requires": {} + }, "@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", diff --git a/package.json b/package.json index 46d65f0dde42..08940ee09ca1 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "devDependencies": { "@babel/compat-data": "7.15.0", "@babel/plugin-proposal-class-properties": "^7.14.5", + "@tailwindcss/aspect-ratio": "^0.4.2", "laravel-mix-purgecss": "^6.0.0", "vue-template-compiler": "^2.6.14" }, diff --git a/public/css/app.css b/public/css/app.css index fc07d0cd28b1..d147eaf14d96 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1,3 +1,3 @@ /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*/ -/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:Open Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.button{border-radius:.25rem;font-size:.875rem;line-height:1.25rem;line-height:1rem;padding:.75rem 1rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:disabled{cursor:not-allowed;opacity:.5}.button-primary{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-primary:hover{font-weight:600}.button-block{display:block;width:100%}.button-danger{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity));color:rgba(255,255,255,var(--tw-text-opacity))}.button-danger:hover{--tw-bg-opacity:1;background-color:rgba(220,38,38,var(--tw-bg-opacity))}.button-secondary{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.button-secondary:hover{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.button-link{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.button-link:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity));text-decoration:underline}.button-link:focus{outline:2px solid transparent;outline-offset:2px;text-decoration:underline}.validation{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-left-width:2px;margin-bottom:.25rem;margin-top:.5rem;padding:.25rem .75rem}.validation-fail{border-color:rgba(239,68,68,var(--tw-border-opacity))}.validation-fail,.validation-pass{--tw-border-opacity:1;--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.validation-pass{border-color:rgba(16,185,129,var(--tw-border-opacity))}.input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.input:focus{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity));outline:2px solid transparent;outline-offset:2px}.input-label{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.input-slim{padding-bottom:.5rem;padding-top:.5rem}.form-checkbox{border-radius:.25rem;cursor:pointer}.form-checkbox,.form-select{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity));border-width:1px}.alert{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-color:rgba(156,163,175,var(--tw-border-opacity));border-left-width:2px;font-size:.875rem;line-height:1.25rem;margin-bottom:.25rem;margin-top:1rem;padding:.75rem 1rem}.alert-success{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.alert-failure{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.badge{align-items:center;border-radius:9999px;display:inline-flex;font-size:.75rem;font-weight:500;line-height:1rem;padding:.125rem .625rem}.badge-light{background-color:rgba(243,244,246,var(--tw-bg-opacity));color:rgba(31,41,55,var(--tw-text-opacity))}.badge-light,.badge-primary{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-primary{background-color:rgba(191,219,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}.badge-danger{background-color:rgba(254,226,226,var(--tw-bg-opacity));color:rgba(239,68,68,var(--tw-text-opacity))}.badge-danger,.badge-success{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-success{background-color:rgba(209,250,229,var(--tw-bg-opacity));color:rgba(16,185,129,var(--tw-text-opacity))}.badge-secondary{background-color:rgba(31,41,55,var(--tw-bg-opacity));color:rgba(229,231,235,var(--tw-text-opacity))}.badge-secondary,.badge-warning{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-warning{background-color:rgba(254,243,199,var(--tw-bg-opacity));color:rgba(217,119,6,var(--tw-text-opacity))}.badge-info{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}@media (min-width:640px){.dataTables_length{margin-bottom:1.25rem!important;margin-top:1.25rem!important}}@media (min-width:1024px){.dataTables_length{margin-bottom:1rem!important;margin-top:1rem!important}}.dataTables_length select{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_length select:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}.dataTables_length select{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;margin-left:.5rem!important;margin-right:.5rem!important;padding:.5rem!important}.dataTables_filter{margin-bottom:1rem}.dataTables_filter input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_filter input:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}@media (min-width:1024px){.dataTables_filter{margin-top:-3rem!important}}.dataTables_paginate{padding-bottom:1.5rem!important;padding-top:.5rem!important}.dataTables_paginate .paginate_button{--tw-border-opacity:1!important;--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;border-radius:.25rem;border-radius:.25rem!important;border-width:1px!important;color:rgba(55,65,81,var(--tw-text-opacity))!important;cursor:pointer!important;font-size:.875rem;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem;line-height:1rem;line-height:1.25rem!important;line-height:1rem!important;margin-right:.25rem!important;padding:.75rem 1rem;padding-bottom:.5rem!important;padding-top:.5rem!important;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dataTables_paginate .current{--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(37,99,235,var(--tw-bg-opacity))!important;color:rgba(255,255,255,var(--tw-text-opacity))!important}.dataTables_info{font-size:.875rem!important;line-height:1.25rem!important}.dataTables_empty{padding-bottom:1rem!important;padding-top:1rem!important}.pagination{align-items:center!important;display:flex!important}.pagination .page-link{--tw-text-opacity:1!important;align-items:center!important;border-color:transparent!important;border-top-width:2px!important;color:rgba(107,114,128,var(--tw-text-opacity))!important;cursor:pointer!important;display:inline-flex!important;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem!important;margin-top:-1px!important;padding-left:1rem!important;padding-right:1rem!important;padding-top:1rem!important;transition-duration:.15s!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.pagination .page-link:hover{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;color:rgba(55,65,81,var(--tw-text-opacity))!important}.pagination .page-link:focus{--tw-border-opacity:1;--tw-text-opacity:1;border-color:rgba(156,163,175,var(--tw-border-opacity));color:rgba(55,65,81,var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.pagination .active>span{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(37,99,235,var(--tw-border-opacity))!important;color:rgba(37,99,235,var(--tw-text-opacity))!important}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{bottom:0;top:0}.inset-0,.inset-x-0{left:0;right:0}.inset-y-0{bottom:0;top:0}.top-0{top:0}.top-1{top:.25rem}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.z-0{z-index:0}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.float-right{float:right}.m-0{margin:0}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-4{margin-bottom:1rem;margin-top:1rem}.my-10{margin-bottom:2.5rem;margin-top:2.5rem}.-my-2{margin-bottom:-.5rem;margin-top:-.5rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-10{margin-top:2.5rem}.-mt-4{margin-top:-1rem}.-mt-6{margin-top:-1.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.-mr-1{margin-right:-.25rem}.-mr-14{margin-right:-3.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-1\.5{margin-bottom:.375rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.-ml-1{margin-left:-.25rem}.-ml-4{margin-left:-1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-32{height:8rem}.h-64{height:16rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-48{width:12rem}.w-56{width:14rem}.w-64{width:16rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-4\/5{width:80%}.w-5\/6{width:83.333333%}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.max-w-xs{max-width:20rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.origin-top-right{transform-origin:top right}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.-translate-x-full{--tw-translate-x:-100%}.translate-y-0{--tw-translate-y:0px}.translate-y-4{--tw-translate-y:1rem}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-100{--tw-scale-x:1;--tw-scale-y:1}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-sm{border-radius:.125rem}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0}.border-4{border-width:4px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-transparent{border-color:transparent}.border-gray-100{--tw-border-opacity:1;border-color:rgba(243,244,246,var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgba(252,165,165,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity:1;border-color:rgba(248,113,113,var(--tw-border-opacity))}.border-green-500{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.group:hover .group-hover\:border-transparent,.hover\:border-transparent:hover{border-color:transparent}.hover\:border-gray-600:hover{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.hover\:border-gray-800:hover{--tw-border-opacity:1;border-color:rgba(31,41,55,var(--tw-border-opacity))}.hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgba(37,99,235,var(--tw-border-opacity))}.focus\:border-blue-300:focus{--tw-border-opacity:1;border-color:rgba(147,197,253,var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.focus\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgba(99,102,241,var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgba(107,114,128,var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgba(239,246,255,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgba(29,78,216,var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.focus\:bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.focus\:bg-gray-600:focus{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-clip-padding{background-clip:padding-box}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-10{padding:2.5rem}.p-2\.5{padding:.625rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-10{padding-right:2.5rem}.pb-4{padding-bottom:1rem}.pb-10{padding-bottom:2.5rem}.pb-20{padding-bottom:5rem}.pl-0{padding-left:0}.pl-3{padding-left:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem}.text-lg,.text-xl{line-height:1.75rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgba(29,78,216,var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.group:hover .group-hover\:text-white,.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.hover\:text-indigo-900:hover{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.focus\:text-gray-500:focus{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.focus\:text-gray-600:focus{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.focus\:text-gray-900:focus{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.underline{text-decoration:underline}.line-through{text-decoration:line-through}.focus\:underline:focus,.hover\:underline:hover{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.opacity-100{opacity:1}.hover\:opacity-80:hover{opacity:.8}*,:after,:before{--tw-shadow:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.hover\:shadow-2xl:hover,.hover\:shadow-lg:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring:focus,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgba(0,0,0,var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(59,130,246,var(--tw-ring-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(99,102,241,var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity:0.05}.filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-linear{transition-timing-function:linear}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:640px){.sm\:inset-0{bottom:0;left:0;right:0;top:0}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-6{grid-column:span 6/span 6}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\:my-8{margin-bottom:2rem;margin-top:2rem}.sm\:mt-0{margin-top:0}.sm\:mt-4{margin-top:1rem}.sm\:mt-6{margin-top:1.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:ml-6{margin-left:1.5rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-lg{max-width:32rem}.sm\:flex-shrink-0{flex-shrink:0}.sm\:translate-y-0{--tw-translate-y:0px}.sm\:scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.sm\:scale-100{--tw-scale-x:1;--tw-scale-y:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-4{gap:1rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\:col-span-1{grid-column:span 1/span 1}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-start-2{grid-column-start:2}.md\:col-start-4{grid-column-start:4}.md\:mx-0{margin-left:0;margin-right:0}.md\:mt-0{margin-top:0}.md\:mt-5{margin-top:1.25rem}.md\:mt-10{margin-top:2.5rem}.md\:mr-2{margin-right:.5rem}.md\:-mr-1{margin-right:-.25rem}.md\:ml-2{margin-left:.5rem}.md\:ml-6{margin-left:1.5rem}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:max-w-3xl{max-width:48rem}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-6{gap:1.5rem}.md\:p-24{padding:6rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:text-left{text-align:left}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}}@media (min-width:1024px){.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-start-3{grid-column-start:3}.lg\:col-start-4{grid-column-start:4}.lg\:-mx-8{margin-left:-2rem;margin-right:-2rem}.lg\:mt-24{margin-top:6rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:h-screen{height:100vh}.lg\:w-1\/2{width:50%}.lg\:w-1\/4{width:25%}.lg\:w-1\/5{width:20%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:items-center{align-items:center}.lg\:gap-4{gap:1rem}.lg\:rounded-lg{border-radius:.5rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:px-16{padding-left:4rem;padding-right:4rem}}@media (min-width:1280px){.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-6{grid-column:span 6/span 6}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:col-start-4{grid-column-start:4}.xl\:mt-32{margin-top:8rem}.xl\:flex{display:flex}.xl\:justify-center{justify-content:center}.xl\:px-16{padding-left:4rem;padding-right:4rem}} +/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:Open Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.button{border-radius:.25rem;font-size:.875rem;line-height:1.25rem;line-height:1rem;padding:.75rem 1rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:disabled{cursor:not-allowed;opacity:.5}.button-primary{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-primary:hover{font-weight:600}.button-block{display:block;width:100%}.button-danger{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity));color:rgba(255,255,255,var(--tw-text-opacity))}.button-danger:hover{--tw-bg-opacity:1;background-color:rgba(220,38,38,var(--tw-bg-opacity))}.button-secondary{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.button-secondary:hover{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.button-link{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.button-link:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity));text-decoration:underline}.button-link:focus{outline:2px solid transparent;outline-offset:2px;text-decoration:underline}.validation{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-left-width:2px;margin-bottom:.25rem;margin-top:.5rem;padding:.25rem .75rem}.validation-fail{border-color:rgba(239,68,68,var(--tw-border-opacity))}.validation-fail,.validation-pass{--tw-border-opacity:1;--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.validation-pass{border-color:rgba(16,185,129,var(--tw-border-opacity))}.input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.input:focus{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity));outline:2px solid transparent;outline-offset:2px}.input-label{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.input-slim{padding-bottom:.5rem;padding-top:.5rem}.form-checkbox{border-radius:.25rem;cursor:pointer}.form-checkbox,.form-select{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity));border-width:1px}.alert{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-color:rgba(156,163,175,var(--tw-border-opacity));border-left-width:2px;font-size:.875rem;line-height:1.25rem;margin-bottom:.25rem;margin-top:1rem;padding:.75rem 1rem}.alert-success{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.alert-failure{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.badge{align-items:center;border-radius:9999px;display:inline-flex;font-size:.75rem;font-weight:500;line-height:1rem;padding:.125rem .625rem}.badge-light{background-color:rgba(243,244,246,var(--tw-bg-opacity));color:rgba(31,41,55,var(--tw-text-opacity))}.badge-light,.badge-primary{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-primary{background-color:rgba(191,219,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}.badge-danger{background-color:rgba(254,226,226,var(--tw-bg-opacity));color:rgba(239,68,68,var(--tw-text-opacity))}.badge-danger,.badge-success{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-success{background-color:rgba(209,250,229,var(--tw-bg-opacity));color:rgba(16,185,129,var(--tw-text-opacity))}.badge-secondary{background-color:rgba(31,41,55,var(--tw-bg-opacity));color:rgba(229,231,235,var(--tw-text-opacity))}.badge-secondary,.badge-warning{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-warning{background-color:rgba(254,243,199,var(--tw-bg-opacity));color:rgba(217,119,6,var(--tw-text-opacity))}.badge-info{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}@media (min-width:640px){.dataTables_length{margin-bottom:1.25rem!important;margin-top:1.25rem!important}}@media (min-width:1024px){.dataTables_length{margin-bottom:1rem!important;margin-top:1rem!important}}.dataTables_length select{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_length select:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}.dataTables_length select{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;margin-left:.5rem!important;margin-right:.5rem!important;padding:.5rem!important}.dataTables_filter{margin-bottom:1rem}.dataTables_filter input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_filter input:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}@media (min-width:1024px){.dataTables_filter{margin-top:-3rem!important}}.dataTables_paginate{padding-bottom:1.5rem!important;padding-top:.5rem!important}.dataTables_paginate .paginate_button{--tw-border-opacity:1!important;--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;border-radius:.25rem;border-radius:.25rem!important;border-width:1px!important;color:rgba(55,65,81,var(--tw-text-opacity))!important;cursor:pointer!important;font-size:.875rem;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem;line-height:1rem;line-height:1.25rem!important;line-height:1rem!important;margin-right:.25rem!important;padding:.75rem 1rem;padding-bottom:.5rem!important;padding-top:.5rem!important;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dataTables_paginate .current{--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(37,99,235,var(--tw-bg-opacity))!important;color:rgba(255,255,255,var(--tw-text-opacity))!important}.dataTables_info{font-size:.875rem!important;line-height:1.25rem!important}.dataTables_empty{padding-bottom:1rem!important;padding-top:1rem!important}.pagination{align-items:center!important;display:flex!important}.pagination .page-link{--tw-text-opacity:1!important;align-items:center!important;border-color:transparent!important;border-top-width:2px!important;color:rgba(107,114,128,var(--tw-text-opacity))!important;cursor:pointer!important;display:inline-flex!important;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem!important;margin-top:-1px!important;padding-left:1rem!important;padding-right:1rem!important;padding-top:1rem!important;transition-duration:.15s!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.pagination .page-link:hover{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;color:rgba(55,65,81,var(--tw-text-opacity))!important}.pagination .page-link:focus{--tw-border-opacity:1;--tw-text-opacity:1;border-color:rgba(156,163,175,var(--tw-border-opacity));color:rgba(55,65,81,var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.pagination .active>span{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(37,99,235,var(--tw-border-opacity))!important;color:rgba(37,99,235,var(--tw-text-opacity))!important}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{bottom:0;top:0}.inset-0,.inset-x-0{left:0;right:0}.inset-y-0{bottom:0;top:0}.top-0{top:0}.top-1{top:.25rem}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.z-0{z-index:0}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.float-right{float:right}.m-0{margin:0}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-4{margin-bottom:1rem;margin-top:1rem}.my-10{margin-bottom:2.5rem;margin-top:2.5rem}.-my-2{margin-bottom:-.5rem;margin-top:-.5rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-10{margin-top:2.5rem}.-mt-4{margin-top:-1rem}.-mt-6{margin-top:-1.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.-mr-1{margin-right:-.25rem}.-mr-14{margin-right:-3.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-1\.5{margin-bottom:.375rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.-ml-1{margin-left:-.25rem}.-ml-4{margin-left:-1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-2{height:.5rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-32{height:8rem}.h-64{height:16rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-48{width:12rem}.w-56{width:14rem}.w-64{width:16rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-4\/5{width:80%}.w-5\/6{width:83.333333%}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.max-w-xs{max-width:20rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.origin-top-right{transform-origin:top right}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.-translate-x-full{--tw-translate-x:-100%}.translate-y-0{--tw-translate-y:0px}.translate-y-4{--tw-translate-y:1rem}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-100{--tw-scale-x:1;--tw-scale-y:1}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-sm{border-radius:.125rem}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0}.border-4{border-width:4px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-transparent{border-color:transparent}.border-gray-100{--tw-border-opacity:1;border-color:rgba(243,244,246,var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgba(252,165,165,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity:1;border-color:rgba(248,113,113,var(--tw-border-opacity))}.border-green-500{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.group:hover .group-hover\:border-transparent,.hover\:border-transparent:hover{border-color:transparent}.hover\:border-gray-600:hover{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.hover\:border-gray-800:hover{--tw-border-opacity:1;border-color:rgba(31,41,55,var(--tw-border-opacity))}.hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgba(37,99,235,var(--tw-border-opacity))}.focus\:border-blue-300:focus{--tw-border-opacity:1;border-color:rgba(147,197,253,var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.focus\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgba(99,102,241,var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgba(107,114,128,var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgba(239,246,255,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgba(29,78,216,var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.focus\:bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.focus\:bg-gray-600:focus{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-clip-padding{background-clip:padding-box}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.object-scale-down{-o-object-fit:scale-down;object-fit:scale-down}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-10{padding:2.5rem}.p-2\.5{padding:.625rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-10{padding-right:2.5rem}.pb-4{padding-bottom:1rem}.pb-10{padding-bottom:2.5rem}.pb-20{padding-bottom:5rem}.pl-0{padding-left:0}.pl-3{padding-left:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem}.text-lg,.text-xl{line-height:1.75rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgba(29,78,216,var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.group:hover .group-hover\:text-white,.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.hover\:text-indigo-900:hover{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.focus\:text-gray-500:focus{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.focus\:text-gray-600:focus{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.focus\:text-gray-900:focus{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.underline{text-decoration:underline}.line-through{text-decoration:line-through}.focus\:underline:focus,.hover\:underline:hover{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.opacity-100{opacity:1}.hover\:opacity-80:hover{opacity:.8}*,:after,:before{--tw-shadow:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.hover\:shadow-2xl:hover,.hover\:shadow-lg:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring:focus,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgba(0,0,0,var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(59,130,246,var(--tw-ring-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(99,102,241,var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity:0.05}.filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-linear{transition-timing-function:linear}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:640px){.sm\:inset-0{bottom:0;left:0;right:0;top:0}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-6{grid-column:span 6/span 6}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\:my-8{margin-bottom:2rem;margin-top:2rem}.sm\:mt-0{margin-top:0}.sm\:mt-4{margin-top:1rem}.sm\:mt-6{margin-top:1.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:ml-6{margin-left:1.5rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-lg{max-width:32rem}.sm\:flex-shrink-0{flex-shrink:0}.sm\:translate-y-0{--tw-translate-y:0px}.sm\:scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.sm\:scale-100{--tw-scale-x:1;--tw-scale-y:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-4{gap:1rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\:col-span-1{grid-column:span 1/span 1}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-start-2{grid-column-start:2}.md\:col-start-4{grid-column-start:4}.md\:mx-0{margin-left:0;margin-right:0}.md\:mt-0{margin-top:0}.md\:mt-5{margin-top:1.25rem}.md\:mt-10{margin-top:2.5rem}.md\:mr-2{margin-right:.5rem}.md\:-mr-1{margin-right:-.25rem}.md\:ml-2{margin-left:.5rem}.md\:ml-6{margin-left:1.5rem}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:max-w-3xl{max-width:48rem}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-6{gap:1.5rem}.md\:p-24{padding:6rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:text-left{text-align:left}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}}@media (min-width:1024px){.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-start-3{grid-column-start:3}.lg\:col-start-4{grid-column-start:4}.lg\:-mx-8{margin-left:-2rem;margin-right:-2rem}.lg\:mt-24{margin-top:6rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:h-screen{height:100vh}.lg\:w-1\/2{width:50%}.lg\:w-1\/4{width:25%}.lg\:w-1\/5{width:20%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:items-center{align-items:center}.lg\:gap-4{gap:1rem}.lg\:rounded-lg{border-radius:.5rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:px-16{padding-left:4rem;padding-right:4rem}}@media (min-width:1280px){.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-6{grid-column:span 6/span 6}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:col-start-4{grid-column-start:4}.xl\:mt-32{margin-top:8rem}.xl\:flex{display:flex}.xl\:justify-center{justify-content:center}.xl\:px-16{padding-left:4rem;padding-right:4rem}} diff --git a/public/js/app.js b/public/js/app.js index 07be4002991b..840ae098d6a7 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -(()=>{var e,t={9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),u=r(4109),c=r(7985),l=r(5061),f=r(5655),p=r(5263);e.exports=function(e){return new Promise((function(t,r){var d,h=e.data,v=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}n.isFormData(h)&&delete v["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",x=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(b+":"+x)}var w=a(e.baseURL,e.url);function O(){if(y){var n="getAllResponseHeaders"in y?u(y.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y};i((function(e){t(e),g()}),(function(e){r(e),g()}),o),y=null}}if(y.open(e.method.toUpperCase(),s(w,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=O:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(O)},y.onabort=function(){y&&(r(l("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){r(l("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},n.isStandardBrowserEnv()){var E=(e.withCredentials||c(w))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;E&&(v[e.xsrfHeaderName]=E)}"setRequestHeader"in y&&n.forEach(v,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete v[t]:y.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),m&&"json"!==m&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(e){y&&(r(!e||e&&e.type?new p("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),h||(h=null),y.send(h)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185);var a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(5655));a.Axios=o,a.Cancel=r(5263),a.CancelToken=r(4972),a.isCancel=r(6502),a.VERSION=r(7288).version,a.all=function(e){return Promise.all(e)},a.spread=r(8713),a.isAxiosError=r(6268),e.exports=a,e.exports.default=a},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185),u=r(4875),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&u.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!n){var l=[s,void 0];for(Array.prototype.unshift.apply(l,r),l=l.concat(o),i=Promise.resolve(e);l.length;)i=i.then(l.shift(),l.shift());return i}for(var f=e;r.length;){var p=r.shift(),d=r.shift();try{f=p(f)}catch(e){d(e);break}}try{i=s(f)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5655),a=r(5263);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4155),i=r(4867),o=r(6016),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(5448)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.24.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],u=void 0===a||s(a,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r{window.axios=r(9669),window.valid=r(5703),document.querySelectorAll(".disposable-alert").forEach((function(e){setTimeout((function(){e.remove()}),5e3)}))},5443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cardNumber=void 0;var n=r(4839),i=r(1938);function o(e,t,r){return{card:e,isPotentiallyValid:t,isValid:r}}t.cardNumber=function(e,t){var r,s;if(void 0===t&&(t={}),"string"!=typeof e&&"number"!=typeof e)return o(null,!1,!1);var a=String(e).replace(/-|\s/g,"");if(!/^\d*$/.test(a))return o(null,!1,!1);var u=i(a);if(0===u.length)return o(null,!1,!1);if(1!==u.length)return o(null,!0,!1);var c=u[0];if(t.maxLength&&a.length>t.maxLength)return o(c,!1,!1);r=c.type===i.types.UNIONPAY&&!0!==t.luhnValidateUnionPay||n(a),s=Math.max.apply(null,c.lengths),t.maxLength&&(s=Math.min(t.maxLength,s));for(var l=0;l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cardholderName=void 0;var r=/^[\d\s-]*$/;function n(e,t){return{isValid:e,isPotentiallyValid:t}}t.cardholderName=function(e){return"string"!=typeof e?n(!1,!1):0===e.length?n(!1,!0):e.length>255?n(!1,!1):r.test(e)?n(!1,!0):n(!0,!0)}},5084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cvv=void 0;function r(e,t){return{isValid:e,isPotentiallyValid:t}}t.cvv=function(e,t){return void 0===t&&(t=3),t=t instanceof Array?t:[t],"string"!=typeof e?r(!1,!1):/^\d*$/.test(e)?function(e,t){for(var r=0;rfunction(e){for(var t=3,r=0;rt?e[r]:t;return t}(t)?r(!1,!1):r(!0,!0):r(!1,!1)}},7622:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";function r(e,t,r){return{isValid:e,isPotentiallyValid:t,isValidForThisYear:r||!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.expirationMonth=void 0,t.expirationMonth=function(e){var t=(new Date).getMonth()+1;if("string"!=typeof e)return r(!1,!1);if(""===e.replace(/\s/g,"")||"0"===e)return r(!1,!0);if(!/^\d*$/.test(e))return r(!1,!1);var n=parseInt(e,10);if(isNaN(Number(e)))return r(!1,!1);var i=n>0&&n<13;return r(i,i,i&&n>=t)}},5275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expirationYear=void 0;function r(e,t,r){return{isValid:e,isPotentiallyValid:t,isCurrentYear:r||!1}}t.expirationYear=function(e,t){var n;if(void 0===t&&(t=19),"string"!=typeof e)return r(!1,!1);if(""===e.replace(/\s/g,""))return r(!1,!0);if(!/^\d*$/.test(e))return r(!1,!1);var i=e.length;if(i<2)return r(!1,!0);var o=(new Date).getFullYear();if(3===i)return r(!1,e.slice(0,2)===String(o).slice(0,2));if(i>4)return r(!1,!1);var s=parseInt(e,10),a=Number(String(o).substr(2,2)),u=!1;if(2===i){if(String(o).substr(0,2)===e)return r(!1,!0);n=a===s,u=s>=a&&s<=a+t}else 4===i&&(n=o===s,u=s>=o&&s<=o+t);return r(u,u,n)}},5703:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=(this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t})(r(1938)),s=r(5367),a=r(5443),u=r(7622),c=r(3437),l=r(5275),f=r(5084),p=r(7204),d={creditCardType:o,cardholderName:s.cardholderName,number:a.cardNumber,expirationDate:u.expirationDate,expirationMonth:c.expirationMonth,expirationYear:l.expirationYear,cvv:f.cvv,postalCode:p.postalCode};e.exports=d},2991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=void 0,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},9178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDate=void 0;var n=r(5275),i=r(2991);t.parseDate=function(e){var t;if(/^\d{4}-\d{1,2}$/.test(e)?t=e.split("-").reverse():/\//.test(e)?t=e.split(/\s*\/\s*/g):/\s/.test(e)&&(t=e.split(/ +/g)),i.isArray(t))return{month:t[0]||"",year:t.slice(1).join()};var r,o,s,a=(r=e,0===(s=Number(r[0]))?2:s>1||1===s&&Number(r[1])>2?1:1===s?(o=r.substr(1),n.expirationYear(o).isPotentiallyValid?1:2):5===r.length?1:r.length>5?2:1),u=e.substr(0,a);return{month:u,year:e.substr(u.length)}}},4839:e=>{"use strict";e.exports=function(e){for(var t,r=0,n=!1,i=e.length-1;i>=0;)t=parseInt(e.charAt(i),10),n&&(t*=2)>9&&(t=t%10+1),n=!n,r+=t,i--;return r%10==0}},7204:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postalCode=void 0;function r(e,t){return{isValid:e,isPotentiallyValid:t}}t.postalCode=function(e,t){void 0===t&&(t={});var n=t.minLength||3;return"string"!=typeof e?r(!1,!1):e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMatchingCardsToResults=void 0;var n=r(4176),i=r(2528);t.addMatchingCardsToResults=function(e,t,r){var o,s;for(o=0;o=s&&(u.matchStrength=s),r.push(u);break}}}},2323:e=>{"use strict";e.exports={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}}},4176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function(e){return e?JSON.parse(JSON.stringify(e)):null}},4558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findBestMatch=void 0,t.findBestMatch=function(e){return function(e){var t=e.filter((function(e){return e.matchStrength})).length;return t>0&&t===e.length}(e)?e.reduce((function(e,t){return e?Number(e.matchStrength){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidInputType=void 0,t.isValidInputType=function(e){return"string"==typeof e||e instanceof String}},2528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matches=void 0,t.matches=function(e,t){return Array.isArray(t)?function(e,t,r){var n=String(t).length,i=e.substr(0,n),o=parseInt(i,10);return t=parseInt(String(t).substr(0,i.length),10),r=parseInt(String(r).substr(0,i.length),10),o>=t&&o<=r}(e,t[0],t[1]):function(e,t){return(t=String(t)).substring(0,e.length)===e.substring(0,t.length)}(e,t)}},1580:()=>{},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l1)for(var r=1;r{if(!r){var s=1/0;for(l=0;l=o)&&Object.keys(n.O).every((e=>n.O[e](r[u])))?r.splice(u--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[r,i,o]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={773:0,170:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,o,[s,a,u]=r,c=0;if(s.some((t=>0!==e[t]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(u)var l=u(n)}for(t&&t(r);cn(7080)));var i=n.O(void 0,[170],(()=>n(1580)));i=n.O(i)})(); \ No newline at end of file +(()=>{var e,t={9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),o=r(4372),s=r(5327),a=r(4097),u=r(4109),c=r(7985),l=r(5061),f=r(5655),p=r(5263);e.exports=function(e){return new Promise((function(t,r){var d,h=e.data,v=e.headers,m=e.responseType;function g(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}n.isFormData(h)&&delete v["Content-Type"];var y=new XMLHttpRequest;if(e.auth){var b=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";v.Authorization="Basic "+btoa(b+":"+w)}var x=a(e.baseURL,e.url);function O(){if(y){var n="getAllResponseHeaders"in y?u(y.getAllResponseHeaders()):null,o={data:m&&"text"!==m&&"json"!==m?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:e,request:y};i((function(e){t(e),g()}),(function(e){r(e),g()}),o),y=null}}if(y.open(e.method.toUpperCase(),s(x,e.params,e.paramsSerializer),!0),y.timeout=e.timeout,"onloadend"in y?y.onloadend=O:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(O)},y.onabort=function(){y&&(r(l("Request aborted",e,"ECONNABORTED",y)),y=null)},y.onerror=function(){r(l("Network Error",e,null,y)),y=null},y.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(l(t,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},n.isStandardBrowserEnv()){var E=(e.withCredentials||c(x))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;E&&(v[e.xsrfHeaderName]=E)}"setRequestHeader"in y&&n.forEach(v,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete v[t]:y.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),m&&"json"!==m&&(y.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&y.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(e){y&&(r(!e||e&&e.type?new p("canceled"):e),y.abort(),y=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),h||(h=null),y.send(h)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),o=r(321),s=r(7185);var a=function e(t){var r=new o(t),a=i(o.prototype.request,r);return n.extend(a,o.prototype,r),n.extend(a,r),a.create=function(r){return e(s(t,r))},a}(r(5655));a.Axios=o,a.Cancel=r(5263),a.CancelToken=r(4972),a.isCancel=r(6502),a.VERSION=r(7288).version,a.all=function(e){return Promise.all(e)},a.spread=r(8713),a.isAxiosError=r(6268),e.exports=a,e.exports.default=a},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;this.promise.then((function(e){if(r._listeners){var t,n=r._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),o=r(782),s=r(3572),a=r(7185),u=r(4875),c=u.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&u.assertOptions(r,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!i){var f=[s,void 0];for(Array.prototype.unshift.apply(f,n),f=f.concat(l),o=Promise.resolve(t);f.length;)o=o.then(f.shift(),f.shift());return o}for(var p=t;n.length;){var d=n.shift(),h=n.shift();try{p=d(p)}catch(e){h(e);break}}try{o=s(p)}catch(e){return Promise.reject(e)}for(;l.length;)o=o.then(l.shift(),l.shift());return o},l.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,r){return this.request(a(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,r,n){return this.request(a(n||{},{method:e,url:t,data:r}))}})),e.exports=l},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,o){var s=new Error(e);return n(s,t,r,i,o)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),o=r(6502),s=r(5655),a=r(5263);function u(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return u(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return u(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(u(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={};function i(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function o(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!n.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return n.isUndefined(t[r])?n.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function u(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return n.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,i=t(e);n.isUndefined(i)&&t!==u||(r[e]=i)})),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function(e,t,r){var o=this||i;return n.forEach(r,(function(r){e=r.call(o,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4155),i=r(4867),o=r(6016),s=r(481),a={"Content-Type":"application/x-www-form-urlencoded"};function u(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(c=r(5448)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(u(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)||t&&"application/json"===t["Content-Type"]?(u(t,"application/json"),function(e,t,r){if(i.isString(e))try{return(t||JSON.parse)(e),i.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&i.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.25.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var o;if(r)o=r(t);else if(n.isURLSearchParams(t))o=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(i)&&a.push("path="+i),n.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,r,o,s={};return e?(n.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(7288).version,i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var o={};i.transitional=function(e,t,r){function i(e,t){return"[Axios v"+n+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(i(n," has been removed"+(t?" in "+t:"")));return t&&!o[n]&&(o[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var o=n[i],s=t[o];if(s){var a=e[o],u=void 0===a||s(a,o,e);if(!0!==u)throw new TypeError("option "+o+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function o(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===i.call(e)}function u(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===i.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var r=0,n=e.length;r{window.axios=r(9669),window.valid=r(5703),document.querySelectorAll(".disposable-alert").forEach((function(e){setTimeout((function(){e.remove()}),5e3)}))},5443:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cardNumber=void 0;var n=r(4839),i=r(1938);function o(e,t,r){return{card:e,isPotentiallyValid:t,isValid:r}}t.cardNumber=function(e,t){var r,s;if(void 0===t&&(t={}),"string"!=typeof e&&"number"!=typeof e)return o(null,!1,!1);var a=String(e).replace(/-|\s/g,"");if(!/^\d*$/.test(a))return o(null,!1,!1);var u=i(a);if(0===u.length)return o(null,!1,!1);if(1!==u.length)return o(null,!0,!1);var c=u[0];if(t.maxLength&&a.length>t.maxLength)return o(c,!1,!1);r=c.type===i.types.UNIONPAY&&!0!==t.luhnValidateUnionPay||n(a),s=Math.max.apply(null,c.lengths),t.maxLength&&(s=Math.min(t.maxLength,s));for(var l=0;l{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cardholderName=void 0;var r=/^[\d\s-]*$/;function n(e,t){return{isValid:e,isPotentiallyValid:t}}t.cardholderName=function(e){return"string"!=typeof e?n(!1,!1):0===e.length?n(!1,!0):e.length>255?n(!1,!1):r.test(e)?n(!1,!0):n(!0,!0)}},5084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cvv=void 0;function r(e,t){return{isValid:e,isPotentiallyValid:t}}t.cvv=function(e,t){return void 0===t&&(t=3),t=t instanceof Array?t:[t],"string"!=typeof e?r(!1,!1):/^\d*$/.test(e)?function(e,t){for(var r=0;rfunction(e){for(var t=3,r=0;rt?e[r]:t;return t}(t)?r(!1,!1):r(!0,!0):r(!1,!1)}},7622:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";function r(e,t,r){return{isValid:e,isPotentiallyValid:t,isValidForThisYear:r||!1}}Object.defineProperty(t,"__esModule",{value:!0}),t.expirationMonth=void 0,t.expirationMonth=function(e){var t=(new Date).getMonth()+1;if("string"!=typeof e)return r(!1,!1);if(""===e.replace(/\s/g,"")||"0"===e)return r(!1,!0);if(!/^\d*$/.test(e))return r(!1,!1);var n=parseInt(e,10);if(isNaN(Number(e)))return r(!1,!1);var i=n>0&&n<13;return r(i,i,i&&n>=t)}},5275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expirationYear=void 0;function r(e,t,r){return{isValid:e,isPotentiallyValid:t,isCurrentYear:r||!1}}t.expirationYear=function(e,t){var n;if(void 0===t&&(t=19),"string"!=typeof e)return r(!1,!1);if(""===e.replace(/\s/g,""))return r(!1,!0);if(!/^\d*$/.test(e))return r(!1,!1);var i=e.length;if(i<2)return r(!1,!0);var o=(new Date).getFullYear();if(3===i)return r(!1,e.slice(0,2)===String(o).slice(0,2));if(i>4)return r(!1,!1);var s=parseInt(e,10),a=Number(String(o).substr(2,2)),u=!1;if(2===i){if(String(o).substr(0,2)===e)return r(!1,!0);n=a===s,u=s>=a&&s<=a+t}else 4===i&&(n=o===s,u=s>=o&&s<=o+t);return r(u,u,n)}},5703:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=(this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t})(r(1938)),s=r(5367),a=r(5443),u=r(7622),c=r(3437),l=r(5275),f=r(5084),p=r(7204),d={creditCardType:o,cardholderName:s.cardholderName,number:a.cardNumber,expirationDate:u.expirationDate,expirationMonth:c.expirationMonth,expirationYear:l.expirationYear,cvv:f.cvv,postalCode:p.postalCode};e.exports=d},2991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=void 0,t.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},9178:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDate=void 0;var n=r(5275),i=r(2991);t.parseDate=function(e){var t;if(/^\d{4}-\d{1,2}$/.test(e)?t=e.split("-").reverse():/\//.test(e)?t=e.split(/\s*\/\s*/g):/\s/.test(e)&&(t=e.split(/ +/g)),i.isArray(t))return{month:t[0]||"",year:t.slice(1).join()};var r,o,s,a=(r=e,0===(s=Number(r[0]))?2:s>1||1===s&&Number(r[1])>2?1:1===s?(o=r.substr(1),n.expirationYear(o).isPotentiallyValid?1:2):5===r.length?1:r.length>5?2:1),u=e.substr(0,a);return{month:u,year:e.substr(u.length)}}},4839:e=>{"use strict";e.exports=function(e){for(var t,r=0,n=!1,i=e.length-1;i>=0;)t=parseInt(e.charAt(i),10),n&&(t*=2)>9&&(t=t%10+1),n=!n,r+=t,i--;return r%10==0}},7204:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postalCode=void 0;function r(e,t){return{isValid:e,isPotentiallyValid:t}}t.postalCode=function(e,t){void 0===t&&(t={});var n=t.minLength||3;return"string"!=typeof e?r(!1,!1):e.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMatchingCardsToResults=void 0;var n=r(4176),i=r(2528);t.addMatchingCardsToResults=function(e,t,r){var o,s;for(o=0;o=s&&(u.matchStrength=s),r.push(u);break}}}},2323:e=>{"use strict";e.exports={visa:{niceType:"Visa",type:"visa",patterns:[4],gaps:[4,8,12],lengths:[16,18,19],code:{name:"CVV",size:3}},mastercard:{niceType:"Mastercard",type:"mastercard",patterns:[[51,55],[2221,2229],[223,229],[23,26],[270,271],2720],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},"american-express":{niceType:"American Express",type:"american-express",patterns:[34,37],gaps:[4,10],lengths:[15],code:{name:"CID",size:4}},"diners-club":{niceType:"Diners Club",type:"diners-club",patterns:[[300,305],36,38,39],gaps:[4,10],lengths:[14,16,19],code:{name:"CVV",size:3}},discover:{niceType:"Discover",type:"discover",patterns:[6011,[644,649],65],gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}},jcb:{niceType:"JCB",type:"jcb",patterns:[2131,1800,[3528,3589]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVV",size:3}},unionpay:{niceType:"UnionPay",type:"unionpay",patterns:[620,[624,626],[62100,62182],[62184,62187],[62185,62197],[62200,62205],[622010,622999],622018,[622019,622999],[62207,62209],[622126,622925],[623,626],6270,6272,6276,[627700,627779],[627781,627799],[6282,6289],6291,6292,810,[8110,8131],[8132,8151],[8152,8163],[8164,8171]],gaps:[4,8,12],lengths:[14,15,16,17,18,19],code:{name:"CVN",size:3}},maestro:{niceType:"Maestro",type:"maestro",patterns:[493698,[5e5,504174],[504176,506698],[506779,508999],[56,59],63,67,6],gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}},elo:{niceType:"Elo",type:"elo",patterns:[401178,401179,438935,457631,457632,431274,451416,457393,504175,[506699,506778],[509e3,509999],627780,636297,636368,[650031,650033],[650035,650051],[650405,650439],[650485,650538],[650541,650598],[650700,650718],[650720,650727],[650901,650978],[651652,651679],[655e3,655019],[655021,655058]],gaps:[4,8,12],lengths:[16],code:{name:"CVE",size:3}},mir:{niceType:"Mir",type:"mir",patterns:[[2200,2204]],gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVP2",size:3}},hiper:{niceType:"Hiper",type:"hiper",patterns:[637095,63737423,63743358,637568,637599,637609,637612],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}},hipercard:{niceType:"Hipercard",type:"hipercard",patterns:[606282],gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}}}},4176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function(e){return e?JSON.parse(JSON.stringify(e)):null}},4558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findBestMatch=void 0,t.findBestMatch=function(e){return function(e){var t=e.filter((function(e){return e.matchStrength})).length;return t>0&&t===e.length}(e)?e.reduce((function(e,t){return e?Number(e.matchStrength){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidInputType=void 0,t.isValidInputType=function(e){return"string"==typeof e||e instanceof String}},2528:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matches=void 0,t.matches=function(e,t){return Array.isArray(t)?function(e,t,r){var n=String(t).length,i=e.substr(0,n),o=parseInt(i,10);return t=parseInt(String(t).substr(0,i.length),10),r=parseInt(String(r).substr(0,i.length),10),o>=t&&o<=r}(e,t[0],t[1]):function(e,t){return(t=String(t)).substring(0,e.length)===e.substring(0,t.length)}(e,t)}},1580:()=>{},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&p())}function p(){if(!c){var e=s(f);c=!0;for(var t=u.length;t;){for(a=u,u=[];++l1)for(var r=1;r{if(!r){var s=1/0;for(l=0;l=o)&&Object.keys(n.O).every((e=>n.O[e](r[u])))?r.splice(u--,1):(a=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[r,i,o]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={773:0,170:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var i,o,[s,a,u]=r,c=0;if(s.some((t=>0!==e[t]))){for(i in a)n.o(a,i)&&(n.m[i]=a[i]);if(u)var l=u(n)}for(t&&t(r);cn(7080)));var i=n.O(void 0,[170],(()=>n(1580)));i=n.O(i)})(); \ No newline at end of file diff --git a/public/js/setup/setup.js b/public/js/setup/setup.js index 020c5e8e1c2a..52f43dda5789 100644 --- a/public/js/setup/setup.js +++ b/public/js/setup/setup.js @@ -1,2 +1,2 @@ /*! For license information please see setup.js.LICENSE.txt */ -(()=>{var e={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),o=n(6026),s=n(4372),i=n(5327),a=n(4097),c=n(4109),u=n(7985),l=n(5061),f=n(5655),d=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,h=e.data,m=e.headers,v=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(h)&&delete m["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(g+":"+w)}var S=a(e.baseURL,e.url);function x(){if(b){var r="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,s={data:v&&"text"!==v&&"json"!==v?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:e,request:b};o((function(e){t(e),y()}),(function(e){n(e),y()}),s),b=null}}if(b.open(e.method.toUpperCase(),i(S,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(x)},b.onabort=function(){b&&(n(l("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",e,null,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var k=(e.withCredentials||u(S))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;k&&(m[e.xsrfHeaderName]=k)}"setRequestHeader"in b&&r.forEach(m,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete m[t]:b.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),v&&"json"!==v&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){b&&(n(!e||e&&e.type?new d("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),h||(h=null),b.send(h)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),o=n(1849),s=n(321),i=n(7185);var a=function e(t){var n=new s(t),a=o(s.prototype.request,n);return r.extend(a,s.prototype,n),r.extend(a,n),a.create=function(n){return e(i(t,n))},a}(n(5655));a.Axios=s,a.Cancel=n(5263),a.CancelToken=n(4972),a.isCancel=n(6502),a.VERSION=n(7288).version,a.all=function(e){return Promise.all(e)},a.spread=n(8713),a.isAxiosError=n(6268),e.exports=a,e.exports.default=a},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),o=n(5327),s=n(782),i=n(3572),a=n(7185),c=n(4875),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new s,response:new s}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var o,s=[];if(this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)})),!r){var l=[i,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(s),o=Promise.resolve(e);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=e;n.length;){var d=n.shift(),p=n.shift();try{f=d(f)}catch(e){p(e);break}}try{o=i(f)}catch(e){return Promise.reject(e)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},l.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(4867);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},4097:(e,t,n)=>{"use strict";var r=n(1793),o=n(7303);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},3572:(e,t,n)=>{"use strict";var r=n(4867),o=n(8527),s=n(6502),i=n(5655),a=n(5263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return s(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function s(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function i(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||s,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),o=n(5655);e.exports=function(e,t,n){var s=this||o;return r.forEach(n,(function(n){e=n.call(s,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4155),o=n(4867),s=n(6016),i=n(481),a={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(5448)),u),transformRequest:[function(e,t){return s(t,"Accept"),s(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)||t&&"application/json"===t["Content-Type"]?(c(t,"application/json"),function(e,t,n){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||r&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw i(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){l.headers[e]=o.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.24.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(r.isURLSearchParams(t))s=t.toString();else{var i=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),s=i.join("&")}if(s){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var s={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,i){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!s[r]&&(s[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,i)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var s=r[o],i=t[s];if(i){var a=e[s],c=void 0===a||i(a,s,e);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+s)}},validators:o}},4867:(e,t,n)=>{"use strict";var r=n(1849),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&d())}function d(){if(!u){var e=i(f);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l1)for(var n=1;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(9669),t=n.n(e);function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;e.classList.remove("alert-failure"),e.innerText="Success!",e.classList.add("alert-success"),t&&(document.getElementById(t).classList.remove("hidden"),document.getElementById(t).scrollIntoView({behavior:"smooth",block:"center"}))}},{key:"handleFailure",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.classList.remove("alert-success"),e.innerText=t||"Oops, looks like something isn't correct!",e.classList.add("alert-failure")}},{key:"handle",value:function(){var e=this;this.checkDbButton.addEventListener("click",(function(){return e.handleDatabaseCheck()})),this.checkSmtpButton.addEventListener("click",(function(){return e.handleSmtpCheck()})),this.checkPdfButton.addEventListener("click",(function(){return e.handleTestPdfCheck()}))}}],o&&r(n.prototype,o),s&&r(n,s),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})()})(); \ No newline at end of file +(()=>{var e={9669:(e,t,n)=>{e.exports=n(1609)},5448:(e,t,n)=>{"use strict";var r=n(4867),o=n(6026),i=n(4372),s=n(5327),a=n(4097),c=n(4109),u=n(7985),l=n(5061),f=n(5655),d=n(5263);e.exports=function(e){return new Promise((function(t,n){var p,h=e.data,m=e.headers,v=e.responseType;function y(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}r.isFormData(h)&&delete m["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";m.Authorization="Basic "+btoa(g+":"+w)}var S=a(e.baseURL,e.url);function x(){if(b){var r="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,i={data:v&&"text"!==v&&"json"!==v?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:r,config:e,request:b};o((function(e){t(e),y()}),(function(e){n(e),y()}),i),b=null}}if(b.open(e.method.toUpperCase(),s(S,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(x)},b.onabort=function(){b&&(n(l("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){n(l("Network Error",e,null,b)),b=null},b.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||f.transitional;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},r.isStandardBrowserEnv()){var k=(e.withCredentials||u(S))&&e.xsrfCookieName?i.read(e.xsrfCookieName):void 0;k&&(m[e.xsrfHeaderName]=k)}"setRequestHeader"in b&&r.forEach(m,(function(e,t){void 0===h&&"content-type"===t.toLowerCase()?delete m[t]:b.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),v&&"json"!==v&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(p=function(e){b&&(n(!e||e&&e.type?new d("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p))),h||(h=null),b.send(h)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),o=n(1849),i=n(321),s=n(7185);var a=function e(t){var n=new i(t),a=o(i.prototype.request,n);return r.extend(a,i.prototype,n),r.extend(a,n),a.create=function(n){return e(s(t,n))},a}(n(5655));a.Axios=i,a.Cancel=n(5263),a.CancelToken=n(4972),a.isCancel=n(6502),a.VERSION=n(7288).version,a.all=function(e){return Promise.all(e)},a.spread=n(8713),a.isAxiosError=n(6268),e.exports=a,e.exports.default=a},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),o=n(5327),i=n(782),s=n(3572),a=n(7185),c=n(4875),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new i,response:new i}}l.prototype.request=function(e,t){if("string"==typeof e?(t=t||{}).url=e:t=e||{},!t.url)throw new Error("Provided config url is not valid");(t=a(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.transitional;void 0!==n&&c.assertOptions(n,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var r=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,r.unshift(e.fulfilled,e.rejected))}));var i,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!o){var f=[s,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(l),i=Promise.resolve(t);f.length;)i=i.then(f.shift(),f.shift());return i}for(var d=t;r.length;){var p=r.shift(),h=r.shift();try{d=p(d)}catch(e){h(e);break}}try{i=s(d)}catch(e){return Promise.reject(e)}for(;l.length;)i=i.then(l.shift(),l.shift());return i},l.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(4867);function o(){this.handlers=[]}o.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},4097:(e,t,n)=>{"use strict";var r=n(1793),o=n(7303);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,o,i){var s=new Error(e);return r(s,t,n,o,i)}},3572:(e,t,n)=>{"use strict";var r=n(4867),o=n(8527),i=n(6502),s=n(5655),a=n(5263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new a("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return c(e),t.data=o.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(c(e),t&&t.response&&(t.response.data=o.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={};function o(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function i(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(e[n],t[n])}function s(e){if(!r.isUndefined(t[e]))return o(void 0,t[e])}function a(n){return r.isUndefined(t[n])?r.isUndefined(e[n])?void 0:o(void 0,e[n]):o(void 0,t[n])}function c(n){return n in t?o(e[n],t[n]):n in e?o(void 0,e[n]):void 0}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c};return r.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=u[e]||i,o=t(e);r.isUndefined(o)&&t!==c||(n[e]=o)})),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),o=n(5655);e.exports=function(e,t,n){var i=this||o;return r.forEach(n,(function(n){e=n.call(i,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4155),o=n(4867),i=n(6016),s=n(481),a={"Content-Type":"application/x-www-form-urlencoded"};function c(e,t){!o.isUndefined(e)&&o.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r))&&(u=n(5448)),u),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),o.isFormData(e)||o.isArrayBuffer(e)||o.isBuffer(e)||o.isStream(e)||o.isFile(e)||o.isBlob(e)?e:o.isArrayBufferView(e)?e.buffer:o.isURLSearchParams(e)?(c(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):o.isObject(e)||t&&"application/json"===t["Content-Type"]?(c(t,"application/json"),function(e,t,n){if(o.isString(e))try{return(t||JSON.parse)(e),o.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||l.transitional,n=t&&t.silentJSONParsing,r=t&&t.forcedJSONParsing,i=!n&&"json"===this.responseType;if(i||r&&o.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};o.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),o.forEach(["post","put","patch"],(function(e){l.headers[e]=o.merge(a)})),e.exports=l},7288:e=>{e.exports={version:"0.25.0"}},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var i;if(n)i=n(t);else if(r.isURLSearchParams(t))i=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e){return r.isObject(e)&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,i,s={};return e?(r.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=r.trim(e.substr(0,i)).toLowerCase(),n=r.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(7288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],c=void 0===a||s(a,i,e);if(!0!==c)throw new TypeError("option "+i+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},4867:(e,t,n)=>{"use strict";var r=n(1849),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n{var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var a,c=[],u=!1,l=-1;function f(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&d())}function d(){if(!u){var e=s(f);u=!0;for(var t=c.length;t;){for(a=c,c=[];++l1)for(var n=1;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(9669),t=n.n(e);function r(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null;e.classList.remove("alert-failure"),e.innerText="Success!",e.classList.add("alert-success"),t&&(document.getElementById(t).classList.remove("hidden"),document.getElementById(t).scrollIntoView({behavior:"smooth",block:"center"}))}},{key:"handleFailure",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e.classList.remove("alert-success"),e.innerText=t||"Oops, looks like something isn't correct!",e.classList.add("alert-failure")}},{key:"handle",value:function(){var e=this;this.checkDbButton.addEventListener("click",(function(){return e.handleDatabaseCheck()})),this.checkSmtpButton.addEventListener("click",(function(){return e.handleSmtpCheck()})),this.checkPdfButton.addEventListener("click",(function(){return e.handleTestPdfCheck()}))}}],o&&r(n.prototype,o),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})()})(); \ No newline at end of file diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 3ac4fd046fe7..1cc8b783d542 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,5 +1,5 @@ { - "/js/app.js": "/js/app.js?id=384185bf9d293949134d09b890c81369", + "/js/app.js": "/js/app.js?id=19300612c6880925e8043b61e8d49632", "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=9fb77e87fe0f85a367050e08f79ec9df", "/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=803182f668c39d631ca5c55437876da4", "/js/clients/payments/forte-credit-card-payment.js": "/js/clients/payments/forte-credit-card-payment.js?id=6e9f466c5504d3753f9b4ffc6f947095", @@ -15,7 +15,7 @@ "/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=6fb63bae43d077b5061f4dadfe8dffc8", "/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=cdc76607aaf0b47a5a4e554e4177713d", "/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=809de47258a681f0ffebe787dd6a9a93", - "/js/setup/setup.js": "/js/setup/setup.js?id=87367cce4927b42a92defdbae7a64711", + "/js/setup/setup.js": "/js/setup/setup.js?id=27560b012f166f8b9417ced2188aab70", "/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=8ce33c3deae058ad314fb8357e5be63b", "/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=be5307abc990bb44f2f92628103b1d98", "/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=c2caa29f753ad1f3a12ca45acddacd72", @@ -42,7 +42,7 @@ "/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=3d53d2f7d0291d9f92cf7414dd2d351c", "/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=db71055862995fd6ae21becfc587a3de", "/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=914a6846ad1e5584635e7430fef76875", - "/css/app.css": "/css/app.css?id=6bafb560444b3b12f8d1ce59bd7fd703", + "/css/app.css": "/css/app.css?id=134313385d8e842c1589a0c057b0a112", "/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ada60afcedcb7c", "/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=15f52a1ee547f2bdd46e56747332ca2d" } diff --git a/resources/views/billing-portal/purchasev2.blade.php b/resources/views/billing-portal/purchasev2.blade.php new file mode 100644 index 000000000000..91c557dc222b --- /dev/null +++ b/resources/views/billing-portal/purchasev2.blade.php @@ -0,0 +1,17 @@ +@extends('portal.ninja2020.layout.clean') +@section('meta_title', ctrans('texts.purchase')) + +@section('body') + @livewire('billing-portal-purchasev2', ['subscription' => $subscription, 'company' => $subscription->company, 'contact' => auth()->guard('contact')->user(), 'hash' => $hash, 'request_data' => $request_data, 'campaign' => request()->query('campaign') ?? null]) +@stop + +@push('footer') + +@endpush diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php new file mode 100644 index 000000000000..99ad8f68b78a --- /dev/null +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -0,0 +1,43 @@ + + +
+ +
+
+ + {{ $subscription->company->present()->name }} + +

+ {{ $subscription->name }} +

+ +
+
+
+
+ + +
+
+ +
+ +
+ +
+
+ +product block + +
+
+
+
+ +customer form block + +
+
+
diff --git a/routes/client.php b/routes/client.php index a7f134f77594..207c05015fdf 100644 --- a/routes/client.php +++ b/routes/client.php @@ -115,6 +115,8 @@ Route::post('payments/process/response', [App\Http\Controllers\ClientPortal\Paym Route::get('payments/process/response', [App\Http\Controllers\ClientPortal\PaymentController::class, 'response'])->name('client.payments.response.get')->middleware(['locale', 'domain_db', 'verify_hash']); Route::get('client/subscriptions/{subscription}/purchase', [App\Http\Controllers\ClientPortal\SubscriptionPurchaseController::class, 'index'])->name('client.subscription.purchase')->middleware('domain_db'); +Route::get('client/subscriptions/{subscription}/purchase/v2', [App\Http\Controllers\ClientPortal\SubscriptionPurchaseController::class, 'upgrade'])->name('client.subscription.upgrade')->middleware('domain_db'); + Route::group(['middleware' => ['invite_db'], 'prefix' => 'client', 'as' => 'client.'], function () { /*Invitation catches*/ From 5316340c29110a71b6f11e7f545f924419ea7211 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 19:32:03 +1100 Subject: [PATCH 30/51] Subscriptions v2 --- app/Console/Commands/S3Cleanup.php | 2 +- package-lock.json | 48 ++++++ package.json | 2 + public/css/app.css | 2 +- public/mix-manifest.json | 2 +- .../billing-portal-purchasev2.blade.php | 148 +++++++++++++++--- tailwind.config.js | 6 +- 7 files changed, 188 insertions(+), 22 deletions(-) diff --git a/app/Console/Commands/S3Cleanup.php b/app/Console/Commands/S3Cleanup.php index 12b998dd5697..7074589de8ba 100644 --- a/app/Console/Commands/S3Cleanup.php +++ b/app/Console/Commands/S3Cleanup.php @@ -42,7 +42,7 @@ class S3Cleanup extends Command */ public function handle() { - if (! Ninja::isHosted()) { + if (!Ninja::isHosted()) { return; } diff --git a/package-lock.json b/package-lock.json index 086f004eaba5..1497d94f6026 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,8 @@ "packages": { "": { "dependencies": { + "@tailwindcss/forms": "^0.3.4", + "@tailwindcss/line-clamp": "^0.3.1", "autoprefixer": "^10.3.7", "axios": "^0.25", "card-js": "^1.0.13", @@ -1692,6 +1694,25 @@ "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" } }, + "node_modules/@tailwindcss/forms": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.3.4.tgz", + "integrity": "sha512-vlAoBifNJUkagB+PAdW4aHMe4pKmSLroH398UPgIogBFc91D2VlHUxe4pjxQhiJl0Nfw53sHSJSQBSTQBZP3vA==", + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=2.0.0" + } + }, + "node_modules/@tailwindcss/line-clamp": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.3.1.tgz", + "integrity": "sha512-pNr0T8LAc3TUx/gxCfQZRe9NB2dPEo/cedPHzUGIPxqDMhgjwNm6jYxww4W5l0zAsAddxr+XfZcqttGiFDgrGg==", + "peerDependencies": { + "tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -5752,6 +5773,14 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/mini-svg-data-uri": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", + "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", + "bin": { + "mini-svg-data-uri": "cli.js" + } + }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -10302,6 +10331,20 @@ "dev": true, "requires": {} }, + "@tailwindcss/forms": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.3.4.tgz", + "integrity": "sha512-vlAoBifNJUkagB+PAdW4aHMe4pKmSLroH398UPgIogBFc91D2VlHUxe4pjxQhiJl0Nfw53sHSJSQBSTQBZP3vA==", + "requires": { + "mini-svg-data-uri": "^1.2.3" + } + }, + "@tailwindcss/line-clamp": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@tailwindcss/line-clamp/-/line-clamp-0.3.1.tgz", + "integrity": "sha512-pNr0T8LAc3TUx/gxCfQZRe9NB2dPEo/cedPHzUGIPxqDMhgjwNm6jYxww4W5l0zAsAddxr+XfZcqttGiFDgrGg==", + "requires": {} + }, "@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -13416,6 +13459,11 @@ } } }, + "mini-svg-data-uri": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", + "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==" + }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", diff --git a/package.json b/package.json index 08940ee09ca1..beadac675645 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,8 @@ "vue-template-compiler": "^2.6.14" }, "dependencies": { + "@tailwindcss/line-clamp": "^0.3.1", + "@tailwindcss/forms": "^0.3.4", "autoprefixer": "^10.3.7", "axios": "^0.25", "card-js": "^1.0.13", diff --git a/public/css/app.css b/public/css/app.css index d147eaf14d96..fc9c0b7b1c50 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1,3 +1,3 @@ /*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*/ -/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:Open Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.button{border-radius:.25rem;font-size:.875rem;line-height:1.25rem;line-height:1rem;padding:.75rem 1rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:disabled{cursor:not-allowed;opacity:.5}.button-primary{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-primary:hover{font-weight:600}.button-block{display:block;width:100%}.button-danger{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity));color:rgba(255,255,255,var(--tw-text-opacity))}.button-danger:hover{--tw-bg-opacity:1;background-color:rgba(220,38,38,var(--tw-bg-opacity))}.button-secondary{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.button-secondary:hover{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.button-link{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.button-link:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity));text-decoration:underline}.button-link:focus{outline:2px solid transparent;outline-offset:2px;text-decoration:underline}.validation{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-left-width:2px;margin-bottom:.25rem;margin-top:.5rem;padding:.25rem .75rem}.validation-fail{border-color:rgba(239,68,68,var(--tw-border-opacity))}.validation-fail,.validation-pass{--tw-border-opacity:1;--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.validation-pass{border-color:rgba(16,185,129,var(--tw-border-opacity))}.input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.input:focus{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity));outline:2px solid transparent;outline-offset:2px}.input-label{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.input-slim{padding-bottom:.5rem;padding-top:.5rem}.form-checkbox{border-radius:.25rem;cursor:pointer}.form-checkbox,.form-select{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity));border-width:1px}.alert{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-color:rgba(156,163,175,var(--tw-border-opacity));border-left-width:2px;font-size:.875rem;line-height:1.25rem;margin-bottom:.25rem;margin-top:1rem;padding:.75rem 1rem}.alert-success{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.alert-failure{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.badge{align-items:center;border-radius:9999px;display:inline-flex;font-size:.75rem;font-weight:500;line-height:1rem;padding:.125rem .625rem}.badge-light{background-color:rgba(243,244,246,var(--tw-bg-opacity));color:rgba(31,41,55,var(--tw-text-opacity))}.badge-light,.badge-primary{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-primary{background-color:rgba(191,219,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}.badge-danger{background-color:rgba(254,226,226,var(--tw-bg-opacity));color:rgba(239,68,68,var(--tw-text-opacity))}.badge-danger,.badge-success{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-success{background-color:rgba(209,250,229,var(--tw-bg-opacity));color:rgba(16,185,129,var(--tw-text-opacity))}.badge-secondary{background-color:rgba(31,41,55,var(--tw-bg-opacity));color:rgba(229,231,235,var(--tw-text-opacity))}.badge-secondary,.badge-warning{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-warning{background-color:rgba(254,243,199,var(--tw-bg-opacity));color:rgba(217,119,6,var(--tw-text-opacity))}.badge-info{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}@media (min-width:640px){.dataTables_length{margin-bottom:1.25rem!important;margin-top:1.25rem!important}}@media (min-width:1024px){.dataTables_length{margin-bottom:1rem!important;margin-top:1rem!important}}.dataTables_length select{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_length select:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}.dataTables_length select{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;margin-left:.5rem!important;margin-right:.5rem!important;padding:.5rem!important}.dataTables_filter{margin-bottom:1rem}.dataTables_filter input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_filter input:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}@media (min-width:1024px){.dataTables_filter{margin-top:-3rem!important}}.dataTables_paginate{padding-bottom:1.5rem!important;padding-top:.5rem!important}.dataTables_paginate .paginate_button{--tw-border-opacity:1!important;--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;border-radius:.25rem;border-radius:.25rem!important;border-width:1px!important;color:rgba(55,65,81,var(--tw-text-opacity))!important;cursor:pointer!important;font-size:.875rem;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem;line-height:1rem;line-height:1.25rem!important;line-height:1rem!important;margin-right:.25rem!important;padding:.75rem 1rem;padding-bottom:.5rem!important;padding-top:.5rem!important;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dataTables_paginate .current{--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(37,99,235,var(--tw-bg-opacity))!important;color:rgba(255,255,255,var(--tw-text-opacity))!important}.dataTables_info{font-size:.875rem!important;line-height:1.25rem!important}.dataTables_empty{padding-bottom:1rem!important;padding-top:1rem!important}.pagination{align-items:center!important;display:flex!important}.pagination .page-link{--tw-text-opacity:1!important;align-items:center!important;border-color:transparent!important;border-top-width:2px!important;color:rgba(107,114,128,var(--tw-text-opacity))!important;cursor:pointer!important;display:inline-flex!important;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem!important;margin-top:-1px!important;padding-left:1rem!important;padding-right:1rem!important;padding-top:1rem!important;transition-duration:.15s!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.pagination .page-link:hover{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;color:rgba(55,65,81,var(--tw-text-opacity))!important}.pagination .page-link:focus{--tw-border-opacity:1;--tw-text-opacity:1;border-color:rgba(156,163,175,var(--tw-border-opacity));color:rgba(55,65,81,var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.pagination .active>span{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(37,99,235,var(--tw-border-opacity))!important;color:rgba(37,99,235,var(--tw-text-opacity))!important}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{bottom:0;top:0}.inset-0,.inset-x-0{left:0;right:0}.inset-y-0{bottom:0;top:0}.top-0{top:0}.top-1{top:.25rem}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.z-0{z-index:0}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.float-right{float:right}.m-0{margin:0}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-4{margin-bottom:1rem;margin-top:1rem}.my-10{margin-bottom:2.5rem;margin-top:2.5rem}.-my-2{margin-bottom:-.5rem;margin-top:-.5rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-10{margin-top:2.5rem}.-mt-4{margin-top:-1rem}.-mt-6{margin-top:-1.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.-mr-1{margin-right:-.25rem}.-mr-14{margin-right:-3.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-1\.5{margin-bottom:.375rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.-ml-1{margin-left:-.25rem}.-ml-4{margin-left:-1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-2{height:.5rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-32{height:8rem}.h-64{height:16rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-48{width:12rem}.w-56{width:14rem}.w-64{width:16rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-4\/5{width:80%}.w-5\/6{width:83.333333%}.w-full{width:100%}.w-screen{width:100vw}.min-w-full{min-width:100%}.max-w-xs{max-width:20rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.origin-top-right{transform-origin:top right}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.-translate-x-full{--tw-translate-x:-100%}.translate-y-0{--tw-translate-y:0px}.translate-y-4{--tw-translate-y:1rem}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-100{--tw-scale-x:1;--tw-scale-y:1}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-sm{border-radius:.125rem}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0}.border-4{border-width:4px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-transparent{border-color:transparent}.border-gray-100{--tw-border-opacity:1;border-color:rgba(243,244,246,var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgba(252,165,165,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity:1;border-color:rgba(248,113,113,var(--tw-border-opacity))}.border-green-500{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.group:hover .group-hover\:border-transparent,.hover\:border-transparent:hover{border-color:transparent}.hover\:border-gray-600:hover{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.hover\:border-gray-800:hover{--tw-border-opacity:1;border-color:rgba(31,41,55,var(--tw-border-opacity))}.hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgba(37,99,235,var(--tw-border-opacity))}.focus\:border-blue-300:focus{--tw-border-opacity:1;border-color:rgba(147,197,253,var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.focus\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgba(99,102,241,var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgba(107,114,128,var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgba(239,246,255,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgba(29,78,216,var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.focus\:bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.focus\:bg-gray-600:focus{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-clip-padding{background-clip:padding-box}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.object-scale-down{-o-object-fit:scale-down;object-fit:scale-down}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-10{padding:2.5rem}.p-2\.5{padding:.625rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-10{padding-right:2.5rem}.pb-4{padding-bottom:1rem}.pb-10{padding-bottom:2.5rem}.pb-20{padding-bottom:5rem}.pl-0{padding-left:0}.pl-3{padding-left:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem}.text-lg,.text-xl{line-height:1.75rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgba(29,78,216,var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.group:hover .group-hover\:text-white,.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.hover\:text-indigo-900:hover{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.focus\:text-gray-500:focus{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.focus\:text-gray-600:focus{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.focus\:text-gray-900:focus{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.underline{text-decoration:underline}.line-through{text-decoration:line-through}.focus\:underline:focus,.hover\:underline:hover{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.opacity-100{opacity:1}.hover\:opacity-80:hover{opacity:.8}*,:after,:before{--tw-shadow:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.hover\:shadow-2xl:hover,.hover\:shadow-lg:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\:ring:focus,.ring-1{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgba(0,0,0,var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(59,130,246,var(--tw-ring-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(99,102,241,var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity:0.05}.filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-linear{transition-timing-function:linear}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@media (min-width:640px){.sm\:inset-0{bottom:0;left:0;right:0;top:0}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-6{grid-column:span 6/span 6}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\:my-8{margin-bottom:2rem;margin-top:2rem}.sm\:mt-0{margin-top:0}.sm\:mt-4{margin-top:1rem}.sm\:mt-6{margin-top:1.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:ml-6{margin-left:1.5rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-lg{max-width:32rem}.sm\:flex-shrink-0{flex-shrink:0}.sm\:translate-y-0{--tw-translate-y:0px}.sm\:scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.sm\:scale-100{--tw-scale-x:1;--tw-scale-y:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-4{gap:1rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\:col-span-1{grid-column:span 1/span 1}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-start-2{grid-column-start:2}.md\:col-start-4{grid-column-start:4}.md\:mx-0{margin-left:0;margin-right:0}.md\:mt-0{margin-top:0}.md\:mt-5{margin-top:1.25rem}.md\:mt-10{margin-top:2.5rem}.md\:mr-2{margin-right:.5rem}.md\:-mr-1{margin-right:-.25rem}.md\:ml-2{margin-left:.5rem}.md\:ml-6{margin-left:1.5rem}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:max-w-3xl{max-width:48rem}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-6{gap:1.5rem}.md\:p-24{padding:6rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:text-left{text-align:left}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}}@media (min-width:1024px){.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-start-3{grid-column-start:3}.lg\:col-start-4{grid-column-start:4}.lg\:-mx-8{margin-left:-2rem;margin-right:-2rem}.lg\:mt-24{margin-top:6rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:h-screen{height:100vh}.lg\:w-1\/2{width:50%}.lg\:w-1\/4{width:25%}.lg\:w-1\/5{width:20%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:items-center{align-items:center}.lg\:gap-4{gap:1rem}.lg\:rounded-lg{border-radius:.5rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:px-16{padding-left:4rem;padding-right:4rem}}@media (min-width:1280px){.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-6{grid-column:span 6/span 6}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:col-start-4{grid-column-start:4}.xl\:mt-32{margin-top:8rem}.xl\:flex{display:flex}.xl\:justify-center{justify-content:center}.xl\:px-16{padding-left:4rem;padding-right:4rem}} +/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */html{-webkit-text-size-adjust:100%;line-height:1.15;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;margin:0}hr{color:inherit;height:0}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background-color:transparent;background-image:none}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:Open Sans,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{font-family:inherit;line-height:inherit}*,:after,:before{border:0 solid;box-sizing:border-box}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af}input::placeholder,textarea::placeholder{color:#9ca3af}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{color:inherit;line-height:inherit;padding:0}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}[type=date],[type=email],[type=month],[type=number],[type=password],[type=search],[type=text],[type=time],[type=url],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[type=date]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}[type=checkbox],[type=radio],select{color-adjust:exact;-webkit-print-color-adjust:exact}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px auto -webkit-focus-ring-color}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.button{border-radius:.25rem;font-size:.875rem;line-height:1.25rem;line-height:1rem;padding:.75rem 1rem;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}button:disabled{cursor:not-allowed;opacity:.5}.button-primary{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.button-primary:hover{font-weight:600}.button-block{display:block;width:100%}.button-danger{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(239,68,68,var(--tw-bg-opacity));color:rgba(255,255,255,var(--tw-text-opacity))}.button-danger:hover{--tw-bg-opacity:1;background-color:rgba(220,38,38,var(--tw-bg-opacity))}.button-secondary{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.button-secondary:hover{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.button-link{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.button-link:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity));text-decoration:underline}.button-link:focus{outline:2px solid transparent;outline-offset:2px;text-decoration:underline}.validation{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-left-width:2px;margin-bottom:.25rem;margin-top:.5rem;padding:.25rem .75rem}.validation-fail{border-color:rgba(239,68,68,var(--tw-border-opacity))}.validation-fail,.validation-pass{--tw-border-opacity:1;--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.validation-pass{border-color:rgba(16,185,129,var(--tw-border-opacity))}.input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.input:focus{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity));outline:2px solid transparent;outline-offset:2px}.input-label{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity));font-size:.875rem;line-height:1.25rem}.input-slim{padding-bottom:.5rem;padding-top:.5rem}.form-checkbox{border-radius:.25rem;cursor:pointer}.form-checkbox,.form-select{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity));border-width:1px}.alert{--tw-border-opacity:1;--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity));border-color:rgba(156,163,175,var(--tw-border-opacity));border-left-width:2px;font-size:.875rem;line-height:1.25rem;margin-bottom:.25rem;margin-top:1rem;padding:.75rem 1rem}.alert-success{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.alert-failure{--tw-border-opacity:1;border-color:rgba(239,68,68,var(--tw-border-opacity))}.badge{align-items:center;border-radius:9999px;display:inline-flex;font-size:.75rem;font-weight:500;line-height:1rem;padding:.125rem .625rem}.badge-light{background-color:rgba(243,244,246,var(--tw-bg-opacity));color:rgba(31,41,55,var(--tw-text-opacity))}.badge-light,.badge-primary{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-primary{background-color:rgba(191,219,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}.badge-danger{background-color:rgba(254,226,226,var(--tw-bg-opacity));color:rgba(239,68,68,var(--tw-text-opacity))}.badge-danger,.badge-success{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-success{background-color:rgba(209,250,229,var(--tw-bg-opacity));color:rgba(16,185,129,var(--tw-text-opacity))}.badge-secondary{background-color:rgba(31,41,55,var(--tw-bg-opacity));color:rgba(229,231,235,var(--tw-text-opacity))}.badge-secondary,.badge-warning{--tw-bg-opacity:1;--tw-text-opacity:1}.badge-warning{background-color:rgba(254,243,199,var(--tw-bg-opacity));color:rgba(217,119,6,var(--tw-text-opacity))}.badge-info{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgba(219,234,254,var(--tw-bg-opacity));color:rgba(59,130,246,var(--tw-text-opacity))}@media (min-width:640px){.dataTables_length{margin-bottom:1.25rem!important;margin-top:1.25rem!important}}@media (min-width:1024px){.dataTables_length{margin-bottom:1rem!important;margin-top:1rem!important}}.dataTables_length select{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_length select:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}.dataTables_length select{--tw-bg-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;margin-left:.5rem!important;margin-right:.5rem!important;padding:.5rem!important}.dataTables_filter{margin-bottom:1rem}.dataTables_filter input{--tw-border-opacity:1;align-items:center;border-color:rgba(209,213,219,var(--tw-border-opacity));border-radius:.25rem;border-width:1px;font-size:.875rem;line-height:1.25rem;margin-top:.5rem;padding:.5rem 1rem}.dataTables_filter input:focus{--tw-bg-opacity:1!important;background-color:rgba(249,250,251,var(--tw-bg-opacity))!important;outline:2px solid transparent!important;outline-offset:2px!important}@media (min-width:1024px){.dataTables_filter{margin-top:-3rem!important}}.dataTables_paginate{padding-bottom:1.5rem!important;padding-top:.5rem!important}.dataTables_paginate .paginate_button{--tw-border-opacity:1!important;--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(255,255,255,var(--tw-bg-opacity))!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;border-radius:.25rem;border-radius:.25rem!important;border-width:1px!important;color:rgba(55,65,81,var(--tw-text-opacity))!important;cursor:pointer!important;font-size:.875rem;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem;line-height:1rem;line-height:1.25rem!important;line-height:1rem!important;margin-right:.25rem!important;padding:.75rem 1rem;padding-bottom:.5rem!important;padding-top:.5rem!important;transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dataTables_paginate .current{--tw-bg-opacity:1!important;--tw-text-opacity:1!important;background-color:rgba(37,99,235,var(--tw-bg-opacity))!important;color:rgba(255,255,255,var(--tw-text-opacity))!important}.dataTables_info{font-size:.875rem!important;line-height:1.25rem!important}.dataTables_empty{padding-bottom:1rem!important;padding-top:1rem!important}.pagination{align-items:center!important;display:flex!important}.pagination .page-link{--tw-text-opacity:1!important;align-items:center!important;border-color:transparent!important;border-top-width:2px!important;color:rgba(107,114,128,var(--tw-text-opacity))!important;cursor:pointer!important;display:inline-flex!important;font-size:.875rem!important;font-weight:500!important;line-height:1.25rem!important;margin-top:-1px!important;padding-left:1rem!important;padding-right:1rem!important;padding-top:1rem!important;transition-duration:.15s!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.pagination .page-link:hover{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(209,213,219,var(--tw-border-opacity))!important;color:rgba(55,65,81,var(--tw-text-opacity))!important}.pagination .page-link:focus{--tw-border-opacity:1;--tw-text-opacity:1;border-color:rgba(156,163,175,var(--tw-border-opacity));color:rgba(55,65,81,var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.pagination .active>span{--tw-border-opacity:1!important;--tw-text-opacity:1!important;border-color:rgba(37,99,235,var(--tw-border-opacity))!important;color:rgba(37,99,235,var(--tw-text-opacity))!important}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{bottom:0;top:0}.inset-0,.inset-x-0{left:0;right:0}.inset-y-0{bottom:0;top:0}.top-0{top:0}.top-1{top:.25rem}.right-0{right:0}.bottom-0{bottom:0}.left-0{left:0}.left-1{left:.25rem}.z-0{z-index:0}.z-10{z-index:10}.z-30{z-index:30}.z-40{z-index:40}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.col-span-3{grid-column:span 3/span 3}.col-span-4{grid-column:span 4/span 4}.col-span-6{grid-column:span 6/span 6}.col-span-8{grid-column:span 8/span 8}.col-span-12{grid-column:span 12/span 12}.float-right{float:right}.m-0{margin:0}.m-auto{margin:auto}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-4{margin-bottom:1rem;margin-top:1rem}.my-10{margin-bottom:2.5rem;margin-top:2.5rem}.-my-2{margin-bottom:-.5rem;margin-top:-.5rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-10{margin-top:2.5rem}.-mt-4{margin-top:-1rem}.-mt-6{margin-top:-1.5rem}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mr-5{margin-right:1.25rem}.-mr-1{margin-right:-.25rem}.-mr-14{margin-right:-3.5rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.mb-10{margin-bottom:2.5rem}.mb-12{margin-bottom:3rem}.mb-1\.5{margin-bottom:.375rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.ml-5{margin-left:1.25rem}.-ml-1{margin-left:-.25rem}.-ml-4{margin-left:-1rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-0{height:0}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-32{height:8rem}.h-64{height:16rem}.h-auto{height:auto}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-0{width:0}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-48{width:12rem}.w-56{width:14rem}.w-64{width:16rem}.w-auto{width:auto}.w-1\/2{width:50%}.w-4\/5{width:80%}.w-5\/6{width:83.333333%}.w-full{width:100%}.w-screen{width:100vw}.min-w-0{min-width:0}.min-w-full{min-width:100%}.max-w-xs{max-width:20rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.origin-top-right{transform-origin:top right}.transform{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x:0px}.-translate-x-full{--tw-translate-x:-100%}.translate-y-0{--tw-translate-y:0px}.translate-y-4{--tw-translate-y:1rem}.scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.scale-100{--tw-scale-x:1;--tw-scale-y:1}@-webkit-keyframes spin{to{transform:rotate(1turn)}}@keyframes spin{to{transform:rotate(1turn)}}@-webkit-keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@-webkit-keyframes pulse{50%{opacity:.5}}@keyframes pulse{50%{opacity:.5}}@-webkit-keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}@keyframes bounce{0%,to{-webkit-animation-timing-function:cubic-bezier(.8,0,1,1);animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{-webkit-animation-timing-function:cubic-bezier(0,0,.2,1);animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}.animate-spin{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.25rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.25rem*var(--tw-space-x-reverse))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.75rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.75rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgba(229,231,235,var(--tw-divide-opacity))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded-sm{border-radius:.125rem}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-lg{border-radius:.5rem}.rounded-full{border-radius:9999px}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0}.border-4{border-width:4px}.border{border-width:1px}.border-t{border-top-width:1px}.border-r{border-right-width:1px}.border-b{border-bottom-width:1px}.border-l-2{border-left-width:2px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-transparent{border-color:transparent}.border-gray-100{--tw-border-opacity:1;border-color:rgba(243,244,246,var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgba(229,231,235,var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity))}.border-gray-600{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgba(252,165,165,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity:1;border-color:rgba(248,113,113,var(--tw-border-opacity))}.border-green-500{--tw-border-opacity:1;border-color:rgba(16,185,129,var(--tw-border-opacity))}.border-blue-500{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.group:hover .group-hover\:border-transparent,.hover\:border-transparent:hover{border-color:transparent}.hover\:border-gray-600:hover{--tw-border-opacity:1;border-color:rgba(75,85,99,var(--tw-border-opacity))}.hover\:border-gray-800:hover{--tw-border-opacity:1;border-color:rgba(31,41,55,var(--tw-border-opacity))}.hover\:border-blue-600:hover{--tw-border-opacity:1;border-color:rgba(37,99,235,var(--tw-border-opacity))}.focus\:border-blue-300:focus{--tw-border-opacity:1;border-color:rgba(147,197,253,var(--tw-border-opacity))}.focus\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgba(59,130,246,var(--tw-border-opacity))}.focus\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgba(99,102,241,var(--tw-border-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgba(255,255,255,var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229,231,235,var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgba(107,114,128,var(--tw-bg-opacity))}.bg-gray-600{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgba(254,226,226,var(--tw-bg-opacity))}.bg-blue-50{--tw-bg-opacity:1;background-color:rgba(239,246,255,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.bg-blue-700{--tw-bg-opacity:1;background-color:rgba(29,78,216,var(--tw-bg-opacity))}.hover\:bg-gray-50:hover{--tw-bg-opacity:1;background-color:rgba(249,250,251,var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity:1;background-color:rgba(59,130,246,var(--tw-bg-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgba(37,99,235,var(--tw-bg-opacity))}.focus\:bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgba(243,244,246,var(--tw-bg-opacity))}.focus\:bg-gray-600:focus{--tw-bg-opacity:1;background-color:rgba(75,85,99,var(--tw-bg-opacity))}.bg-clip-padding{background-clip:padding-box}.fill-current{fill:currentColor}.object-cover{-o-object-fit:cover;object-fit:cover}.object-scale-down{-o-object-fit:scale-down;object-fit:scale-down}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.p-10{padding:2.5rem}.p-2\.5{padding:.625rem}.px-0{padding-left:0;padding-right:0}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-12{padding-left:3rem;padding-right:3rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-bottom:0;padding-top:0}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-4{padding-bottom:1rem;padding-top:1rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.py-8{padding-bottom:2rem;padding-top:2rem}.py-0\.5{padding-bottom:.125rem;padding-top:.125rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pr-2{padding-right:.5rem}.pr-4{padding-right:1rem}.pr-10{padding-right:2.5rem}.pb-4{padding-bottom:1rem}.pb-10{padding-bottom:2.5rem}.pb-20{padding-bottom:5rem}.pl-0{padding-left:0}.pl-3{padding-left:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-bottom{vertical-align:bottom}.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem}.text-lg,.text-xl{line-height:1.75rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-5xl{font-size:3rem;line-height:1}.font-normal{font-weight:400}.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-9{line-height:2.25rem}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-black{--tw-text-opacity:1;color:rgba(0,0,0,var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgba(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity:1;color:rgba(248,113,113,var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgba(239,68,68,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgba(220,38,38,var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgba(5,150,105,var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgba(59,130,246,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgba(29,78,216,var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgba(79,70,229,var(--tw-text-opacity))}.group:hover .group-hover\:text-white,.hover\:text-white:hover{--tw-text-opacity:1;color:rgba(255,255,255,var(--tw-text-opacity))}.hover\:text-gray-300:hover{--tw-text-opacity:1;color:rgba(209,213,219,var(--tw-text-opacity))}.hover\:text-gray-500:hover{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.hover\:text-gray-600:hover{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(55,65,81,var(--tw-text-opacity))}.hover\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31,41,55,var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.hover\:text-blue-600:hover{--tw-text-opacity:1;color:rgba(37,99,235,var(--tw-text-opacity))}.hover\:text-indigo-900:hover{--tw-text-opacity:1;color:rgba(49,46,129,var(--tw-text-opacity))}.focus\:text-gray-500:focus{--tw-text-opacity:1;color:rgba(107,114,128,var(--tw-text-opacity))}.focus\:text-gray-600:focus{--tw-text-opacity:1;color:rgba(75,85,99,var(--tw-text-opacity))}.focus\:text-gray-900:focus{--tw-text-opacity:1;color:rgba(17,24,39,var(--tw-text-opacity))}.underline{text-decoration:underline}.line-through{text-decoration:line-through}.focus\:underline:focus,.hover\:underline:hover{text-decoration:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-75{opacity:.75}.opacity-100{opacity:1}.hover\:opacity-80:hover{opacity:.8}*,:after,:before{--tw-shadow:0 0 #0000}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05)}.shadow,.shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px 0 rgba(0,0,0,.06)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.shadow-lg,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 10px 10px -5px rgba(0,0,0,.04)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -2px rgba(0,0,0,.05)}.hover\:shadow-2xl:hover,.hover\:shadow-lg:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-2xl:hover{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}*,:after,:before{--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-within\:ring-2:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-within\:ring-inset:focus-within{--tw-ring-inset:inset}.ring-black{--tw-ring-opacity:1;--tw-ring-color:rgba(0,0,0,var(--tw-ring-opacity))}.focus-within\:ring-indigo-600:focus-within{--tw-ring-opacity:1;--tw-ring-color:rgba(79,70,229,var(--tw-ring-opacity))}.focus\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(59,130,246,var(--tw-ring-opacity))}.focus\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(99,102,241,var(--tw-ring-opacity))}.ring-opacity-5{--tw-ring-opacity:0.05}.filter{--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition{transition-duration:.15s;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:background-color,border-color,color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-75{transition-duration:75ms}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-linear{transition-timing-function:linear}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.line-clamp-2{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;overflow:hidden}@media (min-width:640px){.sm\:inset-0{bottom:0;left:0;right:0;top:0}.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-span-3{grid-column:span 3/span 3}.sm\:col-span-4{grid-column:span 4/span 4}.sm\:col-span-6{grid-column:span 6/span 6}.sm\:mx-0{margin-left:0;margin-right:0}.sm\:-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.sm\:my-8{margin-bottom:2rem;margin-top:2rem}.sm\:mt-0{margin-top:0}.sm\:mt-4{margin-top:1rem}.sm\:mt-6{margin-top:1.5rem}.sm\:ml-3{margin-left:.75rem}.sm\:ml-4{margin-left:1rem}.sm\:ml-6{margin-left:1.5rem}.sm\:block{display:block}.sm\:inline-block{display:inline-block}.sm\:flex{display:flex}.sm\:grid{display:grid}.sm\:hidden{display:none}.sm\:h-10{height:2.5rem}.sm\:h-screen{height:100vh}.sm\:w-10{width:2.5rem}.sm\:w-auto{width:auto}.sm\:w-full{width:100%}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-lg{max-width:32rem}.sm\:flex-shrink-0{flex-shrink:0}.sm\:translate-y-0{--tw-translate-y:0px}.sm\:scale-95{--tw-scale-x:.95;--tw-scale-y:.95}.sm\:scale-100{--tw-scale-x:1;--tw-scale-y:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row-reverse{flex-direction:row-reverse}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-center{justify-content:center}.sm\:justify-between{justify-content:space-between}.sm\:gap-4{gap:1rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:p-0{padding:0}.sm\:p-6{padding:1.5rem}.sm\:px-0{padding-left:0;padding-right:0}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-left{text-align:left}.sm\:align-middle{vertical-align:middle}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width:768px){.md\:col-span-1{grid-column:span 1/span 1}.md\:col-span-2{grid-column:span 2/span 2}.md\:col-span-4{grid-column:span 4/span 4}.md\:col-span-5{grid-column:span 5/span 5}.md\:col-span-6{grid-column:span 6/span 6}.md\:col-start-2{grid-column-start:2}.md\:col-start-4{grid-column-start:4}.md\:mx-0{margin-left:0;margin-right:0}.md\:mt-0{margin-top:0}.md\:mt-5{margin-top:1.25rem}.md\:mt-10{margin-top:2.5rem}.md\:mr-2{margin-right:.5rem}.md\:-mr-1{margin-right:-.25rem}.md\:ml-2{margin-left:.5rem}.md\:ml-6{margin-left:1.5rem}.md\:block{display:block}.md\:flex{display:flex}.md\:grid{display:grid}.md\:hidden{display:none}.md\:w-1\/2{width:50%}.md\:w-1\/3{width:33.333333%}.md\:max-w-3xl{max-width:48rem}.md\:flex-shrink-0{flex-shrink:0}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:gap-6{gap:1.5rem}.md\:p-24{padding:6rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:text-left{text-align:left}.md\:text-sm{font-size:.875rem;line-height:1.25rem}.md\:text-2xl{font-size:1.5rem;line-height:2rem}}@media (min-width:1024px){.lg\:col-span-3{grid-column:span 3/span 3}.lg\:col-span-6{grid-column:span 6/span 6}.lg\:col-span-7{grid-column:span 7/span 7}.lg\:col-span-8{grid-column:span 8/span 8}.lg\:col-start-3{grid-column-start:3}.lg\:col-start-4{grid-column-start:4}.lg\:-mx-8{margin-left:-2rem;margin-right:-2rem}.lg\:mt-24{margin-top:6rem}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:h-screen{height:100vh}.lg\:w-1\/2{width:50%}.lg\:w-1\/4{width:25%}.lg\:w-1\/5{width:20%}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:items-center{align-items:center}.lg\:gap-4{gap:1rem}.lg\:rounded-lg{border-radius:.5rem}.lg\:px-4{padding-left:1rem;padding-right:1rem}.lg\:px-8{padding-left:2rem;padding-right:2rem}.lg\:px-16{padding-left:4rem;padding-right:4rem}}@media (min-width:1280px){.xl\:col-span-4{grid-column:span 4/span 4}.xl\:col-span-6{grid-column:span 6/span 6}.xl\:col-span-8{grid-column:span 8/span 8}.xl\:col-span-9{grid-column:span 9/span 9}.xl\:col-start-4{grid-column-start:4}.xl\:mt-32{margin-top:8rem}.xl\:flex{display:flex}.xl\:justify-center{justify-content:center}.xl\:px-16{padding-left:4rem;padding-right:4rem}} diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 1cc8b783d542..d8b98aa434bb 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -42,7 +42,7 @@ "/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=3d53d2f7d0291d9f92cf7414dd2d351c", "/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=db71055862995fd6ae21becfc587a3de", "/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=914a6846ad1e5584635e7430fef76875", - "/css/app.css": "/css/app.css?id=134313385d8e842c1589a0c057b0a112", + "/css/app.css": "/css/app.css?id=2c1ff2517e9909ca83760beb295535be", "/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ada60afcedcb7c", "/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=15f52a1ee547f2bdd46e56747332ca2d" } diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php index 99ad8f68b78a..b11732431a25 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -3,8 +3,8 @@
+
-
{{ $subscription->company->present()->name }} @@ -14,7 +14,135 @@
+ + +
+ + @if(!empty($subscription->product_ids)) + + @endif +
+ +
+
+
+
+ +
+

Optional products

+
+
+ + +
+ + @if(!empty($subscription->product_ids)) + + @endif +
+ +
@@ -22,22 +150,6 @@
+
-
- -
-
- -product block - -
-
-
-
- -customer form block - -
-
-
diff --git a/tailwind.config.js b/tailwind.config.js index 813749e83d65..a385edb2496e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -17,5 +17,9 @@ module.exports = { } }, variants: {}, - plugins: [] + plugins: [ + require('@tailwindcss/line-clamp'), + require('@tailwindcss/forms') + ] + }; From c638670d885c73a784063a731996f880ab6f9e87 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 21:57:11 +1100 Subject: [PATCH 31/51] Subscriptions v2 --- .../billing-portal-purchasev2.blade.php | 107 +++++++++--------- 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php index b11732431a25..d8bb121ccb2c 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -4,33 +4,32 @@
-
- {{ $subscription->company->present()->name }}

{{ $subscription->name }}

-
-
@if(!empty($subscription->recurring_product_ids)) +

+ {{ ctrans('texts.recurring_purchases') }} +

    @foreach($subscription->service()->recurring_products() as $product)
  • -

    {!! ctrans('texts.recurring_purchases') !!}

    -
    +
    -

    {!! nl2br($product->notes) !!}

    +

    {!! nl2br($product->notes) !!}

    {{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }} / {{ App\Models\RecurringInvoice::frequencyForKey($subscription->frequency_id) }} @@ -46,13 +45,17 @@ + @endforeach @endif
    -
    +
    - - +
    +

    Order Summary

    +
    + Items 3 + 590$ +
    +
    + + +
    +
    + + +
    + +
    +
    + Total cost + $600 +
    + +
    +
    From 08630874b87cf32866ad1634b1aa67aa6a28c2cf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 22:14:36 +1100 Subject: [PATCH 32/51] Fixes for rules --- app/Services/Bank/ProcessBankRules.php | 8 +-- .../Feature/Bank/BankTransactionRuleTest.php | 51 +++++++++++++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index 686ee2cb0dde..7efb219b589a 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -112,8 +112,8 @@ class ProcessBankRules extends AbstractService { // $this->bank_transaction->client_id = empty($rule['client_id']) ? null : $rule['client_id']; - $this->bank_transaction->vendor_id = empty($rule['vendor_id']) ? null : $rule['vendor_id']; - $this->bank_transaction->ninja_category_id = empty($rule['category_id']) ? null : $rule['category_id']; + $this->bank_transaction->vendor_id = $bank_transaction_rule->vendor_id; + $this->bank_transaction->ninja_category_id = $bank_transaction_rule->category_id; $this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED; $this->bank_transaction->bank_rule_id = $bank_transaction_rule->id; $this->bank_transaction->save(); @@ -122,7 +122,7 @@ class ProcessBankRules extends AbstractService { $expense = ExpenseFactory::create($this->bank_transaction->company_id, $this->bank_transaction->user_id); - $expense->category_id = $this->bank_transaction->ninja_category_id ?: $this->resolveCategory(); + $expense->category_id = $bank_transaction_rule->category_id ?: $this->resolveCategory(); $expense->amount = $this->bank_transaction->amount; $expense->number = $this->getNextExpenseNumber($expense); $expense->currency_id = $this->bank_transaction->currency_id; @@ -130,7 +130,7 @@ class ProcessBankRules extends AbstractService $expense->payment_date = Carbon::parse($this->bank_transaction->date); $expense->transaction_reference = $this->bank_transaction->description; $expense->transaction_id = $this->bank_transaction->id; - $expense->vendor_id = $this->bank_transaction->vendor_id; + $expense->vendor_id = $bank_transaction_rule->vendor_id; $expense->invoice_documents = $this->bank_transaction->company->invoice_expense_documents; $expense->should_be_invoiced = $this->bank_transaction->company->mark_expenses_invoiceable; $expense->save(); diff --git a/tests/Feature/Bank/BankTransactionRuleTest.php b/tests/Feature/Bank/BankTransactionRuleTest.php index bd51bdf966f5..3be7ce68538e 100644 --- a/tests/Feature/Bank/BankTransactionRuleTest.php +++ b/tests/Feature/Bank/BankTransactionRuleTest.php @@ -42,6 +42,57 @@ class BankTransactionRuleTest extends TestCase $this->withoutExceptionHandling(); } + public function testValidationContainsRule() + { + //[{"search_key":"description","operator":"contains","value":"hello"}] + + + $br = BankTransactionRule::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'matches_on_all' => false, + 'auto_convert' => true, + 'applies_to' => 'DEBIT', + 'client_id' => $this->client->id, + 'vendor_id' => $this->vendor->id, + 'category_id' =>$this->expense_category->id, + 'rules' => [ + [ + 'search_key' => 'description', + 'operator' => 'contains', + 'value' => 'hello', + ] + ] + ]); + + $bi = BankIntegration::factory()->create([ + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'account_id' => $this->account->id, + ]); + + $bt = BankTransaction::factory()->create([ + 'bank_integration_id' => $bi->id, + 'company_id' => $this->company->id, + 'user_id' => $this->user->id, + 'description' => 'HellO ThErE CowBoY', + 'base_type' => 'DEBIT', + 'amount' => 100 + ]); + + + $bt->service()->processRules(); + + $bt = $bt->fresh(); + + $this->assertNotNull($bt->expense_id); + $this->assertNotNull($bt->expense->category_id); + $this->assertNotNull($bt->expense->vendor_id); + + + } + + public function testUpdateValidationRules() { From dc5d4f03880da10249b97993a8d658dc9afd2429 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 22:21:12 +1100 Subject: [PATCH 33/51] Fixes for SEPA EPC QR Codes --- app/Helpers/Epc/EpcQrGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index d308f7188ba9..1bfbff2f956b 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -76,7 +76,7 @@ class EpcQrGenerator $this->formatMoney($this->amount), $this->sepa['purpose'], substr($this->invoice->number,0,34), - substr($this->invoice->public_notes,0,139), + '', '' )), "\n"); From 1ef260cb1488705e6aeb4cbacda243da6a9de583 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Nov 2022 22:28:22 +1100 Subject: [PATCH 34/51] Purge company transactions/integrations --- app/Http/Controllers/MigrationController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index 121502d300b0..fab87c414d95 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -181,7 +181,10 @@ class MigrationController extends BaseController $company->tasks()->forceDelete(); $company->vendors()->forceDelete(); $company->expenses()->forceDelete(); - $company->purchase_orders()->forceDelete(); +// $company->bank_transaction_rules()->forceDelete(); + $company->bank_transactions()->forceDelete(); + $company->bank_integrations()->forceDelete(); + $company->all_activities()->forceDelete(); $settings = $company->settings; From 9718e657cdc3a387687f56ed7263501b265c3697 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 07:39:06 +1100 Subject: [PATCH 35/51] minor fixes for invoice controller bulk actions --- app/Http/Controllers/InvoiceController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 723cf5978ae7..73c0ba94a012 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -698,7 +698,7 @@ class InvoiceController extends BaseController /*If we are using bulk actions, we don't want to return anything */ switch ($action) { case 'auto_bill': - $invoice = AutoBill::dispatch($invoice->id, $invoice->company->db); + AutoBill::dispatch($invoice->id, $invoice->company->db); return $this->itemResponse($invoice); case 'clone_to_invoice': From d34337edb509c4f6be612d21aec5d2defa364f75 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 08:05:08 +1100 Subject: [PATCH 36/51] Minor fixes for rules --- .../StoreBankTransactionRuleRequest.php | 5 ++- .../UpdateBankTransactionRuleRequest.php | 3 ++ tests/Feature/BankTransactionRuleApiTest.php | 43 +++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php index f62b7414c710..138ca1277ef2 100644 --- a/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/StoreBankTransactionRuleRequest.php @@ -35,13 +35,16 @@ class StoreBankTransactionRuleRequest extends Request $rules = [ 'name' => 'bail|required|string', 'rules' => 'bail|array', + 'rules.*.operator' => 'bail|required|nullable', + 'rules.*.search_key' => 'bail|required|nullable', + 'rules.*.value' => 'bail|required|nullable', 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', 'applies_to' => 'bail|sometimes|string', ]; if(isset($this->category_id)) - $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,'.auth()->user()->company()->id.',is_deleted,0'; + $rules['category_id'] = 'bail|sometimes|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; if(isset($this->vendor_id)) $rules['vendor_id'] = 'bail|sometimes|exists:vendors,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; diff --git a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php index d5f7baa327a7..535b75525ecc 100644 --- a/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php +++ b/app/Http/Requests/BankTransactionRule/UpdateBankTransactionRuleRequest.php @@ -34,6 +34,9 @@ class UpdateBankTransactionRuleRequest extends Request $rules = [ 'name' => 'bail|required|string', 'rules' => 'bail|array', + 'rules.*.operator' => 'bail|required|nullable', + 'rules.*.search_key' => 'bail|required|nullable', + 'rules.*.value' => 'bail|required|nullable', 'auto_convert' => 'bail|sometimes|bool', 'matches_on_all' => 'bail|sometimes|bool', 'applies_to' => 'bail|sometimes|string', diff --git a/tests/Feature/BankTransactionRuleApiTest.php b/tests/Feature/BankTransactionRuleApiTest.php index e581788c659a..ec38d470c9fc 100644 --- a/tests/Feature/BankTransactionRuleApiTest.php +++ b/tests/Feature/BankTransactionRuleApiTest.php @@ -60,6 +60,49 @@ if(isset($this->vendor_id)) if(isset($this->client_id)) $rules['client_id'] = 'bail|sometimes|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; */ + public function testBankRuleCategoryIdValidation() + { + $data = [ + 'name' => 'The First Rule', + 'rules' => [ + [ + "operator" => "contains", + "search_key" => "description", + "value" => "mobile" + ], + ], + 'assigned_user_id' => null, + 'auto_convert' => false, + 'matches_on_all' => true, + 'applies_to' => 'DEBIT', + 'category_id' => $this->expense_category->hashed_id, + 'vendor_id' => $this->vendor->hashed_id + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->postJson('/api/v1/bank_transaction_rules/', $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $this->assertEquals('DEBIT', $arr['data']['applies_to']); + + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->putJson('/api/v1/bank_transaction_rules/'. $arr['data']['id'], $data); + + $arr = $response->json(); + + $response->assertStatus(200); + + $this->assertEquals('DEBIT', $arr['data']['applies_to']); + } + public function testBankRulePost() { From 132914eedae6bd1edf510271e508ff79516a2c1a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 08:43:21 +1100 Subject: [PATCH 37/51] Updates for currency seeders --- ..._11_22_215618_lock_tasks_when_invoiced.php | 24 +++++++++++++++++++ database/seeders/CurrenciesSeeder.php | 9 +++++++ .../billing-portal-purchasev2.blade.php | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 52dea5fad0bc..9a67fca92ccb 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -1,5 +1,6 @@ 113, 'name' => 'Swazi lilangeni', 'code' => 'SZL', 'symbol' => 'E', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + + ]; + + foreach ($currencies as $currency) { + $record = Currency::whereCode($currency['code'])->first(); + if ($record) { + $record->name = $currency['name']; + $record->symbol = $currency['symbol']; + $record->precision = $currency['precision']; + $record->thousand_separator = $currency['thousand_separator']; + $record->decimal_separator = $currency['decimal_separator']; + if (isset($currency['swap_currency_symbol'])) { + $record->swap_currency_symbol = $currency['swap_currency_symbol']; + } + $record->save(); + } else { + Currency::create($currency); + } + } + } /** diff --git a/database/seeders/CurrenciesSeeder.php b/database/seeders/CurrenciesSeeder.php index 0a74e65d10a6..16bb51897bfd 100644 --- a/database/seeders/CurrenciesSeeder.php +++ b/database/seeders/CurrenciesSeeder.php @@ -127,6 +127,15 @@ class CurrenciesSeeder extends Seeder ['id' => 102, 'name' => 'Moldovan Leu', 'code' => 'MDL', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 103, 'name' => 'Kazakhstani Tenge', 'code' => 'KZT', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 104, 'name' => 'Ethiopian Birr', 'code' => 'ETB', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 105, 'name' => 'Gambia Dalasi', 'code' => 'GMD', 'symbol' => 'D', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 106, 'name' => 'Paraguayan Guarani', 'code' => 'PYG', 'symbol' => '₲', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 107, 'name' => 'Malawi Kwacha', 'code' => 'MWK', 'symbol' => 'MK', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 108, 'name' => 'Zimbabwean Dollar', 'code' => 'ZWL', 'symbol' => 'Z$', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 109, 'name' => 'Cambodian Riel', 'code' => 'KHR', 'symbol' => '៛', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 110, 'name' => 'Vanuatu Vatu', 'code' => 'VUV', 'symbol' => 'VT', 'precision' => '0', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 111, 'name' => 'Cuban Peso', 'code' => 'CUP', 'symbol' => '₱', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 112, 'name' => 'Cayman Island Dollar', 'code' => 'KYD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], + ['id' => 113, 'name' => 'Swazi lilangeni', 'code' => 'SZL', 'symbol' => 'E', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ]; foreach ($currencies as $currency) { diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php index d8bb121ccb2c..2bebdc624c0c 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -3,7 +3,7 @@
    -
    +
    {{ $subscription->company->present()->name }} From ad853569da6f45b4363b976e2b25ef9a243c5e6a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 08:57:38 +1100 Subject: [PATCH 38/51] Update schema dump --- database/schema/mysql-schema.dump | 111 ++++++++++++++++++++++++++++-- 1 file changed, 107 insertions(+), 4 deletions(-) diff --git a/database/schema/mysql-schema.dump b/database/schema/mysql-schema.dump index 1513db183e2b..b705317fc114 100644 --- a/database/schema/mysql-schema.dump +++ b/database/schema/mysql-schema.dump @@ -47,8 +47,10 @@ CREATE TABLE `accounts` ( `account_sms_verification_code` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `account_sms_verification_number` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `account_sms_verified` tinyint(1) NOT NULL DEFAULT 0, + `bank_integration_account_id` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), - KEY `accounts_payment_id_index` (`payment_id`) + KEY `accounts_payment_id_index` (`payment_id`), + KEY `accounts_key_index` (`key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `activities`; @@ -110,11 +112,11 @@ CREATE TABLE `backups` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `activity_id` int(10) unsigned NOT NULL, `json_backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `html_backup` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `amount` decimal(16,4) NOT NULL, `filename` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `disk` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `backups_activity_id_foreign` (`activity_id`), CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -141,6 +143,40 @@ CREATE TABLE `bank_companies` ( CONSTRAINT `bank_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_integrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_integrations` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `provider_name` text COLLATE utf8mb4_unicode_ci NOT NULL, + `provider_id` bigint(20) NOT NULL, + `bank_account_id` bigint(20) NOT NULL, + `bank_account_name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `bank_account_number` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `bank_account_status` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `bank_account_type` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `nickname` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `from_date` date DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `disabled_upstream` tinyint(1) NOT NULL DEFAULT 0, + `auto_sync` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `bank_integrations_user_id_foreign` (`user_id`), + KEY `bank_integrations_account_id_foreign` (`account_id`), + KEY `bank_integrations_company_id_foreign` (`company_id`), + CONSTRAINT `bank_integrations_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_subcompanies`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -164,6 +200,47 @@ CREATE TABLE `bank_subcompanies` ( CONSTRAINT `bank_subcompanies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transactions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transactions` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `bank_integration_id` bigint(20) unsigned NOT NULL, + `transaction_id` bigint(20) unsigned NOT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `account_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `ninja_category_id` int(10) unsigned DEFAULT NULL, + `category_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `base_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `date` date DEFAULT NULL, + `bank_account_id` bigint(20) unsigned NOT NULL, + `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `invoice_ids` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', + `expense_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL DEFAULT 1, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `bank_rule_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transactions_bank_integration_id_foreign` (`bank_integration_id`), + KEY `bank_transactions_user_id_foreign` (`user_id`), + KEY `bank_transactions_company_id_foreign` (`company_id`), + KEY `bank_transactions_transaction_id_index` (`transaction_id`), + KEY `bank_transactions_category_type_index` (`category_type`), + KEY `bank_transactions_base_type_index` (`base_type`), + CONSTRAINT `bank_transactions_bank_integration_id_foreign` FOREIGN KEY (`bank_integration_id`) REFERENCES `bank_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `banks`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -415,11 +492,15 @@ CREATE TABLE `companies` ( `enabled_expense_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, `invoice_task_project` tinyint(1) NOT NULL DEFAULT 0, `report_include_deleted` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `companies_company_key_unique` (`company_key`), KEY `companies_industry_id_foreign` (`industry_id`), KEY `companies_size_id_foreign` (`size_id`), KEY `companies_account_id_index` (`account_id`), + KEY `companies_subdomain_portal_mode_index` (`subdomain`,`portal_mode`), + KEY `companies_portal_domain_portal_mode_index` (`portal_domain`,`portal_mode`), + KEY `companies_company_key_index` (`company_key`), CONSTRAINT `companies_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `companies_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), CONSTRAINT `companies_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) @@ -508,6 +589,7 @@ CREATE TABLE `company_tokens` ( KEY `company_tokens_account_id_foreign` (`account_id`), KEY `company_tokens_user_id_foreign` (`user_id`), KEY `company_tokens_company_id_index` (`company_id`), + KEY `company_tokens_token_deleted_at_index` (`token`,`deleted_at`), CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -770,6 +852,7 @@ CREATE TABLE `documents` ( `is_public` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `documents_company_id_index` (`company_id`), + KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), CONSTRAINT `documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -786,6 +869,7 @@ CREATE TABLE `expense_categories` ( `deleted_at` timestamp NULL DEFAULT NULL, `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `bank_category_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), @@ -829,7 +913,7 @@ CREATE TABLE `expenses` ( `transaction_reference` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, `invoice_documents` tinyint(1) NOT NULL DEFAULT 1, - `transaction_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `transaction_id` bigint(20) unsigned DEFAULT NULL, `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, @@ -846,6 +930,7 @@ CREATE TABLE `expenses` ( KEY `expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_company_id_index` (`company_id`), + KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -953,8 +1038,8 @@ CREATE TABLE `invoice_invitations` ( KEY `invoice_invitations_company_id_foreign` (`company_id`), KEY `invoice_invitations_deleted_at_invoice_id_company_id_index` (`deleted_at`,`invoice_id`,`company_id`), KEY `invoice_invitations_invoice_id_index` (`invoice_id`), - KEY `invoice_invitations_key_index` (`key`), KEY `invoice_invitations_message_id_index` (`message_id`), + KEY `invoice_invitations_key_deleted_at_index` (`key`,`deleted_at`), CONSTRAINT `invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -1223,6 +1308,7 @@ CREATE TABLE `payments` ( `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `transaction_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_company_id_number_unique` (`company_id`,`number`), UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), @@ -1279,6 +1365,7 @@ CREATE TABLE `products` ( KEY `products_user_id_foreign` (`user_id`), KEY `products_company_id_index` (`company_id`), KEY `pro_co_us_up_index` (`company_id`,`user_id`,`assigned_user_id`,`updated_at`), + KEY `products_product_key_company_id_index` (`product_key`,`company_id`), CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -1893,6 +1980,9 @@ CREATE TABLE `subscriptions` ( `group_id` int(10) unsigned DEFAULT NULL, `price` decimal(20,6) NOT NULL DEFAULT 0.000000, `promo_price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `registration_required` tinyint(1) NOT NULL DEFAULT 0, + `optional_product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `optional_recurring_product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1973,6 +2063,7 @@ CREATE TABLE `tasks` ( `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, `is_date_based` tinyint(1) NOT NULL DEFAULT 0, `status_order` int(11) DEFAULT NULL, + `invoice_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `tasks_company_id_number_unique` (`company_id`,`number`), KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -2094,6 +2185,8 @@ CREATE TABLE `users` ( `last_confirmed_email_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `has_password` tinyint(1) NOT NULL DEFAULT 0, `oauth_user_token_expiry` datetime DEFAULT NULL, + `sms_verification_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `verified_phone_number` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), @@ -2390,3 +2483,13 @@ INSERT INTO `migrations` VALUES (160,'2022_09_07_101731_add_reporting_option_to_ INSERT INTO `migrations` VALUES (161,'2022_09_21_012417_add_threeds_to_braintree',2); INSERT INTO `migrations` VALUES (162,'2022_09_30_235337_add_idempotency_key_to_payments',2); INSERT INTO `migrations` VALUES (163,'2022_10_05_205645_add_indexes_to_client_hash',2); +INSERT INTO `migrations` VALUES (164,'2022_08_05_023357_bank_integration',3); +INSERT INTO `migrations` VALUES (165,'2022_10_06_011344_add_key_to_products',3); +INSERT INTO `migrations` VALUES (166,'2022_10_07_065455_add_key_to_company_tokens_table',3); +INSERT INTO `migrations` VALUES (167,'2022_10_10_070137_add_documentable_index',3); +INSERT INTO `migrations` VALUES (168,'2022_10_27_044909_add_user_sms_verification_code',3); +INSERT INTO `migrations` VALUES (169,'2022_11_02_063742_add_verified_number_flag_to_users_table',3); +INSERT INTO `migrations` VALUES (170,'2022_11_04_013539_disabled_upstream_bank_integrations_table',3); +INSERT INTO `migrations` VALUES (171,'2022_11_06_215526_drop_html_backups_column_from_backups_table',3); +INSERT INTO `migrations` VALUES (172,'2022_11_16_093535_calmness_design',3); +INSERT INTO `migrations` VALUES (173,'2022_11_22_215618_lock_tasks_when_invoiced',3); From 891c742c5d359656bac0f6612036827cad46f42d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 09:33:25 +1100 Subject: [PATCH 39/51] Fixes for custom client portal subdomains --- app/Http/Requests/Company/UpdateCompanyRequest.php | 4 ++-- app/Utils/Traits/Inviteable.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Requests/Company/UpdateCompanyRequest.php b/app/Http/Requests/Company/UpdateCompanyRequest.php index 16efe91040ea..08d1c89bd94d 100644 --- a/app/Http/Requests/Company/UpdateCompanyRequest.php +++ b/app/Http/Requests/Company/UpdateCompanyRequest.php @@ -74,9 +74,9 @@ class UpdateCompanyRequest extends Request $input = $this->all(); - if (Ninja::isHosted() && array_key_exists('portal_domain', $input) && strlen($input['portal_domain']) > 1) { + if (array_key_exists('portal_domain', $input) && strlen($input['portal_domain']) > 1) { $input['portal_domain'] = $this->addScheme($input['portal_domain']); - $input['portal_domain'] = strtolower($input['portal_domain']); + $input['portal_domain'] = rtrim(strtolower($input['portal_domain']), "/"); } if (array_key_exists('settings', $input)) { diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index 8b6481bd1ff0..d2ac6eca9c6c 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -95,7 +95,7 @@ trait Inviteable if (Ninja::isHosted()) { $domain = $this->company->domain(); } else { - $domain = config('ninja.app_url'); + $domain = strlen($this->company->portal_domain) > 5 ? $this->company->portal_domain : config('ninja.app_url'); } switch ($this->company->portal_mode) { From 3994abd10feca1868924aa6491200610f874cd80 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 09:37:14 +1100 Subject: [PATCH 40/51] minor fixes for usage of client portal subdomains in self hosted instances --- app/Http/Requests/Company/StoreCompanyRequest.php | 12 +----------- app/Utils/Traits/Inviteable.php | 6 +++--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/app/Http/Requests/Company/StoreCompanyRequest.php b/app/Http/Requests/Company/StoreCompanyRequest.php index f60ca455e93e..62c0eb8f1255 100644 --- a/app/Http/Requests/Company/StoreCompanyRequest.php +++ b/app/Http/Requests/Company/StoreCompanyRequest.php @@ -65,18 +65,8 @@ class StoreCompanyRequest extends Request $input['google_analytics_key'] = $input['google_analytics_url']; } - // $company_settings = CompanySettings::defaults(); - - //@todo this code doesn't make sense as we never return $company_settings anywhere - //@deprecated??? - // if (array_key_exists('settings', $input) && ! empty($input['settings'])) { - // foreach ($input['settings'] as $key => $value) { - // $company_settings->{$key} = $value; - // } - // } - if (array_key_exists('portal_domain', $input)) { - $input['portal_domain'] = strtolower($input['portal_domain']); + $input['portal_domain'] = rtrim(strtolower($input['portal_domain']), "/"); } $this->replace($input); diff --git a/app/Utils/Traits/Inviteable.php b/app/Utils/Traits/Inviteable.php index d2ac6eca9c6c..595b3a51f23a 100644 --- a/app/Utils/Traits/Inviteable.php +++ b/app/Utils/Traits/Inviteable.php @@ -68,7 +68,7 @@ trait Inviteable ); $writer = new Writer($renderer); - $qr = $writer->writeString($this->getPaymentLink()); + $qr = $writer->writeString($this->getPaymentLink(), 'utf-8'); return " {$qr}"; @@ -80,7 +80,7 @@ trait Inviteable if (Ninja::isHosted()) { $domain = $this->company->domain(); } else { - $domain = config('ninja.app_url'); + $domain = strlen($this->company->portal_domain) > 5 ? $this->company->portal_domain : config('ninja.app_url'); } $entity_type = Str::snake(class_basename($this->entityType())); @@ -121,7 +121,7 @@ trait Inviteable if (Ninja::isHosted()) { $domain = $this->company->domain(); } else { - $domain = config('ninja.app_url'); + $domain = strlen($this->company->portal_domain) > 5 ? $this->company->portal_domain : config('ninja.app_url'); } switch ($this->company->portal_mode) { From 60341c7c073f74bd69b12e6cf784be833aab13a3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 11:38:57 +1100 Subject: [PATCH 41/51] Add filters for tasks by project --- app/Filters/TaskFilters.php | 13 + app/Http/Controllers/ActivityController.php | 2 + app/Models/Activity.php | 8 + app/Models/VendorContact.php | 1 + database/schema/mysql-schema.dump | 269 +++++++++++--------- 5 files changed, 172 insertions(+), 121 deletions(-) diff --git a/app/Filters/TaskFilters.php b/app/Filters/TaskFilters.php index f8278f506043..733f35880ff2 100644 --- a/app/Filters/TaskFilters.php +++ b/app/Filters/TaskFilters.php @@ -12,6 +12,7 @@ namespace App\Filters; use App\Models\User; +use App\Utils\Traits\MakesHash; use Illuminate\Database\Eloquent\Builder; /** @@ -19,6 +20,8 @@ use Illuminate\Database\Eloquent\Builder; */ class TaskFilters extends QueryFilters { + use MakesHash; + /** * Filter based on search text. * @@ -111,6 +114,16 @@ class TaskFilters extends QueryFilters }); } + public function project_tasks($project) + { + + if (strlen($project) == 0) { + return $this->builder; + } + + return $this->builder->where('project_id', $this->decodePrimaryKey($project)); + } + /** * Sorts the list based on $sort. * diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 612db688292f..9bba61a97f2b 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -110,6 +110,8 @@ class ActivityController extends BaseController 'vendor' => $activity->vendor ? $activity->vendor : '', 'vendor_contact' => $activity->vendor_contact ? $activity->vendor_contact : '', 'purchase_order' => $activity->purchase_order ? $activity->purchase_order : '', + 'subscription' => $activity->subscription ? $activity->subscription : '', + 'vendor_contact' => $activity->vendor_contact ? $activity->vendor_contact : '', ]; return array_merge($arr, $activity->toArray()); diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 68e569d52027..daa84260a6a2 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -292,6 +292,14 @@ class Activity extends StaticModel return $this->belongsTo(Quote::class)->withTrashed(); } + /** + * @return mixed + */ + public function subscription() + { + return $this->belongsTo(Subscription::class)->withTrashed(); + } + /** * @return mixed */ diff --git a/app/Models/VendorContact.php b/app/Models/VendorContact.php index 6dd0cff534e6..2fc72ade957e 100644 --- a/app/Models/VendorContact.php +++ b/app/Models/VendorContact.php @@ -64,6 +64,7 @@ class VendorContact extends Authenticatable implements HasLocalePreference 'email', 'is_primary', 'vendor_id', + 'send_email', ]; public function avatar() diff --git a/database/schema/mysql-schema.dump b/database/schema/mysql-schema.dump index b705317fc114..e7cd45635d62 100644 --- a/database/schema/mysql-schema.dump +++ b/database/schema/mysql-schema.dump @@ -51,7 +51,7 @@ CREATE TABLE `accounts` ( PRIMARY KEY (`id`), KEY `accounts_payment_id_index` (`payment_id`), KEY `accounts_key_index` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -103,7 +103,7 @@ CREATE TABLE `activities` ( KEY `activities_purchase_order_id_company_id_index` (`purchase_order_id`,`company_id`), KEY `activities_vendor_contact_id_company_id_index` (`vendor_contact_id`,`company_id`), CONSTRAINT `activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -120,7 +120,7 @@ CREATE TABLE `backups` ( PRIMARY KEY (`id`), KEY `backups_activity_id_foreign` (`activity_id`), CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -141,7 +141,7 @@ CREATE TABLE `bank_companies` ( CONSTRAINT `bank_companies_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`), CONSTRAINT `bank_companies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_integrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -175,7 +175,7 @@ CREATE TABLE `bank_integrations` ( CONSTRAINT `bank_integrations_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_integrations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_subcompanies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -198,6 +198,32 @@ CREATE TABLE `bank_subcompanies` ( CONSTRAINT `bank_subcompanies_bank_company_id_foreign` FOREIGN KEY (`bank_company_id`) REFERENCES `bank_companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_subcompanies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_subcompanies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transaction_rules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transaction_rules` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, + `rules` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `auto_convert` tinyint(1) NOT NULL DEFAULT 0, + `matches_on_all` tinyint(1) NOT NULL DEFAULT 0, + `applies_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CREDIT', + `client_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transaction_rules_user_id_foreign` (`user_id`), + KEY `bank_transaction_rules_company_id_foreign` (`company_id`), + CONSTRAINT `bank_transaction_rules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transaction_rules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_transactions`; @@ -239,7 +265,7 @@ CREATE TABLE `bank_transactions` ( CONSTRAINT `bank_transactions_bank_integration_id_foreign` FOREIGN KEY (`bank_integration_id`) REFERENCES `bank_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `banks`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -251,7 +277,7 @@ CREATE TABLE `banks` ( `bank_library_id` int(11) NOT NULL DEFAULT 1, `config` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -302,7 +328,7 @@ CREATE TABLE `client_contacts` ( KEY `client_contacts_contact_key(20)_index` (`contact_key`(20)), KEY `client_contacts_email_index` (`email`), CONSTRAINT `client_contacts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_gateway_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -327,7 +353,7 @@ CREATE TABLE `client_gateway_tokens` ( KEY `client_gateway_tokens_client_id_foreign` (`client_id`), CONSTRAINT `client_gateway_tokens_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_gateway_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -357,7 +383,7 @@ CREATE TABLE `client_subscriptions` ( CONSTRAINT `client_subscriptions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_subscriptions_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`), CONSTRAINT `client_subscriptions_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -416,7 +442,7 @@ CREATE TABLE `clients` ( CONSTRAINT `clients_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `clients_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), CONSTRAINT `clients_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -504,7 +530,7 @@ CREATE TABLE `companies` ( CONSTRAINT `companies_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `companies_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), CONSTRAINT `companies_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -543,7 +569,7 @@ CREATE TABLE `company_gateways` ( CONSTRAINT `company_gateways_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_gateways_gateway_key_foreign` FOREIGN KEY (`gateway_key`) REFERENCES `gateways` (`key`), CONSTRAINT `company_gateways_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_ledgers`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -567,7 +593,7 @@ CREATE TABLE `company_ledgers` ( KEY `company_ledgers_client_id_foreign` (`client_id`), CONSTRAINT `company_ledgers_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_ledgers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -593,7 +619,7 @@ CREATE TABLE `company_tokens` ( CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -621,7 +647,7 @@ CREATE TABLE `company_user` ( KEY `company_user_user_id_index` (`user_id`), CONSTRAINT `company_user_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE, CONSTRAINT `company_user_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `countries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -646,7 +672,7 @@ CREATE TABLE `countries` ( `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '', `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -683,7 +709,7 @@ CREATE TABLE `credit_invitations` ( CONSTRAINT `credit_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_invitations_credit_id_foreign` FOREIGN KEY (`credit_id`) REFERENCES `credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credits`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -759,7 +785,7 @@ CREATE TABLE `credits` ( CONSTRAINT `credits_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -775,7 +801,7 @@ CREATE TABLE `currencies` ( `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `date_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -786,7 +812,7 @@ CREATE TABLE `date_formats` ( `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `datetime_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -797,7 +823,7 @@ CREATE TABLE `datetime_formats` ( `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -818,7 +844,7 @@ CREATE TABLE `designs` ( KEY `designs_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `designs_company_id_index` (`company_id`), CONSTRAINT `designs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `documents`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -854,7 +880,7 @@ CREATE TABLE `documents` ( KEY `documents_company_id_index` (`company_id`), KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), CONSTRAINT `documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expense_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -874,7 +900,7 @@ CREATE TABLE `expense_categories` ( KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), CONSTRAINT `expense_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -933,7 +959,7 @@ CREATE TABLE `expenses` ( KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -948,7 +974,7 @@ CREATE TABLE `failed_jobs` ( `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateway_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -958,7 +984,7 @@ CREATE TABLE `gateway_types` ( `alias` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -979,7 +1005,7 @@ CREATE TABLE `gateways` ( `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `gateways_key_unique` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `group_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -998,7 +1024,7 @@ CREATE TABLE `group_settings` ( PRIMARY KEY (`id`), KEY `group_settings_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `group_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `industries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1007,7 +1033,7 @@ CREATE TABLE `industries` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1044,7 +1070,7 @@ CREATE TABLE `invoice_invitations` ( CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1123,7 +1149,7 @@ CREATE TABLE `invoices` ( CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1138,7 +1164,7 @@ CREATE TABLE `jobs` ( `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `languages`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1148,7 +1174,7 @@ CREATE TABLE `languages` ( `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `licenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1168,7 +1194,7 @@ CREATE TABLE `licenses` ( `recurring_invoice_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `licenses_license_key_unique` (`license_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1178,7 +1204,7 @@ CREATE TABLE `migrations` ( `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1188,7 +1214,7 @@ CREATE TABLE `password_resets` ( `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_hashes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1206,7 +1232,7 @@ CREATE TABLE `payment_hashes` ( KEY `payment_hashes_payment_id_foreign` (`payment_id`), KEY `payment_hashes_hash_index` (`hash`), CONSTRAINT `payment_hashes_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_libraries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1218,7 +1244,7 @@ CREATE TABLE `payment_libraries` ( `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `visible` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_terms`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1238,7 +1264,7 @@ CREATE TABLE `payment_terms` ( KEY `payment_terms_user_id_foreign` (`user_id`), CONSTRAINT `payment_terms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payment_terms_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1248,7 +1274,7 @@ CREATE TABLE `payment_types` ( `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `gateway_type_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `paymentables`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1267,7 +1293,7 @@ CREATE TABLE `paymentables` ( KEY `paymentables_payment_id_foreign` (`payment_id`), KEY `paymentables_paymentable_id_index` (`paymentable_id`), CONSTRAINT `paymentables_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1307,8 +1333,8 @@ CREATE TABLE `payments` ( `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `transaction_id` bigint(20) unsigned DEFAULT NULL, + `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_company_id_number_unique` (`company_id`,`number`), UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), @@ -1326,7 +1352,7 @@ CREATE TABLE `payments` ( CONSTRAINT `payments_company_gateway_id_foreign` FOREIGN KEY (`company_gateway_id`) REFERENCES `company_gateways` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1368,7 +1394,7 @@ CREATE TABLE `products` ( KEY `products_product_key_company_id_index` (`product_key`,`company_id`), CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `projects`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1402,7 +1428,7 @@ CREATE TABLE `projects` ( KEY `projects_company_id_index` (`company_id`), CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_order_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1438,7 +1464,7 @@ CREATE TABLE `purchase_order_invitations` ( CONSTRAINT `purchase_order_invitations_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purchase_order_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purchase_order_invitations_vendor_contact_id_foreign` FOREIGN KEY (`vendor_contact_id`) REFERENCES `vendor_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1514,7 +1540,7 @@ CREATE TABLE `purchase_orders` ( CONSTRAINT `purchase_orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purchase_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `purchase_orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1551,7 +1577,7 @@ CREATE TABLE `quote_invitations` ( CONSTRAINT `quote_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quote_invitations_quote_id_foreign` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quote_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1628,7 +1654,7 @@ CREATE TABLE `quotes` ( CONSTRAINT `quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1692,7 +1718,7 @@ CREATE TABLE `recurring_expenses` ( KEY `recurring_expenses_company_id_index` (`company_id`), CONSTRAINT `recurring_expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1727,7 +1753,7 @@ CREATE TABLE `recurring_invoice_invitations` ( CONSTRAINT `recurring_invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoice_invitations_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1804,7 +1830,7 @@ CREATE TABLE `recurring_invoices` ( CONSTRAINT `recurring_invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1839,7 +1865,7 @@ CREATE TABLE `recurring_quote_invitations` ( CONSTRAINT `recurring_quote_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quote_invitations_recurring_quote_id_foreign` FOREIGN KEY (`recurring_quote_id`) REFERENCES `recurring_invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quote_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1913,7 +1939,7 @@ CREATE TABLE `recurring_quotes` ( CONSTRAINT `recurring_quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `schedulers`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1923,8 +1949,8 @@ CREATE TABLE `schedulers` ( `paused` tinyint(1) NOT NULL DEFAULT 0, `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `repeat_every` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `start_from` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `scheduled_run` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `start_from` timestamp NULL DEFAULT NULL, + `scheduled_run` timestamp NULL DEFAULT NULL, `company_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, @@ -1934,7 +1960,7 @@ CREATE TABLE `schedulers` ( `parameters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), KEY `schedulers_action_name_index` (`action_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sizes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1943,7 +1969,7 @@ CREATE TABLE `sizes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1955,8 +1981,8 @@ CREATE TABLE `subscriptions` ( `company_id` int(10) unsigned NOT NULL, `product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `frequency_id` int(10) unsigned DEFAULT NULL, - `auto_bill` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `promo_code` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `auto_bill` text COLLATE utf8mb4_unicode_ci DEFAULT '', + `promo_code` text COLLATE utf8mb4_unicode_ci DEFAULT '', `promo_discount` double(8,2) NOT NULL DEFAULT 0.00, `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, `allow_cancellation` tinyint(1) NOT NULL DEFAULT 1, @@ -1987,7 +2013,7 @@ CREATE TABLE `subscriptions` ( UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `billing_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `system_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2009,7 +2035,7 @@ CREATE TABLE `system_logs` ( KEY `system_logs_client_id_foreign` (`client_id`), CONSTRAINT `system_logs_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `system_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_statuses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2031,7 +2057,7 @@ CREATE TABLE `task_statuses` ( KEY `task_statuses_user_id_foreign` (`user_id`), CONSTRAINT `task_statuses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_statuses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2075,7 +2101,7 @@ CREATE TABLE `tasks` ( CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tax_rates`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2096,7 +2122,7 @@ CREATE TABLE `tax_rates` ( KEY `tax_rates_company_id_index` (`company_id`), CONSTRAINT `tax_rates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tax_rates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `timezones`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2107,7 +2133,7 @@ CREATE TABLE `timezones` ( `location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `utc_offset` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `transaction_events`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2141,7 +2167,7 @@ CREATE TABLE `transaction_events` ( PRIMARY KEY (`id`), KEY `transaction_events_client_id_index` (`client_id`), CONSTRAINT `transaction_events_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2192,7 +2218,7 @@ CREATE TABLE `users` ( UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), KEY `users_account_id_index` (`account_id`), CONSTRAINT `users_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendor_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2244,7 +2270,7 @@ CREATE TABLE `vendor_contacts` ( CONSTRAINT `vendor_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vendor_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vendor_contacts_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendors`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2289,7 +2315,7 @@ CREATE TABLE `vendors` ( CONSTRAINT `vendors_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`), CONSTRAINT `vendors_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`), CONSTRAINT `vendors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `webhooks`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2311,7 +2337,7 @@ CREATE TABLE `webhooks` ( KEY `subscriptions_company_id_foreign` (`company_id`), KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2445,51 +2471,52 @@ INSERT INTO `migrations` VALUES (122,'2022_02_25_015411_update_stripe_apple_doma INSERT INTO `migrations` VALUES (123,'2022_03_09_053508_transaction_events',1); INSERT INTO `migrations` VALUES (124,'2022_03_24_090728_markdown_email_enabled_wysiwyg_editor',1); INSERT INTO `migrations` VALUES (125,'2022_03_29_014025_reverse_apple_domain_for_hosted',1); -INSERT INTO `migrations` VALUES (126,'2022_04_22_115838_client_settings_parse_for_types',1); -INSERT INTO `migrations` VALUES (127,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',1); -INSERT INTO `migrations` VALUES (128,'2022_05_08_004937_heal_stripe_gateway_configuration',1); -INSERT INTO `migrations` VALUES (129,'2022_05_16_224917_add_auto_bill_tries_to_invoices_table',1); -INSERT INTO `migrations` VALUES (130,'2022_05_18_055442_update_custom_value_four_columns',1); -INSERT INTO `migrations` VALUES (131,'2022_05_23_050754_drop_redundant_column_show_production_description_dropdown',1); -INSERT INTO `migrations` VALUES (132,'2022_04_14_121548_forte_payment_gateway',2); -INSERT INTO `migrations` VALUES (133,'2022_05_18_162152_create_scheduled_jobs_table',2); -INSERT INTO `migrations` VALUES (134,'2022_05_18_162443_create_schedulers_table',2); -INSERT INTO `migrations` VALUES (135,'2022_05_28_234651_create_purchase_orders_table',2); -INSERT INTO `migrations` VALUES (136,'2022_05_30_181109_drop_scheduled_jobs_table',2); -INSERT INTO `migrations` VALUES (137,'2022_05_30_184320_add_job_related_fields_to_schedulers_table',2); -INSERT INTO `migrations` VALUES (138,'2022_05_31_101504_inventory_management_schema',2); -INSERT INTO `migrations` VALUES (139,'2022_06_01_215859_set_recurring_client_timestamp',2); -INSERT INTO `migrations` VALUES (140,'2022_06_01_224339_create_purchase_order_invitations_table',2); -INSERT INTO `migrations` VALUES (141,'2022_06_10_030503_set_account_flag_for_react',2); -INSERT INTO `migrations` VALUES (142,'2022_06_16_025156_add_react_switching_flag',2); -INSERT INTO `migrations` VALUES (143,'2022_06_17_082627_change_refresh_token_column_size',2); -INSERT INTO `migrations` VALUES (144,'2022_06_21_104350_fixes_for_description_in_pdf_designs',2); -INSERT INTO `migrations` VALUES (145,'2022_06_22_090547_set_oauth_expiry_column',2); -INSERT INTO `migrations` VALUES (146,'2022_06_24_141018_upgrade_failed_jobs_table',2); -INSERT INTO `migrations` VALUES (147,'2022_06_30_000126_add_flag_to_accounts_table',2); -INSERT INTO `migrations` VALUES (148,'2022_07_06_080127_add_purchase_order_to_expense',2); -INSERT INTO `migrations` VALUES (149,'2022_07_09_235510_add_index_to_payment_hash',2); -INSERT INTO `migrations` VALUES (150,'2022_07_18_033756_fixes_for_date_formats_table_react',2); -INSERT INTO `migrations` VALUES (151,'2022_07_21_023805_add_hebrew_language',2); -INSERT INTO `migrations` VALUES (152,'2022_07_26_091216_add_sms_verification_to_hosted_account',2); -INSERT INTO `migrations` VALUES (153,'2022_07_28_232340_enabled_expense_tax_rates_to_companies_table',2); -INSERT INTO `migrations` VALUES (154,'2022_07_29_091235_correction_for_companies_table_types',2); -INSERT INTO `migrations` VALUES (155,'2022_08_11_011534_licenses_table_for_self_host',2); -INSERT INTO `migrations` VALUES (156,'2022_08_24_215917_invoice_task_project_companies_table',2); -INSERT INTO `migrations` VALUES (157,'2022_08_26_232500_add_email_status_column_to_purchase_order_invitations_table',2); -INSERT INTO `migrations` VALUES (158,'2022_08_28_210111_add_index_to_payments_table',2); -INSERT INTO `migrations` VALUES (159,'2022_09_05_024719_update_designs_for_tech_template',2); -INSERT INTO `migrations` VALUES (160,'2022_09_07_101731_add_reporting_option_to_companies_table',2); -INSERT INTO `migrations` VALUES (161,'2022_09_21_012417_add_threeds_to_braintree',2); -INSERT INTO `migrations` VALUES (162,'2022_09_30_235337_add_idempotency_key_to_payments',2); -INSERT INTO `migrations` VALUES (163,'2022_10_05_205645_add_indexes_to_client_hash',2); -INSERT INTO `migrations` VALUES (164,'2022_08_05_023357_bank_integration',3); -INSERT INTO `migrations` VALUES (165,'2022_10_06_011344_add_key_to_products',3); -INSERT INTO `migrations` VALUES (166,'2022_10_07_065455_add_key_to_company_tokens_table',3); -INSERT INTO `migrations` VALUES (167,'2022_10_10_070137_add_documentable_index',3); -INSERT INTO `migrations` VALUES (168,'2022_10_27_044909_add_user_sms_verification_code',3); -INSERT INTO `migrations` VALUES (169,'2022_11_02_063742_add_verified_number_flag_to_users_table',3); -INSERT INTO `migrations` VALUES (170,'2022_11_04_013539_disabled_upstream_bank_integrations_table',3); -INSERT INTO `migrations` VALUES (171,'2022_11_06_215526_drop_html_backups_column_from_backups_table',3); -INSERT INTO `migrations` VALUES (172,'2022_11_16_093535_calmness_design',3); -INSERT INTO `migrations` VALUES (173,'2022_11_22_215618_lock_tasks_when_invoiced',3); +INSERT INTO `migrations` VALUES (126,'2022_04_14_121548_forte_payment_gateway',1); +INSERT INTO `migrations` VALUES (127,'2022_04_22_115838_client_settings_parse_for_types',1); +INSERT INTO `migrations` VALUES (128,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',1); +INSERT INTO `migrations` VALUES (129,'2022_05_08_004937_heal_stripe_gateway_configuration',1); +INSERT INTO `migrations` VALUES (130,'2022_05_16_224917_add_auto_bill_tries_to_invoices_table',1); +INSERT INTO `migrations` VALUES (131,'2022_05_18_055442_update_custom_value_four_columns',1); +INSERT INTO `migrations` VALUES (132,'2022_05_18_162152_create_scheduled_jobs_table',1); +INSERT INTO `migrations` VALUES (133,'2022_05_18_162443_create_schedulers_table',1); +INSERT INTO `migrations` VALUES (134,'2022_05_23_050754_drop_redundant_column_show_production_description_dropdown',1); +INSERT INTO `migrations` VALUES (135,'2022_05_28_234651_create_purchase_orders_table',1); +INSERT INTO `migrations` VALUES (136,'2022_05_30_181109_drop_scheduled_jobs_table',1); +INSERT INTO `migrations` VALUES (137,'2022_05_30_184320_add_job_related_fields_to_schedulers_table',1); +INSERT INTO `migrations` VALUES (138,'2022_05_31_101504_inventory_management_schema',1); +INSERT INTO `migrations` VALUES (139,'2022_06_01_215859_set_recurring_client_timestamp',1); +INSERT INTO `migrations` VALUES (140,'2022_06_01_224339_create_purchase_order_invitations_table',1); +INSERT INTO `migrations` VALUES (141,'2022_06_10_030503_set_account_flag_for_react',1); +INSERT INTO `migrations` VALUES (142,'2022_06_16_025156_add_react_switching_flag',1); +INSERT INTO `migrations` VALUES (143,'2022_06_17_082627_change_refresh_token_column_size',1); +INSERT INTO `migrations` VALUES (144,'2022_06_21_104350_fixes_for_description_in_pdf_designs',1); +INSERT INTO `migrations` VALUES (145,'2022_06_22_090547_set_oauth_expiry_column',1); +INSERT INTO `migrations` VALUES (146,'2022_06_24_141018_upgrade_failed_jobs_table',1); +INSERT INTO `migrations` VALUES (147,'2022_06_30_000126_add_flag_to_accounts_table',1); +INSERT INTO `migrations` VALUES (148,'2022_07_06_080127_add_purchase_order_to_expense',1); +INSERT INTO `migrations` VALUES (149,'2022_07_09_235510_add_index_to_payment_hash',1); +INSERT INTO `migrations` VALUES (150,'2022_07_18_033756_fixes_for_date_formats_table_react',1); +INSERT INTO `migrations` VALUES (151,'2022_07_21_023805_add_hebrew_language',1); +INSERT INTO `migrations` VALUES (152,'2022_07_26_091216_add_sms_verification_to_hosted_account',1); +INSERT INTO `migrations` VALUES (153,'2022_07_28_232340_enabled_expense_tax_rates_to_companies_table',1); +INSERT INTO `migrations` VALUES (154,'2022_07_29_091235_correction_for_companies_table_types',1); +INSERT INTO `migrations` VALUES (155,'2022_08_05_023357_bank_integration',1); +INSERT INTO `migrations` VALUES (156,'2022_08_11_011534_licenses_table_for_self_host',1); +INSERT INTO `migrations` VALUES (157,'2022_08_24_215917_invoice_task_project_companies_table',1); +INSERT INTO `migrations` VALUES (158,'2022_08_26_232500_add_email_status_column_to_purchase_order_invitations_table',1); +INSERT INTO `migrations` VALUES (159,'2022_08_28_210111_add_index_to_payments_table',1); +INSERT INTO `migrations` VALUES (160,'2022_09_05_024719_update_designs_for_tech_template',1); +INSERT INTO `migrations` VALUES (161,'2022_09_07_101731_add_reporting_option_to_companies_table',1); +INSERT INTO `migrations` VALUES (162,'2022_09_21_012417_add_threeds_to_braintree',1); +INSERT INTO `migrations` VALUES (163,'2022_09_30_235337_add_idempotency_key_to_payments',1); +INSERT INTO `migrations` VALUES (164,'2022_10_05_205645_add_indexes_to_client_hash',1); +INSERT INTO `migrations` VALUES (165,'2022_10_06_011344_add_key_to_products',1); +INSERT INTO `migrations` VALUES (166,'2022_10_07_065455_add_key_to_company_tokens_table',1); +INSERT INTO `migrations` VALUES (167,'2022_10_10_070137_add_documentable_index',1); +INSERT INTO `migrations` VALUES (168,'2022_10_27_044909_add_user_sms_verification_code',1); +INSERT INTO `migrations` VALUES (169,'2022_11_02_063742_add_verified_number_flag_to_users_table',1); +INSERT INTO `migrations` VALUES (170,'2022_11_04_013539_disabled_upstream_bank_integrations_table',1); +INSERT INTO `migrations` VALUES (171,'2022_11_06_215526_drop_html_backups_column_from_backups_table',1); +INSERT INTO `migrations` VALUES (172,'2022_11_16_093535_calmness_design',1); +INSERT INTO `migrations` VALUES (173,'2022_11_22_215618_lock_tasks_when_invoiced',1); +INSERT INTO `migrations` VALUES (174,'2022_11_13_034143_bank_transaction_rules_table',2); From 4ea0d03b5ce969f9f88049ba60b36e157640a2d2 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 14:33:18 +1100 Subject: [PATCH 42/51] Update validation rules for subscriptions --- app/Http/Controllers/MigrationController.php | 2 +- .../Subscription/StoreSubscriptionRequest.php | 46 +- .../UpdateSubscriptionRequest.php | 48 +- app/Models/Subscription.php | 1 + app/Transformers/SubscriptionTransformer.php | 4 + ..._11_22_215618_lock_tasks_when_invoiced.php | 1 + database/schema/db-ninja-01-schema.dump | 2489 +++++++++-------- 7 files changed, 1369 insertions(+), 1222 deletions(-) diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index fab87c414d95..73268eb0caf3 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -181,7 +181,7 @@ class MigrationController extends BaseController $company->tasks()->forceDelete(); $company->vendors()->forceDelete(); $company->expenses()->forceDelete(); -// $company->bank_transaction_rules()->forceDelete(); + $company->bank_transaction_rules()->forceDelete(); $company->bank_transactions()->forceDelete(); $company->bank_integrations()->forceDelete(); diff --git a/app/Http/Requests/Subscription/StoreSubscriptionRequest.php b/app/Http/Requests/Subscription/StoreSubscriptionRequest.php index 441cdd755d18..2b0f9093b948 100644 --- a/app/Http/Requests/Subscription/StoreSubscriptionRequest.php +++ b/app/Http/Requests/Subscription/StoreSubscriptionRequest.php @@ -35,26 +35,34 @@ class StoreSubscriptionRequest extends Request public function rules() { $rules = [ - 'product_ids' => ['sometimes'], - 'recurring_product_ids' => ['sometimes'], - 'assigned_user_id' => ['sometimes'], - 'is_recurring' => ['sometimes'], - 'frequency_id' => ['required_with:recurring_product_ids'], - 'auto_bill' => ['sometimes'], - 'promo_code' => ['sometimes'], - 'promo_discount' => ['sometimes'], - 'is_amount_discount' => ['sometimes'], - 'allow_cancellation' => ['sometimes'], - 'per_set_enabled' => ['sometimes'], - 'min_seats_limit' => ['sometimes'], - 'max_seats_limit' => ['sometimes'], - 'trial_enabled' => ['sometimes'], - 'trial_duration' => ['sometimes'], - 'allow_query_overrides' => ['sometimes'], - 'allow_plan_changes' => ['sometimes'], - 'refund_period' => ['sometimes'], - 'webhook_configuration' => ['array'], 'name' => ['required', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)], + 'group_id' => ['bail','sometimes', 'nullable', Rule::exists('group_settings','id')->where('company_id', auth()->user()->company()->id)], + 'assigned_user_id' => ['bail','sometimes', 'nullable', Rule::exists('users','id')->where('account_id', auth()->user()->account_id)], + 'product_ids' => 'bail|sometimes|nullable|string', + 'recurring_product_ids' => 'bail|sometimes|nullable|string', + 'is_recurring' => 'bail|sometimes|bool', + 'frequency_id' => 'bail|required_with:recurring_product_ids', + 'auto_bill' => 'bail|sometimes|nullable|string', + 'promo_code' => 'bail|sometimes|nullable|string', + 'promo_discount' => 'bail|sometimes|numeric', + 'is_amount_discount' => 'bail|sometimes|bool', + 'allow_cancellation' => 'bail|sometimes|bool', + 'per_set_enabled' => 'bail|sometimes|bool', + 'min_seats_limit' => 'bail|sometimes|numeric', + 'max_seats_limit' => 'bail|sometimes|numeric', + 'trial_enabled' => 'bail|sometimes|bool', + 'trial_duration' => 'bail|sometimes|numeric', + 'allow_query_overrides' => 'bail|sometimes|bool', + 'allow_plan_changes' => 'bail|sometimes|bool', + 'refund_period' => 'bail|sometimes|numeric', + 'webhook_configuration' => 'bail|array', + 'webhook_configuration.post_purchase_url' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_rest_method' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_headers' => 'bail|sometimes|array', + 'registration_required' => 'bail|sometimes|bool', + 'optional_recurring_product_ids' => 'bail|sometimes|nullable|string', + 'optional_product_ids' => 'bail|sometimes|nullable|string', + 'use_inventory_management' => 'bail|sometimes|bool' ]; return $this->globalRules($rules); diff --git a/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php b/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php index 2b34f4fd61de..06f438a41102 100644 --- a/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php +++ b/app/Http/Requests/Subscription/UpdateSubscriptionRequest.php @@ -37,26 +37,34 @@ class UpdateSubscriptionRequest extends Request public function rules() { $rules = [ - 'product_ids' => ['sometimes'], - 'recurring_product_ids' => ['sometimes'], - 'assigned_user_id' => ['sometimes'], - 'is_recurring' => ['sometimes'], - 'frequency_id' => ['required_with:recurring_product_ids'], - 'auto_bill' => ['sometimes'], - 'promo_code' => ['sometimes'], - 'promo_discount' => ['sometimes'], - 'is_amount_discount' => ['sometimes'], - 'allow_cancellation' => ['sometimes'], - 'per_set_enabled' => ['sometimes'], - 'min_seats_limit' => ['sometimes'], - 'max_seats_limit' => ['sometimes'], - 'trial_enabled' => ['sometimes'], - 'trial_duration' => ['sometimes'], - 'allow_query_overrides' => ['sometimes'], - 'allow_plan_changes' => ['sometimes'], - 'refund_period' => ['sometimes'], - 'webhook_configuration' => ['array'], - 'name' => ['sometimes', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)->ignore($this->subscription->id)], + 'name' => ['bail','sometimes', Rule::unique('subscriptions')->where('company_id', auth()->user()->company()->id)->ignore($this->subscription->id)], + 'group_id' => ['bail','sometimes', 'nullable', Rule::exists('group_settings','id')->where('company_id', auth()->user()->company()->id)], + 'assigned_user_id' => ['bail','sometimes', 'nullable', Rule::exists('users','id')->where('account_id', auth()->user()->account_id)], + 'product_ids' => 'bail|sometimes|nullable|string', + 'recurring_product_ids' => 'bail|sometimes|nullable|string', + 'is_recurring' => 'bail|sometimes|bool', + 'frequency_id' => 'bail|required_with:recurring_product_ids', + 'auto_bill' => 'bail|sometimes|nullable|string', + 'promo_code' => 'bail|sometimes|nullable|string', + 'promo_discount' => 'bail|sometimes|numeric', + 'is_amount_discount' => 'bail|sometimes|bool', + 'allow_cancellation' => 'bail|sometimes|bool', + 'per_set_enabled' => 'bail|sometimes|bool', + 'min_seats_limit' => 'bail|sometimes|numeric', + 'max_seats_limit' => 'bail|sometimes|numeric', + 'trial_enabled' => 'bail|sometimes|bool', + 'trial_duration' => 'bail|sometimes|numeric', + 'allow_query_overrides' => 'bail|sometimes|bool', + 'allow_plan_changes' => 'bail|sometimes|bool', + 'refund_period' => 'bail|sometimes|numeric', + 'webhook_configuration' => 'bail|array', + 'webhook_configuration.post_purchase_url' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_rest_method' => 'bail|sometimes|nullable|string', + 'webhook_configuration.post_purchase_headers' => 'bail|sometimes|array', + 'registration_required' => 'bail|sometimes|bool', + 'optional_recurring_product_ids' => 'bail|sometimes|nullable|string', + 'optional_product_ids' => 'bail|sometimes|nullable|string', + 'use_inventory_management' => 'bail|sometimes|bool', ]; return $this->globalRules($rules); diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 41ac945b2866..0b75dad02c9b 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -57,6 +57,7 @@ class Subscription extends BaseModel 'registration_required', 'optional_product_ids', 'optional_recurring_product_ids', + 'use_inventory_management', ]; protected $casts = [ diff --git a/app/Transformers/SubscriptionTransformer.php b/app/Transformers/SubscriptionTransformer.php index 01580d27b48e..14649a31b072 100644 --- a/app/Transformers/SubscriptionTransformer.php +++ b/app/Transformers/SubscriptionTransformer.php @@ -68,6 +68,10 @@ class SubscriptionTransformer extends EntityTransformer 'updated_at' => (int) $subscription->updated_at, 'archived_at' => (int) $subscription->deleted_at, 'plan_map' => '', //@deprecated 03/04/2021 + 'use_inventory_management' => (bool) $subscription->use_inventory_management, + 'optional_recurring_product_ids' =>(string)$subscription->optional_recurring_product_ids, + 'optional_product_ids' => (string) $subscription->optional_product_ids, + 'registration_required' => (bool) $subscription->registration_required, ]; } } diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 9a67fca92ccb..00c1925cb016 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -32,6 +32,7 @@ return new class extends Migration Schema::table('subscriptions', function (Blueprint $table) { $table->boolean('registration_required')->default(false); + $table->boolean('use_inventory_management')->default(false); $table->text('optional_product_ids')->nullable(); $table->text('optional_recurring_product_ids')->nullable(); diff --git a/database/schema/db-ninja-01-schema.dump b/database/schema/db-ninja-01-schema.dump index 0d2543573130..e311a8edc3c2 100644 --- a/database/schema/db-ninja-01-schema.dump +++ b/database/schema/db-ninja-01-schema.dump @@ -6,47 +6,48 @@ /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `accounts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `accounts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `plan` enum('pro','enterprise','white_label') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_term` enum('month','year') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `plan` enum('pro','enterprise','white_label') DEFAULT NULL, + `plan_term` enum('month','year') DEFAULT NULL, `plan_started` date DEFAULT NULL, `plan_paid` date DEFAULT NULL, `plan_expires` date DEFAULT NULL, - `user_agent` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payment_id` int unsigned DEFAULT NULL, - `default_company_id` int unsigned NOT NULL, + `user_agent` varchar(191) DEFAULT NULL, + `key` varchar(191) DEFAULT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, + `default_company_id` int(10) unsigned NOT NULL, `trial_started` date DEFAULT NULL, - `trial_plan` enum('pro','enterprise') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `trial_plan` enum('pro','enterprise') DEFAULT NULL, `plan_price` decimal(7,2) DEFAULT NULL, - `num_users` smallint NOT NULL DEFAULT '1', - `utm_source` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_medium` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_campaign` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_term` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_content` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `latest_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.0.0', - `report_errors` tinyint(1) NOT NULL DEFAULT '0', - `referral_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `num_users` smallint(6) NOT NULL DEFAULT 1, + `utm_source` varchar(191) DEFAULT NULL, + `utm_medium` varchar(191) DEFAULT NULL, + `utm_campaign` varchar(191) DEFAULT NULL, + `utm_term` varchar(191) DEFAULT NULL, + `utm_content` varchar(191) DEFAULT NULL, + `latest_version` varchar(191) NOT NULL DEFAULT '0.0.0', + `report_errors` tinyint(1) NOT NULL DEFAULT 0, + `referral_code` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_scheduler_running` tinyint(1) NOT NULL DEFAULT '0', - `trial_duration` int unsigned DEFAULT NULL, - `is_onboarding` tinyint(1) NOT NULL DEFAULT '0', - `onboarding` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_migrated` tinyint(1) NOT NULL DEFAULT '0', - `platform` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hosted_client_count` int unsigned DEFAULT NULL, - `hosted_company_count` int unsigned DEFAULT NULL, - `inapp_transaction_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `set_react_as_default_ap` tinyint(1) NOT NULL DEFAULT '0', - `is_flagged` tinyint(1) NOT NULL DEFAULT '0', - `is_verified_account` tinyint(1) NOT NULL DEFAULT '0', - `account_sms_verification_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `account_sms_verification_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `account_sms_verified` tinyint(1) NOT NULL DEFAULT '0', + `is_scheduler_running` tinyint(1) NOT NULL DEFAULT 0, + `trial_duration` int(10) unsigned DEFAULT NULL, + `is_onboarding` tinyint(1) NOT NULL DEFAULT 0, + `onboarding` mediumtext DEFAULT NULL, + `is_migrated` tinyint(1) NOT NULL DEFAULT 0, + `platform` varchar(128) DEFAULT NULL, + `hosted_client_count` int(10) unsigned DEFAULT NULL, + `hosted_company_count` int(10) unsigned DEFAULT NULL, + `inapp_transaction_id` varchar(100) DEFAULT NULL, + `set_react_as_default_ap` tinyint(1) NOT NULL DEFAULT 0, + `is_flagged` tinyint(1) NOT NULL DEFAULT 0, + `is_verified_account` tinyint(1) NOT NULL DEFAULT 0, + `account_sms_verification_code` text DEFAULT NULL, + `account_sms_verification_number` text DEFAULT NULL, + `account_sms_verified` tinyint(1) NOT NULL DEFAULT 0, + `bank_integration_account_id` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `accounts_payment_id_index` (`payment_id`), KEY `accounts_key_index` (`key`) @@ -54,36 +55,36 @@ CREATE TABLE `accounts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `activities` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `client_contact_id` int unsigned DEFAULT NULL, - `account_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `payment_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `credit_id` int unsigned DEFAULT NULL, - `invitation_id` int unsigned DEFAULT NULL, - `task_id` int unsigned DEFAULT NULL, - `expense_id` int unsigned DEFAULT NULL, - `activity_type_id` int unsigned DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_system` tinyint(1) NOT NULL DEFAULT '0', - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `client_contact_id` int(10) unsigned DEFAULT NULL, + `account_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `credit_id` int(10) unsigned DEFAULT NULL, + `invitation_id` int(10) unsigned DEFAULT NULL, + `task_id` int(10) unsigned DEFAULT NULL, + `expense_id` int(10) unsigned DEFAULT NULL, + `activity_type_id` int(10) unsigned DEFAULT NULL, + `ip` varchar(191) NOT NULL, + `is_system` tinyint(1) NOT NULL DEFAULT 0, + `notes` text NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `token_id` int unsigned DEFAULT NULL, - `quote_id` int unsigned DEFAULT NULL, - `subscription_id` int unsigned DEFAULT NULL, - `recurring_invoice_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `recurring_quote_id` int unsigned DEFAULT NULL, - `purchase_order_id` int unsigned DEFAULT NULL, - `vendor_contact_id` int unsigned DEFAULT NULL, + `token_id` int(10) unsigned DEFAULT NULL, + `quote_id` int(10) unsigned DEFAULT NULL, + `subscription_id` int(10) unsigned DEFAULT NULL, + `recurring_invoice_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `recurring_quote_id` int(10) unsigned DEFAULT NULL, + `purchase_order_id` int(10) unsigned DEFAULT NULL, + `vendor_contact_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `activities_vendor_id_company_id_index` (`vendor_id`,`company_id`), KEY `activities_project_id_company_id_index` (`project_id`,`company_id`), @@ -106,16 +107,16 @@ CREATE TABLE `activities` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `backups` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `activity_id` int unsigned NOT NULL, - `json_backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `html_backup` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `activity_id` int(10) unsigned NOT NULL, + `json_backup` mediumtext DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `amount` decimal(16,4) NOT NULL, - `filename` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `filename` text DEFAULT NULL, + `disk` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), KEY `backups_activity_id_foreign` (`activity_id`), CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -123,13 +124,13 @@ CREATE TABLE `backups` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `bank_companies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `bank_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `username` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `bank_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `username` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -142,17 +143,51 @@ CREATE TABLE `bank_companies` ( CONSTRAINT `bank_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_integrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_integrations` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `provider_name` text NOT NULL, + `provider_id` bigint(20) NOT NULL, + `bank_account_id` bigint(20) NOT NULL, + `bank_account_name` text DEFAULT NULL, + `bank_account_number` text DEFAULT NULL, + `bank_account_status` text DEFAULT NULL, + `bank_account_type` text DEFAULT NULL, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency` text DEFAULT NULL, + `nickname` text NOT NULL DEFAULT '', + `from_date` date DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `disabled_upstream` tinyint(1) NOT NULL DEFAULT 0, + `auto_sync` tinyint(1) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `bank_integrations_user_id_foreign` (`user_id`), + KEY `bank_integrations_account_id_foreign` (`account_id`), + KEY `bank_integrations_company_id_foreign` (`company_id`), + CONSTRAINT `bank_integrations_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_integrations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_subcompanies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `bank_subcompanies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `bank_company_id` int unsigned NOT NULL, - `account_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `bank_company_id` int(10) unsigned NOT NULL, + `account_name` varchar(191) DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `account_number` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -165,53 +200,120 @@ CREATE TABLE `bank_subcompanies` ( CONSTRAINT `bank_subcompanies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transaction_rules`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transaction_rules` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `name` varchar(191) NOT NULL, + `rules` mediumtext DEFAULT NULL, + `auto_convert` tinyint(1) NOT NULL DEFAULT 0, + `matches_on_all` tinyint(1) NOT NULL DEFAULT 0, + `applies_to` varchar(191) NOT NULL DEFAULT 'CREDIT', + `client_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transaction_rules_user_id_foreign` (`user_id`), + KEY `bank_transaction_rules_company_id_foreign` (`company_id`), + CONSTRAINT `bank_transaction_rules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transaction_rules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `bank_transactions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `bank_transactions` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `bank_integration_id` bigint(20) unsigned NOT NULL, + `transaction_id` bigint(20) unsigned NOT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `currency_code` varchar(191) DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `account_type` varchar(191) DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `ninja_category_id` int(10) unsigned DEFAULT NULL, + `category_type` varchar(191) NOT NULL, + `base_type` varchar(191) NOT NULL, + `date` date DEFAULT NULL, + `bank_account_id` bigint(20) unsigned NOT NULL, + `description` text DEFAULT NULL, + `invoice_ids` text NOT NULL DEFAULT '', + `expense_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL DEFAULT 1, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp(6) NULL DEFAULT NULL, + `updated_at` timestamp(6) NULL DEFAULT NULL, + `deleted_at` timestamp(6) NULL DEFAULT NULL, + `bank_rule_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `bank_transactions_bank_integration_id_foreign` (`bank_integration_id`), + KEY `bank_transactions_user_id_foreign` (`user_id`), + KEY `bank_transactions_company_id_foreign` (`company_id`), + KEY `bank_transactions_transaction_id_index` (`transaction_id`), + KEY `bank_transactions_category_type_index` (`category_type`), + KEY `bank_transactions_base_type_index` (`base_type`), + CONSTRAINT `bank_transactions_bank_integration_id_foreign` FOREIGN KEY (`bank_integration_id`) REFERENCES `bank_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `bank_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `banks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `banks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remote_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_library_id` int NOT NULL DEFAULT '1', - `config` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) DEFAULT NULL, + `remote_id` varchar(191) DEFAULT NULL, + `bank_library_id` int(11) NOT NULL DEFAULT 1, + `config` text DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_contacts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `email` varchar(100) DEFAULT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT '0', - `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `is_primary` tinyint(1) NOT NULL DEFAULT 0, + `confirmed` tinyint(1) NOT NULL DEFAULT 0, `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT '0', - `send_email` tinyint(1) NOT NULL DEFAULT '1', - `contact_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_provider_id` int(10) unsigned DEFAULT NULL, + `google_2fa_secret` varchar(191) DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(255) DEFAULT NULL, + `avatar_type` varchar(255) DEFAULT NULL, + `avatar_size` varchar(255) DEFAULT NULL, + `password` varchar(191) NOT NULL, + `token` varchar(191) DEFAULT NULL, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, + `send_email` tinyint(1) NOT NULL DEFAULT 1, + `contact_key` varchar(191) DEFAULT NULL, + `remember_token` varchar(100) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -230,22 +332,22 @@ CREATE TABLE `client_contacts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_gateway_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_gateway_tokens` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `routing_number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `company_gateway_id` int unsigned NOT NULL, - `gateway_customer_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `gateway_type_id` int unsigned NOT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT '0', - `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `token` text DEFAULT NULL, + `routing_number` text DEFAULT NULL, + `company_gateway_id` int(10) unsigned NOT NULL, + `gateway_customer_reference` varchar(191) DEFAULT NULL, + `gateway_type_id` int(10) unsigned NOT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `meta` text DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `client_gateway_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `client_gateway_tokens_client_id_foreign` (`client_id`), @@ -255,21 +357,21 @@ CREATE TABLE `client_gateway_tokens` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `client_subscriptions` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `subscription_id` int unsigned NOT NULL, - `recurring_invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned NOT NULL, - `trial_started` int unsigned DEFAULT NULL, - `trial_ends` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `subscription_id` int(10) unsigned NOT NULL, + `recurring_invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned NOT NULL, + `trial_started` int(10) unsigned DEFAULT NULL, + `trial_ends` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `quantity` int unsigned NOT NULL DEFAULT '1', + `invoice_id` int(10) unsigned DEFAULT NULL, + `quantity` int(10) unsigned NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `client_subscriptions_subscription_id_foreign` (`subscription_id`), KEY `client_subscriptions_recurring_invoice_id_foreign` (`recurring_invoice_id`), @@ -285,50 +387,50 @@ CREATE TABLE `client_subscriptions` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `clients` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `client_hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `logo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `balance` decimal(20,6) NOT NULL DEFAULT '0.000000', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `credit_balance` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `client_hash` text DEFAULT NULL, + `logo` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `credit_balance` decimal(20,6) NOT NULL DEFAULT 0.000000, `last_login` timestamp NULL DEFAULT NULL, - `industry_id` int unsigned DEFAULT NULL, - `size_id` int unsigned DEFAULT NULL, - `address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int unsigned DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `shipping_address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_country_id` int unsigned DEFAULT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `group_settings_id` int unsigned DEFAULT NULL, - `vat_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `industry_id` int(10) unsigned DEFAULT NULL, + `size_id` int(10) unsigned DEFAULT NULL, + `address1` varchar(191) DEFAULT NULL, + `address2` varchar(191) DEFAULT NULL, + `city` varchar(191) DEFAULT NULL, + `state` varchar(191) DEFAULT NULL, + `postal_code` varchar(191) DEFAULT NULL, + `country_id` int(10) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `shipping_address1` varchar(191) DEFAULT NULL, + `shipping_address2` varchar(191) DEFAULT NULL, + `shipping_city` varchar(191) DEFAULT NULL, + `shipping_state` varchar(191) DEFAULT NULL, + `shipping_postal_code` varchar(191) DEFAULT NULL, + `shipping_country_id` int(10) unsigned DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `group_settings_id` int(10) unsigned DEFAULT NULL, + `vat_number` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `id_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id_number` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `clients_company_id_number_unique` (`company_id`,`number`), KEY `clients_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -344,78 +446,79 @@ CREATE TABLE `clients` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `companies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `account_id` int unsigned NOT NULL, - `industry_id` int unsigned DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_key` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `convert_products` tinyint(1) NOT NULL DEFAULT '0', - `fill_products` tinyint(1) NOT NULL DEFAULT '1', - `update_products` tinyint(1) NOT NULL DEFAULT '1', - `show_product_details` tinyint(1) NOT NULL DEFAULT '1', - `client_can_register` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_taxes4` tinyint(1) NOT NULL DEFAULT '0', - `show_product_cost` tinyint(1) NOT NULL DEFAULT '0', - `enabled_tax_rates` int unsigned NOT NULL DEFAULT '0', - `enabled_modules` int unsigned NOT NULL DEFAULT '0', - `enable_product_cost` tinyint(1) NOT NULL DEFAULT '0', - `enable_product_quantity` tinyint(1) NOT NULL DEFAULT '1', - `default_quantity` tinyint(1) NOT NULL DEFAULT '1', - `subdomain` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `db` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size_id` int unsigned DEFAULT NULL, - `first_day_of_week` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `first_month_of_year` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `portal_mode` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'subdomain', - `portal_domain` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `enable_modules` smallint NOT NULL DEFAULT '0', - `custom_fields` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `slack_webhook_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `google_analytics_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `industry_id` int(10) unsigned DEFAULT NULL, + `ip` varchar(191) DEFAULT NULL, + `company_key` varchar(100) NOT NULL, + `convert_products` tinyint(1) NOT NULL DEFAULT 0, + `fill_products` tinyint(1) NOT NULL DEFAULT 1, + `update_products` tinyint(1) NOT NULL DEFAULT 1, + `show_product_details` tinyint(1) NOT NULL DEFAULT 1, + `client_can_register` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_taxes4` tinyint(1) NOT NULL DEFAULT 0, + `show_product_cost` tinyint(1) NOT NULL DEFAULT 0, + `enabled_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, + `enabled_modules` int(10) unsigned NOT NULL DEFAULT 0, + `enable_product_cost` tinyint(1) NOT NULL DEFAULT 0, + `enable_product_quantity` tinyint(1) NOT NULL DEFAULT 1, + `default_quantity` tinyint(1) NOT NULL DEFAULT 1, + `subdomain` varchar(191) DEFAULT NULL, + `db` varchar(191) DEFAULT NULL, + `size_id` int(10) unsigned DEFAULT NULL, + `first_day_of_week` varchar(191) DEFAULT NULL, + `first_month_of_year` varchar(191) DEFAULT NULL, + `portal_mode` varchar(191) NOT NULL DEFAULT 'subdomain', + `portal_domain` varchar(191) DEFAULT NULL, + `enable_modules` smallint(6) NOT NULL DEFAULT 0, + `custom_fields` mediumtext NOT NULL, + `settings` mediumtext NOT NULL, + `slack_webhook_url` varchar(191) NOT NULL, + `google_analytics_key` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `enabled_item_tax_rates` int NOT NULL DEFAULT '0', - `is_large` tinyint(1) NOT NULL DEFAULT '0', - `enable_shop_api` tinyint(1) NOT NULL DEFAULT '0', - `default_auto_bill` enum('off','always','optin','optout') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `mark_expenses_invoiceable` tinyint(1) NOT NULL DEFAULT '0', - `mark_expenses_paid` tinyint(1) NOT NULL DEFAULT '0', - `invoice_expense_documents` tinyint(1) NOT NULL DEFAULT '0', - `auto_start_tasks` tinyint(1) NOT NULL DEFAULT '0', - `invoice_task_timelog` tinyint(1) NOT NULL DEFAULT '1', - `invoice_task_documents` tinyint(1) NOT NULL DEFAULT '0', - `show_tasks_table` tinyint(1) NOT NULL DEFAULT '0', - `is_disabled` tinyint(1) NOT NULL DEFAULT '0', - `default_task_is_date_based` tinyint(1) NOT NULL DEFAULT '0', - `enable_product_discount` tinyint(1) NOT NULL DEFAULT '0', + `enabled_item_tax_rates` int(11) NOT NULL DEFAULT 0, + `is_large` tinyint(1) NOT NULL DEFAULT 0, + `enable_shop_api` tinyint(1) NOT NULL DEFAULT 0, + `default_auto_bill` enum('off','always','optin','optout') NOT NULL DEFAULT 'off', + `mark_expenses_invoiceable` tinyint(1) NOT NULL DEFAULT 0, + `mark_expenses_paid` tinyint(1) NOT NULL DEFAULT 0, + `invoice_expense_documents` tinyint(1) NOT NULL DEFAULT 0, + `auto_start_tasks` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_timelog` tinyint(1) NOT NULL DEFAULT 1, + `invoice_task_documents` tinyint(1) NOT NULL DEFAULT 0, + `show_tasks_table` tinyint(1) NOT NULL DEFAULT 0, + `is_disabled` tinyint(1) NOT NULL DEFAULT 0, + `default_task_is_date_based` tinyint(1) NOT NULL DEFAULT 0, + `enable_product_discount` tinyint(1) NOT NULL DEFAULT 0, `calculate_expense_tax_by_amount` tinyint(1) NOT NULL, - `expense_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `session_timeout` int NOT NULL DEFAULT '0', - `oauth_password_required` tinyint(1) NOT NULL DEFAULT '0', - `invoice_task_datelog` tinyint(1) NOT NULL DEFAULT '1', - `default_password_timeout` int NOT NULL DEFAULT '30', - `show_task_end_date` tinyint(1) NOT NULL DEFAULT '0', - `markdown_enabled` tinyint(1) NOT NULL DEFAULT '1', - `use_comma_as_decimal_place` tinyint(1) NOT NULL DEFAULT '0', - `report_include_drafts` tinyint(1) NOT NULL DEFAULT '0', - `client_registration_fields` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `convert_rate_to_client` tinyint(1) NOT NULL DEFAULT '1', - `markdown_email_enabled` tinyint(1) NOT NULL DEFAULT '0', - `stop_on_unpaid_recurring` tinyint(1) NOT NULL DEFAULT '0', - `use_quote_terms_on_conversion` tinyint(1) NOT NULL DEFAULT '0', - `enable_applying_payments` tinyint(1) NOT NULL DEFAULT '0', - `track_inventory` tinyint(1) NOT NULL DEFAULT '0', - `inventory_notification_threshold` int NOT NULL DEFAULT '0', - `stock_notification` tinyint(1) NOT NULL DEFAULT '1', - `enabled_expense_tax_rates` int unsigned NOT NULL DEFAULT '0', - `invoice_task_project` tinyint(1) NOT NULL DEFAULT '0', - `report_include_deleted` tinyint(1) NOT NULL DEFAULT '0', + `expense_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `session_timeout` int(11) NOT NULL DEFAULT 0, + `oauth_password_required` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_datelog` tinyint(1) NOT NULL DEFAULT 1, + `default_password_timeout` int(11) NOT NULL DEFAULT 30, + `show_task_end_date` tinyint(1) NOT NULL DEFAULT 0, + `markdown_enabled` tinyint(1) NOT NULL DEFAULT 1, + `use_comma_as_decimal_place` tinyint(1) NOT NULL DEFAULT 0, + `report_include_drafts` tinyint(1) NOT NULL DEFAULT 0, + `client_registration_fields` mediumtext DEFAULT NULL, + `convert_rate_to_client` tinyint(1) NOT NULL DEFAULT 1, + `markdown_email_enabled` tinyint(1) NOT NULL DEFAULT 0, + `stop_on_unpaid_recurring` tinyint(1) NOT NULL DEFAULT 0, + `use_quote_terms_on_conversion` tinyint(1) NOT NULL DEFAULT 0, + `enable_applying_payments` tinyint(1) NOT NULL DEFAULT 0, + `track_inventory` tinyint(1) NOT NULL DEFAULT 0, + `inventory_notification_threshold` int(11) NOT NULL DEFAULT 0, + `stock_notification` tinyint(1) NOT NULL DEFAULT 1, + `enabled_expense_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, + `invoice_task_project` tinyint(1) NOT NULL DEFAULT 0, + `report_include_deleted` tinyint(1) NOT NULL DEFAULT 0, + `invoice_task_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `companies_company_key_unique` (`company_key`), KEY `companies_industry_id_foreign` (`industry_id`), @@ -431,34 +534,34 @@ CREATE TABLE `companies` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_gateways` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `gateway_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `accepted_credit_cards` int unsigned NOT NULL, - `require_cvv` tinyint(1) NOT NULL DEFAULT '1', - `require_billing_address` tinyint(1) DEFAULT '1', - `require_shipping_address` tinyint(1) DEFAULT '1', - `update_details` tinyint(1) DEFAULT '0', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `config` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `fees_and_limits` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `custom_value1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `gateway_key` varchar(191) NOT NULL, + `accepted_credit_cards` int(10) unsigned NOT NULL, + `require_cvv` tinyint(1) NOT NULL DEFAULT 1, + `require_billing_address` tinyint(1) DEFAULT 1, + `require_shipping_address` tinyint(1) DEFAULT 1, + `update_details` tinyint(1) DEFAULT 0, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `config` mediumtext NOT NULL, + `fees_and_limits` text NOT NULL, + `custom_value1` varchar(191) DEFAULT NULL, + `custom_value2` varchar(191) DEFAULT NULL, + `custom_value3` varchar(191) DEFAULT NULL, + `custom_value4` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `token_billing` enum('off','always','optin','optout') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `label` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `require_client_name` tinyint(1) NOT NULL DEFAULT '0', - `require_postal_code` tinyint(1) NOT NULL DEFAULT '0', - `require_client_phone` tinyint(1) NOT NULL DEFAULT '0', - `require_contact_name` tinyint(1) NOT NULL DEFAULT '0', - `require_contact_email` tinyint(1) NOT NULL DEFAULT '0', + `token_billing` enum('off','always','optin','optout') NOT NULL DEFAULT 'off', + `label` varchar(255) DEFAULT NULL, + `require_client_name` tinyint(1) NOT NULL DEFAULT 0, + `require_postal_code` tinyint(1) NOT NULL DEFAULT 0, + `require_client_phone` tinyint(1) NOT NULL DEFAULT 0, + `require_contact_name` tinyint(1) NOT NULL DEFAULT 0, + `require_contact_email` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `company_gateways_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `company_gateways_gateway_key_foreign` (`gateway_key`), @@ -470,19 +573,19 @@ CREATE TABLE `company_gateways` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_ledgers`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_ledgers` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `activity_id` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `activity_id` int(10) unsigned DEFAULT NULL, `adjustment` decimal(20,6) DEFAULT NULL, `balance` decimal(20,6) DEFAULT NULL, - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `company_ledgerable_id` int unsigned NOT NULL, - `company_ledgerable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `notes` text DEFAULT NULL, + `hash` text DEFAULT NULL, + `company_ledgerable_id` int(10) unsigned NOT NULL, + `company_ledgerable_type` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -494,24 +597,25 @@ CREATE TABLE `company_ledgers` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_tokens` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `account_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `account_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `token` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_system` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_system` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `company_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `company_tokens_account_id_foreign` (`account_id`), KEY `company_tokens_user_id_foreign` (`user_id`), KEY `company_tokens_company_id_index` (`company_id`), + KEY `company_tokens_token_deleted_at_index` (`token`,`deleted_at`), CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -519,24 +623,24 @@ CREATE TABLE `company_tokens` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `company_user` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `account_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `permissions` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `notifications` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `slack_webhook_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_owner` tinyint(1) NOT NULL DEFAULT '0', - `is_admin` tinyint(1) NOT NULL DEFAULT '0', - `is_locked` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `account_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `permissions` mediumtext DEFAULT NULL, + `notifications` mediumtext DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `slack_webhook_url` varchar(191) NOT NULL, + `is_owner` tinyint(1) NOT NULL DEFAULT 0, + `is_admin` tinyint(1) NOT NULL DEFAULT 0, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `permissions_updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `ninja_portal_url` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `permissions_updated_at` timestamp NOT NULL DEFAULT current_timestamp(), + `ninja_portal_url` text NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `company_user_company_id_user_id_unique` (`company_id`,`user_id`), KEY `company_user_account_id_company_id_deleted_at_index` (`account_id`,`company_id`,`deleted_at`), @@ -547,43 +651,43 @@ CREATE TABLE `company_user` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `countries`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `countries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `capital` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `citizenship` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_sub_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `full_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_2` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_3` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `region_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `sub_region_code` varchar(3) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `eea` tinyint(1) NOT NULL DEFAULT '0', - `swap_postal_code` tinyint(1) NOT NULL DEFAULT '0', - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0', - `thousand_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `decimal_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `capital` varchar(255) DEFAULT NULL, + `citizenship` varchar(255) DEFAULT NULL, + `country_code` varchar(3) DEFAULT NULL, + `currency` varchar(255) DEFAULT NULL, + `currency_code` varchar(255) DEFAULT NULL, + `currency_sub_unit` varchar(255) DEFAULT NULL, + `full_name` varchar(255) DEFAULT NULL, + `iso_3166_2` varchar(2) DEFAULT NULL, + `iso_3166_3` varchar(3) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `region_code` varchar(3) DEFAULT NULL, + `sub_region_code` varchar(3) DEFAULT NULL, + `eea` tinyint(1) NOT NULL DEFAULT 0, + `swap_postal_code` tinyint(1) NOT NULL DEFAULT 0, + `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, + `thousand_separator` varchar(191) DEFAULT NULL, + `decimal_separator` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `credit_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `credit_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `credit_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -591,8 +695,8 @@ CREATE TABLE `credit_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `credit_invitations_client_contact_id_credit_id_unique` (`client_contact_id`,`credit_id`), KEY `credit_invitations_user_id_foreign` (`user_id`), @@ -608,55 +712,55 @@ CREATE TABLE `credit_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credits`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `credits` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` datetime DEFAULT NULL, `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -669,8 +773,8 @@ CREATE TABLE `credits` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `credits_company_id_number_unique` (`company_id`,`number`), KEY `credits_user_id_foreign` (`user_id`), @@ -684,54 +788,54 @@ CREATE TABLE `credits` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `currencies` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `symbol` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `precision` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `thousand_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `decimal_separator` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `symbol` varchar(191) NOT NULL, + `precision` varchar(191) NOT NULL, + `thousand_separator` varchar(191) NOT NULL, + `decimal_separator` varchar(191) NOT NULL, + `code` varchar(191) NOT NULL, + `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `date_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `date_formats` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `format` varchar(191) NOT NULL, + `format_moment` varchar(191) NOT NULL, + `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `datetime_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `datetime_formats` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `format` varchar(191) NOT NULL, + `format_moment` varchar(191) NOT NULL, + `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `designs` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `is_custom` tinyint(1) NOT NULL DEFAULT '1', - `is_active` tinyint(1) NOT NULL DEFAULT '1', - `design` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) NOT NULL, + `is_custom` tinyint(1) NOT NULL DEFAULT 1, + `is_active` tinyint(1) NOT NULL DEFAULT 1, + `design` mediumtext DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -743,52 +847,54 @@ CREATE TABLE `designs` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `documents`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `documents` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `preview` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `disk` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hash` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size` int unsigned DEFAULT NULL, - `width` int unsigned DEFAULT NULL, - `height` int unsigned DEFAULT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `url` varchar(191) DEFAULT NULL, + `preview` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `type` varchar(191) DEFAULT NULL, + `disk` varchar(191) DEFAULT NULL, + `hash` varchar(100) DEFAULT NULL, + `size` int(10) unsigned DEFAULT NULL, + `width` int(10) unsigned DEFAULT NULL, + `height` int(10) unsigned DEFAULT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `documentable_id` int unsigned NOT NULL, - `documentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `documentable_id` int(10) unsigned NOT NULL, + `documentable_type` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_public` tinyint(1) NOT NULL DEFAULT '1', + `is_public` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `documents_company_id_index` (`company_id`), + KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), CONSTRAINT `documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expense_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `expense_categories` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `company_id` int unsigned NOT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `company_id` int(10) unsigned NOT NULL, + `name` varchar(191) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `color` varchar(191) NOT NULL DEFAULT '#fff', + `bank_category_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), @@ -797,101 +903,102 @@ CREATE TABLE `expense_categories` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `expenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `bank_id` int unsigned DEFAULT NULL, - `invoice_currency_id` int unsigned DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `category_id` int unsigned DEFAULT NULL, - `payment_type_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `company_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `bank_id` int(10) unsigned DEFAULT NULL, + `invoice_currency_id` int(10) unsigned DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `payment_type_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `amount` decimal(20,6) NOT NULL, `foreign_amount` decimal(20,6) NOT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, `date` date DEFAULT NULL, `payment_date` date DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `transaction_reference` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT '0', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '1', - `transaction_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `tax_amount1` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_amount2` decimal(20,6) NOT NULL DEFAULT '1.000000', - `tax_amount3` decimal(20,6) NOT NULL DEFAULT '1.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT '0', + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `transaction_reference` text DEFAULT NULL, + `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 1, + `transaction_id` bigint(20) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `tax_amount1` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_amount2` decimal(20,6) NOT NULL DEFAULT 1.000000, + `tax_amount3` decimal(20,6) NOT NULL DEFAULT 1.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_company_id_index` (`company_id`), + KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `failed_jobs` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `uuid` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `connection` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `queue` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `exception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `uuid` varchar(191) DEFAULT NULL, + `connection` text NOT NULL, + `queue` text NOT NULL, + `payload` longtext NOT NULL, + `exception` longtext NOT NULL, + `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateway_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `gateway_types` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `alias` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `alias` varchar(191) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `gateways` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `provider` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `visible` tinyint(1) NOT NULL DEFAULT '1', - `sort_order` int unsigned NOT NULL DEFAULT '10000', - `site_url` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_offsite` tinyint(1) NOT NULL DEFAULT '0', - `is_secure` tinyint(1) NOT NULL DEFAULT '0', - `fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `default_gateway_type_id` int unsigned NOT NULL DEFAULT '1', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `key` varchar(191) NOT NULL, + `provider` varchar(191) NOT NULL, + `visible` tinyint(1) NOT NULL DEFAULT 1, + `sort_order` int(10) unsigned NOT NULL DEFAULT 10000, + `site_url` varchar(200) DEFAULT NULL, + `is_offsite` tinyint(1) NOT NULL DEFAULT 0, + `is_secure` tinyint(1) NOT NULL DEFAULT 0, + `fields` longtext DEFAULT NULL, + `default_gateway_type_id` int(10) unsigned NOT NULL DEFAULT 1, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -900,18 +1007,18 @@ CREATE TABLE `gateways` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `group_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `group_settings` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `settings` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_default` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `settings` mediumtext DEFAULT NULL, + `is_default` tinyint(1) NOT NULL DEFAULT 0, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `group_settings_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `group_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -919,27 +1026,27 @@ CREATE TABLE `group_settings` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `industries`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `industries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoice_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `invoice_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -947,15 +1054,15 @@ CREATE TABLE `invoice_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `invoice_invitations_client_contact_id_invoice_id_unique` (`client_contact_id`,`invoice_id`), KEY `invoice_invitations_user_id_foreign` (`user_id`), KEY `invoice_invitations_company_id_foreign` (`company_id`), KEY `invoice_invitations_deleted_at_invoice_id_company_id_index` (`deleted_at`,`invoice_id`,`company_id`), KEY `invoice_invitations_invoice_id_index` (`invoice_id`), - KEY `invoice_invitations_key_index` (`key`), + KEY `invoice_invitations_key_deleted_at_index` (`key`,`deleted_at`), CONSTRAINT `invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, @@ -964,54 +1071,54 @@ CREATE TABLE `invoice_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `invoices` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -1024,10 +1131,10 @@ CREATE TABLE `invoices` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, - `auto_bill_tries` smallint NOT NULL DEFAULT '0', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, + `auto_bill_tries` smallint(6) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `invoices_company_id_number_unique` (`company_id`,`number`), KEY `invoices_user_id_foreign` (`user_id`), @@ -1043,79 +1150,79 @@ CREATE TABLE `invoices` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `jobs` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `attempts` tinyint unsigned NOT NULL, - `reserved_at` int unsigned DEFAULT NULL, - `available_at` int unsigned NOT NULL, - `created_at` int unsigned NOT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `queue` varchar(191) NOT NULL, + `payload` longtext NOT NULL, + `attempts` tinyint(3) unsigned NOT NULL, + `reserved_at` int(10) unsigned DEFAULT NULL, + `available_at` int(10) unsigned NOT NULL, + `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `languages`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `languages` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `locale` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `locale` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `licenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `licenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `license_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `email` varchar(191) DEFAULT NULL, + `license_key` varchar(191) DEFAULT NULL, `is_claimed` tinyint(1) DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_id` int unsigned DEFAULT NULL, - `recurring_invoice_id` bigint unsigned DEFAULT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `product_id` int(10) unsigned DEFAULT NULL, + `recurring_invoice_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `licenses_license_key_unique` (`license_key`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `migrations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `migration` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `batch` int NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `migration` varchar(191) NOT NULL, + `batch` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `password_resets` ( - `email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(128) NOT NULL, + `token` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_hashes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_hashes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `hash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `hash` varchar(255) NOT NULL, `fee_total` decimal(16,4) NOT NULL, - `fee_invoice_id` int unsigned DEFAULT NULL, - `data` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `payment_id` int unsigned DEFAULT NULL, + `fee_invoice_id` int(10) unsigned DEFAULT NULL, + `data` mediumtext NOT NULL, + `payment_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), @@ -1126,26 +1233,26 @@ CREATE TABLE `payment_hashes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_libraries`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_libraries` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `visible` tinyint(1) NOT NULL DEFAULT '1', + `name` varchar(191) DEFAULT NULL, + `visible` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_terms`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_terms` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `num_days` int DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `num_days` int(11) DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1158,24 +1265,24 @@ CREATE TABLE `payment_terms` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payment_types` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `gateway_type_id` int DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `gateway_type_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `paymentables`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `paymentables` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `payment_id` int unsigned NOT NULL, - `paymentable_id` int unsigned NOT NULL, - `amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `refunded` decimal(16,4) NOT NULL DEFAULT '0.0000', - `paymentable_type` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payment_id` int(10) unsigned NOT NULL, + `paymentable_id` int(10) unsigned NOT NULL, + `amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, + `paymentable_type` varchar(191) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1187,43 +1294,44 @@ CREATE TABLE `paymentables` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `payments` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `client_contact_id` int unsigned DEFAULT NULL, - `invitation_id` int unsigned DEFAULT NULL, - `company_gateway_id` int unsigned DEFAULT NULL, - `gateway_type_id` int unsigned DEFAULT NULL, - `type_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `refunded` decimal(20,6) NOT NULL DEFAULT '0.000000', - `applied` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `client_contact_id` int(10) unsigned DEFAULT NULL, + `invitation_id` int(10) unsigned DEFAULT NULL, + `company_gateway_id` int(10) unsigned DEFAULT NULL, + `gateway_type_id` int(10) unsigned DEFAULT NULL, + `type_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `refunded` decimal(20,6) NOT NULL DEFAULT 0.000000, + `applied` decimal(20,6) NOT NULL DEFAULT 0.000000, `date` date DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payer_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `transaction_reference` varchar(191) DEFAULT NULL, + `payer_id` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_manual` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `currency_id` int unsigned NOT NULL, - `exchange_currency_id` int unsigned DEFAULT NULL, - `meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_manual` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `currency_id` int(10) unsigned NOT NULL, + `exchange_currency_id` int(10) unsigned DEFAULT NULL, + `meta` text DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `idempotency_key` varchar(64) DEFAULT NULL, + `transaction_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), KEY `payments_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1244,36 +1352,36 @@ CREATE TABLE `payments` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `products` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `product_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `cost` decimal(20,6) NOT NULL DEFAULT '0.000000', - `price` decimal(20,6) NOT NULL DEFAULT '0.000000', - `quantity` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `product_key` varchar(191) DEFAULT NULL, + `notes` text DEFAULT NULL, + `cost` decimal(20,6) NOT NULL DEFAULT 0.000000, + `price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `quantity` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, `deleted_at` timestamp(6) NULL DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `in_stock_quantity` int NOT NULL DEFAULT '0', - `stock_notification` tinyint(1) NOT NULL DEFAULT '1', - `stock_notification_threshold` int NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `in_stock_quantity` int(11) NOT NULL DEFAULT 0, + `stock_notification` tinyint(1) NOT NULL DEFAULT 1, + `stock_notification_threshold` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `products_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `products_user_id_foreign` (`user_id`), @@ -1286,29 +1394,29 @@ CREATE TABLE `products` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `projects`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `projects` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `task_rate` decimal(20,6) NOT NULL DEFAULT '0.000000', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) NOT NULL, + `task_rate` decimal(20,6) NOT NULL DEFAULT 0.000000, `due_date` date DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `private_notes` text DEFAULT NULL, `budgeted_hours` decimal(20,6) NOT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', + `public_notes` text DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `number` varchar(191) DEFAULT NULL, + `color` varchar(191) NOT NULL DEFAULT '#fff', PRIMARY KEY (`id`), KEY `projects_user_id_foreign` (`user_id`), KEY `projects_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1319,18 +1427,18 @@ CREATE TABLE `projects` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_order_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `purchase_order_invitations` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `vendor_contact_id` int unsigned NOT NULL, - `purchase_order_id` bigint unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `vendor_contact_id` int(10) unsigned NOT NULL, + `purchase_order_id` bigint(20) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -1338,7 +1446,7 @@ CREATE TABLE `purchase_order_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendor_purchase_unique` (`vendor_contact_id`,`purchase_order_id`), KEY `purchase_order_invitations_user_id_foreign` (`user_id`), @@ -1355,69 +1463,69 @@ CREATE TABLE `purchase_order_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_orders`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `purchase_orders` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` datetime DEFAULT NULL, `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, `reminder1_sent` date DEFAULT NULL, `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, `amount` decimal(20,6) NOT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, `partial_due_date` datetime DEFAULT NULL, `last_viewed` datetime DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `expense_id` int unsigned DEFAULT NULL, + `expense_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `purchase_orders_user_id_foreign` (`user_id`), KEY `purchase_orders_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1431,18 +1539,18 @@ CREATE TABLE `purchase_orders` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `quote_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `quote_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `quote_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, @@ -1450,8 +1558,8 @@ CREATE TABLE `quote_invitations` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `signature_ip` text DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `quote_invitations_client_contact_id_quote_id_unique` (`client_contact_id`,`quote_id`), KEY `quote_invitations_user_id_foreign` (`user_id`), @@ -1467,55 +1575,55 @@ CREATE TABLE `quote_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `quotes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `recurring_id` int unsigned DEFAULT NULL, - `design_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `recurring_id` int(10) unsigned DEFAULT NULL, + `design_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `last_sent_date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(20,6) DEFAULT NULL, @@ -1528,8 +1636,8 @@ CREATE TABLE `quotes` ( `reminder2_sent` date DEFAULT NULL, `reminder3_sent` date DEFAULT NULL, `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `quotes_company_id_number_unique` (`company_id`,`number`), KEY `quotes_user_id_foreign` (`user_id`), @@ -1544,38 +1652,38 @@ CREATE TABLE `quotes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_expenses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `status_id` int unsigned NOT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `bank_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `payment_type_id` int unsigned DEFAULT NULL, - `recurring_expense_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '1', - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `status_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `bank_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `payment_type_id` int(10) unsigned DEFAULT NULL, + `recurring_expense_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_name3` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `payment_date` date DEFAULT NULL, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT '0', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '0', - `transaction_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `category_id` int unsigned DEFAULT NULL, - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT '0', + `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, + `transaction_id` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, `tax_amount1` decimal(20,6) DEFAULT NULL, `tax_amount2` decimal(20,6) DEFAULT NULL, `tax_amount3` decimal(20,6) DEFAULT NULL, @@ -1584,18 +1692,18 @@ CREATE TABLE `recurring_expenses` ( `tax_rate3` decimal(20,6) DEFAULT NULL, `amount` decimal(20,6) DEFAULT NULL, `foreign_amount` decimal(20,6) DEFAULT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT '1.000000', - `assigned_user_id` int unsigned DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `invoice_currency_id` int unsigned DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `transaction_reference` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `frequency_id` int unsigned NOT NULL, + `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `invoice_currency_id` int(10) unsigned DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `transaction_reference` text DEFAULT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int DEFAULT NULL, + `remaining_cycles` int(11) DEFAULT NULL, `next_send_date_client` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `recurring_expenses_company_id_number_unique` (`company_id`,`number`), @@ -1608,26 +1716,26 @@ CREATE TABLE `recurring_expenses` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_invoice_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `recurring_invoice_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `recurring_invoice_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `cli_rec` (`client_contact_id`,`recurring_invoice_id`), KEY `recurring_invoice_invitations_user_id_foreign` (`user_id`), @@ -1643,68 +1751,68 @@ CREATE TABLE `recurring_invoice_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_invoices` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `number` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `number` text DEFAULT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `amount` decimal(20,6) NOT NULL, `balance` decimal(20,6) NOT NULL, `partial` decimal(16,4) DEFAULT NULL, `last_viewed` datetime DEFAULT NULL, - `frequency_id` int unsigned NOT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int DEFAULT NULL, + `remaining_cycles` int(11) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `design_id` int unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0', + `auto_bill` varchar(191) NOT NULL DEFAULT 'off', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `design_id` int(10) unsigned DEFAULT NULL, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `due_date_days` varchar(191) DEFAULT NULL, `partial_due_date` date DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', - `subscription_id` int unsigned DEFAULT NULL, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, + `subscription_id` int(10) unsigned DEFAULT NULL, `next_send_date_client` datetime DEFAULT NULL, PRIMARY KEY (`id`), KEY `recurring_invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1719,23 +1827,23 @@ CREATE TABLE `recurring_invoices` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_quote_invitations` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `client_contact_id` int unsigned NOT NULL, - `recurring_quote_id` int unsigned NOT NULL, - `key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `signature_base64` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `client_contact_id` int(10) unsigned NOT NULL, + `recurring_quote_id` int(10) unsigned NOT NULL, + `key` varchar(191) NOT NULL, + `transaction_reference` varchar(191) DEFAULT NULL, + `message_id` varchar(191) DEFAULT NULL, + `email_error` mediumtext DEFAULT NULL, + `signature_base64` text DEFAULT NULL, `signature_date` datetime DEFAULT NULL, `sent_date` datetime DEFAULT NULL, `viewed_date` datetime DEFAULT NULL, `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `email_status` enum('delivered','bounced','spam') DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1754,67 +1862,67 @@ CREATE TABLE `recurring_quote_invitations` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `recurring_quotes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `project_id` int unsigned DEFAULT NULL, - `vendor_id` int unsigned DEFAULT NULL, - `status_id` int unsigned NOT NULL, - `discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `po_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `vendor_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned NOT NULL, + `discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `number` varchar(191) DEFAULT NULL, + `po_number` varchar(191) DEFAULT NULL, `date` date DEFAULT NULL, `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `line_items` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `backup` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `footer` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `terms` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `tax_name1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT '0.000000', - `tax_name3` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT '0.000000', - `total_taxes` decimal(20,6) NOT NULL DEFAULT '0.000000', - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `amount` decimal(20,6) NOT NULL DEFAULT '0.000000', - `balance` decimal(20,6) NOT NULL DEFAULT '0.000000', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `line_items` mediumtext DEFAULT NULL, + `backup` mediumtext DEFAULT NULL, + `footer` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `terms` text DEFAULT NULL, + `tax_name1` varchar(191) DEFAULT NULL, + `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name2` varchar(191) DEFAULT NULL, + `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, + `tax_name3` varchar(191) DEFAULT NULL, + `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, + `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, + `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, `last_viewed` datetime DEFAULT NULL, - `frequency_id` int unsigned NOT NULL, + `frequency_id` int(10) unsigned NOT NULL, `last_sent_date` datetime DEFAULT NULL, `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int unsigned DEFAULT NULL, + `remaining_cycles` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT '0', - `paid_to_date` decimal(20,6) NOT NULL DEFAULT '0.000000', + `auto_bill` varchar(191) NOT NULL DEFAULT 'off', + `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, + `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, `custom_surcharge1` decimal(20,6) DEFAULT NULL, `custom_surcharge2` decimal(20,6) DEFAULT NULL, `custom_surcharge3` decimal(20,6) DEFAULT NULL, `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT '0', - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT '0', - `due_date_days` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT '1.000000', + `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, + `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, + `due_date_days` varchar(191) DEFAULT NULL, + `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, `partial` decimal(16,4) DEFAULT NULL, `partial_due_date` date DEFAULT NULL, - `subscription_id` int unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT '1', + `subscription_id` int(10) unsigned DEFAULT NULL, + `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), KEY `recurring_quotes_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `recurring_quotes_user_id_foreign` (`user_id`), @@ -1828,69 +1936,73 @@ CREATE TABLE `recurring_quotes` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `schedulers`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `schedulers` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT, - `paused` tinyint(1) NOT NULL DEFAULT '0', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `repeat_every` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `start_from` timestamp NOT NULL, - `scheduled_run` timestamp NOT NULL, - `company_id` bigint unsigned NOT NULL, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `paused` tinyint(1) NOT NULL DEFAULT 0, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `repeat_every` varchar(191) NOT NULL, + `start_from` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `scheduled_run` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `company_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `action_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `action_class` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `parameters` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `action_name` varchar(191) NOT NULL, + `action_class` varchar(191) NOT NULL, + `parameters` mediumtext DEFAULT NULL, PRIMARY KEY (`id`), KEY `schedulers_action_name_index` (`action_name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `sizes`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `sizes` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `subscriptions` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `frequency_id` int unsigned DEFAULT NULL, - `auto_bill` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `promo_code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `promo_discount` double(8,2) NOT NULL DEFAULT '0.00', - `is_amount_discount` tinyint(1) NOT NULL DEFAULT '0', - `allow_cancellation` tinyint(1) NOT NULL DEFAULT '1', - `per_seat_enabled` tinyint(1) NOT NULL DEFAULT '0', - `min_seats_limit` int unsigned NOT NULL, - `max_seats_limit` int unsigned NOT NULL, - `trial_enabled` tinyint(1) NOT NULL DEFAULT '0', - `trial_duration` int unsigned NOT NULL, - `allow_query_overrides` tinyint(1) NOT NULL DEFAULT '0', - `allow_plan_changes` tinyint(1) NOT NULL DEFAULT '0', - `plan_map` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `refund_period` int unsigned DEFAULT NULL, - `webhook_configuration` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `product_ids` text DEFAULT NULL, + `frequency_id` int(10) unsigned DEFAULT NULL, + `auto_bill` text DEFAULT NULL, + `promo_code` text DEFAULT NULL, + `promo_discount` double(8,2) NOT NULL DEFAULT 0.00, + `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, + `allow_cancellation` tinyint(1) NOT NULL DEFAULT 1, + `per_seat_enabled` tinyint(1) NOT NULL DEFAULT 0, + `min_seats_limit` int(10) unsigned NOT NULL, + `max_seats_limit` int(10) unsigned NOT NULL, + `trial_enabled` tinyint(1) NOT NULL DEFAULT 0, + `trial_duration` int(10) unsigned NOT NULL, + `allow_query_overrides` tinyint(1) NOT NULL DEFAULT 0, + `allow_plan_changes` tinyint(1) NOT NULL DEFAULT 0, + `plan_map` text DEFAULT NULL, + `refund_period` int(10) unsigned DEFAULT NULL, + `webhook_configuration` mediumtext NOT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, - `currency_id` int unsigned DEFAULT NULL, - `recurring_product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `group_id` int unsigned DEFAULT NULL, - `price` decimal(20,6) NOT NULL DEFAULT '0.000000', - `promo_price` decimal(20,6) NOT NULL DEFAULT '0.000000', + `currency_id` int(10) unsigned DEFAULT NULL, + `recurring_product_ids` text DEFAULT NULL, + `name` varchar(191) NOT NULL, + `group_id` int(10) unsigned DEFAULT NULL, + `price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `promo_price` decimal(20,6) NOT NULL DEFAULT 0.000000, + `registration_required` tinyint(1) NOT NULL DEFAULT 0, + `use_inventory_management` tinyint(1) NOT NULL DEFAULT 0, + `optional_product_ids` text DEFAULT NULL, + `optional_recurring_product_ids` text DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1899,16 +2011,16 @@ CREATE TABLE `subscriptions` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `system_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `system_logs` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, - `client_id` int unsigned DEFAULT NULL, - `category_id` int unsigned DEFAULT NULL, - `event_id` int unsigned DEFAULT NULL, - `type_id` int unsigned DEFAULT NULL, - `log` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `category_id` int(10) unsigned DEFAULT NULL, + `event_id` int(10) unsigned DEFAULT NULL, + `type_id` int(10) unsigned DEFAULT NULL, + `log` mediumtext NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, @@ -1921,19 +2033,19 @@ CREATE TABLE `system_logs` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_statuses`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `task_statuses` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) DEFAULT NULL, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `status_sort_order` int DEFAULT NULL, - `color` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - `status_order` int DEFAULT NULL, + `status_sort_order` int(11) DEFAULT NULL, + `color` varchar(191) NOT NULL DEFAULT '#fff', + `status_order` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_statuses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `task_statuses_user_id_foreign` (`user_id`), @@ -1943,34 +2055,35 @@ CREATE TABLE `task_statuses` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `tasks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `client_id` int unsigned DEFAULT NULL, - `invoice_id` int unsigned DEFAULT NULL, - `project_id` int unsigned DEFAULT NULL, - `status_id` int unsigned DEFAULT NULL, - `status_sort_order` int DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `client_id` int(10) unsigned DEFAULT NULL, + `invoice_id` int(10) unsigned DEFAULT NULL, + `project_id` int(10) unsigned DEFAULT NULL, + `status_id` int(10) unsigned DEFAULT NULL, + `status_sort_order` int(11) DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `duration` int unsigned DEFAULT NULL, - `description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `is_running` tinyint(1) NOT NULL DEFAULT '0', - `time_log` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT '0.000000', - `invoice_documents` tinyint(1) NOT NULL DEFAULT '0', - `is_date_based` tinyint(1) NOT NULL DEFAULT '0', - `status_order` int DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `duration` int(10) unsigned DEFAULT NULL, + `description` text DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `is_running` tinyint(1) NOT NULL DEFAULT 0, + `time_log` text DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, + `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, + `is_date_based` tinyint(1) NOT NULL DEFAULT 0, + `status_order` int(11) DEFAULT NULL, + `invoice_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tasks_user_id_foreign` (`user_id`), @@ -1985,17 +2098,17 @@ CREATE TABLE `tasks` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tax_rates`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `tax_rates` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT '0.000000', - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `name` varchar(100) NOT NULL, + `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), KEY `tax_rates_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tax_rates_user_id_foreign` (`user_id`), @@ -2006,44 +2119,44 @@ CREATE TABLE `tax_rates` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `timezones`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `timezones` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `location` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `utc_offset` int NOT NULL DEFAULT '0', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(191) NOT NULL, + `location` varchar(191) NOT NULL, + `utc_offset` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `transaction_events`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `transaction_events` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `client_id` int unsigned NOT NULL, - `invoice_id` int unsigned NOT NULL, - `payment_id` int unsigned NOT NULL, - `credit_id` int unsigned NOT NULL, - `client_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `client_paid_to_date` decimal(16,4) NOT NULL DEFAULT '0.0000', - `client_credit_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_partial` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_paid_to_date` decimal(16,4) NOT NULL DEFAULT '0.0000', - `invoice_status` int unsigned DEFAULT NULL, - `payment_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_applied` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_refunded` decimal(16,4) NOT NULL DEFAULT '0.0000', - `payment_status` int unsigned DEFAULT NULL, - `paymentables` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `event_id` int unsigned NOT NULL, - `timestamp` int unsigned NOT NULL, - `payment_request` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `metadata` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `credit_balance` decimal(16,4) NOT NULL DEFAULT '0.0000', - `credit_amount` decimal(16,4) NOT NULL DEFAULT '0.0000', - `credit_status` int unsigned DEFAULT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client_id` int(10) unsigned NOT NULL, + `invoice_id` int(10) unsigned NOT NULL, + `payment_id` int(10) unsigned NOT NULL, + `credit_id` int(10) unsigned NOT NULL, + `client_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `client_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, + `client_credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_partial` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, + `invoice_status` int(10) unsigned DEFAULT NULL, + `payment_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_applied` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, + `payment_status` int(10) unsigned DEFAULT NULL, + `paymentables` mediumtext DEFAULT NULL, + `event_id` int(10) unsigned NOT NULL, + `timestamp` int(10) unsigned NOT NULL, + `payment_request` mediumtext DEFAULT NULL, + `metadata` mediumtext DEFAULT NULL, + `credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, + `credit_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, + `credit_status` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `transaction_events_client_id_index` (`client_id`), CONSTRAINT `transaction_events_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE @@ -2051,46 +2164,48 @@ CREATE TABLE `transaction_events` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `account_id` int unsigned NOT NULL, - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ip` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `device_token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `account_id` int(10) unsigned NOT NULL, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `ip` varchar(191) DEFAULT NULL, + `device_token` varchar(191) DEFAULT NULL, + `email` varchar(100) NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `theme_id` int DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `referral_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `oauth_provider_id` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `google_2fa_secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_width` int unsigned DEFAULT NULL, - `avatar_height` int unsigned DEFAULT NULL, - `avatar_size` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `theme_id` int(11) DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `referral_code` varchar(191) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_user_token` text DEFAULT NULL, + `oauth_provider_id` varchar(191) DEFAULT NULL, + `google_2fa_secret` text DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(100) DEFAULT NULL, + `avatar_width` int(10) unsigned DEFAULT NULL, + `avatar_height` int(10) unsigned DEFAULT NULL, + `avatar_size` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `last_login` datetime DEFAULT NULL, - `signature` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `signature` mediumtext DEFAULT NULL, + `password` varchar(191) NOT NULL, + `remember_token` varchar(100) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `oauth_user_refresh_token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `last_confirmed_email_address` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `has_password` tinyint(1) NOT NULL DEFAULT '0', + `oauth_user_refresh_token` text DEFAULT NULL, + `last_confirmed_email_address` varchar(191) DEFAULT NULL, + `has_password` tinyint(1) NOT NULL DEFAULT 0, `oauth_user_token_expiry` datetime DEFAULT NULL, + `sms_verification_code` varchar(191) DEFAULT NULL, + `verified_phone_number` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`), UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), @@ -2100,42 +2215,42 @@ CREATE TABLE `users` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendor_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `vendor_contacts` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned NOT NULL, - `user_id` int unsigned NOT NULL, - `vendor_id` int unsigned NOT NULL, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned NOT NULL, + `user_id` int(10) unsigned NOT NULL, + `vendor_id` int(10) unsigned NOT NULL, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT '0', - `first_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `send_email` tinyint(1) NOT NULL DEFAULT '0', + `is_primary` tinyint(1) NOT NULL DEFAULT 0, + `first_name` varchar(191) DEFAULT NULL, + `last_name` varchar(191) DEFAULT NULL, + `email` varchar(191) DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `send_email` tinyint(1) NOT NULL DEFAULT 0, `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `confirmed` tinyint(1) NOT NULL DEFAULT '0', + `confirmation_code` varchar(191) DEFAULT NULL, + `confirmed` tinyint(1) NOT NULL DEFAULT 0, `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint DEFAULT NULL, - `oauth_user_id` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT '0', - `contact_key` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `failed_logins` smallint(6) DEFAULT NULL, + `oauth_user_id` varchar(100) DEFAULT NULL, + `oauth_provider_id` int(10) unsigned DEFAULT NULL, + `google_2fa_secret` varchar(191) DEFAULT NULL, + `accepted_terms_version` varchar(191) DEFAULT NULL, + `avatar` varchar(255) DEFAULT NULL, + `avatar_type` varchar(255) DEFAULT NULL, + `avatar_size` varchar(255) DEFAULT NULL, + `password` varchar(191) NOT NULL, + `token` varchar(191) DEFAULT NULL, + `is_locked` tinyint(1) NOT NULL DEFAULT 0, + `contact_key` varchar(191) DEFAULT NULL, + `remember_token` varchar(100) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendor_contacts_oauth_user_id_unique` (`oauth_user_id`), UNIQUE KEY `vendor_contacts_oauth_provider_id_unique` (`oauth_provider_id`), @@ -2152,37 +2267,37 @@ CREATE TABLE `vendor_contacts` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendors`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `vendors` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, - `user_id` int unsigned NOT NULL, - `assigned_user_id` int unsigned DEFAULT NULL, - `company_id` int unsigned NOT NULL, - `currency_id` int unsigned DEFAULT NULL, - `name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address1` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int unsigned DEFAULT NULL, - `phone` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `website` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint NOT NULL DEFAULT '0', - `vat_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_name` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value2` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value3` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `custom_value4` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `vendor_hash` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `id_number` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `user_id` int(10) unsigned NOT NULL, + `assigned_user_id` int(10) unsigned DEFAULT NULL, + `company_id` int(10) unsigned NOT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, + `name` varchar(191) DEFAULT NULL, + `address1` varchar(191) DEFAULT NULL, + `address2` varchar(191) DEFAULT NULL, + `city` varchar(191) DEFAULT NULL, + `state` varchar(191) DEFAULT NULL, + `postal_code` varchar(191) DEFAULT NULL, + `country_id` int(10) unsigned DEFAULT NULL, + `phone` varchar(191) DEFAULT NULL, + `private_notes` text DEFAULT NULL, + `website` varchar(191) DEFAULT NULL, + `is_deleted` tinyint(4) NOT NULL DEFAULT 0, + `vat_number` varchar(191) DEFAULT NULL, + `transaction_name` varchar(191) DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, + `custom_value1` text DEFAULT NULL, + `custom_value2` text DEFAULT NULL, + `custom_value3` text DEFAULT NULL, + `custom_value4` text DEFAULT NULL, + `vendor_hash` text DEFAULT NULL, + `public_notes` text DEFAULT NULL, + `id_number` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `vendors_company_id_number_unique` (`company_id`,`number`), KEY `vendors_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -2197,20 +2312,20 @@ CREATE TABLE `vendors` ( /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `webhooks`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `webhooks` ( - `id` int unsigned NOT NULL AUTO_INCREMENT, - `company_id` int unsigned DEFAULT NULL, - `user_id` int unsigned DEFAULT NULL, - `event_id` int unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT '0', - `target_url` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `format` enum('JSON','UBL') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'JSON', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `company_id` int(10) unsigned DEFAULT NULL, + `user_id` int(10) unsigned DEFAULT NULL, + `event_id` int(10) unsigned DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT 0, + `target_url` varchar(191) NOT NULL, + `format` enum('JSON','UBL') NOT NULL DEFAULT 'JSON', `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `deleted_at` timestamp(6) NULL DEFAULT NULL, - `rest_method` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, - `headers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci, + `rest_method` text DEFAULT NULL, + `headers` text DEFAULT NULL, PRIMARY KEY (`id`), KEY `subscriptions_company_id_foreign` (`company_id`), KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), @@ -2391,3 +2506,13 @@ INSERT INTO `migrations` VALUES (164,'2022_09_21_012417_add_threeds_to_braintree INSERT INTO `migrations` VALUES (165,'2022_09_30_235337_add_idempotency_key_to_payments',12); INSERT INTO `migrations` VALUES (166,'2022_10_05_205645_add_indexes_to_client_hash',12); INSERT INTO `migrations` VALUES (167,'2022_10_06_011344_add_key_to_products',12); +INSERT INTO `migrations` VALUES (168,'2022_08_05_023357_bank_integration',13); +INSERT INTO `migrations` VALUES (169,'2022_10_07_065455_add_key_to_company_tokens_table',13); +INSERT INTO `migrations` VALUES (170,'2022_10_10_070137_add_documentable_index',13); +INSERT INTO `migrations` VALUES (171,'2022_10_27_044909_add_user_sms_verification_code',13); +INSERT INTO `migrations` VALUES (172,'2022_11_02_063742_add_verified_number_flag_to_users_table',13); +INSERT INTO `migrations` VALUES (173,'2022_11_04_013539_disabled_upstream_bank_integrations_table',13); +INSERT INTO `migrations` VALUES (174,'2022_11_06_215526_drop_html_backups_column_from_backups_table',13); +INSERT INTO `migrations` VALUES (175,'2022_11_13_034143_bank_transaction_rules_table',13); +INSERT INTO `migrations` VALUES (176,'2022_11_16_093535_calmness_design',13); +INSERT INTO `migrations` VALUES (177,'2022_11_22_215618_lock_tasks_when_invoiced',13); From 29d909ad081f15e2a126c233f91f16be50ea3dd5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 15:43:14 +1100 Subject: [PATCH 43/51] Fixes for SendReminders firing twice --- app/Jobs/Util/ReminderJob.php | 12 ++++++++++-- config/ninja.php | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 403ef964a37e..8b8a4610d543 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -50,11 +50,20 @@ class ReminderJob implements ShouldQueue $this->processReminders(); } else { //multiDB environment, need to + /* foreach (MultiDB::$dbs as $db) { MultiDB::setDB($db); nlog("set db {$db}"); $this->processReminders(); } + */ + //24-11-2022 fix for potential memory leak during a long running process, the second reminder may run twice + foreach (config('ninja.dbs') as $db) { + MultiDB::setDB($db); + nlog("set db {$db}"); + $this->processReminders(); + } + } } @@ -79,9 +88,8 @@ class ReminderJob implements ShouldQueue if ($invoice->isPayable()) { $reminder_template = $invoice->calculateTemplate('invoice'); nlog("reminder template = {$reminder_template}"); - $invoice->service()->touchReminder($reminder_template)->save(); $invoice = $this->calcLateFee($invoice, $reminder_template); - + $invoice->service()->touchReminder($reminder_template)->save(); $invoice->service()->touchPdf(); //20-04-2022 fixes for endless reminders - generic template naming was wrong diff --git a/config/ninja.php b/config/ninja.php index b850fef4ff1e..45ec406ae11d 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -211,4 +211,5 @@ return [ 'dev_mode' => env("YODLEE_DEV_MODE", false), 'config_name' => env("YODLEE_CONFIG_NAME", false), ], + 'dbs' => ['db-ninja-01','db-ninja-02'] ]; From 264a4df13b58d38a7874c6ed3a1623986ca1ba92 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 16:49:03 +1100 Subject: [PATCH 44/51] Adjustments for handling invoice deletion --- app/Jobs/Util/ReminderJob.php | 8 +++++--- app/Services/Credit/ApplyPayment.php | 2 +- app/Services/Invoice/ApplyPayment.php | 2 +- app/Services/Invoice/InvoiceService.php | 6 ++++-- tests/Feature/SubscriptionApiTest.php | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 8b8a4610d543..23875c3f6c9a 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -71,6 +71,8 @@ class ReminderJob implements ShouldQueue { nlog('Sending invoice reminders '.now()->format('Y-m-d h:i:s')); + set_time_limit(0); + Invoice::query() ->where('is_deleted', 0) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) @@ -90,7 +92,7 @@ class ReminderJob implements ShouldQueue nlog("reminder template = {$reminder_template}"); $invoice = $this->calcLateFee($invoice, $reminder_template); $invoice->service()->touchReminder($reminder_template)->save(); - $invoice->service()->touchPdf(); + $invoice->service()->touchPdf(true); //20-04-2022 fixes for endless reminders - generic template naming was wrong $enabled_reminder = 'enable_'.$reminder_template; @@ -107,7 +109,7 @@ class ReminderJob implements ShouldQueue (Ninja::isSelfHost() || $invoice->company->account->isPaidHostedClient())) { $invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) { - EmailEntity::dispatchSync($invitation, $invitation->company, $reminder_template); + EmailEntity::dispatch($invitation, $invitation->company, $reminder_template); nlog("Firing reminder email for invoice {$invoice->number} - {$reminder_template}"); }); @@ -206,7 +208,7 @@ class ReminderJob implements ShouldQueue /**Refresh Invoice values*/ $invoice->calc()->getInvoice()->save(); $invoice->fresh(); - $invoice->service()->deletePdf(); + // $invoice->service()->deletePdf(); 24-11-2022 no need to delete here because we regenerate later anyway /* Refresh the client here to ensure the balance is fresh */ $client = $invoice->client; diff --git a/app/Services/Credit/ApplyPayment.php b/app/Services/Credit/ApplyPayment.php index a80264c7ecb4..b5df4be9e60f 100644 --- a/app/Services/Credit/ApplyPayment.php +++ b/app/Services/Credit/ApplyPayment.php @@ -147,7 +147,7 @@ class ApplyPayment event(new InvoiceWasUpdated($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); if ((int) $this->invoice->balance == 0) { - $this->invoice->service()->deletePdf(); + $this->invoice->service()->touchPdf(); $this->invoice = $this->invoice->fresh(); event(new InvoiceWasPaid($this->invoice, $this->payment, $this->payment->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); } diff --git a/app/Services/Invoice/ApplyPayment.php b/app/Services/Invoice/ApplyPayment.php index d124c7f821d5..1c873aa11a22 100644 --- a/app/Services/Invoice/ApplyPayment.php +++ b/app/Services/Invoice/ApplyPayment.php @@ -103,7 +103,7 @@ class ApplyPayment extends AbstractService } }); - $this->invoice->service()->applyNumber()->workFlow()->save(); + $this->invoice->service()->applyNumber()->workFlow()->touchPdf()->save(); $transaction = [ 'invoice' => $this->invoice->transaction_event(), diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 6ee15254ccba..0717804d7048 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -112,10 +112,12 @@ class InvoiceService * @param Payment $payment The Payment * @param float $payment_amount The Payment amount * @return InvoiceService Parent class object + * @deprecated 24-11-2022 - cannot find any references to this method anywhere */ public function applyPayment(Payment $payment, float $payment_amount) { - $this->deletePdf(); + // $this->deletePdf(); + $this->invoice = $this->markSent(); $this->invoice = (new ApplyPayment($this->invoice, $payment, $payment_amount))->run(); @@ -218,7 +220,7 @@ class InvoiceService public function markDeleted() { $this->removeUnpaidGatewayFees(); - $this->deletePdf(); + // $this->deletePdf(); $this->invoice = (new MarkInvoiceDeleted($this->invoice))->run(); diff --git a/tests/Feature/SubscriptionApiTest.php b/tests/Feature/SubscriptionApiTest.php index 8cf835f9767f..86360680e510 100644 --- a/tests/Feature/SubscriptionApiTest.php +++ b/tests/Feature/SubscriptionApiTest.php @@ -83,7 +83,7 @@ class SubscriptionApiTest extends TestCase $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, - ])->post('/api/v1/subscriptions', ['product_ids' => $product->id, 'allow_cancellation' => true, 'name' => Str::random(5)]); + ])->post('/api/v1/subscriptions', ['product_ids' => $product->hashed_id, 'allow_cancellation' => true, 'name' => Str::random(5)]); // nlog($response); $response->assertStatus(200); @@ -98,7 +98,7 @@ class SubscriptionApiTest extends TestCase $response1 = $this ->withHeaders(['X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token]) - ->post('/api/v1/subscriptions', ['product_ids' => $product->id, 'name' => Str::random(5)]) + ->post('/api/v1/subscriptions', ['product_ids' => $product->hashed_id, 'name' => Str::random(5)]) ->assertStatus(200) ->json(); From 8f5fb2ca9fc0fb606411777a3b4810047dac8f52 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 17:23:36 +1100 Subject: [PATCH 45/51] Fixes for recurring invoice edge case --- app/Jobs/Util/ReminderJob.php | 2 +- app/Models/Company.php | 1 + app/Models/PurchaseOrder.php | 3 ++- app/Services/Client/ClientService.php | 3 --- app/Services/Invoice/InvoiceService.php | 2 +- app/Transformers/CompanyTransformer.php | 1 + app/Transformers/PurchaseOrderTransformer.php | 1 + .../2022_11_22_215618_lock_tasks_when_invoiced.php | 6 ++++++ 8 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 23875c3f6c9a..90dd5e35fe8e 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -215,7 +215,7 @@ class ReminderJob implements ShouldQueue $client = $client->fresh(); nlog('adjusting client balance and invoice balance by #'.$invoice->number.' '.($invoice->balance - $temp_invoice_balance)); - $client->service()->updateBalance($invoice->balance - $temp_invoice_balance)->save(); + $client->service()->updateBalance($invoice->balance - $temp_invoice_balance); $invoice->ledger()->updateInvoiceBalance($invoice->balance - $temp_invoice_balance, "Late Fee Adjustment for invoice {$invoice->number}"); $transaction = [ diff --git a/app/Models/Company.php b/app/Models/Company.php index 407cdb5ce827..37d4814e4da0 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -125,6 +125,7 @@ class Company extends BaseModel 'invoice_task_project', 'report_include_deleted', 'invoice_task_lock', + 'use_vendor_currency', ]; protected $hidden = [ diff --git a/app/Models/PurchaseOrder.php b/app/Models/PurchaseOrder.php index 851822e09841..5ef33b62dc34 100644 --- a/app/Models/PurchaseOrder.php +++ b/app/Models/PurchaseOrder.php @@ -79,7 +79,8 @@ class PurchaseOrder extends BaseModel 'partial', 'paid_to_date', 'vendor_id', - 'last_viewed' + 'last_viewed', + 'currency_id', ]; protected $casts = [ diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index a4d033c34559..6ffec56c2046 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -29,7 +29,6 @@ class ClientService public function updateBalance(float $amount) { - // $this->client->balance += $amount; \DB::connection(config('database.default'))->transaction(function () use($amount) { @@ -44,8 +43,6 @@ class ClientService public function updateBalanceAndPaidToDate(float $balance, float $paid_to_date) { - // $this->client->balance += $amount; - // $this->client->paid_to_date += $amount; \DB::connection(config('database.default'))->transaction(function () use($balance, $paid_to_date) { diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 0717804d7048..9a0efc7347d9 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -117,7 +117,7 @@ class InvoiceService public function applyPayment(Payment $payment, float $payment_amount) { // $this->deletePdf(); - $this->invoice = $this->markSent(); + $this->invoice = $this->markSent()->save(); $this->invoice = (new ApplyPayment($this->invoice, $payment, $payment_amount))->run(); diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 0651bc1eb7c6..1b47cdbd5b62 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -189,6 +189,7 @@ class CompanyTransformer extends EntityTransformer 'invoice_task_project' => (bool) $company->invoice_task_project, 'report_include_deleted' => (bool) $company->report_include_deleted, 'invoice_task_lock' => (bool) $company->invoice_task_lock, + 'use_vendor_currency' => (bool) $company->use_vendor_currency, ]; } diff --git a/app/Transformers/PurchaseOrderTransformer.php b/app/Transformers/PurchaseOrderTransformer.php index fd0684c76c08..d444addf07d7 100644 --- a/app/Transformers/PurchaseOrderTransformer.php +++ b/app/Transformers/PurchaseOrderTransformer.php @@ -132,6 +132,7 @@ class PurchaseOrderTransformer extends EntityTransformer 'paid_to_date' => (float)$purchase_order->paid_to_date, 'subscription_id' => $this->encodePrimaryKey($purchase_order->subscription_id), 'expense_id' => $this->encodePrimaryKey($purchase_order->expense_id), + 'currency_id' => $purchase_order->currency_id ? (string) $purchase_order->currency_id : '', ]; } diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 00c1925cb016..30bb7f57261c 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -22,6 +22,12 @@ return new class extends Migration Schema::table('companies', function (Blueprint $table) { $table->boolean('invoice_task_lock')->default(false); + $table->boolean('use_vendor_currency')->default(false); + }); + + Schema::table('purchase_orders', function (Blueprint $table) + { + $table->unsignedInteger('currency_id')->nullable(); }); Schema::table('bank_transactions', function (Blueprint $table) From 20810bd7fe7b72d1f2eea6c972b031c18ddbb456 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 20:33:52 +1100 Subject: [PATCH 46/51] Minor fixes for company count --- app/Http/Controllers/InvoiceController.php | 2 +- .../Requests/Company/StoreCompanyRequest.php | 3 + .../Requests/Company/UpdateCompanyRequest.php | 10 +- .../Company/ValidCompanyQuantity.php | 1 + app/Jobs/Util/ReminderJob.php | 105 +- app/Services/Client/ClientService.php | 37 +- app/Services/Invoice/ApplyPaymentAmount.php | 2 +- app/Services/Invoice/InvoiceService.php | 2 +- ..._11_22_215618_lock_tasks_when_invoiced.php | 2 + database/schema/db-ninja-01-schema.dump | 457 +-- database/schema/mysql-schema.dump | 2522 ----------------- resources/views/pdf-designs/bold.html | 11 + resources/views/pdf-designs/business.html | 10 + resources/views/pdf-designs/calm.html | 12 + resources/views/pdf-designs/clean.html | 11 + resources/views/pdf-designs/creative.html | 11 + resources/views/pdf-designs/elegant.html | 11 + resources/views/pdf-designs/hipster.html | 11 + resources/views/pdf-designs/modern.html | 11 + resources/views/pdf-designs/plain.html | 5 +- resources/views/pdf-designs/playful.html | 11 + resources/views/pdf-designs/tech.html | 11 + 22 files changed, 436 insertions(+), 2822 deletions(-) delete mode 100644 database/schema/mysql-schema.dump diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 73c0ba94a012..b81b4a476387 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -771,7 +771,7 @@ class InvoiceController extends BaseController } break; case 'cancel': - $invoice = $invoice->service()->handleCancellation()->deletePdf()->touchPdf()->save(); + $invoice = $invoice->service()->handleCancellation()->touchPdf()->save(); if (! $bulk) { $this->itemResponse($invoice); diff --git a/app/Http/Requests/Company/StoreCompanyRequest.php b/app/Http/Requests/Company/StoreCompanyRequest.php index 62c0eb8f1255..6a6d24342e46 100644 --- a/app/Http/Requests/Company/StoreCompanyRequest.php +++ b/app/Http/Requests/Company/StoreCompanyRequest.php @@ -61,6 +61,9 @@ class StoreCompanyRequest extends Request { $input = $this->all(); + if(!isset($input['name'])) + $input['name'] = 'Untitled Company'; + if (array_key_exists('google_analytics_url', $input)) { $input['google_analytics_key'] = $input['google_analytics_url']; } diff --git a/app/Http/Requests/Company/UpdateCompanyRequest.php b/app/Http/Requests/Company/UpdateCompanyRequest.php index 08d1c89bd94d..2a8d881bca6d 100644 --- a/app/Http/Requests/Company/UpdateCompanyRequest.php +++ b/app/Http/Requests/Company/UpdateCompanyRequest.php @@ -108,7 +108,7 @@ class UpdateCompanyRequest extends Request } } - $settings['email_style_custom'] = str_replace("{{", "", $settings['email_style_custom']); + $settings['email_style_custom'] = str_replace(['{{','}}'], ['',''], $settings['email_style_custom']); if (! $account->isFreeHostedClient()) { return $settings; @@ -127,9 +127,11 @@ class UpdateCompanyRequest extends Request private function addScheme($url, $scheme = 'https://') { - $url = str_replace('http://', '', $url); - - $url = parse_url($url, PHP_URL_SCHEME) === null ? $scheme.$url : $url; + if(Ninja::isHosted()) + { + $url = str_replace('http://', '', $url); + $url = parse_url($url, PHP_URL_SCHEME) === null ? $scheme.$url : $url; + } return rtrim($url, '/'); } diff --git a/app/Http/ValidationRules/Company/ValidCompanyQuantity.php b/app/Http/ValidationRules/Company/ValidCompanyQuantity.php index a465aef0a3a0..a90e861c9ae2 100644 --- a/app/Http/ValidationRules/Company/ValidCompanyQuantity.php +++ b/app/Http/ValidationRules/Company/ValidCompanyQuantity.php @@ -26,6 +26,7 @@ class ValidCompanyQuantity implements Rule */ public function passes($attribute, $value) { + if (Ninja::isSelfHost()) { return auth()->user()->company()->account->companies->count() < 10; } diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 90dd5e35fe8e..3e6d3914a942 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -74,55 +74,55 @@ class ReminderJob implements ShouldQueue set_time_limit(0); Invoice::query() - ->where('is_deleted', 0) - ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) - ->whereNull('deleted_at') - ->where('balance', '>', 0) - ->where('next_send_date', '<=', now()->toDateTimeString()) - ->whereHas('client', function ($query) { - $query->where('is_deleted', 0) - ->where('deleted_at', null); - }) - ->whereHas('company', function ($query) { - $query->where('is_disabled', 0); - }) - ->with('invitations')->cursor()->each(function ($invoice) { - if ($invoice->isPayable()) { - $reminder_template = $invoice->calculateTemplate('invoice'); - nlog("reminder template = {$reminder_template}"); - $invoice = $this->calcLateFee($invoice, $reminder_template); - $invoice->service()->touchReminder($reminder_template)->save(); - $invoice->service()->touchPdf(true); + ->where('is_deleted', 0) + ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]) + ->whereNull('deleted_at') + ->where('balance', '>', 0) + ->where('next_send_date', '<=', now()->toDateTimeString()) + ->whereHas('client', function ($query) { + $query->where('is_deleted', 0) + ->where('deleted_at', null); + }) + ->whereHas('company', function ($query) { + $query->where('is_disabled', 0); + }) + ->with('invitations')->cursor()->each(function ($invoice) { + if ($invoice->isPayable()) { + $reminder_template = $invoice->calculateTemplate('invoice'); + nlog("reminder template = {$reminder_template}"); + $invoice = $this->calcLateFee($invoice, $reminder_template); + $invoice->service()->touchReminder($reminder_template)->save(); + $invoice->service()->touchPdf(true); - //20-04-2022 fixes for endless reminders - generic template naming was wrong - $enabled_reminder = 'enable_'.$reminder_template; - - if ($reminder_template == 'endless_reminder') { - $enabled_reminder = 'enable_reminder_endless'; - } - - //check if this reminder needs to be emailed - //15-01-2022 - insert addition if block if send_reminders is definitely set - if (in_array($reminder_template, ['reminder1', 'reminder2', 'reminder3', 'reminder_endless', 'endless_reminder']) && - $invoice->client->getSetting($enabled_reminder) && - $invoice->client->getSetting('send_reminders') && - (Ninja::isSelfHost() || $invoice->company->account->isPaidHostedClient())) { - - $invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) { - EmailEntity::dispatch($invitation, $invitation->company, $reminder_template); - nlog("Firing reminder email for invoice {$invoice->number} - {$reminder_template}"); - }); - - if ($invoice->invitations->count() > 0) { - event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars(), $reminder_template)); - } - } - $invoice->service()->setReminder()->save(); - } else { - $invoice->next_send_date = null; - $invoice->save(); + //20-04-2022 fixes for endless reminders - generic template naming was wrong + $enabled_reminder = 'enable_'.$reminder_template; + if ($reminder_template == 'endless_reminder') { + $enabled_reminder = 'enable_reminder_endless'; } - }); + + //check if this reminder needs to be emailed + //15-01-2022 - insert addition if block if send_reminders is definitely set + if (in_array($reminder_template, ['reminder1', 'reminder2', 'reminder3', 'reminder_endless', 'endless_reminder']) && + $invoice->client->getSetting($enabled_reminder) && + $invoice->client->getSetting('send_reminders') && + (Ninja::isSelfHost() || $invoice->company->account->isPaidHostedClient())) { + + $invoice->invitations->each(function ($invitation) use ($invoice, $reminder_template) { + EmailEntity::dispatch($invitation, $invitation->company, $reminder_template); + nlog("Firing reminder email for invoice {$invoice->number} - {$reminder_template}"); + }); + + if ($invoice->invitations->count() > 0) { + event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars(), $reminder_template)); + } + } + $invoice->service()->setReminder()->save(); + } else { + $invoice->next_send_date = null; + $invoice->save(); + } + + }); } /** @@ -206,22 +206,17 @@ class ReminderJob implements ShouldQueue $invoice->line_items = $invoice_items; /**Refresh Invoice values*/ - $invoice->calc()->getInvoice()->save(); - $invoice->fresh(); + $invoice = $invoice->calc()->getInvoice(); // $invoice->service()->deletePdf(); 24-11-2022 no need to delete here because we regenerate later anyway - /* Refresh the client here to ensure the balance is fresh */ - $client = $invoice->client; - $client = $client->fresh(); - nlog('adjusting client balance and invoice balance by #'.$invoice->number.' '.($invoice->balance - $temp_invoice_balance)); - $client->service()->updateBalance($invoice->balance - $temp_invoice_balance); + $invoice->client->service()->updateBalance($invoice->balance - $temp_invoice_balance); $invoice->ledger()->updateInvoiceBalance($invoice->balance - $temp_invoice_balance, "Late Fee Adjustment for invoice {$invoice->number}"); $transaction = [ 'invoice' => $invoice->transaction_event(), 'payment' => [], - 'client' => $client->transaction_event(), + 'client' => $invoice->client->transaction_event(), 'credit' => [], 'metadata' => ['setLateFee'], ]; diff --git a/app/Services/Client/ClientService.php b/app/Services/Client/ClientService.php index 6ffec56c2046..9b9da5dfaf0a 100644 --- a/app/Services/Client/ClientService.php +++ b/app/Services/Client/ClientService.php @@ -30,28 +30,43 @@ class ClientService public function updateBalance(float $amount) { - \DB::connection(config('database.default'))->transaction(function () use($amount) { + try { + \DB::connection(config('database.default'))->transaction(function () use($amount) { - $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); - $this->client->balance += $amount; - $this->client->save(); + nlog("inside transaction - updating balance by {$amount}"); - }, 2); + $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); + $this->client->balance += $amount; + $this->client->save(); + + }, 2); + } + catch (\Throwable $throwable) { + nlog("DB ERROR " . $throwable->getMessage()); + } return $this; + } public function updateBalanceAndPaidToDate(float $balance, float $paid_to_date) { - \DB::connection(config('database.default'))->transaction(function () use($balance, $paid_to_date) { + try { + \DB::connection(config('database.default'))->transaction(function () use($balance, $paid_to_date) { - $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); - $this->client->balance += $balance; - $this->client->paid_to_date += $paid_to_date; - $this->client->save(); + $this->client = Client::withTrashed()->where('id', $this->client->id)->lockForUpdate()->first(); + $this->client->balance += $balance; + $this->client->paid_to_date += $paid_to_date; + $this->client->save(); + + }, 2); + } + catch (\Throwable $throwable) { + nlog("DB ERROR " . $throwable->getMessage()); + } + - }, 2); return $this; } diff --git a/app/Services/Invoice/ApplyPaymentAmount.php b/app/Services/Invoice/ApplyPaymentAmount.php index 473a3b9591b7..6783347bc1f2 100644 --- a/app/Services/Invoice/ApplyPaymentAmount.php +++ b/app/Services/Invoice/ApplyPaymentAmount.php @@ -83,7 +83,7 @@ class ApplyPaymentAmount extends AbstractService ->updatePaidToDate($payment->amount) ->setCalculatedStatus() ->applyNumber() - ->deletePdf() + ->touchPdf() ->save(); $this->invoice diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 9a0efc7347d9..740c21a5fdd3 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -220,7 +220,6 @@ class InvoiceService public function markDeleted() { $this->removeUnpaidGatewayFees(); - // $this->deletePdf(); $this->invoice = (new MarkInvoiceDeleted($this->invoice))->run(); @@ -380,6 +379,7 @@ class InvoiceService })->toArray(); $this->invoice = $this->invoice->calc()->getInvoice(); + $this->invoice->service()->touchPdf(); /* 24-03-2022 */ $new_balance = $this->invoice->balance; diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 30bb7f57261c..105ccb345b96 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -67,6 +67,8 @@ return new class extends Migration } } + \Illuminate\Support\Facades\Artisan::call('ninja:design-update'); + } /** diff --git a/database/schema/db-ninja-01-schema.dump b/database/schema/db-ninja-01-schema.dump index e311a8edc3c2..9ceaf0a561c6 100644 --- a/database/schema/db-ninja-01-schema.dump +++ b/database/schema/db-ninja-01-schema.dump @@ -51,7 +51,7 @@ CREATE TABLE `accounts` ( PRIMARY KEY (`id`), KEY `accounts_payment_id_index` (`payment_id`), KEY `accounts_key_index` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `activities`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -103,7 +103,7 @@ CREATE TABLE `activities` ( KEY `activities_purchase_order_id_company_id_index` (`purchase_order_id`,`company_id`), KEY `activities_vendor_contact_id_company_id_index` (`vendor_contact_id`,`company_id`), CONSTRAINT `activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `backups`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -120,7 +120,7 @@ CREATE TABLE `backups` ( PRIMARY KEY (`id`), KEY `backups_activity_id_foreign` (`activity_id`), CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -141,7 +141,7 @@ CREATE TABLE `bank_companies` ( CONSTRAINT `bank_companies_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`), CONSTRAINT `bank_companies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_integrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -198,7 +198,7 @@ CREATE TABLE `bank_subcompanies` ( CONSTRAINT `bank_subcompanies_bank_company_id_foreign` FOREIGN KEY (`bank_company_id`) REFERENCES `bank_companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_subcompanies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `bank_subcompanies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `bank_transaction_rules`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -277,7 +277,7 @@ CREATE TABLE `banks` ( `bank_library_id` int(11) NOT NULL DEFAULT 1, `config` text DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -328,7 +328,7 @@ CREATE TABLE `client_contacts` ( KEY `client_contacts_contact_key(20)_index` (`contact_key`(20)), KEY `client_contacts_email_index` (`email`), CONSTRAINT `client_contacts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_gateway_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -353,7 +353,7 @@ CREATE TABLE `client_gateway_tokens` ( KEY `client_gateway_tokens_client_id_foreign` (`client_id`), CONSTRAINT `client_gateway_tokens_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_gateway_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `client_subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -383,7 +383,7 @@ CREATE TABLE `client_subscriptions` ( CONSTRAINT `client_subscriptions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `client_subscriptions_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`), CONSTRAINT `client_subscriptions_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `clients`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -442,7 +442,7 @@ CREATE TABLE `clients` ( CONSTRAINT `clients_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `clients_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), CONSTRAINT `clients_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `companies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -519,6 +519,7 @@ CREATE TABLE `companies` ( `invoice_task_project` tinyint(1) NOT NULL DEFAULT 0, `report_include_deleted` tinyint(1) NOT NULL DEFAULT 0, `invoice_task_lock` tinyint(1) NOT NULL DEFAULT 0, + `use_vendor_currency` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE KEY `companies_company_key_unique` (`company_key`), KEY `companies_industry_id_foreign` (`industry_id`), @@ -530,7 +531,7 @@ CREATE TABLE `companies` ( CONSTRAINT `companies_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `companies_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), CONSTRAINT `companies_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -569,7 +570,7 @@ CREATE TABLE `company_gateways` ( CONSTRAINT `company_gateways_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_gateways_gateway_key_foreign` FOREIGN KEY (`gateway_key`) REFERENCES `gateways` (`key`), CONSTRAINT `company_gateways_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_ledgers`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -593,7 +594,7 @@ CREATE TABLE `company_ledgers` ( KEY `company_ledgers_client_id_foreign` (`client_id`), CONSTRAINT `company_ledgers_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_ledgers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_tokens`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -619,7 +620,7 @@ CREATE TABLE `company_tokens` ( CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `company_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -640,14 +641,14 @@ CREATE TABLE `company_user` ( `created_at` timestamp(6) NULL DEFAULT NULL, `updated_at` timestamp(6) NULL DEFAULT NULL, `permissions_updated_at` timestamp NOT NULL DEFAULT current_timestamp(), - `ninja_portal_url` text NOT NULL, + `ninja_portal_url` text NOT NULL DEFAULT '', PRIMARY KEY (`id`), UNIQUE KEY `company_user_company_id_user_id_unique` (`company_id`,`user_id`), KEY `company_user_account_id_company_id_deleted_at_index` (`account_id`,`company_id`,`deleted_at`), KEY `company_user_user_id_index` (`user_id`), CONSTRAINT `company_user_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE, CONSTRAINT `company_user_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `countries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -669,10 +670,10 @@ CREATE TABLE `countries` ( `eea` tinyint(1) NOT NULL DEFAULT 0, `swap_postal_code` tinyint(1) NOT NULL DEFAULT 0, `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, - `thousand_separator` varchar(191) DEFAULT NULL, - `decimal_separator` varchar(191) DEFAULT NULL, + `thousand_separator` varchar(191) DEFAULT '', + `decimal_separator` varchar(191) DEFAULT '', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credit_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -704,11 +705,12 @@ CREATE TABLE `credit_invitations` ( KEY `credit_invitations_deleted_at_credit_id_company_id_index` (`deleted_at`,`credit_id`,`company_id`), KEY `credit_invitations_credit_id_index` (`credit_id`), KEY `credit_invitations_key_index` (`key`), + KEY `credit_invitations_message_id_index` (`message_id`), CONSTRAINT `credit_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_invitations_credit_id_foreign` FOREIGN KEY (`credit_id`) REFERENCES `credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credit_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `credits`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -784,7 +786,7 @@ CREATE TABLE `credits` ( CONSTRAINT `credits_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `credits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `currencies`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -800,7 +802,7 @@ CREATE TABLE `currencies` ( `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `date_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -811,7 +813,7 @@ CREATE TABLE `date_formats` ( `format_moment` varchar(191) NOT NULL, `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `datetime_formats`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -822,7 +824,7 @@ CREATE TABLE `datetime_formats` ( `format_moment` varchar(191) NOT NULL, `format_dart` varchar(191) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `designs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -843,7 +845,7 @@ CREATE TABLE `designs` ( KEY `designs_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `designs_company_id_index` (`company_id`), CONSTRAINT `designs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `documents`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -879,7 +881,7 @@ CREATE TABLE `documents` ( KEY `documents_company_id_index` (`company_id`), KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), CONSTRAINT `documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expense_categories`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -899,7 +901,7 @@ CREATE TABLE `expense_categories` ( KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expense_categories_company_id_index` (`company_id`), CONSTRAINT `expense_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -951,13 +953,14 @@ CREATE TABLE `expenses` ( `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), + UNIQUE KEY `expenses_company_id_number_unique` (`company_id`,`number`), KEY `expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `expenses_user_id_foreign` (`user_id`), KEY `expenses_company_id_index` (`company_id`), KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `failed_jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -972,7 +975,7 @@ CREATE TABLE `failed_jobs` ( `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateway_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -982,7 +985,7 @@ CREATE TABLE `gateway_types` ( `alias` varchar(191) DEFAULT NULL, `name` varchar(191) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `gateways`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1003,7 +1006,7 @@ CREATE TABLE `gateways` ( `updated_at` timestamp(6) NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `gateways_key_unique` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `group_settings`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1022,7 +1025,7 @@ CREATE TABLE `group_settings` ( PRIMARY KEY (`id`), KEY `group_settings_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `group_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `industries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1031,7 +1034,7 @@ CREATE TABLE `industries` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoice_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1062,12 +1065,13 @@ CREATE TABLE `invoice_invitations` ( KEY `invoice_invitations_company_id_foreign` (`company_id`), KEY `invoice_invitations_deleted_at_invoice_id_company_id_index` (`deleted_at`,`invoice_id`,`company_id`), KEY `invoice_invitations_invoice_id_index` (`invoice_id`), + KEY `invoice_invitations_message_id_index` (`message_id`), KEY `invoice_invitations_key_deleted_at_index` (`key`,`deleted_at`), CONSTRAINT `invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1146,7 +1150,7 @@ CREATE TABLE `invoices` ( CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `jobs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1161,7 +1165,7 @@ CREATE TABLE `jobs` ( `created_at` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), KEY `jobs_queue_index` (`queue`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `languages`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1171,7 +1175,7 @@ CREATE TABLE `languages` ( `name` varchar(191) NOT NULL, `locale` varchar(191) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `licenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1191,7 +1195,7 @@ CREATE TABLE `licenses` ( `recurring_invoice_id` bigint(20) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `licenses_license_key_unique` (`license_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `migrations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1201,7 +1205,7 @@ CREATE TABLE `migrations` ( `migration` varchar(191) NOT NULL, `batch` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `password_resets`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1211,7 +1215,7 @@ CREATE TABLE `password_resets` ( `token` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, KEY `password_resets_email_index` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_hashes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1229,7 +1233,7 @@ CREATE TABLE `payment_hashes` ( KEY `payment_hashes_payment_id_foreign` (`payment_id`), KEY `payment_hashes_hash_index` (`hash`), CONSTRAINT `payment_hashes_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_libraries`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1241,7 +1245,7 @@ CREATE TABLE `payment_libraries` ( `name` varchar(191) DEFAULT NULL, `visible` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_terms`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1261,7 +1265,7 @@ CREATE TABLE `payment_terms` ( KEY `payment_terms_user_id_foreign` (`user_id`), CONSTRAINT `payment_terms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payment_terms_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payment_types`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1271,7 +1275,7 @@ CREATE TABLE `payment_types` ( `name` varchar(191) NOT NULL, `gateway_type_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `paymentables`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1290,7 +1294,7 @@ CREATE TABLE `paymentables` ( KEY `paymentables_payment_id_foreign` (`payment_id`), KEY `paymentables_paymentable_id_index` (`paymentable_id`), CONSTRAINT `paymentables_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `payments`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1330,9 +1334,10 @@ CREATE TABLE `payments` ( `custom_value2` text DEFAULT NULL, `custom_value3` text DEFAULT NULL, `custom_value4` text DEFAULT NULL, - `idempotency_key` varchar(64) DEFAULT NULL, `transaction_id` bigint(20) unsigned DEFAULT NULL, + `idempotency_key` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`), + UNIQUE KEY `payments_company_id_number_unique` (`company_id`,`number`), UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), KEY `payments_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `payments_client_contact_id_foreign` (`client_contact_id`), @@ -1348,7 +1353,7 @@ CREATE TABLE `payments` ( CONSTRAINT `payments_company_gateway_id_foreign` FOREIGN KEY (`company_gateway_id`) REFERENCES `company_gateways` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1390,7 +1395,7 @@ CREATE TABLE `products` ( KEY `products_product_key_company_id_index` (`product_key`,`company_id`), CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `projects`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1418,12 +1423,13 @@ CREATE TABLE `projects` ( `number` varchar(191) DEFAULT NULL, `color` varchar(191) NOT NULL DEFAULT '#fff', PRIMARY KEY (`id`), + UNIQUE KEY `projects_company_id_number_unique` (`company_id`,`number`), KEY `projects_user_id_foreign` (`user_id`), KEY `projects_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `projects_company_id_index` (`company_id`), CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `projects_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `purchase_order_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1526,6 +1532,7 @@ CREATE TABLE `purchase_orders` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `expense_id` int(10) unsigned DEFAULT NULL, + `currency_id` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), KEY `purchase_orders_user_id_foreign` (`user_id`), KEY `purchase_orders_company_id_deleted_at_index` (`company_id`,`deleted_at`), @@ -1567,11 +1574,12 @@ CREATE TABLE `quote_invitations` ( KEY `quote_invitations_deleted_at_quote_id_company_id_index` (`deleted_at`,`quote_id`,`company_id`), KEY `quote_invitations_quote_id_index` (`quote_id`), KEY `quote_invitations_key_index` (`key`), + KEY `quote_invitations_message_id_index` (`message_id`), CONSTRAINT `quote_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quote_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quote_invitations_quote_id_foreign` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quote_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `quotes`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1648,7 +1656,7 @@ CREATE TABLE `quotes` ( CONSTRAINT `quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_expenses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1747,7 +1755,7 @@ CREATE TABLE `recurring_invoice_invitations` ( CONSTRAINT `recurring_invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoice_invitations_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_invoices`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1761,7 +1769,7 @@ CREATE TABLE `recurring_invoices` ( `project_id` int(10) unsigned DEFAULT NULL, `vendor_id` int(10) unsigned DEFAULT NULL, `status_id` int(10) unsigned NOT NULL, - `number` text DEFAULT NULL, + `number` varchar(191) DEFAULT NULL, `discount` double(8,2) NOT NULL DEFAULT 0.00, `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, `po_number` varchar(191) DEFAULT NULL, @@ -1815,6 +1823,7 @@ CREATE TABLE `recurring_invoices` ( `subscription_id` int(10) unsigned DEFAULT NULL, `next_send_date_client` datetime DEFAULT NULL, PRIMARY KEY (`id`), + UNIQUE KEY `recurring_invoices_company_id_number_unique` (`company_id`,`number`), KEY `recurring_invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `recurring_invoices_user_id_foreign` (`user_id`), KEY `recurring_invoices_client_id_index` (`client_id`), @@ -1823,7 +1832,7 @@ CREATE TABLE `recurring_invoices` ( CONSTRAINT `recurring_invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `recurring_quote_invitations`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1932,7 +1941,7 @@ CREATE TABLE `recurring_quotes` ( CONSTRAINT `recurring_quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `recurring_quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `schedulers`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1942,8 +1951,8 @@ CREATE TABLE `schedulers` ( `paused` tinyint(1) NOT NULL DEFAULT 0, `is_deleted` tinyint(1) NOT NULL DEFAULT 0, `repeat_every` varchar(191) NOT NULL, - `start_from` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `scheduled_run` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `start_from` timestamp NULL DEFAULT NULL, + `scheduled_run` timestamp NULL DEFAULT NULL, `company_id` bigint(20) unsigned NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, @@ -1962,7 +1971,7 @@ CREATE TABLE `sizes` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `subscriptions`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -1974,8 +1983,8 @@ CREATE TABLE `subscriptions` ( `company_id` int(10) unsigned NOT NULL, `product_ids` text DEFAULT NULL, `frequency_id` int(10) unsigned DEFAULT NULL, - `auto_bill` text DEFAULT NULL, - `promo_code` text DEFAULT NULL, + `auto_bill` text DEFAULT '', + `promo_code` text DEFAULT '', `promo_discount` double(8,2) NOT NULL DEFAULT 0.00, `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, `allow_cancellation` tinyint(1) NOT NULL DEFAULT 1, @@ -2007,7 +2016,7 @@ CREATE TABLE `subscriptions` ( UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), CONSTRAINT `billing_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `system_logs`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2029,7 +2038,7 @@ CREATE TABLE `system_logs` ( KEY `system_logs_client_id_foreign` (`client_id`), CONSTRAINT `system_logs_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `system_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `task_statuses`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2051,7 +2060,7 @@ CREATE TABLE `task_statuses` ( KEY `task_statuses_user_id_foreign` (`user_id`), CONSTRAINT `task_statuses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `task_statuses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tasks`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2085,6 +2094,7 @@ CREATE TABLE `tasks` ( `status_order` int(11) DEFAULT NULL, `invoice_lock` tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), + UNIQUE KEY `tasks_company_id_number_unique` (`company_id`,`number`), KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), KEY `tasks_user_id_foreign` (`user_id`), KEY `tasks_invoice_id_foreign` (`invoice_id`), @@ -2094,7 +2104,7 @@ CREATE TABLE `tasks` ( CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tasks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `tax_rates`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2115,7 +2125,7 @@ CREATE TABLE `tax_rates` ( KEY `tax_rates_company_id_index` (`company_id`), CONSTRAINT `tax_rates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `tax_rates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `timezones`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2126,7 +2136,7 @@ CREATE TABLE `timezones` ( `location` varchar(191) NOT NULL, `utc_offset` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `transaction_events`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2211,7 +2221,7 @@ CREATE TABLE `users` ( UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), KEY `users_account_id_index` (`account_id`), CONSTRAINT `users_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendor_contacts`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2263,7 +2273,7 @@ CREATE TABLE `vendor_contacts` ( CONSTRAINT `vendor_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vendor_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `vendor_contacts_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `vendors`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2308,7 +2318,7 @@ CREATE TABLE `vendors` ( CONSTRAINT `vendors_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`), CONSTRAINT `vendors_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`), CONSTRAINT `vendors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `webhooks`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -2330,7 +2340,7 @@ CREATE TABLE `webhooks` ( KEY `subscriptions_company_id_foreign` (`company_id`), KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2361,158 +2371,155 @@ INSERT INTO `migrations` VALUES (19,'2020_10_12_204517_project_number_column',1) INSERT INTO `migrations` VALUES (20,'2020_10_14_201320_project_ids_to_entities',1); INSERT INTO `migrations` VALUES (21,'2020_10_19_101823_project_name_unique_removal',1); INSERT INTO `migrations` VALUES (22,'2020_10_21_222738_expenses_nullable_assigned_user',1); -INSERT INTO `migrations` VALUES (23,'2020_10_22_204900_company_table_fields',2); -INSERT INTO `migrations` VALUES (24,'2020_10_27_021751_tasks_invoice_documents',2); -INSERT INTO `migrations` VALUES (25,'2020_10_28_224711_status_sort_order',2); -INSERT INTO `migrations` VALUES (26,'2020_10_28_225022_assigned_user_tasks_table',2); -INSERT INTO `migrations` VALUES (27,'2020_10_29_001541_vendors_phone_column',2); -INSERT INTO `migrations` VALUES (28,'2020_10_29_093836_change_start_time_column_type',2); -INSERT INTO `migrations` VALUES (29,'2020_10_29_204434_tasks_table_project_nullable',2); -INSERT INTO `migrations` VALUES (30,'2020_10_29_210402_change_default_show_tasks_table',2); -INSERT INTO `migrations` VALUES (31,'2020_10_30_084139_change_expense_currency_id_column',2); -INSERT INTO `migrations` VALUES (32,'2020_11_01_031750_drop_migrating_column',2); -INSERT INTO `migrations` VALUES (33,'2020_11_03_200345_company_gateway_fields_refactor',2); -INSERT INTO `migrations` VALUES (34,'2020_11_08_212050_custom_fields_for_payments_table',2); -INSERT INTO `migrations` VALUES (35,'2020_11_12_104413_company_gateway_rename_column',2); -INSERT INTO `migrations` VALUES (36,'2020_11_15_203755_soft_delete_paymentables',2); -INSERT INTO `migrations` VALUES (37,'2020_12_14_114722_task_fields',2); -INSERT INTO `migrations` VALUES (38,'2020_12_17_104033_add_enable_product_discount_field_to_companies_table',2); -INSERT INTO `migrations` VALUES (39,'2020_12_20_005609_change_products_table_cost_resolution',2); -INSERT INTO `migrations` VALUES (40,'2020_12_23_220648_remove_null_values_in_countries_table',2); -INSERT INTO `migrations` VALUES (41,'2021_01_03_215053_update_canadian_dollar_symbol',2); -INSERT INTO `migrations` VALUES (42,'2021_01_05_013203_improve_decimal_resolution',2); -INSERT INTO `migrations` VALUES (43,'2021_01_07_023350_update_singapore_dollar_symbol',2); -INSERT INTO `migrations` VALUES (44,'2021_01_08_093324_expenses_table_additional_fields',2); -INSERT INTO `migrations` VALUES (45,'2021_01_11_092056_fix_company_settings_url',2); -INSERT INTO `migrations` VALUES (46,'2021_01_17_040331_change_custom_surcharge_column_type',2); -INSERT INTO `migrations` VALUES (47,'2021_01_23_044502_scheduler_is_running_check',2); -INSERT INTO `migrations` VALUES (48,'2021_01_24_052645_add_paid_to_date_column',2); -INSERT INTO `migrations` VALUES (49,'2021_01_25_095351_add_number_field_to_clients_and_vendors',2); -INSERT INTO `migrations` VALUES (50,'2021_01_29_121502_add_permission_changed_timestamp',2); -INSERT INTO `migrations` VALUES (51,'2021_02_15_214724_additional_company_properties',2); -INSERT INTO `migrations` VALUES (52,'2021_02_19_212722_email_last_confirmed_email_address_users_table',2); -INSERT INTO `migrations` VALUES (53,'2021_02_25_205901_enum_invitations_email_status',2); -INSERT INTO `migrations` VALUES (54,'2021_02_27_091713_add_invoice_task_datelog_property',2); -INSERT INTO `migrations` VALUES (55,'2021_03_03_230941_add_has_password_field_to_user_table',2); -INSERT INTO `migrations` VALUES (56,'2021_03_08_123729_create_billing_subscriptions_table',2); -INSERT INTO `migrations` VALUES (57,'2021_03_08_205030_add_russian_lang',2); -INSERT INTO `migrations` VALUES (58,'2021_03_09_132242_add_currency_id_to_billing_subscriptions_table',2); -INSERT INTO `migrations` VALUES (59,'2021_03_18_113704_change_2fa_column_from_varchar_to_text',2); -INSERT INTO `migrations` VALUES (60,'2021_03_19_221024_add_unique_constraints_on_all_entities',2); -INSERT INTO `migrations` VALUES (61,'2021_03_20_033751_add_invoice_id_to_client_subscriptions_table',2); -INSERT INTO `migrations` VALUES (62,'2021_03_23_233844_add_nullable_constraint_to_recurring_invoice_id',2); -INSERT INTO `migrations` VALUES (63,'2021_03_25_082025_refactor_billing_scriptions_table',2); -INSERT INTO `migrations` VALUES (64,'2021_03_26_201148_add_price_column_to_subscriptions_table',2); -INSERT INTO `migrations` VALUES (65,'2021_04_01_093128_modify_column_on_subscriptions_table',2); -INSERT INTO `migrations` VALUES (66,'2021_04_05_115345_add_trial_duration_to_accounts_table',2); -INSERT INTO `migrations` VALUES (67,'2021_04_05_213802_add_rest_fields_to_webhooks_table',2); -INSERT INTO `migrations` VALUES (68,'2021_04_06_131028_create_licenses_table',2); -INSERT INTO `migrations` VALUES (69,'2021_04_12_095424_stripe_connect_gateway',2); -INSERT INTO `migrations` VALUES (70,'2021_04_13_013424_add_subscription_id_to_activities_table',2); -INSERT INTO `migrations` VALUES (71,'2021_04_22_110240_add_property_to_checkout_gateway_config',2); -INSERT INTO `migrations` VALUES (72,'2021_04_29_085418_add_number_years_active_to_company_users_table',2); -INSERT INTO `migrations` VALUES (73,'2021_05_03_152940_make_braintree_provider_visible',2); -INSERT INTO `migrations` VALUES (74,'2021_05_04_231430_add_task_property_to_companies_table',2); -INSERT INTO `migrations` VALUES (75,'2021_05_05_014713_activate_we_pay',2); -INSERT INTO `migrations` VALUES (76,'2021_05_10_041528_add_recurring_invoice_id_to_activities_table',2); -INSERT INTO `migrations` VALUES (77,'2021_05_27_105157_add_tech_design',2); -INSERT INTO `migrations` VALUES (78,'2021_05_30_100933_make_documents_assigned_user_nullable',2); -INSERT INTO `migrations` VALUES (79,'2021_06_10_221012_add_ninja_portal_column_to_accounts_table',2); -INSERT INTO `migrations` VALUES (80,'2021_06_24_095942_payments_table_currency_nullable',2); -INSERT INTO `migrations` VALUES (81,'2021_06_24_115919_update_designs',2); -INSERT INTO `migrations` VALUES (82,'2021_07_08_115919_update_designs',3); -INSERT INTO `migrations` VALUES (83,'2021_07_10_085821_activate_payfast_payment_driver',3); -INSERT INTO `migrations` VALUES (84,'2021_07_19_074503_set_invoice_task_datelog_true_in_companies_table',4); -INSERT INTO `migrations` VALUES (85,'2021_07_20_095537_activate_paytrace_payment_driver',4); -INSERT INTO `migrations` VALUES (86,'2021_07_21_213344_change_english_languages_tables',4); -INSERT INTO `migrations` VALUES (87,'2021_07_21_234227_activate_eway_payment_driver',4); -INSERT INTO `migrations` VALUES (88,'2021_08_03_115024_activate_mollie_payment_driver',4); -INSERT INTO `migrations` VALUES (89,'2021_08_05_235942_add_zelle_payment_type',4); -INSERT INTO `migrations` VALUES (90,'2021_08_07_222435_add_markdown_enabled_column_to_companies_table',4); -INSERT INTO `migrations` VALUES (91,'2021_08_10_034407_add_more_languages',4); -INSERT INTO `migrations` VALUES (92,'2021_08_18_220124_use_comma_as_decimal_place_companies_table',4); -INSERT INTO `migrations` VALUES (93,'2021_08_24_115919_update_designs',4); -INSERT INTO `migrations` VALUES (94,'2021_08_25_093105_report_include_drafts_in_companies_table',5); -INSERT INTO `migrations` VALUES (95,'2021_08_14_054458_square_payment_driver',6); -INSERT INTO `migrations` VALUES (96,'2021_08_23_101529_recurring_expenses_schema',6); -INSERT INTO `migrations` VALUES (97,'2021_09_05_101209_update_braintree_gateway',6); -INSERT INTO `migrations` VALUES (98,'2021_09_20_233053_set_square_test_mode_boolean',6); -INSERT INTO `migrations` VALUES (99,'2021_09_23_100629_add_currencies',6); -INSERT INTO `migrations` VALUES (100,'2021_09_24_201319_add_mollie_bank_transfer_to_payment_types',6); -INSERT INTO `migrations` VALUES (101,'2021_09_24_211504_add_kbc_to_payment_types',6); -INSERT INTO `migrations` VALUES (102,'2021_09_24_213858_add_bancontact_to_payment_types',6); -INSERT INTO `migrations` VALUES (103,'2021_09_28_154647_activate_gocardless_payment_driver',6); -INSERT INTO `migrations` VALUES (104,'2021_09_29_190258_add_required_client_registration_fields',6); -INSERT INTO `migrations` VALUES (105,'2021_10_04_134908_add_ideal_to_payment_types',6); -INSERT INTO `migrations` VALUES (106,'2021_10_06_044800_updated_bold_and_modern_designs',6); -INSERT INTO `migrations` VALUES (107,'2021_10_07_141737_razorpay',6); -INSERT INTO `migrations` VALUES (108,'2021_10_07_155410_add_hosted_page_to_payment_types',6); -INSERT INTO `migrations` VALUES (109,'2021_10_15_00000_stripe_payment_gateways',6); -INSERT INTO `migrations` VALUES (110,'2021_10_16_135200_add_direct_debit_to_payment_types',6); -INSERT INTO `migrations` VALUES (111,'2021_10_19_142200_add_gateway_type_for_direct_debit',6); -INSERT INTO `migrations` VALUES (112,'2021_10_20_005529_add_filename_to_backups_table',6); -INSERT INTO `migrations` VALUES (113,'2021_11_08_131308_onboarding',6); -INSERT INTO `migrations` VALUES (114,'2021_11_09_115919_update_designs',6); -INSERT INTO `migrations` VALUES (115,'2021_11_10_184847_add_is_migrate_column_to_accounts_table',6); -INSERT INTO `migrations` VALUES (116,'2021_11_11_163121_add_instant_bank_transfer',7); -INSERT INTO `migrations` VALUES (117,'2021_12_20_095542_add_serbian_language_translations',8); -INSERT INTO `migrations` VALUES (118,'2022_01_02_022421_add_slovak_language',8); -INSERT INTO `migrations` VALUES (119,'2022_01_06_061231_add_app_domain_id_to_gateways_table',8); -INSERT INTO `migrations` VALUES (120,'2022_01_18_004856_add_estonian_language',8); -INSERT INTO `migrations` VALUES (121,'2022_01_19_085907_add_platform_column_to_accounts_table',8); -INSERT INTO `migrations` VALUES (122,'2022_01_19_232436_add_kyd_currency',8); -INSERT INTO `migrations` VALUES (123,'2022_01_27_223617_add_client_count_to_accounts_table',8); -INSERT INTO `migrations` VALUES (124,'2022_02_06_091629_add_client_currency_conversion_to_companies_table',8); -INSERT INTO `migrations` VALUES (125,'2022_02_25_015411_update_stripe_apple_domain_config',9); -INSERT INTO `migrations` VALUES (126,'2022_03_09_053508_transaction_events',10); -INSERT INTO `migrations` VALUES (127,'2022_03_24_090728_markdown_email_enabled_wysiwyg_editor',10); -INSERT INTO `migrations` VALUES (128,'2022_03_29_014025_reverse_apple_domain_for_hosted',10); -INSERT INTO `migrations` VALUES (129,'2022_04_22_115838_client_settings_parse_for_types',10); -INSERT INTO `migrations` VALUES (130,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',10); -INSERT INTO `migrations` VALUES (131,'2022_04_14_121548_forte_payment_gateway',11); -INSERT INTO `migrations` VALUES (132,'2022_05_08_004937_heal_stripe_gateway_configuration',11); -INSERT INTO `migrations` VALUES (133,'2022_05_16_224917_add_auto_bill_tries_to_invoices_table',11); -INSERT INTO `migrations` VALUES (134,'2022_05_18_055442_update_custom_value_four_columns',11); -INSERT INTO `migrations` VALUES (135,'2022_05_18_162152_create_scheduled_jobs_table',11); -INSERT INTO `migrations` VALUES (136,'2022_05_18_162443_create_schedulers_table',11); -INSERT INTO `migrations` VALUES (137,'2022_05_23_050754_drop_redundant_column_show_production_description_dropdown',11); -INSERT INTO `migrations` VALUES (138,'2022_05_28_234651_create_purchase_orders_table',11); -INSERT INTO `migrations` VALUES (139,'2022_05_30_181109_drop_scheduled_jobs_table',11); -INSERT INTO `migrations` VALUES (140,'2022_05_30_184320_add_job_related_fields_to_schedulers_table',11); -INSERT INTO `migrations` VALUES (141,'2022_05_31_101504_inventory_management_schema',11); -INSERT INTO `migrations` VALUES (142,'2022_06_01_215859_set_recurring_client_timestamp',11); -INSERT INTO `migrations` VALUES (143,'2022_06_01_224339_create_purchase_order_invitations_table',11); -INSERT INTO `migrations` VALUES (144,'2022_06_10_030503_set_account_flag_for_react',11); -INSERT INTO `migrations` VALUES (145,'2022_06_16_025156_add_react_switching_flag',11); -INSERT INTO `migrations` VALUES (146,'2022_06_17_082627_change_refresh_token_column_size',11); -INSERT INTO `migrations` VALUES (147,'2022_06_21_104350_fixes_for_description_in_pdf_designs',11); -INSERT INTO `migrations` VALUES (148,'2022_06_22_090547_set_oauth_expiry_column',11); -INSERT INTO `migrations` VALUES (149,'2022_06_24_141018_upgrade_failed_jobs_table',11); -INSERT INTO `migrations` VALUES (150,'2022_06_30_000126_add_flag_to_accounts_table',11); -INSERT INTO `migrations` VALUES (151,'2022_07_06_080127_add_purchase_order_to_expense',11); -INSERT INTO `migrations` VALUES (152,'2022_07_09_235510_add_index_to_payment_hash',11); -INSERT INTO `migrations` VALUES (153,'2022_07_18_033756_fixes_for_date_formats_table_react',11); -INSERT INTO `migrations` VALUES (154,'2022_07_21_023805_add_hebrew_language',11); -INSERT INTO `migrations` VALUES (155,'2022_07_26_091216_add_sms_verification_to_hosted_account',11); -INSERT INTO `migrations` VALUES (156,'2022_07_28_232340_enabled_expense_tax_rates_to_companies_table',11); -INSERT INTO `migrations` VALUES (157,'2022_07_29_091235_correction_for_companies_table_types',11); -INSERT INTO `migrations` VALUES (158,'2022_08_11_011534_licenses_table_for_self_host',12); -INSERT INTO `migrations` VALUES (159,'2022_08_24_215917_invoice_task_project_companies_table',12); -INSERT INTO `migrations` VALUES (160,'2022_08_26_232500_add_email_status_column_to_purchase_order_invitations_table',12); -INSERT INTO `migrations` VALUES (161,'2022_08_28_210111_add_index_to_payments_table',12); -INSERT INTO `migrations` VALUES (162,'2022_09_05_024719_update_designs_for_tech_template',12); -INSERT INTO `migrations` VALUES (163,'2022_09_07_101731_add_reporting_option_to_companies_table',12); -INSERT INTO `migrations` VALUES (164,'2022_09_21_012417_add_threeds_to_braintree',12); -INSERT INTO `migrations` VALUES (165,'2022_09_30_235337_add_idempotency_key_to_payments',12); -INSERT INTO `migrations` VALUES (166,'2022_10_05_205645_add_indexes_to_client_hash',12); -INSERT INTO `migrations` VALUES (167,'2022_10_06_011344_add_key_to_products',12); -INSERT INTO `migrations` VALUES (168,'2022_08_05_023357_bank_integration',13); -INSERT INTO `migrations` VALUES (169,'2022_10_07_065455_add_key_to_company_tokens_table',13); -INSERT INTO `migrations` VALUES (170,'2022_10_10_070137_add_documentable_index',13); -INSERT INTO `migrations` VALUES (171,'2022_10_27_044909_add_user_sms_verification_code',13); -INSERT INTO `migrations` VALUES (172,'2022_11_02_063742_add_verified_number_flag_to_users_table',13); -INSERT INTO `migrations` VALUES (173,'2022_11_04_013539_disabled_upstream_bank_integrations_table',13); -INSERT INTO `migrations` VALUES (174,'2022_11_06_215526_drop_html_backups_column_from_backups_table',13); -INSERT INTO `migrations` VALUES (175,'2022_11_13_034143_bank_transaction_rules_table',13); -INSERT INTO `migrations` VALUES (176,'2022_11_16_093535_calmness_design',13); -INSERT INTO `migrations` VALUES (177,'2022_11_22_215618_lock_tasks_when_invoiced',13); +INSERT INTO `migrations` VALUES (23,'2020_10_22_204900_company_table_fields',1); +INSERT INTO `migrations` VALUES (24,'2020_10_27_021751_tasks_invoice_documents',1); +INSERT INTO `migrations` VALUES (25,'2020_10_28_224711_status_sort_order',1); +INSERT INTO `migrations` VALUES (26,'2020_10_28_225022_assigned_user_tasks_table',1); +INSERT INTO `migrations` VALUES (27,'2020_10_29_001541_vendors_phone_column',1); +INSERT INTO `migrations` VALUES (28,'2020_10_29_093836_change_start_time_column_type',1); +INSERT INTO `migrations` VALUES (29,'2020_10_29_204434_tasks_table_project_nullable',1); +INSERT INTO `migrations` VALUES (30,'2020_10_29_210402_change_default_show_tasks_table',1); +INSERT INTO `migrations` VALUES (31,'2020_10_30_084139_change_expense_currency_id_column',1); +INSERT INTO `migrations` VALUES (32,'2020_11_01_031750_drop_migrating_column',1); +INSERT INTO `migrations` VALUES (33,'2020_11_03_200345_company_gateway_fields_refactor',1); +INSERT INTO `migrations` VALUES (34,'2020_11_08_212050_custom_fields_for_payments_table',1); +INSERT INTO `migrations` VALUES (35,'2020_11_12_104413_company_gateway_rename_column',1); +INSERT INTO `migrations` VALUES (36,'2020_11_15_203755_soft_delete_paymentables',1); +INSERT INTO `migrations` VALUES (37,'2020_12_14_114722_task_fields',1); +INSERT INTO `migrations` VALUES (38,'2020_12_17_104033_add_enable_product_discount_field_to_companies_table',1); +INSERT INTO `migrations` VALUES (39,'2020_12_20_005609_change_products_table_cost_resolution',1); +INSERT INTO `migrations` VALUES (40,'2020_12_23_220648_remove_null_values_in_countries_table',1); +INSERT INTO `migrations` VALUES (41,'2021_01_03_215053_update_canadian_dollar_symbol',1); +INSERT INTO `migrations` VALUES (42,'2021_01_05_013203_improve_decimal_resolution',1); +INSERT INTO `migrations` VALUES (43,'2021_01_07_023350_update_singapore_dollar_symbol',1); +INSERT INTO `migrations` VALUES (44,'2021_01_08_093324_expenses_table_additional_fields',1); +INSERT INTO `migrations` VALUES (45,'2021_01_11_092056_fix_company_settings_url',1); +INSERT INTO `migrations` VALUES (46,'2021_01_17_040331_change_custom_surcharge_column_type',1); +INSERT INTO `migrations` VALUES (47,'2021_01_23_044502_scheduler_is_running_check',1); +INSERT INTO `migrations` VALUES (48,'2021_01_24_052645_add_paid_to_date_column',1); +INSERT INTO `migrations` VALUES (49,'2021_01_25_095351_add_number_field_to_clients_and_vendors',1); +INSERT INTO `migrations` VALUES (50,'2021_01_29_121502_add_permission_changed_timestamp',1); +INSERT INTO `migrations` VALUES (51,'2021_02_15_214724_additional_company_properties',1); +INSERT INTO `migrations` VALUES (52,'2021_02_19_212722_email_last_confirmed_email_address_users_table',1); +INSERT INTO `migrations` VALUES (53,'2021_02_25_205901_enum_invitations_email_status',1); +INSERT INTO `migrations` VALUES (54,'2021_02_27_091713_add_invoice_task_datelog_property',1); +INSERT INTO `migrations` VALUES (55,'2021_03_03_230941_add_has_password_field_to_user_table',1); +INSERT INTO `migrations` VALUES (56,'2021_03_08_123729_create_billing_subscriptions_table',1); +INSERT INTO `migrations` VALUES (57,'2021_03_08_205030_add_russian_lang',1); +INSERT INTO `migrations` VALUES (58,'2021_03_09_132242_add_currency_id_to_billing_subscriptions_table',1); +INSERT INTO `migrations` VALUES (59,'2021_03_18_113704_change_2fa_column_from_varchar_to_text',1); +INSERT INTO `migrations` VALUES (60,'2021_03_19_221024_add_unique_constraints_on_all_entities',1); +INSERT INTO `migrations` VALUES (61,'2021_03_20_033751_add_invoice_id_to_client_subscriptions_table',1); +INSERT INTO `migrations` VALUES (62,'2021_03_23_233844_add_nullable_constraint_to_recurring_invoice_id',1); +INSERT INTO `migrations` VALUES (63,'2021_03_25_082025_refactor_billing_scriptions_table',1); +INSERT INTO `migrations` VALUES (64,'2021_03_26_201148_add_price_column_to_subscriptions_table',1); +INSERT INTO `migrations` VALUES (65,'2021_04_01_093128_modify_column_on_subscriptions_table',1); +INSERT INTO `migrations` VALUES (66,'2021_04_05_115345_add_trial_duration_to_accounts_table',1); +INSERT INTO `migrations` VALUES (67,'2021_04_05_213802_add_rest_fields_to_webhooks_table',1); +INSERT INTO `migrations` VALUES (68,'2021_04_06_131028_create_licenses_table',1); +INSERT INTO `migrations` VALUES (69,'2021_04_12_095424_stripe_connect_gateway',1); +INSERT INTO `migrations` VALUES (70,'2021_04_13_013424_add_subscription_id_to_activities_table',1); +INSERT INTO `migrations` VALUES (71,'2021_04_22_110240_add_property_to_checkout_gateway_config',1); +INSERT INTO `migrations` VALUES (72,'2021_04_29_085418_add_number_years_active_to_company_users_table',1); +INSERT INTO `migrations` VALUES (73,'2021_05_03_152940_make_braintree_provider_visible',1); +INSERT INTO `migrations` VALUES (74,'2021_05_04_231430_add_task_property_to_companies_table',1); +INSERT INTO `migrations` VALUES (75,'2021_05_05_014713_activate_we_pay',1); +INSERT INTO `migrations` VALUES (76,'2021_05_10_041528_add_recurring_invoice_id_to_activities_table',1); +INSERT INTO `migrations` VALUES (77,'2021_05_27_105157_add_tech_design',1); +INSERT INTO `migrations` VALUES (78,'2021_05_30_100933_make_documents_assigned_user_nullable',1); +INSERT INTO `migrations` VALUES (79,'2021_06_10_221012_add_ninja_portal_column_to_accounts_table',1); +INSERT INTO `migrations` VALUES (80,'2021_06_24_095942_payments_table_currency_nullable',1); +INSERT INTO `migrations` VALUES (81,'2021_07_10_085821_activate_payfast_payment_driver',1); +INSERT INTO `migrations` VALUES (82,'2021_07_19_074503_set_invoice_task_datelog_true_in_companies_table',1); +INSERT INTO `migrations` VALUES (83,'2021_07_20_095537_activate_paytrace_payment_driver',1); +INSERT INTO `migrations` VALUES (84,'2021_07_21_213344_change_english_languages_tables',1); +INSERT INTO `migrations` VALUES (85,'2021_07_21_234227_activate_eway_payment_driver',1); +INSERT INTO `migrations` VALUES (86,'2021_08_03_115024_activate_mollie_payment_driver',1); +INSERT INTO `migrations` VALUES (87,'2021_08_05_235942_add_zelle_payment_type',1); +INSERT INTO `migrations` VALUES (88,'2021_08_07_222435_add_markdown_enabled_column_to_companies_table',1); +INSERT INTO `migrations` VALUES (89,'2021_08_10_034407_add_more_languages',1); +INSERT INTO `migrations` VALUES (90,'2021_08_14_054458_square_payment_driver',1); +INSERT INTO `migrations` VALUES (91,'2021_08_18_220124_use_comma_as_decimal_place_companies_table',1); +INSERT INTO `migrations` VALUES (92,'2021_08_23_101529_recurring_expenses_schema',1); +INSERT INTO `migrations` VALUES (93,'2021_08_25_093105_report_include_drafts_in_companies_table',1); +INSERT INTO `migrations` VALUES (94,'2021_09_05_101209_update_braintree_gateway',1); +INSERT INTO `migrations` VALUES (95,'2021_09_20_233053_set_square_test_mode_boolean',1); +INSERT INTO `migrations` VALUES (96,'2021_09_23_100629_add_currencies',1); +INSERT INTO `migrations` VALUES (97,'2021_09_24_201319_add_mollie_bank_transfer_to_payment_types',1); +INSERT INTO `migrations` VALUES (98,'2021_09_24_211504_add_kbc_to_payment_types',1); +INSERT INTO `migrations` VALUES (99,'2021_09_24_213858_add_bancontact_to_payment_types',1); +INSERT INTO `migrations` VALUES (100,'2021_09_28_154647_activate_gocardless_payment_driver',1); +INSERT INTO `migrations` VALUES (101,'2021_09_29_190258_add_required_client_registration_fields',1); +INSERT INTO `migrations` VALUES (102,'2021_10_04_134908_add_ideal_to_payment_types',1); +INSERT INTO `migrations` VALUES (103,'2021_10_06_044800_updated_bold_and_modern_designs',1); +INSERT INTO `migrations` VALUES (104,'2021_10_07_141737_razorpay',1); +INSERT INTO `migrations` VALUES (105,'2021_10_07_155410_add_hosted_page_to_payment_types',1); +INSERT INTO `migrations` VALUES (106,'2021_10_15_00000_stripe_payment_gateways',1); +INSERT INTO `migrations` VALUES (107,'2021_10_16_135200_add_direct_debit_to_payment_types',1); +INSERT INTO `migrations` VALUES (108,'2021_10_19_142200_add_gateway_type_for_direct_debit',1); +INSERT INTO `migrations` VALUES (109,'2021_10_20_005529_add_filename_to_backups_table',1); +INSERT INTO `migrations` VALUES (110,'2021_11_08_131308_onboarding',1); +INSERT INTO `migrations` VALUES (111,'2021_11_09_115919_update_designs',1); +INSERT INTO `migrations` VALUES (112,'2021_11_10_184847_add_is_migrate_column_to_accounts_table',1); +INSERT INTO `migrations` VALUES (113,'2021_11_11_163121_add_instant_bank_transfer',1); +INSERT INTO `migrations` VALUES (114,'2021_12_20_095542_add_serbian_language_translations',1); +INSERT INTO `migrations` VALUES (115,'2022_01_02_022421_add_slovak_language',1); +INSERT INTO `migrations` VALUES (116,'2022_01_06_061231_add_app_domain_id_to_gateways_table',1); +INSERT INTO `migrations` VALUES (117,'2022_01_18_004856_add_estonian_language',1); +INSERT INTO `migrations` VALUES (118,'2022_01_19_085907_add_platform_column_to_accounts_table',1); +INSERT INTO `migrations` VALUES (119,'2022_01_19_232436_add_kyd_currency',1); +INSERT INTO `migrations` VALUES (120,'2022_01_27_223617_add_client_count_to_accounts_table',1); +INSERT INTO `migrations` VALUES (121,'2022_02_06_091629_add_client_currency_conversion_to_companies_table',1); +INSERT INTO `migrations` VALUES (122,'2022_02_25_015411_update_stripe_apple_domain_config',1); +INSERT INTO `migrations` VALUES (123,'2022_03_09_053508_transaction_events',1); +INSERT INTO `migrations` VALUES (124,'2022_03_24_090728_markdown_email_enabled_wysiwyg_editor',1); +INSERT INTO `migrations` VALUES (125,'2022_03_29_014025_reverse_apple_domain_for_hosted',1); +INSERT INTO `migrations` VALUES (126,'2022_04_14_121548_forte_payment_gateway',1); +INSERT INTO `migrations` VALUES (127,'2022_04_22_115838_client_settings_parse_for_types',1); +INSERT INTO `migrations` VALUES (128,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',1); +INSERT INTO `migrations` VALUES (129,'2022_05_08_004937_heal_stripe_gateway_configuration',1); +INSERT INTO `migrations` VALUES (130,'2022_05_16_224917_add_auto_bill_tries_to_invoices_table',1); +INSERT INTO `migrations` VALUES (131,'2022_05_18_055442_update_custom_value_four_columns',1); +INSERT INTO `migrations` VALUES (132,'2022_05_18_162152_create_scheduled_jobs_table',1); +INSERT INTO `migrations` VALUES (133,'2022_05_18_162443_create_schedulers_table',1); +INSERT INTO `migrations` VALUES (134,'2022_05_23_050754_drop_redundant_column_show_production_description_dropdown',1); +INSERT INTO `migrations` VALUES (135,'2022_05_28_234651_create_purchase_orders_table',1); +INSERT INTO `migrations` VALUES (136,'2022_05_30_181109_drop_scheduled_jobs_table',1); +INSERT INTO `migrations` VALUES (137,'2022_05_30_184320_add_job_related_fields_to_schedulers_table',1); +INSERT INTO `migrations` VALUES (138,'2022_05_31_101504_inventory_management_schema',1); +INSERT INTO `migrations` VALUES (139,'2022_06_01_215859_set_recurring_client_timestamp',1); +INSERT INTO `migrations` VALUES (140,'2022_06_01_224339_create_purchase_order_invitations_table',1); +INSERT INTO `migrations` VALUES (141,'2022_06_10_030503_set_account_flag_for_react',1); +INSERT INTO `migrations` VALUES (142,'2022_06_16_025156_add_react_switching_flag',1); +INSERT INTO `migrations` VALUES (143,'2022_06_17_082627_change_refresh_token_column_size',1); +INSERT INTO `migrations` VALUES (144,'2022_06_21_104350_fixes_for_description_in_pdf_designs',1); +INSERT INTO `migrations` VALUES (145,'2022_06_22_090547_set_oauth_expiry_column',1); +INSERT INTO `migrations` VALUES (146,'2022_06_24_141018_upgrade_failed_jobs_table',1); +INSERT INTO `migrations` VALUES (147,'2022_06_30_000126_add_flag_to_accounts_table',1); +INSERT INTO `migrations` VALUES (148,'2022_07_06_080127_add_purchase_order_to_expense',1); +INSERT INTO `migrations` VALUES (149,'2022_07_09_235510_add_index_to_payment_hash',1); +INSERT INTO `migrations` VALUES (150,'2022_07_18_033756_fixes_for_date_formats_table_react',1); +INSERT INTO `migrations` VALUES (151,'2022_07_21_023805_add_hebrew_language',1); +INSERT INTO `migrations` VALUES (152,'2022_07_26_091216_add_sms_verification_to_hosted_account',1); +INSERT INTO `migrations` VALUES (153,'2022_07_28_232340_enabled_expense_tax_rates_to_companies_table',1); +INSERT INTO `migrations` VALUES (154,'2022_07_29_091235_correction_for_companies_table_types',1); +INSERT INTO `migrations` VALUES (155,'2022_08_05_023357_bank_integration',1); +INSERT INTO `migrations` VALUES (156,'2022_08_11_011534_licenses_table_for_self_host',1); +INSERT INTO `migrations` VALUES (157,'2022_08_24_215917_invoice_task_project_companies_table',1); +INSERT INTO `migrations` VALUES (158,'2022_08_26_232500_add_email_status_column_to_purchase_order_invitations_table',1); +INSERT INTO `migrations` VALUES (159,'2022_08_28_210111_add_index_to_payments_table',1); +INSERT INTO `migrations` VALUES (160,'2022_09_05_024719_update_designs_for_tech_template',1); +INSERT INTO `migrations` VALUES (161,'2022_09_07_101731_add_reporting_option_to_companies_table',1); +INSERT INTO `migrations` VALUES (162,'2022_09_21_012417_add_threeds_to_braintree',1); +INSERT INTO `migrations` VALUES (163,'2022_09_30_235337_add_idempotency_key_to_payments',1); +INSERT INTO `migrations` VALUES (164,'2022_10_05_205645_add_indexes_to_client_hash',1); +INSERT INTO `migrations` VALUES (165,'2022_10_06_011344_add_key_to_products',1); +INSERT INTO `migrations` VALUES (166,'2022_10_07_065455_add_key_to_company_tokens_table',1); +INSERT INTO `migrations` VALUES (167,'2022_10_10_070137_add_documentable_index',1); +INSERT INTO `migrations` VALUES (168,'2022_10_27_044909_add_user_sms_verification_code',1); +INSERT INTO `migrations` VALUES (169,'2022_11_02_063742_add_verified_number_flag_to_users_table',1); +INSERT INTO `migrations` VALUES (170,'2022_11_04_013539_disabled_upstream_bank_integrations_table',1); +INSERT INTO `migrations` VALUES (171,'2022_11_06_215526_drop_html_backups_column_from_backups_table',1); +INSERT INTO `migrations` VALUES (172,'2022_11_13_034143_bank_transaction_rules_table',1); +INSERT INTO `migrations` VALUES (173,'2022_11_16_093535_calmness_design',1); +INSERT INTO `migrations` VALUES (174,'2022_11_22_215618_lock_tasks_when_invoiced',1); diff --git a/database/schema/mysql-schema.dump b/database/schema/mysql-schema.dump deleted file mode 100644 index e7cd45635d62..000000000000 --- a/database/schema/mysql-schema.dump +++ /dev/null @@ -1,2522 +0,0 @@ -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -DROP TABLE IF EXISTS `accounts`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `accounts` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `plan` enum('pro','enterprise','white_label') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_term` enum('month','year') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_started` date DEFAULT NULL, - `plan_paid` date DEFAULT NULL, - `plan_expires` date DEFAULT NULL, - `user_agent` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payment_id` int(10) unsigned DEFAULT NULL, - `default_company_id` int(10) unsigned NOT NULL, - `trial_started` date DEFAULT NULL, - `trial_plan` enum('pro','enterprise') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `plan_price` decimal(7,2) DEFAULT NULL, - `num_users` smallint(6) NOT NULL DEFAULT 1, - `utm_source` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_medium` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_campaign` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_term` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `utm_content` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `latest_version` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.0.0', - `report_errors` tinyint(1) NOT NULL DEFAULT 0, - `referral_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_scheduler_running` tinyint(1) NOT NULL DEFAULT 0, - `trial_duration` int(10) unsigned DEFAULT NULL, - `is_onboarding` tinyint(1) NOT NULL DEFAULT 0, - `onboarding` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_migrated` tinyint(1) NOT NULL DEFAULT 0, - `platform` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hosted_client_count` int(10) unsigned DEFAULT NULL, - `hosted_company_count` int(10) unsigned DEFAULT NULL, - `inapp_transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `set_react_as_default_ap` tinyint(1) NOT NULL DEFAULT 0, - `is_flagged` tinyint(1) NOT NULL DEFAULT 0, - `is_verified_account` tinyint(1) NOT NULL DEFAULT 0, - `account_sms_verification_code` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_sms_verification_number` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_sms_verified` tinyint(1) NOT NULL DEFAULT 0, - `bank_integration_account_id` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `accounts_payment_id_index` (`payment_id`), - KEY `accounts_key_index` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `activities`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `activities` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `client_contact_id` int(10) unsigned DEFAULT NULL, - `account_id` int(10) unsigned DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `payment_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `credit_id` int(10) unsigned DEFAULT NULL, - `invitation_id` int(10) unsigned DEFAULT NULL, - `task_id` int(10) unsigned DEFAULT NULL, - `expense_id` int(10) unsigned DEFAULT NULL, - `activity_type_id` int(10) unsigned DEFAULT NULL, - `ip` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `is_system` tinyint(1) NOT NULL DEFAULT 0, - `notes` text COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `token_id` int(10) unsigned DEFAULT NULL, - `quote_id` int(10) unsigned DEFAULT NULL, - `subscription_id` int(10) unsigned DEFAULT NULL, - `recurring_invoice_id` int(10) unsigned DEFAULT NULL, - `recurring_expense_id` int(10) unsigned DEFAULT NULL, - `recurring_quote_id` int(10) unsigned DEFAULT NULL, - `purchase_order_id` int(10) unsigned DEFAULT NULL, - `vendor_contact_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `activities_vendor_id_company_id_index` (`vendor_id`,`company_id`), - KEY `activities_project_id_company_id_index` (`project_id`,`company_id`), - KEY `activities_user_id_company_id_index` (`user_id`,`company_id`), - KEY `activities_client_id_company_id_index` (`client_id`,`company_id`), - KEY `activities_payment_id_company_id_index` (`payment_id`,`company_id`), - KEY `activities_invoice_id_company_id_index` (`invoice_id`,`company_id`), - KEY `activities_credit_id_company_id_index` (`credit_id`,`company_id`), - KEY `activities_invitation_id_company_id_index` (`invitation_id`,`company_id`), - KEY `activities_task_id_company_id_index` (`task_id`,`company_id`), - KEY `activities_expense_id_company_id_index` (`expense_id`,`company_id`), - KEY `activities_client_contact_id_company_id_index` (`client_contact_id`,`company_id`), - KEY `activities_company_id_foreign` (`company_id`), - KEY `activities_quote_id_company_id_index` (`quote_id`,`company_id`), - KEY `activities_recurring_invoice_id_company_id_index` (`recurring_invoice_id`,`company_id`), - KEY `activities_purchase_order_id_company_id_index` (`purchase_order_id`,`company_id`), - KEY `activities_vendor_contact_id_company_id_index` (`vendor_contact_id`,`company_id`), - CONSTRAINT `activities_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `backups`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `backups` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `activity_id` int(10) unsigned NOT NULL, - `json_backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `amount` decimal(16,4) NOT NULL, - `filename` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `disk` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `backups_activity_id_foreign` (`activity_id`), - CONSTRAINT `backups_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bank_companies`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_companies` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `bank_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `bank_companies_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `bank_companies_user_id_foreign` (`user_id`), - KEY `bank_companies_bank_id_foreign` (`bank_id`), - CONSTRAINT `bank_companies_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`), - CONSTRAINT `bank_companies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_companies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bank_integrations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_integrations` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `account_id` int(10) unsigned NOT NULL, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `provider_name` text COLLATE utf8mb4_unicode_ci NOT NULL, - `provider_id` bigint(20) NOT NULL, - `bank_account_id` bigint(20) NOT NULL, - `bank_account_name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_account_number` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_account_status` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_account_type` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, - `currency` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `nickname` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `from_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `disabled_upstream` tinyint(1) NOT NULL DEFAULT 0, - `auto_sync` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `bank_integrations_user_id_foreign` (`user_id`), - KEY `bank_integrations_account_id_foreign` (`account_id`), - KEY `bank_integrations_company_id_foreign` (`company_id`), - CONSTRAINT `bank_integrations_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_integrations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_integrations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bank_subcompanies`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_subcompanies` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `bank_company_id` int(10) unsigned NOT NULL, - `account_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `account_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `bank_subcompanies_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `bank_subcompanies_user_id_foreign` (`user_id`), - KEY `bank_subcompanies_bank_company_id_foreign` (`bank_company_id`), - CONSTRAINT `bank_subcompanies_bank_company_id_foreign` FOREIGN KEY (`bank_company_id`) REFERENCES `bank_companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_subcompanies_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_subcompanies_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bank_transaction_rules`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_transaction_rules` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `rules` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `auto_convert` tinyint(1) NOT NULL DEFAULT 0, - `matches_on_all` tinyint(1) NOT NULL DEFAULT 0, - `applies_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CREDIT', - `client_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `bank_transaction_rules_user_id_foreign` (`user_id`), - KEY `bank_transaction_rules_company_id_foreign` (`company_id`), - CONSTRAINT `bank_transaction_rules_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_transaction_rules_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `bank_transactions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bank_transactions` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `bank_integration_id` bigint(20) unsigned NOT NULL, - `transaction_id` bigint(20) unsigned NOT NULL, - `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, - `currency_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `account_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, - `ninja_category_id` int(10) unsigned DEFAULT NULL, - `category_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `base_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `date` date DEFAULT NULL, - `bank_account_id` bigint(20) unsigned NOT NULL, - `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `invoice_ids` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - `expense_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `status_id` int(10) unsigned NOT NULL DEFAULT 1, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `bank_rule_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `bank_transactions_bank_integration_id_foreign` (`bank_integration_id`), - KEY `bank_transactions_user_id_foreign` (`user_id`), - KEY `bank_transactions_company_id_foreign` (`company_id`), - KEY `bank_transactions_transaction_id_index` (`transaction_id`), - KEY `bank_transactions_category_type_index` (`category_type`), - KEY `bank_transactions_base_type_index` (`base_type`), - CONSTRAINT `bank_transactions_bank_integration_id_foreign` FOREIGN KEY (`bank_integration_id`) REFERENCES `bank_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_transactions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `bank_transactions_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `banks`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `banks` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remote_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `bank_library_id` int(11) NOT NULL DEFAULT 1, - `config` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `client_contacts`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `client_contacts` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT 0, - `confirmed` tinyint(1) NOT NULL DEFAULT 0, - `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int(10) unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT 0, - `send_email` tinyint(1) NOT NULL DEFAULT 1, - `contact_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `client_contacts_oauth_user_id_unique` (`oauth_user_id`), - UNIQUE KEY `client_contacts_oauth_provider_id_unique` (`oauth_provider_id`), - KEY `client_contacts_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `client_contacts_company_id_email_deleted_at_index` (`company_id`,`email`,`deleted_at`), - KEY `client_contacts_company_id_index` (`company_id`), - KEY `client_contacts_client_id_index` (`client_id`), - KEY `client_contacts_user_id_index` (`user_id`), - KEY `client_contacts_contact_key(20)_index` (`contact_key`(20)), - KEY `client_contacts_email_index` (`email`), - CONSTRAINT `client_contacts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `client_gateway_tokens`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `client_gateway_tokens` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `token` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `routing_number` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_gateway_id` int(10) unsigned NOT NULL, - `gateway_customer_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `gateway_type_id` int(10) unsigned NOT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT 0, - `meta` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `client_gateway_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `client_gateway_tokens_client_id_foreign` (`client_id`), - CONSTRAINT `client_gateway_tokens_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `client_gateway_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `client_subscriptions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `client_subscriptions` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `subscription_id` int(10) unsigned NOT NULL, - `recurring_invoice_id` int(10) unsigned DEFAULT NULL, - `client_id` int(10) unsigned NOT NULL, - `trial_started` int(10) unsigned DEFAULT NULL, - `trial_ends` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `quantity` int(10) unsigned NOT NULL DEFAULT 1, - PRIMARY KEY (`id`), - KEY `client_subscriptions_subscription_id_foreign` (`subscription_id`), - KEY `client_subscriptions_recurring_invoice_id_foreign` (`recurring_invoice_id`), - KEY `client_subscriptions_client_id_foreign` (`client_id`), - KEY `client_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `client_subscriptions_invoice_id_foreign` (`invoice_id`), - CONSTRAINT `client_subscriptions_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`), - CONSTRAINT `client_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE, - CONSTRAINT `client_subscriptions_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `client_subscriptions_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`), - CONSTRAINT `client_subscriptions_subscription_id_foreign` FOREIGN KEY (`subscription_id`) REFERENCES `subscriptions` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `clients`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `clients` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `client_hash` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `credit_balance` decimal(20,6) NOT NULL DEFAULT 0.000000, - `last_login` timestamp NULL DEFAULT NULL, - `industry_id` int(10) unsigned DEFAULT NULL, - `size_id` int(10) unsigned DEFAULT NULL, - `address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int(10) unsigned DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `shipping_country_id` int(10) unsigned DEFAULT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `group_settings_id` int(10) unsigned DEFAULT NULL, - `vat_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `id_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `clients_company_id_number_unique` (`company_id`,`number`), - KEY `clients_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `clients_industry_id_foreign` (`industry_id`), - KEY `clients_size_id_foreign` (`size_id`), - KEY `clients_company_id_index` (`company_id`), - KEY `clients_user_id_index` (`user_id`), - KEY `clients_client_hash(20)_index` (`client_hash`(20)), - CONSTRAINT `clients_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `clients_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), - CONSTRAINT `clients_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `companies`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `companies` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `account_id` int(10) unsigned NOT NULL, - `industry_id` int(10) unsigned DEFAULT NULL, - `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, - `convert_products` tinyint(1) NOT NULL DEFAULT 0, - `fill_products` tinyint(1) NOT NULL DEFAULT 1, - `update_products` tinyint(1) NOT NULL DEFAULT 1, - `show_product_details` tinyint(1) NOT NULL DEFAULT 1, - `client_can_register` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_taxes1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_taxes2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_taxes3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_taxes4` tinyint(1) NOT NULL DEFAULT 0, - `show_product_cost` tinyint(1) NOT NULL DEFAULT 0, - `enabled_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, - `enabled_modules` int(10) unsigned NOT NULL DEFAULT 0, - `enable_product_cost` tinyint(1) NOT NULL DEFAULT 0, - `enable_product_quantity` tinyint(1) NOT NULL DEFAULT 1, - `default_quantity` tinyint(1) NOT NULL DEFAULT 1, - `subdomain` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `db` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size_id` int(10) unsigned DEFAULT NULL, - `first_day_of_week` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `first_month_of_year` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `portal_mode` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'subdomain', - `portal_domain` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `enable_modules` smallint(6) NOT NULL DEFAULT 0, - `custom_fields` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `slack_webhook_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `google_analytics_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `enabled_item_tax_rates` int(11) NOT NULL DEFAULT 0, - `is_large` tinyint(1) NOT NULL DEFAULT 0, - `enable_shop_api` tinyint(1) NOT NULL DEFAULT 0, - `default_auto_bill` enum('off','always','optin','optout') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `mark_expenses_invoiceable` tinyint(1) NOT NULL DEFAULT 0, - `mark_expenses_paid` tinyint(1) NOT NULL DEFAULT 0, - `invoice_expense_documents` tinyint(1) NOT NULL DEFAULT 0, - `auto_start_tasks` tinyint(1) NOT NULL DEFAULT 0, - `invoice_task_timelog` tinyint(1) NOT NULL DEFAULT 1, - `invoice_task_documents` tinyint(1) NOT NULL DEFAULT 0, - `show_tasks_table` tinyint(1) NOT NULL DEFAULT 0, - `is_disabled` tinyint(1) NOT NULL DEFAULT 0, - `default_task_is_date_based` tinyint(1) NOT NULL DEFAULT 0, - `enable_product_discount` tinyint(1) NOT NULL DEFAULT 0, - `calculate_expense_tax_by_amount` tinyint(1) NOT NULL, - `expense_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `session_timeout` int(11) NOT NULL DEFAULT 0, - `oauth_password_required` tinyint(1) NOT NULL DEFAULT 0, - `invoice_task_datelog` tinyint(1) NOT NULL DEFAULT 1, - `default_password_timeout` int(11) NOT NULL DEFAULT 30, - `show_task_end_date` tinyint(1) NOT NULL DEFAULT 0, - `markdown_enabled` tinyint(1) NOT NULL DEFAULT 1, - `use_comma_as_decimal_place` tinyint(1) NOT NULL DEFAULT 0, - `report_include_drafts` tinyint(1) NOT NULL DEFAULT 0, - `client_registration_fields` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `convert_rate_to_client` tinyint(1) NOT NULL DEFAULT 1, - `markdown_email_enabled` tinyint(1) NOT NULL DEFAULT 0, - `stop_on_unpaid_recurring` tinyint(1) NOT NULL DEFAULT 0, - `use_quote_terms_on_conversion` tinyint(1) NOT NULL DEFAULT 0, - `enable_applying_payments` tinyint(1) NOT NULL DEFAULT 0, - `track_inventory` tinyint(1) NOT NULL DEFAULT 0, - `inventory_notification_threshold` int(11) NOT NULL DEFAULT 0, - `stock_notification` tinyint(1) NOT NULL DEFAULT 1, - `enabled_expense_tax_rates` int(10) unsigned NOT NULL DEFAULT 0, - `invoice_task_project` tinyint(1) NOT NULL DEFAULT 0, - `report_include_deleted` tinyint(1) NOT NULL DEFAULT 0, - `invoice_task_lock` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `companies_company_key_unique` (`company_key`), - KEY `companies_industry_id_foreign` (`industry_id`), - KEY `companies_size_id_foreign` (`size_id`), - KEY `companies_account_id_index` (`account_id`), - KEY `companies_subdomain_portal_mode_index` (`subdomain`,`portal_mode`), - KEY `companies_portal_domain_portal_mode_index` (`portal_domain`,`portal_mode`), - KEY `companies_company_key_index` (`company_key`), - CONSTRAINT `companies_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `companies_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`), - CONSTRAINT `companies_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `company_gateways`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `company_gateways` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `gateway_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `accepted_credit_cards` int(10) unsigned NOT NULL, - `require_cvv` tinyint(1) NOT NULL DEFAULT 1, - `require_billing_address` tinyint(1) DEFAULT 1, - `require_shipping_address` tinyint(1) DEFAULT 1, - `update_details` tinyint(1) DEFAULT 0, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `config` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `fees_and_limits` text COLLATE utf8mb4_unicode_ci NOT NULL, - `custom_value1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `token_billing` enum('off','always','optin','optout') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `label` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `require_client_name` tinyint(1) NOT NULL DEFAULT 0, - `require_postal_code` tinyint(1) NOT NULL DEFAULT 0, - `require_client_phone` tinyint(1) NOT NULL DEFAULT 0, - `require_contact_name` tinyint(1) NOT NULL DEFAULT 0, - `require_contact_email` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `company_gateways_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `company_gateways_gateway_key_foreign` (`gateway_key`), - KEY `company_gateways_user_id_foreign` (`user_id`), - CONSTRAINT `company_gateways_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `company_gateways_gateway_key_foreign` FOREIGN KEY (`gateway_key`) REFERENCES `gateways` (`key`), - CONSTRAINT `company_gateways_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `company_ledgers`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `company_ledgers` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `activity_id` int(10) unsigned DEFAULT NULL, - `adjustment` decimal(20,6) DEFAULT NULL, - `balance` decimal(20,6) DEFAULT NULL, - `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hash` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_ledgerable_id` int(10) unsigned NOT NULL, - `company_ledgerable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `company_ledgers_company_id_foreign` (`company_id`), - KEY `company_ledgers_client_id_foreign` (`client_id`), - CONSTRAINT `company_ledgers_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `company_ledgers_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `company_tokens`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `company_tokens` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `account_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `is_system` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `company_tokens_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `company_tokens_account_id_foreign` (`account_id`), - KEY `company_tokens_user_id_foreign` (`user_id`), - KEY `company_tokens_company_id_index` (`company_id`), - KEY `company_tokens_token_deleted_at_index` (`token`,`deleted_at`), - CONSTRAINT `company_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `company_tokens_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `company_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `company_user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `company_user` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `account_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `permissions` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notifications` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `slack_webhook_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `is_owner` tinyint(1) NOT NULL DEFAULT 0, - `is_admin` tinyint(1) NOT NULL DEFAULT 0, - `is_locked` tinyint(1) NOT NULL DEFAULT 0, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `permissions_updated_at` timestamp NOT NULL DEFAULT current_timestamp(), - `ninja_portal_url` text COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', - PRIMARY KEY (`id`), - UNIQUE KEY `company_user_company_id_user_id_unique` (`company_id`,`user_id`), - KEY `company_user_account_id_company_id_deleted_at_index` (`account_id`,`company_id`,`deleted_at`), - KEY `company_user_user_id_index` (`user_id`), - CONSTRAINT `company_user_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE, - CONSTRAINT `company_user_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `countries`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `countries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `capital` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `citizenship` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `currency_sub_unit` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `full_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_2` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `iso_3166_3` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `region_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `sub_region_code` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `eea` tinyint(1) NOT NULL DEFAULT 0, - `swap_postal_code` tinyint(1) NOT NULL DEFAULT 0, - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, - `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '', - `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '', - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credit_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credit_invitations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `client_contact_id` int(10) unsigned NOT NULL, - `credit_id` int(10) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `credit_invitations_client_contact_id_credit_id_unique` (`client_contact_id`,`credit_id`), - KEY `credit_invitations_user_id_foreign` (`user_id`), - KEY `credit_invitations_company_id_foreign` (`company_id`), - KEY `credit_invitations_deleted_at_credit_id_company_id_index` (`deleted_at`,`credit_id`,`company_id`), - KEY `credit_invitations_credit_id_index` (`credit_id`), - KEY `credit_invitations_key_index` (`key`), - KEY `credit_invitations_message_id_index` (`message_id`), - CONSTRAINT `credit_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `credit_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `credit_invitations_credit_id_foreign` FOREIGN KEY (`credit_id`) REFERENCES `credits` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `credit_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `credits`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `credits` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `status_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `recurring_id` int(10) unsigned DEFAULT NULL, - `design_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `last_sent_date` datetime DEFAULT NULL, - `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `amount` decimal(20,6) NOT NULL, - `balance` decimal(20,6) NOT NULL, - `partial` decimal(20,6) DEFAULT NULL, - `partial_due_date` datetime DEFAULT NULL, - `last_viewed` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `reminder1_sent` date DEFAULT NULL, - `reminder2_sent` date DEFAULT NULL, - `reminder3_sent` date DEFAULT NULL, - `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `subscription_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `credits_company_id_number_unique` (`company_id`,`number`), - KEY `credits_user_id_foreign` (`user_id`), - KEY `credits_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `credits_client_id_index` (`client_id`), - KEY `credits_company_id_index` (`company_id`), - CONSTRAINT `credits_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `credits_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `credits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `currencies`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `currencies` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `symbol` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `precision` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `thousand_separator` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `decimal_separator` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `swap_currency_symbol` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `date_formats`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `date_formats` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `datetime_formats`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `datetime_formats` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `format` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_moment` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format_dart` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `designs`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `designs` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `is_custom` tinyint(1) NOT NULL DEFAULT 1, - `is_active` tinyint(1) NOT NULL DEFAULT 1, - `design` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `designs_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `designs_company_id_index` (`company_id`), - CONSTRAINT `designs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `documents`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `documents` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `url` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `preview` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `disk` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `hash` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `size` int(10) unsigned DEFAULT NULL, - `width` int(10) unsigned DEFAULT NULL, - `height` int(10) unsigned DEFAULT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT 0, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `documentable_id` int(10) unsigned NOT NULL, - `documentable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_public` tinyint(1) NOT NULL DEFAULT 1, - PRIMARY KEY (`id`), - KEY `documents_company_id_index` (`company_id`), - KEY `documents_documentable_id_documentable_type_deleted_at_index` (`documentable_id`,`documentable_type`,`deleted_at`), - CONSTRAINT `documents_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `expense_categories`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `expense_categories` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `company_id` int(10) unsigned NOT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - `bank_category_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `expense_categories_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `expense_categories_company_id_index` (`company_id`), - CONSTRAINT `expense_categories_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `expenses`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `expenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `bank_id` int(10) unsigned DEFAULT NULL, - `invoice_currency_id` int(10) unsigned DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, - `payment_type_id` int(10) unsigned DEFAULT NULL, - `recurring_expense_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `amount` decimal(20,6) NOT NULL, - `foreign_amount` decimal(20,6) NOT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `date` date DEFAULT NULL, - `payment_date` date DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_reference` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, - `invoice_documents` tinyint(1) NOT NULL DEFAULT 1, - `transaction_id` bigint(20) unsigned DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `tax_amount1` decimal(20,6) NOT NULL DEFAULT 1.000000, - `tax_amount2` decimal(20,6) NOT NULL DEFAULT 1.000000, - `tax_amount3` decimal(20,6) NOT NULL DEFAULT 1.000000, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `expenses_company_id_number_unique` (`company_id`,`number`), - KEY `expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `expenses_user_id_foreign` (`user_id`), - KEY `expenses_company_id_index` (`company_id`), - KEY `expenses_invoice_id_deleted_at_index` (`invoice_id`,`deleted_at`), - CONSTRAINT `expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `failed_jobs`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `failed_jobs` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `uuid` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, - `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `failed_at` timestamp NOT NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`), - UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `gateway_types`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `gateway_types` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `alias` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `gateways`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `gateways` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `provider` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `visible` tinyint(1) NOT NULL DEFAULT 1, - `sort_order` int(10) unsigned NOT NULL DEFAULT 10000, - `site_url` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_offsite` tinyint(1) NOT NULL DEFAULT 0, - `is_secure` tinyint(1) NOT NULL DEFAULT 0, - `fields` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `default_gateway_type_id` int(10) unsigned NOT NULL DEFAULT 1, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `gateways_key_unique` (`key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `group_settings`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `group_settings` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `settings` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_default` tinyint(1) NOT NULL DEFAULT 0, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `group_settings_company_id_deleted_at_index` (`company_id`,`deleted_at`), - CONSTRAINT `group_settings_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `industries`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `industries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `invoice_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `invoice_invitations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `client_contact_id` int(10) unsigned NOT NULL, - `invoice_id` int(10) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `invoice_invitations_client_contact_id_invoice_id_unique` (`client_contact_id`,`invoice_id`), - KEY `invoice_invitations_user_id_foreign` (`user_id`), - KEY `invoice_invitations_company_id_foreign` (`company_id`), - KEY `invoice_invitations_deleted_at_invoice_id_company_id_index` (`deleted_at`,`invoice_id`,`company_id`), - KEY `invoice_invitations_invoice_id_index` (`invoice_id`), - KEY `invoice_invitations_message_id_index` (`message_id`), - KEY `invoice_invitations_key_deleted_at_index` (`key`,`deleted_at`), - CONSTRAINT `invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `invoice_invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `invoices`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `invoices` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `status_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `recurring_id` int(10) unsigned DEFAULT NULL, - `design_id` int(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `last_sent_date` date DEFAULT NULL, - `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `amount` decimal(20,6) NOT NULL, - `balance` decimal(20,6) NOT NULL, - `partial` decimal(20,6) DEFAULT NULL, - `partial_due_date` datetime DEFAULT NULL, - `last_viewed` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `reminder1_sent` date DEFAULT NULL, - `reminder2_sent` date DEFAULT NULL, - `reminder3_sent` date DEFAULT NULL, - `reminder_last_sent` date DEFAULT NULL, - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `subscription_id` int(10) unsigned DEFAULT NULL, - `auto_bill_tries` smallint(6) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `invoices_company_id_number_unique` (`company_id`,`number`), - KEY `invoices_user_id_foreign` (`user_id`), - KEY `invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `invoices_client_id_index` (`client_id`), - KEY `invoices_company_id_index` (`company_id`), - KEY `invoices_recurring_id_index` (`recurring_id`), - KEY `invoices_status_id_balance_index` (`status_id`,`balance`), - CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `jobs`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `jobs` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, - `attempts` tinyint(3) unsigned NOT NULL, - `reserved_at` int(10) unsigned DEFAULT NULL, - `available_at` int(10) unsigned NOT NULL, - `created_at` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `jobs_queue_index` (`queue`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `languages`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `languages` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `locale` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `licenses`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `licenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `license_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_claimed` tinyint(1) DEFAULT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_id` int(10) unsigned DEFAULT NULL, - `recurring_invoice_id` bigint(20) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `licenses_license_key_unique` (`license_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `migrations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `migrations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `batch` int(11) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `password_resets`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `password_resets` ( - `email` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - KEY `password_resets_email_index` (`email`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `payment_hashes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `payment_hashes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `hash` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, - `fee_total` decimal(16,4) NOT NULL, - `fee_invoice_id` int(10) unsigned DEFAULT NULL, - `data` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `payment_id` int(10) unsigned DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `payment_hashes_payment_id_foreign` (`payment_id`), - KEY `payment_hashes_hash_index` (`hash`), - CONSTRAINT `payment_hashes_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `payment_libraries`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `payment_libraries` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `visible` tinyint(1) NOT NULL DEFAULT 1, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `payment_terms`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `payment_terms` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `num_days` int(11) DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `payment_terms_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `payment_terms_user_id_foreign` (`user_id`), - CONSTRAINT `payment_terms_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `payment_terms_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `payment_types`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `payment_types` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `gateway_type_id` int(11) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `paymentables`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `paymentables` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `payment_id` int(10) unsigned NOT NULL, - `paymentable_id` int(10) unsigned NOT NULL, - `amount` decimal(16,4) NOT NULL DEFAULT 0.0000, - `refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, - `paymentable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `paymentables_payment_id_foreign` (`payment_id`), - KEY `paymentables_paymentable_id_index` (`paymentable_id`), - CONSTRAINT `paymentables_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `payments`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `payments` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `client_contact_id` int(10) unsigned DEFAULT NULL, - `invitation_id` int(10) unsigned DEFAULT NULL, - `company_gateway_id` int(10) unsigned DEFAULT NULL, - `gateway_type_id` int(10) unsigned DEFAULT NULL, - `type_id` int(10) unsigned DEFAULT NULL, - `status_id` int(10) unsigned NOT NULL, - `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, - `refunded` decimal(20,6) NOT NULL DEFAULT 0.000000, - `applied` decimal(20,6) NOT NULL DEFAULT 0.000000, - `date` date DEFAULT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `payer_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `is_manual` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `currency_id` int(10) unsigned NOT NULL, - `exchange_currency_id` int(10) unsigned DEFAULT NULL, - `meta` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_id` bigint(20) unsigned DEFAULT NULL, - `idempotency_key` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `payments_company_id_number_unique` (`company_id`,`number`), - UNIQUE KEY `payments_company_id_idempotency_key_unique` (`company_id`,`idempotency_key`), - KEY `payments_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `payments_client_contact_id_foreign` (`client_contact_id`), - KEY `payments_company_gateway_id_foreign` (`company_gateway_id`), - KEY `payments_user_id_foreign` (`user_id`), - KEY `payments_company_id_index` (`company_id`), - KEY `payments_client_id_index` (`client_id`), - KEY `payments_status_id_index` (`status_id`), - KEY `payments_transaction_reference_index` (`transaction_reference`), - KEY `payments_idempotency_key_index` (`idempotency_key`), - CONSTRAINT `payments_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `payments_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `payments_company_gateway_id_foreign` FOREIGN KEY (`company_gateway_id`) REFERENCES `company_gateways` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `payments_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `products`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `products` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `product_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `cost` decimal(20,6) NOT NULL DEFAULT 0.000000, - `price` decimal(20,6) NOT NULL DEFAULT 0.000000, - `quantity` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `in_stock_quantity` int(11) NOT NULL DEFAULT 0, - `stock_notification` tinyint(1) NOT NULL DEFAULT 1, - `stock_notification_threshold` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `products_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `products_user_id_foreign` (`user_id`), - KEY `products_company_id_index` (`company_id`), - KEY `pro_co_us_up_index` (`company_id`,`user_id`,`assigned_user_id`,`updated_at`), - KEY `products_product_key_company_id_index` (`product_key`,`company_id`), - CONSTRAINT `products_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `projects`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `projects` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `task_rate` decimal(20,6) NOT NULL DEFAULT 0.000000, - `due_date` date DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `budgeted_hours` decimal(20,6) NOT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - PRIMARY KEY (`id`), - UNIQUE KEY `projects_company_id_number_unique` (`company_id`,`number`), - KEY `projects_user_id_foreign` (`user_id`), - KEY `projects_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `projects_company_id_index` (`company_id`), - CONSTRAINT `projects_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `projects_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `purchase_order_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `purchase_order_invitations` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `vendor_contact_id` int(10) unsigned NOT NULL, - `purchase_order_id` bigint(20) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `vendor_purchase_unique` (`vendor_contact_id`,`purchase_order_id`), - KEY `purchase_order_invitations_user_id_foreign` (`user_id`), - KEY `purchase_order_invitations_company_id_foreign` (`company_id`), - KEY `vendor_purchase_company_index` (`deleted_at`,`purchase_order_id`,`company_id`), - KEY `purchase_order_invitations_purchase_order_id_index` (`purchase_order_id`), - KEY `purchase_order_invitations_key_index` (`key`), - KEY `purchase_order_invitations_message_id_index` (`message_id`), - CONSTRAINT `purchase_order_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `purchase_order_invitations_purchase_order_id_foreign` FOREIGN KEY (`purchase_order_id`) REFERENCES `purchase_orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `purchase_order_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `purchase_order_invitations_vendor_contact_id_foreign` FOREIGN KEY (`vendor_contact_id`) REFERENCES `vendor_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `purchase_orders`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `purchase_orders` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `status_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `recurring_id` int(10) unsigned DEFAULT NULL, - `design_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `last_sent_date` datetime DEFAULT NULL, - `due_date` date DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `reminder1_sent` date DEFAULT NULL, - `reminder2_sent` date DEFAULT NULL, - `reminder3_sent` date DEFAULT NULL, - `reminder_last_sent` date DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `balance` decimal(20,6) NOT NULL, - `partial` decimal(20,6) DEFAULT NULL, - `amount` decimal(20,6) NOT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `partial_due_date` datetime DEFAULT NULL, - `last_viewed` datetime DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `expense_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `purchase_orders_user_id_foreign` (`user_id`), - KEY `purchase_orders_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `purchase_orders_client_id_index` (`client_id`), - KEY `purchase_orders_company_id_index` (`company_id`), - KEY `purchase_orders_expense_id_index` (`expense_id`), - CONSTRAINT `purchase_orders_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `purchase_orders_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `purchase_orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `quote_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `quote_invitations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `client_contact_id` int(10) unsigned NOT NULL, - `quote_id` int(10) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `signature_ip` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `quote_invitations_client_contact_id_quote_id_unique` (`client_contact_id`,`quote_id`), - KEY `quote_invitations_user_id_foreign` (`user_id`), - KEY `quote_invitations_company_id_foreign` (`company_id`), - KEY `quote_invitations_deleted_at_quote_id_company_id_index` (`deleted_at`,`quote_id`,`company_id`), - KEY `quote_invitations_quote_id_index` (`quote_id`), - KEY `quote_invitations_key_index` (`key`), - KEY `quote_invitations_message_id_index` (`message_id`), - CONSTRAINT `quote_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `quote_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `quote_invitations_quote_id_foreign` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `quote_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `quotes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `quotes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `status_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `recurring_id` int(10) unsigned DEFAULT NULL, - `design_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `last_sent_date` date DEFAULT NULL, - `due_date` datetime DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `amount` decimal(20,6) NOT NULL, - `balance` decimal(20,6) NOT NULL, - `partial` decimal(20,6) DEFAULT NULL, - `partial_due_date` datetime DEFAULT NULL, - `last_viewed` datetime DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `reminder1_sent` date DEFAULT NULL, - `reminder2_sent` date DEFAULT NULL, - `reminder3_sent` date DEFAULT NULL, - `reminder_last_sent` date DEFAULT NULL, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `subscription_id` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `quotes_company_id_number_unique` (`company_id`,`number`), - KEY `quotes_user_id_foreign` (`user_id`), - KEY `quotes_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `quotes_client_id_index` (`client_id`), - KEY `quotes_company_id_index` (`company_id`), - KEY `quotes_company_id_updated_at_index` (`company_id`,`updated_at`), - CONSTRAINT `quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `recurring_expenses`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `recurring_expenses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned NOT NULL, - `status_id` int(10) unsigned NOT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `bank_id` int(10) unsigned DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `payment_type_id` int(10) unsigned DEFAULT NULL, - `recurring_expense_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `payment_date` date DEFAULT NULL, - `should_be_invoiced` tinyint(1) NOT NULL DEFAULT 0, - `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, - `transaction_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, - `calculate_tax_by_amount` tinyint(1) NOT NULL DEFAULT 0, - `tax_amount1` decimal(20,6) DEFAULT NULL, - `tax_amount2` decimal(20,6) DEFAULT NULL, - `tax_amount3` decimal(20,6) DEFAULT NULL, - `tax_rate1` decimal(20,6) DEFAULT NULL, - `tax_rate2` decimal(20,6) DEFAULT NULL, - `tax_rate3` decimal(20,6) DEFAULT NULL, - `amount` decimal(20,6) DEFAULT NULL, - `foreign_amount` decimal(20,6) DEFAULT NULL, - `exchange_rate` decimal(20,6) NOT NULL DEFAULT 1.000000, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `invoice_currency_id` int(10) unsigned DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_reference` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `frequency_id` int(10) unsigned NOT NULL, - `last_sent_date` datetime DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(11) DEFAULT NULL, - `next_send_date_client` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `recurring_expenses_company_id_number_unique` (`company_id`,`number`), - KEY `recurring_expenses_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `recurring_expenses_user_id_foreign` (`user_id`), - KEY `recurring_expenses_company_id_index` (`company_id`), - CONSTRAINT `recurring_expenses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `recurring_invoice_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `recurring_invoice_invitations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `client_contact_id` int(10) unsigned NOT NULL, - `recurring_invoice_id` int(10) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `cli_rec` (`client_contact_id`,`recurring_invoice_id`), - KEY `recurring_invoice_invitations_user_id_foreign` (`user_id`), - KEY `recurring_invoice_invitations_company_id_foreign` (`company_id`), - KEY `rec_co_del` (`deleted_at`,`recurring_invoice_id`,`company_id`), - KEY `recurring_invoice_invitations_recurring_invoice_id_index` (`recurring_invoice_id`), - KEY `recurring_invoice_invitations_key_index` (`key`), - CONSTRAINT `recurring_invoice_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_invoice_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_invoice_invitations_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `recurring_invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_invoice_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `recurring_invoices`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `recurring_invoices` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `status_id` int(10) unsigned NOT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `amount` decimal(20,6) NOT NULL, - `balance` decimal(20,6) NOT NULL, - `partial` decimal(16,4) DEFAULT NULL, - `last_viewed` datetime DEFAULT NULL, - `frequency_id` int(10) unsigned NOT NULL, - `last_sent_date` datetime DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(11) DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, - `design_id` int(10) unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `due_date_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `partial_due_date` date DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `subscription_id` int(10) unsigned DEFAULT NULL, - `next_send_date_client` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `recurring_invoices_company_id_number_unique` (`company_id`,`number`), - KEY `recurring_invoices_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `recurring_invoices_user_id_foreign` (`user_id`), - KEY `recurring_invoices_client_id_index` (`client_id`), - KEY `recurring_invoices_company_id_index` (`company_id`), - KEY `recurring_invoices_status_id_index` (`status_id`), - CONSTRAINT `recurring_invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_invoices_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `recurring_quote_invitations`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `recurring_quote_invitations` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `client_contact_id` int(10) unsigned NOT NULL, - `recurring_quote_id` int(10) unsigned NOT NULL, - `key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `transaction_reference` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `message_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email_error` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_base64` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `signature_date` datetime DEFAULT NULL, - `sent_date` datetime DEFAULT NULL, - `viewed_date` datetime DEFAULT NULL, - `opened_date` datetime DEFAULT NULL, - `email_status` enum('delivered','bounced','spam') COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `cli_rec_q` (`client_contact_id`,`recurring_quote_id`), - KEY `recurring_quote_invitations_user_id_foreign` (`user_id`), - KEY `recurring_quote_invitations_company_id_foreign` (`company_id`), - KEY `rec_co_del_q` (`deleted_at`,`recurring_quote_id`,`company_id`), - KEY `recurring_quote_invitations_recurring_quote_id_index` (`recurring_quote_id`), - KEY `recurring_quote_invitations_key_index` (`key`), - CONSTRAINT `recurring_quote_invitations_client_contact_id_foreign` FOREIGN KEY (`client_contact_id`) REFERENCES `client_contacts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_quote_invitations_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_quote_invitations_recurring_quote_id_foreign` FOREIGN KEY (`recurring_quote_id`) REFERENCES `recurring_invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_quote_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `recurring_quotes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `recurring_quotes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `vendor_id` int(10) unsigned DEFAULT NULL, - `status_id` int(10) unsigned NOT NULL, - `discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `po_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `date` date DEFAULT NULL, - `due_date` datetime DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `line_items` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `backup` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `footer` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `terms` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_name1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate1` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate2` decimal(20,6) NOT NULL DEFAULT 0.000000, - `tax_name3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `tax_rate3` decimal(20,6) NOT NULL DEFAULT 0.000000, - `total_taxes` decimal(20,6) NOT NULL DEFAULT 0.000000, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `amount` decimal(20,6) NOT NULL DEFAULT 0.000000, - `balance` decimal(20,6) NOT NULL DEFAULT 0.000000, - `last_viewed` datetime DEFAULT NULL, - `frequency_id` int(10) unsigned NOT NULL, - `last_sent_date` datetime DEFAULT NULL, - `next_send_date` datetime DEFAULT NULL, - `remaining_cycles` int(10) unsigned DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `auto_bill` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off', - `auto_bill_enabled` tinyint(1) NOT NULL DEFAULT 0, - `paid_to_date` decimal(20,6) NOT NULL DEFAULT 0.000000, - `custom_surcharge1` decimal(20,6) DEFAULT NULL, - `custom_surcharge2` decimal(20,6) DEFAULT NULL, - `custom_surcharge3` decimal(20,6) DEFAULT NULL, - `custom_surcharge4` decimal(20,6) DEFAULT NULL, - `custom_surcharge_tax1` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax2` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax3` tinyint(1) NOT NULL DEFAULT 0, - `custom_surcharge_tax4` tinyint(1) NOT NULL DEFAULT 0, - `due_date_days` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `exchange_rate` decimal(13,6) NOT NULL DEFAULT 1.000000, - `partial` decimal(16,4) DEFAULT NULL, - `partial_due_date` date DEFAULT NULL, - `subscription_id` int(10) unsigned DEFAULT NULL, - `uses_inclusive_taxes` tinyint(1) NOT NULL DEFAULT 1, - PRIMARY KEY (`id`), - KEY `recurring_quotes_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `recurring_quotes_user_id_foreign` (`user_id`), - KEY `recurring_quotes_client_id_index` (`client_id`), - KEY `recurring_quotes_company_id_index` (`company_id`), - KEY `recurring_quotes_status_id_index` (`status_id`), - CONSTRAINT `recurring_quotes_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_quotes_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `recurring_quotes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `schedulers`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `schedulers` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `paused` tinyint(1) NOT NULL DEFAULT 0, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `repeat_every` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `start_from` timestamp NULL DEFAULT NULL, - `scheduled_run` timestamp NULL DEFAULT NULL, - `company_id` bigint(20) unsigned NOT NULL, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `action_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `action_class` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `parameters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `schedulers_action_name_index` (`action_name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `sizes`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `sizes` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `subscriptions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `subscriptions` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `frequency_id` int(10) unsigned DEFAULT NULL, - `auto_bill` text COLLATE utf8mb4_unicode_ci DEFAULT '', - `promo_code` text COLLATE utf8mb4_unicode_ci DEFAULT '', - `promo_discount` double(8,2) NOT NULL DEFAULT 0.00, - `is_amount_discount` tinyint(1) NOT NULL DEFAULT 0, - `allow_cancellation` tinyint(1) NOT NULL DEFAULT 1, - `per_seat_enabled` tinyint(1) NOT NULL DEFAULT 0, - `min_seats_limit` int(10) unsigned NOT NULL, - `max_seats_limit` int(10) unsigned NOT NULL, - `trial_enabled` tinyint(1) NOT NULL DEFAULT 0, - `trial_duration` int(10) unsigned NOT NULL, - `allow_query_overrides` tinyint(1) NOT NULL DEFAULT 0, - `allow_plan_changes` tinyint(1) NOT NULL DEFAULT 0, - `plan_map` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `refund_period` int(10) unsigned DEFAULT NULL, - `webhook_configuration` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp NULL DEFAULT NULL, - `updated_at` timestamp NULL DEFAULT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `recurring_product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `group_id` int(10) unsigned DEFAULT NULL, - `price` decimal(20,6) NOT NULL DEFAULT 0.000000, - `promo_price` decimal(20,6) NOT NULL DEFAULT 0.000000, - `registration_required` tinyint(1) NOT NULL DEFAULT 0, - `optional_product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `optional_recurring_product_ids` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `subscriptions_company_id_name_unique` (`company_id`,`name`), - KEY `billing_subscriptions_company_id_deleted_at_index` (`company_id`,`deleted_at`), - CONSTRAINT `billing_subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `system_logs`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `system_logs` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `category_id` int(10) unsigned DEFAULT NULL, - `event_id` int(10) unsigned DEFAULT NULL, - `type_id` int(10) unsigned DEFAULT NULL, - `log` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `system_logs_company_id_foreign` (`company_id`), - KEY `system_logs_client_id_foreign` (`client_id`), - CONSTRAINT `system_logs_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `system_logs_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `task_statuses`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `task_statuses` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `company_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `status_sort_order` int(11) DEFAULT NULL, - `color` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#fff', - `status_order` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `task_statuses_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `task_statuses_user_id_foreign` (`user_id`), - CONSTRAINT `task_statuses_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `task_statuses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `tasks`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `tasks` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `client_id` int(10) unsigned DEFAULT NULL, - `invoice_id` int(10) unsigned DEFAULT NULL, - `project_id` int(10) unsigned DEFAULT NULL, - `status_id` int(10) unsigned DEFAULT NULL, - `status_sort_order` int(11) DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `duration` int(10) unsigned DEFAULT NULL, - `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `is_running` tinyint(1) NOT NULL DEFAULT 0, - `time_log` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, - `invoice_documents` tinyint(1) NOT NULL DEFAULT 0, - `is_date_based` tinyint(1) NOT NULL DEFAULT 0, - `status_order` int(11) DEFAULT NULL, - `invoice_lock` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `tasks_company_id_number_unique` (`company_id`,`number`), - KEY `tasks_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `tasks_user_id_foreign` (`user_id`), - KEY `tasks_invoice_id_foreign` (`invoice_id`), - KEY `tasks_client_id_foreign` (`client_id`), - KEY `tasks_company_id_index` (`company_id`), - CONSTRAINT `tasks_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `tasks_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `tasks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `tasks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `tax_rates`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `tax_rates` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, - `rate` decimal(20,6) NOT NULL DEFAULT 0.000000, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - KEY `tax_rates_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `tax_rates_user_id_foreign` (`user_id`), - KEY `tax_rates_company_id_index` (`company_id`), - CONSTRAINT `tax_rates_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `tax_rates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `timezones`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `timezones` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `location` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `utc_offset` int(11) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `transaction_events`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `transaction_events` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client_id` int(10) unsigned NOT NULL, - `invoice_id` int(10) unsigned NOT NULL, - `payment_id` int(10) unsigned NOT NULL, - `credit_id` int(10) unsigned NOT NULL, - `client_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, - `client_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, - `client_credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, - `invoice_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, - `invoice_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, - `invoice_partial` decimal(16,4) NOT NULL DEFAULT 0.0000, - `invoice_paid_to_date` decimal(16,4) NOT NULL DEFAULT 0.0000, - `invoice_status` int(10) unsigned DEFAULT NULL, - `payment_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, - `payment_applied` decimal(16,4) NOT NULL DEFAULT 0.0000, - `payment_refunded` decimal(16,4) NOT NULL DEFAULT 0.0000, - `payment_status` int(10) unsigned DEFAULT NULL, - `paymentables` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `event_id` int(10) unsigned NOT NULL, - `timestamp` int(10) unsigned NOT NULL, - `payment_request` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `metadata` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `credit_balance` decimal(16,4) NOT NULL DEFAULT 0.0000, - `credit_amount` decimal(16,4) NOT NULL DEFAULT 0.0000, - `credit_status` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `transaction_events_client_id_index` (`client_id`), - CONSTRAINT `transaction_events_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `account_id` int(10) unsigned NOT NULL, - `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `ip` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `device_token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, - `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `theme_id` int(11) DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `referral_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_user_token` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `google_2fa_secret` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_width` int(10) unsigned DEFAULT NULL, - `avatar_height` int(10) unsigned DEFAULT NULL, - `avatar_size` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `last_login` datetime DEFAULT NULL, - `signature` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `oauth_user_refresh_token` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_confirmed_email_address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `has_password` tinyint(1) NOT NULL DEFAULT 0, - `oauth_user_token_expiry` datetime DEFAULT NULL, - `sms_verification_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `verified_phone_number` tinyint(1) NOT NULL DEFAULT 0, - PRIMARY KEY (`id`), - UNIQUE KEY `users_email_unique` (`email`), - UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`), - KEY `users_account_id_index` (`account_id`), - CONSTRAINT `users_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `vendor_contacts`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `vendor_contacts` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned NOT NULL, - `user_id` int(10) unsigned NOT NULL, - `vendor_id` int(10) unsigned NOT NULL, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `is_primary` tinyint(1) NOT NULL DEFAULT 0, - `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `last_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `send_email` tinyint(1) NOT NULL DEFAULT 0, - `email_verified_at` timestamp NULL DEFAULT NULL, - `confirmation_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `confirmed` tinyint(1) NOT NULL DEFAULT 0, - `last_login` timestamp NULL DEFAULT NULL, - `failed_logins` smallint(6) DEFAULT NULL, - `oauth_user_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `oauth_provider_id` int(10) unsigned DEFAULT NULL, - `google_2fa_secret` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `accepted_terms_version` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `avatar_size` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `token` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_locked` tinyint(1) NOT NULL DEFAULT 0, - `contact_key` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `vendor_contacts_oauth_user_id_unique` (`oauth_user_id`), - UNIQUE KEY `vendor_contacts_oauth_provider_id_unique` (`oauth_provider_id`), - KEY `vendor_contacts_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `vendor_contacts_user_id_foreign` (`user_id`), - KEY `vendor_contacts_vendor_id_index` (`vendor_id`), - KEY `vendor_contacts_company_id_email_deleted_at_index` (`company_id`,`email`,`deleted_at`), - KEY `vendor_contacts_contact_key(20)_index` (`contact_key`(20)), - KEY `vendor_contacts_email_index` (`email`), - CONSTRAINT `vendor_contacts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `vendor_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `vendor_contacts_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `vendors`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `vendors` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp NULL DEFAULT NULL, - `user_id` int(10) unsigned NOT NULL, - `assigned_user_id` int(10) unsigned DEFAULT NULL, - `company_id` int(10) unsigned NOT NULL, - `currency_id` int(10) unsigned DEFAULT NULL, - `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `address2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `city` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `state` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `postal_code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `country_id` int(10) unsigned DEFAULT NULL, - `phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `private_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `website` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `is_deleted` tinyint(4) NOT NULL DEFAULT 0, - `vat_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `transaction_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value1` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value2` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value3` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `custom_value4` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `vendor_hash` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `public_notes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `id_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `vendors_company_id_number_unique` (`company_id`,`number`), - KEY `vendors_company_id_deleted_at_index` (`company_id`,`deleted_at`), - KEY `vendors_user_id_foreign` (`user_id`), - KEY `vendors_country_id_foreign` (`country_id`), - KEY `vendors_currency_id_foreign` (`currency_id`), - CONSTRAINT `vendors_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `vendors_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`), - CONSTRAINT `vendors_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`), - CONSTRAINT `vendors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -DROP TABLE IF EXISTS `webhooks`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `webhooks` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `company_id` int(10) unsigned DEFAULT NULL, - `user_id` int(10) unsigned DEFAULT NULL, - `event_id` int(10) unsigned DEFAULT NULL, - `is_deleted` tinyint(1) NOT NULL DEFAULT 0, - `target_url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, - `format` enum('JSON','UBL') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'JSON', - `created_at` timestamp(6) NULL DEFAULT NULL, - `updated_at` timestamp(6) NULL DEFAULT NULL, - `deleted_at` timestamp(6) NULL DEFAULT NULL, - `rest_method` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - `headers` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `subscriptions_company_id_foreign` (`company_id`), - KEY `subscriptions_event_id_company_id_index` (`event_id`,`company_id`), - CONSTRAINT `subscriptions_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC; -/*!40101 SET character_set_client = @saved_cs_client */; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - -INSERT INTO `migrations` VALUES (1,'2014_10_12_100000_create_password_resets_table',1); -INSERT INTO `migrations` VALUES (2,'2014_10_13_000000_create_users_table',1); -INSERT INTO `migrations` VALUES (3,'2019_11_10_115926_create_failed_jobs_table',1); -INSERT INTO `migrations` VALUES (4,'2020_03_05_123315_create_jobs_table',1); -INSERT INTO `migrations` VALUES (5,'2020_04_08_234530_add_is_deleted_column_to_company_tokens_table',1); -INSERT INTO `migrations` VALUES (6,'2020_05_13_035355_add_google_refresh_token_to_users_table',1); -INSERT INTO `migrations` VALUES (7,'2020_07_05_084934_company_too_large_attribute',1); -INSERT INTO `migrations` VALUES (8,'2020_07_08_065301_add_token_id_to_activity_table',1); -INSERT INTO `migrations` VALUES (9,'2020_07_21_112424_update_enabled_modules_value',1); -INSERT INTO `migrations` VALUES (10,'2020_07_28_104218_shop_token',1); -INSERT INTO `migrations` VALUES (11,'2020_08_04_080851_add_is_deleted_to_group_settings',1); -INSERT INTO `migrations` VALUES (12,'2020_08_11_221627_add_is_deleted_flag_to_client_gateway_token_table',1); -INSERT INTO `migrations` VALUES (13,'2020_08_13_095946_remove_photo_design',1); -INSERT INTO `migrations` VALUES (14,'2020_08_13_212702_add_reminder_sent_fields_to_entity_tables',1); -INSERT INTO `migrations` VALUES (15,'2020_08_18_140557_add_is_public_to_documents_table',1); -INSERT INTO `migrations` VALUES (16,'2020_09_22_205113_id_number_fields_for_missing_entities',1); -INSERT INTO `migrations` VALUES (17,'2020_09_27_215800_update_gateway_table_visible_column',1); -INSERT INTO `migrations` VALUES (18,'2020_10_11_211122_vendor_schema_update',1); -INSERT INTO `migrations` VALUES (19,'2020_10_12_204517_project_number_column',1); -INSERT INTO `migrations` VALUES (20,'2020_10_14_201320_project_ids_to_entities',1); -INSERT INTO `migrations` VALUES (21,'2020_10_19_101823_project_name_unique_removal',1); -INSERT INTO `migrations` VALUES (22,'2020_10_21_222738_expenses_nullable_assigned_user',1); -INSERT INTO `migrations` VALUES (23,'2020_10_22_204900_company_table_fields',1); -INSERT INTO `migrations` VALUES (24,'2020_10_27_021751_tasks_invoice_documents',1); -INSERT INTO `migrations` VALUES (25,'2020_10_28_224711_status_sort_order',1); -INSERT INTO `migrations` VALUES (26,'2020_10_28_225022_assigned_user_tasks_table',1); -INSERT INTO `migrations` VALUES (27,'2020_10_29_001541_vendors_phone_column',1); -INSERT INTO `migrations` VALUES (28,'2020_10_29_093836_change_start_time_column_type',1); -INSERT INTO `migrations` VALUES (29,'2020_10_29_204434_tasks_table_project_nullable',1); -INSERT INTO `migrations` VALUES (30,'2020_10_29_210402_change_default_show_tasks_table',1); -INSERT INTO `migrations` VALUES (31,'2020_10_30_084139_change_expense_currency_id_column',1); -INSERT INTO `migrations` VALUES (32,'2020_11_01_031750_drop_migrating_column',1); -INSERT INTO `migrations` VALUES (33,'2020_11_03_200345_company_gateway_fields_refactor',1); -INSERT INTO `migrations` VALUES (34,'2020_11_08_212050_custom_fields_for_payments_table',1); -INSERT INTO `migrations` VALUES (35,'2020_11_12_104413_company_gateway_rename_column',1); -INSERT INTO `migrations` VALUES (36,'2020_11_15_203755_soft_delete_paymentables',1); -INSERT INTO `migrations` VALUES (37,'2020_12_14_114722_task_fields',1); -INSERT INTO `migrations` VALUES (38,'2020_12_17_104033_add_enable_product_discount_field_to_companies_table',1); -INSERT INTO `migrations` VALUES (39,'2020_12_20_005609_change_products_table_cost_resolution',1); -INSERT INTO `migrations` VALUES (40,'2020_12_23_220648_remove_null_values_in_countries_table',1); -INSERT INTO `migrations` VALUES (41,'2021_01_03_215053_update_canadian_dollar_symbol',1); -INSERT INTO `migrations` VALUES (42,'2021_01_05_013203_improve_decimal_resolution',1); -INSERT INTO `migrations` VALUES (43,'2021_01_07_023350_update_singapore_dollar_symbol',1); -INSERT INTO `migrations` VALUES (44,'2021_01_08_093324_expenses_table_additional_fields',1); -INSERT INTO `migrations` VALUES (45,'2021_01_11_092056_fix_company_settings_url',1); -INSERT INTO `migrations` VALUES (46,'2021_01_17_040331_change_custom_surcharge_column_type',1); -INSERT INTO `migrations` VALUES (47,'2021_01_23_044502_scheduler_is_running_check',1); -INSERT INTO `migrations` VALUES (48,'2021_01_24_052645_add_paid_to_date_column',1); -INSERT INTO `migrations` VALUES (49,'2021_01_25_095351_add_number_field_to_clients_and_vendors',1); -INSERT INTO `migrations` VALUES (50,'2021_01_29_121502_add_permission_changed_timestamp',1); -INSERT INTO `migrations` VALUES (51,'2021_02_15_214724_additional_company_properties',1); -INSERT INTO `migrations` VALUES (52,'2021_02_19_212722_email_last_confirmed_email_address_users_table',1); -INSERT INTO `migrations` VALUES (53,'2021_02_25_205901_enum_invitations_email_status',1); -INSERT INTO `migrations` VALUES (54,'2021_02_27_091713_add_invoice_task_datelog_property',1); -INSERT INTO `migrations` VALUES (55,'2021_03_03_230941_add_has_password_field_to_user_table',1); -INSERT INTO `migrations` VALUES (56,'2021_03_08_123729_create_billing_subscriptions_table',1); -INSERT INTO `migrations` VALUES (57,'2021_03_08_205030_add_russian_lang',1); -INSERT INTO `migrations` VALUES (58,'2021_03_09_132242_add_currency_id_to_billing_subscriptions_table',1); -INSERT INTO `migrations` VALUES (59,'2021_03_18_113704_change_2fa_column_from_varchar_to_text',1); -INSERT INTO `migrations` VALUES (60,'2021_03_19_221024_add_unique_constraints_on_all_entities',1); -INSERT INTO `migrations` VALUES (61,'2021_03_20_033751_add_invoice_id_to_client_subscriptions_table',1); -INSERT INTO `migrations` VALUES (62,'2021_03_23_233844_add_nullable_constraint_to_recurring_invoice_id',1); -INSERT INTO `migrations` VALUES (63,'2021_03_25_082025_refactor_billing_scriptions_table',1); -INSERT INTO `migrations` VALUES (64,'2021_03_26_201148_add_price_column_to_subscriptions_table',1); -INSERT INTO `migrations` VALUES (65,'2021_04_01_093128_modify_column_on_subscriptions_table',1); -INSERT INTO `migrations` VALUES (66,'2021_04_05_115345_add_trial_duration_to_accounts_table',1); -INSERT INTO `migrations` VALUES (67,'2021_04_05_213802_add_rest_fields_to_webhooks_table',1); -INSERT INTO `migrations` VALUES (68,'2021_04_06_131028_create_licenses_table',1); -INSERT INTO `migrations` VALUES (69,'2021_04_12_095424_stripe_connect_gateway',1); -INSERT INTO `migrations` VALUES (70,'2021_04_13_013424_add_subscription_id_to_activities_table',1); -INSERT INTO `migrations` VALUES (71,'2021_04_22_110240_add_property_to_checkout_gateway_config',1); -INSERT INTO `migrations` VALUES (72,'2021_04_29_085418_add_number_years_active_to_company_users_table',1); -INSERT INTO `migrations` VALUES (73,'2021_05_03_152940_make_braintree_provider_visible',1); -INSERT INTO `migrations` VALUES (74,'2021_05_04_231430_add_task_property_to_companies_table',1); -INSERT INTO `migrations` VALUES (75,'2021_05_05_014713_activate_we_pay',1); -INSERT INTO `migrations` VALUES (76,'2021_05_10_041528_add_recurring_invoice_id_to_activities_table',1); -INSERT INTO `migrations` VALUES (77,'2021_05_27_105157_add_tech_design',1); -INSERT INTO `migrations` VALUES (78,'2021_05_30_100933_make_documents_assigned_user_nullable',1); -INSERT INTO `migrations` VALUES (79,'2021_06_10_221012_add_ninja_portal_column_to_accounts_table',1); -INSERT INTO `migrations` VALUES (80,'2021_06_24_095942_payments_table_currency_nullable',1); -INSERT INTO `migrations` VALUES (81,'2021_07_10_085821_activate_payfast_payment_driver',1); -INSERT INTO `migrations` VALUES (82,'2021_07_19_074503_set_invoice_task_datelog_true_in_companies_table',1); -INSERT INTO `migrations` VALUES (83,'2021_07_20_095537_activate_paytrace_payment_driver',1); -INSERT INTO `migrations` VALUES (84,'2021_07_21_213344_change_english_languages_tables',1); -INSERT INTO `migrations` VALUES (85,'2021_07_21_234227_activate_eway_payment_driver',1); -INSERT INTO `migrations` VALUES (86,'2021_08_03_115024_activate_mollie_payment_driver',1); -INSERT INTO `migrations` VALUES (87,'2021_08_05_235942_add_zelle_payment_type',1); -INSERT INTO `migrations` VALUES (88,'2021_08_07_222435_add_markdown_enabled_column_to_companies_table',1); -INSERT INTO `migrations` VALUES (89,'2021_08_10_034407_add_more_languages',1); -INSERT INTO `migrations` VALUES (90,'2021_08_14_054458_square_payment_driver',1); -INSERT INTO `migrations` VALUES (91,'2021_08_18_220124_use_comma_as_decimal_place_companies_table',1); -INSERT INTO `migrations` VALUES (92,'2021_08_23_101529_recurring_expenses_schema',1); -INSERT INTO `migrations` VALUES (93,'2021_08_25_093105_report_include_drafts_in_companies_table',1); -INSERT INTO `migrations` VALUES (94,'2021_09_05_101209_update_braintree_gateway',1); -INSERT INTO `migrations` VALUES (95,'2021_09_20_233053_set_square_test_mode_boolean',1); -INSERT INTO `migrations` VALUES (96,'2021_09_23_100629_add_currencies',1); -INSERT INTO `migrations` VALUES (97,'2021_09_24_201319_add_mollie_bank_transfer_to_payment_types',1); -INSERT INTO `migrations` VALUES (98,'2021_09_24_211504_add_kbc_to_payment_types',1); -INSERT INTO `migrations` VALUES (99,'2021_09_24_213858_add_bancontact_to_payment_types',1); -INSERT INTO `migrations` VALUES (100,'2021_09_28_154647_activate_gocardless_payment_driver',1); -INSERT INTO `migrations` VALUES (101,'2021_09_29_190258_add_required_client_registration_fields',1); -INSERT INTO `migrations` VALUES (102,'2021_10_04_134908_add_ideal_to_payment_types',1); -INSERT INTO `migrations` VALUES (103,'2021_10_06_044800_updated_bold_and_modern_designs',1); -INSERT INTO `migrations` VALUES (104,'2021_10_07_141737_razorpay',1); -INSERT INTO `migrations` VALUES (105,'2021_10_07_155410_add_hosted_page_to_payment_types',1); -INSERT INTO `migrations` VALUES (106,'2021_10_15_00000_stripe_payment_gateways',1); -INSERT INTO `migrations` VALUES (107,'2021_10_16_135200_add_direct_debit_to_payment_types',1); -INSERT INTO `migrations` VALUES (108,'2021_10_19_142200_add_gateway_type_for_direct_debit',1); -INSERT INTO `migrations` VALUES (109,'2021_10_20_005529_add_filename_to_backups_table',1); -INSERT INTO `migrations` VALUES (110,'2021_11_08_131308_onboarding',1); -INSERT INTO `migrations` VALUES (111,'2021_11_09_115919_update_designs',1); -INSERT INTO `migrations` VALUES (112,'2021_11_10_184847_add_is_migrate_column_to_accounts_table',1); -INSERT INTO `migrations` VALUES (113,'2021_11_11_163121_add_instant_bank_transfer',1); -INSERT INTO `migrations` VALUES (114,'2021_12_20_095542_add_serbian_language_translations',1); -INSERT INTO `migrations` VALUES (115,'2022_01_02_022421_add_slovak_language',1); -INSERT INTO `migrations` VALUES (116,'2022_01_06_061231_add_app_domain_id_to_gateways_table',1); -INSERT INTO `migrations` VALUES (117,'2022_01_18_004856_add_estonian_language',1); -INSERT INTO `migrations` VALUES (118,'2022_01_19_085907_add_platform_column_to_accounts_table',1); -INSERT INTO `migrations` VALUES (119,'2022_01_19_232436_add_kyd_currency',1); -INSERT INTO `migrations` VALUES (120,'2022_01_27_223617_add_client_count_to_accounts_table',1); -INSERT INTO `migrations` VALUES (121,'2022_02_06_091629_add_client_currency_conversion_to_companies_table',1); -INSERT INTO `migrations` VALUES (122,'2022_02_25_015411_update_stripe_apple_domain_config',1); -INSERT INTO `migrations` VALUES (123,'2022_03_09_053508_transaction_events',1); -INSERT INTO `migrations` VALUES (124,'2022_03_24_090728_markdown_email_enabled_wysiwyg_editor',1); -INSERT INTO `migrations` VALUES (125,'2022_03_29_014025_reverse_apple_domain_for_hosted',1); -INSERT INTO `migrations` VALUES (126,'2022_04_14_121548_forte_payment_gateway',1); -INSERT INTO `migrations` VALUES (127,'2022_04_22_115838_client_settings_parse_for_types',1); -INSERT INTO `migrations` VALUES (128,'2022_04_26_032252_convert_custom_fields_column_from_varchar_to_text',1); -INSERT INTO `migrations` VALUES (129,'2022_05_08_004937_heal_stripe_gateway_configuration',1); -INSERT INTO `migrations` VALUES (130,'2022_05_16_224917_add_auto_bill_tries_to_invoices_table',1); -INSERT INTO `migrations` VALUES (131,'2022_05_18_055442_update_custom_value_four_columns',1); -INSERT INTO `migrations` VALUES (132,'2022_05_18_162152_create_scheduled_jobs_table',1); -INSERT INTO `migrations` VALUES (133,'2022_05_18_162443_create_schedulers_table',1); -INSERT INTO `migrations` VALUES (134,'2022_05_23_050754_drop_redundant_column_show_production_description_dropdown',1); -INSERT INTO `migrations` VALUES (135,'2022_05_28_234651_create_purchase_orders_table',1); -INSERT INTO `migrations` VALUES (136,'2022_05_30_181109_drop_scheduled_jobs_table',1); -INSERT INTO `migrations` VALUES (137,'2022_05_30_184320_add_job_related_fields_to_schedulers_table',1); -INSERT INTO `migrations` VALUES (138,'2022_05_31_101504_inventory_management_schema',1); -INSERT INTO `migrations` VALUES (139,'2022_06_01_215859_set_recurring_client_timestamp',1); -INSERT INTO `migrations` VALUES (140,'2022_06_01_224339_create_purchase_order_invitations_table',1); -INSERT INTO `migrations` VALUES (141,'2022_06_10_030503_set_account_flag_for_react',1); -INSERT INTO `migrations` VALUES (142,'2022_06_16_025156_add_react_switching_flag',1); -INSERT INTO `migrations` VALUES (143,'2022_06_17_082627_change_refresh_token_column_size',1); -INSERT INTO `migrations` VALUES (144,'2022_06_21_104350_fixes_for_description_in_pdf_designs',1); -INSERT INTO `migrations` VALUES (145,'2022_06_22_090547_set_oauth_expiry_column',1); -INSERT INTO `migrations` VALUES (146,'2022_06_24_141018_upgrade_failed_jobs_table',1); -INSERT INTO `migrations` VALUES (147,'2022_06_30_000126_add_flag_to_accounts_table',1); -INSERT INTO `migrations` VALUES (148,'2022_07_06_080127_add_purchase_order_to_expense',1); -INSERT INTO `migrations` VALUES (149,'2022_07_09_235510_add_index_to_payment_hash',1); -INSERT INTO `migrations` VALUES (150,'2022_07_18_033756_fixes_for_date_formats_table_react',1); -INSERT INTO `migrations` VALUES (151,'2022_07_21_023805_add_hebrew_language',1); -INSERT INTO `migrations` VALUES (152,'2022_07_26_091216_add_sms_verification_to_hosted_account',1); -INSERT INTO `migrations` VALUES (153,'2022_07_28_232340_enabled_expense_tax_rates_to_companies_table',1); -INSERT INTO `migrations` VALUES (154,'2022_07_29_091235_correction_for_companies_table_types',1); -INSERT INTO `migrations` VALUES (155,'2022_08_05_023357_bank_integration',1); -INSERT INTO `migrations` VALUES (156,'2022_08_11_011534_licenses_table_for_self_host',1); -INSERT INTO `migrations` VALUES (157,'2022_08_24_215917_invoice_task_project_companies_table',1); -INSERT INTO `migrations` VALUES (158,'2022_08_26_232500_add_email_status_column_to_purchase_order_invitations_table',1); -INSERT INTO `migrations` VALUES (159,'2022_08_28_210111_add_index_to_payments_table',1); -INSERT INTO `migrations` VALUES (160,'2022_09_05_024719_update_designs_for_tech_template',1); -INSERT INTO `migrations` VALUES (161,'2022_09_07_101731_add_reporting_option_to_companies_table',1); -INSERT INTO `migrations` VALUES (162,'2022_09_21_012417_add_threeds_to_braintree',1); -INSERT INTO `migrations` VALUES (163,'2022_09_30_235337_add_idempotency_key_to_payments',1); -INSERT INTO `migrations` VALUES (164,'2022_10_05_205645_add_indexes_to_client_hash',1); -INSERT INTO `migrations` VALUES (165,'2022_10_06_011344_add_key_to_products',1); -INSERT INTO `migrations` VALUES (166,'2022_10_07_065455_add_key_to_company_tokens_table',1); -INSERT INTO `migrations` VALUES (167,'2022_10_10_070137_add_documentable_index',1); -INSERT INTO `migrations` VALUES (168,'2022_10_27_044909_add_user_sms_verification_code',1); -INSERT INTO `migrations` VALUES (169,'2022_11_02_063742_add_verified_number_flag_to_users_table',1); -INSERT INTO `migrations` VALUES (170,'2022_11_04_013539_disabled_upstream_bank_integrations_table',1); -INSERT INTO `migrations` VALUES (171,'2022_11_06_215526_drop_html_backups_column_from_backups_table',1); -INSERT INTO `migrations` VALUES (172,'2022_11_16_093535_calmness_design',1); -INSERT INTO `migrations` VALUES (173,'2022_11_22_215618_lock_tasks_when_invoiced',1); -INSERT INTO `migrations` VALUES (174,'2022_11_13_034143_bank_transaction_rules_table',2); diff --git a/resources/views/pdf-designs/bold.html b/resources/views/pdf-designs/bold.html index 5b322484286e..b7380befd586 100644 --- a/resources/views/pdf-designs/bold.html +++ b/resources/views/pdf-designs/bold.html @@ -321,6 +321,17 @@ position: fixed; } + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } + /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/business.html b/resources/views/pdf-designs/business.html index d4c0da6f2c44..5094629b83b7 100644 --- a/resources/views/pdf-designs/business.html +++ b/resources/views/pdf-designs/business.html @@ -306,6 +306,16 @@ position: fixed; } + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/calm.html b/resources/views/pdf-designs/calm.html index bbd8887835ca..ad9fc8239b2d 100644 --- a/resources/views/pdf-designs/calm.html +++ b/resources/views/pdf-designs/calm.html @@ -293,6 +293,18 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } + /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/clean.html b/resources/views/pdf-designs/clean.html index dac7dcfe60b7..51101e918901 100644 --- a/resources/views/pdf-designs/clean.html +++ b/resources/views/pdf-designs/clean.html @@ -286,6 +286,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/creative.html b/resources/views/pdf-designs/creative.html index 1f7f6dbe8050..5c7fbbcec08a 100644 --- a/resources/views/pdf-designs/creative.html +++ b/resources/views/pdf-designs/creative.html @@ -258,6 +258,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/elegant.html b/resources/views/pdf-designs/elegant.html index 649160995e15..765a0b467c1c 100644 --- a/resources/views/pdf-designs/elegant.html +++ b/resources/views/pdf-designs/elegant.html @@ -262,6 +262,17 @@ opacity: 0.2; z-index:200 !important; position: fixed; + } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/hipster.html b/resources/views/pdf-designs/hipster.html index d3201b1bc92c..0fa18db9bda1 100644 --- a/resources/views/pdf-designs/hipster.html +++ b/resources/views/pdf-designs/hipster.html @@ -280,6 +280,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/modern.html b/resources/views/pdf-designs/modern.html index e47ebffd3db4..ec3962214a3c 100644 --- a/resources/views/pdf-designs/modern.html +++ b/resources/views/pdf-designs/modern.html @@ -307,6 +307,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ diff --git a/resources/views/pdf-designs/plain.html b/resources/views/pdf-designs/plain.html index 5075e7f3f646..aa38661960f8 100644 --- a/resources/views/pdf-designs/plain.html +++ b/resources/views/pdf-designs/plain.html @@ -252,9 +252,10 @@ } .project-header { - font-size: 1.5em; + font-size: 1.2em; margin-top: 0.1em; - margin-bottom: 0.1em; + margin-bottom: 0; + padding-bottom: 0; margin-left: 0; margin-right: 0; font-weight: bold; diff --git a/resources/views/pdf-designs/playful.html b/resources/views/pdf-designs/playful.html index 84ac8eb6f294..6b4b1f7aa42f 100644 --- a/resources/views/pdf-designs/playful.html +++ b/resources/views/pdf-designs/playful.html @@ -323,6 +323,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ diff --git a/resources/views/pdf-designs/tech.html b/resources/views/pdf-designs/tech.html index e9ff50fe6242..fc322ea7e7f1 100644 --- a/resources/views/pdf-designs/tech.html +++ b/resources/views/pdf-designs/tech.html @@ -287,6 +287,17 @@ z-index:200 !important; position: fixed; } + + .project-header { + font-size: 1.2em; + margin-top: 0.1em; + margin-bottom: 0; + padding-bottom: 0; + margin-left: 0; + margin-right: 0; + font-weight: bold; + color: #505050; + } /** Useful snippets, uncomment to enable. **/ /** Hide company logo **/ From fa5c3645568eac5bcdd8a8cd04a13863aa7c5b90 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 24 Nov 2022 21:07:20 +1100 Subject: [PATCH 47/51] Add checks to prevent duplicate reminders from being sent --- app/Jobs/Util/ReminderJob.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 3e6d3914a942..64e6faf13cef 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -88,6 +88,13 @@ class ReminderJob implements ShouldQueue }) ->with('invitations')->cursor()->each(function ($invoice) { if ($invoice->isPayable()) { + + //Attempts to prevent duplicates from sending + if($invoice->reminder_last_sent && Carbon::parse($invoice->reminder_last_sent)->startOfDay()->eq(now()->startOfDay())){ + nlog("caught a duplicate reminder for invoice {$invoice->number}"); + return; + } + $reminder_template = $invoice->calculateTemplate('invoice'); nlog("reminder template = {$reminder_template}"); $invoice = $this->calcLateFee($invoice, $reminder_template); From 990b43299c9e2f8f590145cc68e7dba5520db306 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 25 Nov 2022 07:07:12 +1100 Subject: [PATCH 48/51] Refactor bank rule column name --- app/Services/Bank/ProcessBankRules.php | 4 ++-- app/Transformers/BankTransactionTransformer.php | 2 +- .../migrations/2022_11_22_215618_lock_tasks_when_invoiced.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index 7efb219b589a..86743bcb366d 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -68,7 +68,7 @@ class ProcessBankRules extends AbstractService //stub for credit rules foreach($this->credit_rules as $rule) { - // $this->bank_transaction->bank_rule_id = $bank_transaction_rule->id; + // $this->bank_transaction->bank_transaction_rule_id = $bank_transaction_rule->id; } @@ -115,7 +115,7 @@ class ProcessBankRules extends AbstractService $this->bank_transaction->vendor_id = $bank_transaction_rule->vendor_id; $this->bank_transaction->ninja_category_id = $bank_transaction_rule->category_id; $this->bank_transaction->status_id = BankTransaction::STATUS_MATCHED; - $this->bank_transaction->bank_rule_id = $bank_transaction_rule->id; + $this->bank_transaction->bank_transaction_rule_id = $bank_transaction_rule->id; $this->bank_transaction->save(); if($bank_transaction_rule['auto_convert']) diff --git a/app/Transformers/BankTransactionTransformer.php b/app/Transformers/BankTransactionTransformer.php index f633e050e8cd..483dcc8426cb 100644 --- a/app/Transformers/BankTransactionTransformer.php +++ b/app/Transformers/BankTransactionTransformer.php @@ -67,7 +67,7 @@ class BankTransactionTransformer extends EntityTransformer 'invoice_ids' => (string) $bank_transaction->invoice_ids ?: '', 'expense_id'=> (string) $this->encodePrimaryKey($bank_transaction->expense_id) ?: '', 'vendor_id'=> (string) $this->encodePrimaryKey($bank_transaction->vendor_id) ?: '', - 'bank_rule_id' => (string) $this->encodePrimaryKey($bank_transaction->bank_rule_id) ?: '', + 'bank_transaction_rule_id' => (string) $this->encodePrimaryKey($bank_transaction->bank_transaction_rule_id) ?: '', 'is_deleted' => (bool) $bank_transaction->is_deleted, 'created_at' => (int) $bank_transaction->created_at, 'updated_at' => (int) $bank_transaction->updated_at, diff --git a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php index 105ccb345b96..aedade816870 100644 --- a/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php +++ b/database/migrations/2022_11_22_215618_lock_tasks_when_invoiced.php @@ -32,7 +32,7 @@ return new class extends Migration Schema::table('bank_transactions', function (Blueprint $table) { - $table->bigInteger('bank_rule_id')->nullable(); + $table->bigInteger('bank_transaction_rule_id')->nullable(); }); Schema::table('subscriptions', function (Blueprint $table) From ff38a913025b130c7b0ea34c7e30f09e28174945 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 25 Nov 2022 07:52:47 +1100 Subject: [PATCH 49/51] Bulk match transactions --- .../Controllers/BankTransactionController.php | 23 +++++++++++++++---- app/Jobs/Bank/MatchBankTransactions.php | 12 +++++++--- .../BankTransactionRepository.php | 15 ++++++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/BankTransactionController.php b/app/Http/Controllers/BankTransactionController.php index 901f1812a071..ef0354d1ea1e 100644 --- a/app/Http/Controllers/BankTransactionController.php +++ b/app/Http/Controllers/BankTransactionController.php @@ -481,19 +481,32 @@ class BankTransactionController extends BaseController { $action = request()->input('action'); - if(!in_array($action, ['archive', 'restore', 'delete'])) + if(!in_array($action, ['archive', 'restore', 'delete', 'convert_matched'])) return response()->json(['message' => 'Unsupported action.'], 400); $ids = request()->input('ids'); $bank_transactions = BankTransaction::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()->get(); - $bank_transactions->each(function ($bank_transaction, $key) use ($action) { - if (auth()->user()->can('edit', $bank_transaction)) { - $this->bank_transaction_repo->{$action}($bank_transaction); + if($action == 'convert_matched') //catch this action + { + if(auth()->user()->isAdmin()) + { + $this->bank_transaction_repo->convert_matched($bank_transactions); } - }); + else + return; + } + else { + $bank_transactions->each(function ($bank_transaction, $key) use ($action) { + if (auth()->user()->can('edit', $bank_transaction)) { + $this->bank_transaction_repo->{$action}($bank_transaction); + } + }); + + } + /* Need to understand which permission are required for the given bulk action ie. view / edit */ return $this->listResponse(BankTransaction::withTrashed()->whereIn('id', $this->transformKeys($ids))->company()); diff --git a/app/Jobs/Bank/MatchBankTransactions.php b/app/Jobs/Bank/MatchBankTransactions.php index d99c8fadb644..dad8d2467f70 100644 --- a/app/Jobs/Bank/MatchBankTransactions.php +++ b/app/Jobs/Bank/MatchBankTransactions.php @@ -179,7 +179,7 @@ class MatchBankTransactions implements ShouldQueue } private function matchExpense($input) :self - { + { nlog($input); //if there is a category id, pull it from Yodlee and insert - or just reuse!! $this->bt = BankTransaction::find($input['id']); @@ -196,13 +196,19 @@ class MatchBankTransactions implements ShouldQueue $expense->payment_date = Carbon::parse($this->bt->date); $expense->transaction_reference = $this->bt->description; $expense->transaction_id = $this->bt->id; - $expense->vendor_id = array_key_exists('vendor_id', $input) ? $input['vendor_id'] : null; + + if(array_key_exists('vendor_id', $input)) + $expense->vendor_id = $input['vendor_id']; + $expense->invoice_documents = $this->company->invoice_expense_documents; $expense->should_be_invoiced = $this->company->mark_expenses_invoiceable; $expense->save(); $this->bt->expense_id = $expense->id; - $this->bt->vendor_id = array_key_exists('vendor_id', $input) ? $input['vendor_id'] : null; + + if(array_key_exists('vendor_id', $input)) + $this->bt->vendor_id = $input['vendor_id']; + $this->bt->status_id = BankTransaction::STATUS_CONVERTED; $this->bt->save(); diff --git a/app/Repositories/BankTransactionRepository.php b/app/Repositories/BankTransactionRepository.php index 1a5bfba1662e..b9fe838376d0 100644 --- a/app/Repositories/BankTransactionRepository.php +++ b/app/Repositories/BankTransactionRepository.php @@ -11,6 +11,7 @@ namespace App\Repositories; +use App\Jobs\Bank\MatchBankTransactions; use App\Models\BankTransaction; use App\Models\Task; use App\Models\TaskStatus; @@ -35,4 +36,18 @@ class BankTransactionRepository extends BaseRepository return $bank_transaction->fresh(); } + public function convert_matched($bank_transactions) + { + + $data['transactions'] = $bank_transactions->map(function ($bt){ + return ['id' => $bt->id, 'invoice_ids' => $bt->invoice_ids]; + + })->toArray(); + + $bts = (new MatchBankTransactions(auth()->user()->company()->id, auth()->user()->company()->db, $data))->handle(); + + + } + + } From 0784bdaef3180e1dd65a58ca9f443bde01a7cbde Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 25 Nov 2022 07:53:37 +1100 Subject: [PATCH 50/51] Clean up for logging --- app/Jobs/Bank/MatchBankTransactions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/Bank/MatchBankTransactions.php b/app/Jobs/Bank/MatchBankTransactions.php index dad8d2467f70..c1cd8e17094c 100644 --- a/app/Jobs/Bank/MatchBankTransactions.php +++ b/app/Jobs/Bank/MatchBankTransactions.php @@ -179,7 +179,7 @@ class MatchBankTransactions implements ShouldQueue } private function matchExpense($input) :self - { nlog($input); + { //if there is a category id, pull it from Yodlee and insert - or just reuse!! $this->bt = BankTransaction::find($input['id']); From 08d1672258c3ea2c411ab16f4bbc38a0c28e671a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 25 Nov 2022 08:25:34 +1100 Subject: [PATCH 51/51] Safety return for missing invoice --- app/Jobs/Bank/MatchBankTransactions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Jobs/Bank/MatchBankTransactions.php b/app/Jobs/Bank/MatchBankTransactions.php index c1cd8e17094c..9f5260e204ab 100644 --- a/app/Jobs/Bank/MatchBankTransactions.php +++ b/app/Jobs/Bank/MatchBankTransactions.php @@ -260,6 +260,9 @@ class MatchBankTransactions implements ShouldQueue }, 1); + if(!$this->invoice) + return; + /* Create Payment */ $payment = PaymentFactory::create($this->invoice->company_id, $this->invoice->user_id);