From: Winfried Kappeler Date: Mon, 3 Jun 2024 19:58:23 +0000 (+0200) Subject: V 0.0.2 Mandator Account Transaction moved to lkn X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=0d315fa249159f3c3a6c2f6f900833fb92089c2f;p=kaesch.git V 0.0.2 Mandator Account Transaction moved to lkn - modules Mandator Account Transaction are now symbolic links --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 0197747..9f0aa87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# V 0.0.2 Mandator Account Transaction moved to lkn + +- modules Mandator Account Transaction are now symbolic links + # V 0.0.1 Initial commit - base functionality diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php deleted file mode 100644 index fee029f..0000000 --- a/app/Http/Controllers/AccountController.php +++ /dev/null @@ -1,208 +0,0 @@ -btnSubmit === 'btnCancel') { - $rc = redirect("/account-index/$mandator->id"); - } else { - $fields = $request->all(); - if (count($fields) === 0) { - $fields = [ - 'name' => '', - 'info' => '', - 'mandator_id' => '', - 'amount' => '0.00' - ]; - } - $fields['mandator'] = $mandator->name; - $fields['mandator_id'] = $mandator->id; - $context = new ContextLaraKnife($request, $fields); - $rc = view('account.create', [ - 'context' => $context, - ]); - } - return $rc; - } - /** - * Show the form for editing the specified resource. - */ - public function edit(Account $account, Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect("/account-index/$account->mandator_id"); - } else { - $fields = $request->all(); - if ($request->btnSubmit === 'btnStore') { - $fields = $request->all(); - $validator = Validator::make($fields, ['name' => Rule::unique('accounts')->ignore($account->id)]); - if ($validator->fails()) { - $errors = $validator->errors(); - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($fields['info']); - $account->update($validated); - } - } - if ($rc == null) { - if (count($fields) === 0) { - $fields = [ - 'name' => $account->name, - 'info' => $account->info, - 'mandator_id' => $account->mandator_id, - 'mandator' => Mandator::find($account->mandator_id)->name - ]; - } - $context = new ContextLaraKnife($request, $fields, $account); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('account-edit', 0, $account->id); - $rc = view('account.edit', [ - 'context' => $context, - 'navTabsInfo' => $navigationTabInfo - ]); - } - } - return $rc; - } - /** - * Remove the specified resource from storage. - */ - public function destroy(Account $account, Request $request) - { - if ($request->btnSubmit === 'btnDelete') { - $account->delete(); - } - return redirect('/account-index'); - } - /** - * Display the database records of the resource. - */ - public function index(Mandator $mandator, Request $request) - { - if ($request->btnSubmit === 'btnNew') { - $url = "/account-create/$mandator->id"; - $rc = redirect($url); - } else { - $sql = " -SELECT t0.*, - t1.name as mandator -FROM accounts t0 -LEFT JOIN mandators t1 ON t1.id=t0.mandator_id -"; - $parameters = []; - $fields = $request->all(); - if (count($fields) == 0) { - $fields = [ - 'text' => '', - '_sortParams' => 'name:asc;id:desc' - ]; - } else { - $conditions = []; - ViewHelper::addConditionPattern($conditions, $parameters, 't0.name,t0.info', 'text'); - ViewHelper::addConditionPattern($conditions, $parameters, 'info'); - ViewHelper::addConditionConstComparison($conditions, $parameters, 'mandator_id', $mandator->id); - $sql = DbHelper::addConditions($sql, $conditions); - } - $sql = DbHelper::addOrderBy($sql, $fields['_sortParams']); - $pagination = new Pagination($sql, $parameters, $fields); - $records = $pagination->records; - $fields['mandator_id'] = $mandator->id; - $context = new ContextLaraKnife($request, $fields); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('mandator-edit', 1, $mandator->id); - $rc = view('account.index', [ - 'context' => $context, - 'records' => $records, - 'pagination' => $pagination, - 'navTabsInfo' => $navigationTabInfo - ]); - } - return $rc; - } - /** - * Returns the validation rules. - * @return array The validation rules. - */ - private function rules(bool $isCreate = false): array - { - $rc = [ - 'name' => 'required', - 'info' => '', - 'mandator_id' => 'required', - 'amount' => 'required' - ]; - return $rc; - } - public static function routes() - { - Route::get('/account-index/{mandator}', [AccountController::class, 'index'])->middleware('auth'); - Route::post('/account-index/{mandator}', [AccountController::class, 'index'])->middleware('auth'); - Route::get('/account-create/{mandator}', [AccountController::class, 'create'])->middleware('auth'); - Route::put('/account-store/{mandator}', [AccountController::class, 'store'])->middleware('auth'); - Route::post('/account-edit/{account}', [AccountController::class, 'edit'])->middleware('auth'); - Route::get('/account-edit/{account}', [AccountController::class, 'edit'])->middleware('auth'); - Route::get('/account-show/{account}/delete', [AccountController::class, 'show'])->middleware('auth'); - Route::delete('/account-show/{account}/delete', [AccountController::class, 'destroy'])->middleware('auth'); - } - /** - * Display the specified resource. - */ - public function show(Account $account, Request $request) - { - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect('/account-index')->middleware('auth'); - } else { - $context = new ContextLaraKnife($request, null, $account); - $rc = view('account.show', [ - 'context' => $context, - 'mode' => 'delete' - ]); - } - return $rc; - } - - /** - * Store a newly created resource in storage. - */ - public function store(Mandator $mandator, Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnStore') { - $fields = $request->all(); - $validator = Validator::make($fields, $this->rules(true)); - if ($validator->fails()) { - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($validated['info']); - $validated['mandator_id'] = $mandator->id; - Account::create($validated); - } - } - if ($rc == null) { - $rc = redirect("/account-index/$mandator->id"); - } - return $rc; - } -} diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php new file mode 120000 index 0000000..5c8c59b --- /dev/null +++ b/app/Http/Controllers/AccountController.php @@ -0,0 +1 @@ +../../../vendor/hamatoma/laraknife/templates/Http/Controllers/AccountController.php \ No newline at end of file diff --git a/app/Http/Controllers/MandatorController.php b/app/Http/Controllers/MandatorController.php deleted file mode 100644 index 958691d..0000000 --- a/app/Http/Controllers/MandatorController.php +++ /dev/null @@ -1,207 +0,0 @@ -btnSubmit === 'btnCancel') { - $rc = redirect('/mandator-index'); - } else { - $fields = $request->all(); - if (count($fields) === 0) { - $fields = [ - 'name' => '', - 'info' => '', - 'group_id' => '' - ]; - } - $optionsGroup = DbHelper::comboboxDataOfTable('groups', 'name', 'id', $fields['group_id'], __('')); - $context = new ContextLaraKnife($request, $fields); - $rc = view('mandator.create', [ - 'context' => $context, - 'optionsGroup' => $optionsGroup, - ]); - } - return $rc; - } - /** - * Show the form for editing the specified resource. - */ - public function edit(Mandator $mandator, Request $request) - { - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect('/mandator-index'); - } else { - $fields = $request->all(); - if (count($fields) === 0) { - $fields = [ - 'name' => $mandator->name, - 'info' => $mandator->info, - 'group_id' => $mandator->group_id - ]; - } - $optionsGroup = DbHelper::comboboxDataOfTable('groups', 'name', 'id', $fields['group_id'], __('')); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('mandator-edit', 0, $mandator->id); - $context = new ContextLaraKnife($request, null, $mandator); - $rc = view('mandator.edit', [ - 'context' => $context, - 'optionsGroup' => $optionsGroup, - 'navTabsInfo' => $navigationTabInfo - ]); - } - return $rc; - } - /** - * Remove the specified resource from storage. - */ - public function destroy(Mandator $mandator, Request $request) - { - if ($request->btnSubmit === 'btnDelete') { - $mandator->delete(); - } - return redirect('/mandator-index'); - } - /** - * Display the database records of the resource. - */ - public function index(Request $request) - { - if ($request->btnSubmit === 'btnNew') { - return redirect('/mandator-create'); - } else { - $sql = " -SELECT t0.*, - t1.name as `group` -FROM mandators t0 -LEFT JOIN groups t1 ON t1.id=t0.group_id -"; - $parameters = []; - $fields = $request->all(); - if (count($fields) == 0) { - $fields = [ - 'text' => '', - '_sortParams' => 'name:asc;id:asc' - ]; - } else { - $conditions = []; - ViewHelper::addConditionPattern($conditions, $parameters, 't0.name,t0.info', 'text'); - $sql = DbHelper::addConditions($sql, $conditions); - } - $sql = DbHelper::addOrderBy($sql, $fields['_sortParams']); - $pagination = new Pagination($sql, $parameters, $fields); - $records = $pagination->records; - $context = new ContextLaraKnife($request, $fields); - return view('mandator.index', [ - 'context' => $context, - 'records' => $records, - 'pagination' => $pagination - ]); - } - } - /** - * Returns the validation rules. - * @return array The validation rules. - */ - private function rules(bool $isCreate=false): array - { - $rc = [ - 'name' => 'required', - 'info' => '', - 'group_id' => 'required' - ]; - return $rc; - } - public static function routes() - { - Route::get('/mandator-index', [MandatorController::class, 'index'])->middleware('auth'); - Route::post('/mandator-index', [MandatorController::class, 'index'])->middleware('auth'); - Route::get('/mandator-create', [MandatorController::class, 'create'])->middleware('auth'); - Route::put('/mandator-store', [MandatorController::class, 'store'])->middleware('auth'); - Route::post('/mandator-edit/{mandator}', [MandatorController::class, 'edit'])->middleware('auth'); - Route::get('/mandator-edit/{mandator}', [MandatorController::class, 'edit'])->middleware('auth'); - Route::post('/mandator-update/{mandator}', [MandatorController::class, 'update'])->middleware('auth'); - Route::get('/mandator-show/{mandator}/delete', [MandatorController::class, 'show'])->middleware('auth'); - Route::delete('/mandator-show/{mandator}/delete', [MandatorController::class, 'destroy'])->middleware('auth'); - } - /** - * Display the specified resource. - */ - public function show(Mandator $mandator, Request $request) - { - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect('/mandator-index')->middleware('auth'); - } else { - $optionsGroup = DbHelper::comboboxDataOfTable('groups', 'name', 'id', $fields['group_id'], __('')); - $context = new ContextLaraKnife($request, null, $mandator); - $rc = view('mandator.show', [ - 'context' => $context, - 'optionsGroup' => $optionsGroup, - 'mode' => 'delete' - ]); - } - return $rc; - } - - /** - * Store a newly created resource in storage. - */ - public function store(Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnStore') { - $fields = $request->all(); - $validator = Validator::make($fields, $this->rules(true)); - if ($validator->fails()) { - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($validated['info']); - Mandator::create($validated); - } - } - if ($rc == null){ - $rc = redirect('/mandator-index'); - } - return $rc; - } - /** - * Update the specified resource in storage. - */ - public function update(Mandator $mandator, Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnStore') { - $fields = $request->all(); - $validator = Validator::make($fields, $this->rules(false)); - if ($validator->fails()) { - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($validated['info']); - $mandator->update($validated); - } - } - if ($rc == null){ - $rc = redirect('/mandator-index'); - } - return $rc; - } -} diff --git a/app/Http/Controllers/MandatorController.php b/app/Http/Controllers/MandatorController.php new file mode 120000 index 0000000..11b40fe --- /dev/null +++ b/app/Http/Controllers/MandatorController.php @@ -0,0 +1 @@ +../../../vendor/hamatoma/laraknife/templates/Http/Controllers/MandatorController.php \ No newline at end of file diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php deleted file mode 100644 index 86d256a..0000000 --- a/app/Http/Controllers/TransactionController.php +++ /dev/null @@ -1,314 +0,0 @@ -btnSubmit === 'btnCancel') { - $rc = redirect("/transaction-index/$account->id"); - } else { - $fields = $request->all(); - if (count($fields) === 0) { - $fields = [ - 'name' => '', - 'info' => '', - 'amount' => '0.00', - 'transactiontype_scope' => '', - 'transactionstate_scope' => 1331, - 'date' => (new \DateTime('now'))->format('Y-m-d'), - 'owner_id' => auth()->user()->id - ]; - } - $optionsTransactiontype = SProperty::optionsByScope('transactiontype', $fields['transactiontype_scope'], '-'); - $optionsTransactionstate = SProperty::optionsByScope('transactionstate', $fields['transactionstate_scope'], '-'); - $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['owner_id'], __('')); - $fields['account_id'] = $account->id; - $fields['account'] = $account->name; - $fields['mandator'] = Mandator::find($account->mandator_id)->name; - $context = new ContextLaraKnife($request, $fields); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('transaction-create', 0, $account->id); - $rc = view('transaction.create', [ - 'context' => $context, - 'optionsTransactiontype' => $optionsTransactiontype, - 'optionsTransactionstate' => $optionsTransactionstate, - 'optionsOwner' => $optionsOwner, - 'navTabsInfo' => $navigationTabInfo - ]); - } - return $rc; - } - /** - * Show the form for editing the specified resource. - */ - public function edit(Transaction $transaction, Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect("/transaction-index/$transaction->account_id"); - } else { - $fields = $request->all(); - if ($request->btnSubmit === 'btnStore') { - $validator = Validator::make($fields, $this->rules(false)); - if ($validator->fails()) { - $errors = $validator->errors(); - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($validated['info']); - $transaction->update($validated); - } - } - if (count($fields) === 0) { - $fields = [ - 'name' => $transaction->name, - 'info' => $transaction->info, - 'amount' => $transaction->amount, - 'transactiontype_scope' => $transaction->transactiontype_scope, - 'transactionstate_scope' => $transaction->transactionstate_scope, - 'date' => $transaction->date, - ]; - } - $optionsTransactiontype = SProperty::optionsByScope('transactiontype', $transaction->transactiontype_scope, ''); - $optionsTransactionstate = SProperty::optionsByScope('transactionstate', $transaction->transactionstate_scope, ''); - $id = $transaction->account_id; - $account = Account::find($id); - $fields['account_id'] = $account->id; - $fields['account'] = $account->name; - $fields['mandator'] = Mandator::find($account->mandator_id)->name; - $context = new ContextLaraKnife($request, $fields, $transaction); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('transaction-edit', 0, $transaction->id); - $rc = view('transaction.edit', [ - 'context' => $context, - 'optionsTransactiontype' => $optionsTransactiontype, - 'optionsTransactionstate' => $optionsTransactionstate, - 'navTabsInfo' => $navigationTabInfo - ]); - } - return $rc; - } - public function editOwner(Transaction $transaction, Request $request) - { - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect("/transaction-index/$transaction->reference_id"); - } else { - $fields = $request->all(); - if (count($fields) === 0) { - $fields = [ - 'owner_id' => $transaction->owner_id, - 'recipients' => '', - ]; - } - ViewHelper::adaptCheckbox($fields, 'withEmail'); - if ($request->btnSubmit === 'btnStore' && ($owner = $fields['owner_id']) != null) { - $transaction->update(['owner_id' => $fields['owner_id']]); - if ($fields['withEmail']) { - $this->sendEmail($transaction->owner_id, $transaction); - } - } - $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $transaction->owner_id, __('')); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('transaction-edit', 1, $transaction->id, $transaction->options); - $context = new ContextLaraKnife($request, null, $transaction); - $rc = view('transaction.edit_owner', [ - 'context' => $context, - 'optionsOwner' => $optionsOwner, - 'navTabsInfo' => $navigationTabInfo - ]); - } - return $rc; - } - - /** - * Remove the specified resource from storage. - */ - public function destroy(Transaction $transaction, Request $request) - { - if ($request->btnSubmit === 'btnDelete') { - $transaction->delete(); - } - return redirect('/transaction-index'); - } - /** - * Display the database records of the resource. - */ - public function index(Account $account, Request $request) - { - if ($request->btnSubmit === 'btnNew') { - return redirect("/transaction-create/$account->id"); - } else { - $sql = " -SELECT t0.*, - t1.name as transactiontype_scope, - t2.name as transactionstate_scope, - t3.name as owner -FROM transactions t0 -LEFT JOIN sproperties t1 ON t1.id=t0.transactiontype_scope -LEFT JOIN sproperties t2 ON t2.id=t0.transactionstate_scope -LEFT JOIN users t3 ON t3.id=t0.owner_id -"; - $parameters = []; - $fields = $request->all(); - if (count($fields) == 0) { - $from = DateTimeHelper::firstDayOfYear()->format('Y-m-d'); - $fields = [ - 'transactiontype' => '', - 'transactionstate' => '', - 'owner' => auth()->user()->id, - 'text' => '', - 'from' => $from, - 'until' => '', - '_sortParams' => 'date:desc;id:asc' - ]; - } else { - $conditions = []; - ViewHelper::addConditionConstComparison($conditions, $parameters, 'account_id', $account->id); - ViewHelper::addConditionComparism($conditions, $parameters, 'transactiontype_scope', 'transactiontype'); - ViewHelper::addConditionComparism($conditions, $parameters, 'transactionstate_scope', 'transactionstate'); - ViewHelper::addConditionComparism($conditions, $parameters, 'owner_id', 'owner'); - ViewHelper::addConditionPattern($conditions, $parameters, 'name,info', 'text'); - ViewHelper::addConditionComparism($conditions, $parameters, 'from', 'date', '>='); - ViewHelper::addConditionComparism($conditions, $parameters, 'until', 'date', '<='); - $sql = DbHelper::addConditions($sql, $conditions); - } - $sql = DbHelper::addOrderBy($sql, $fields['_sortParams']); - $pagination = new Pagination($sql, $parameters, $fields); - $records = $pagination->records; - $optionsTransactiontype = SProperty::optionsByScope('transactiontype', $fields['transactiontype'], 'all'); - $optionsTransactionstate = SProperty::optionsByScope('transactionstate', $fields['transactionstate'], 'all'); - $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['owner'], __('')); - $fields['account_id'] = $account->id; - $fields['mandator'] = Mandator::find($account->mandator_id)->name; - $fields['account'] = $account->name; - $context = new ContextLaraKnife($request, $fields); - $navigationTabInfo = ViewHelperLocal::getNavigationTabInfo('account-edit', 1, $account->id); - return view('transaction.index', [ - 'context' => $context, - 'records' => $records, - 'optionsTransactiontype' => $optionsTransactiontype, - 'optionsTransactionstate' => $optionsTransactionstate, - 'optionsOwner' => $optionsOwner, - 'pagination' => $pagination, - 'navTabsInfo' => $navigationTabInfo - ]); - } - } - /** - * Returns the validation rules. - * @return array The validation rules. - */ - private function rules(bool $isCreate = false): array - { - $rc = [ - 'name' => 'required', - 'info' => '', - 'amount' => 'required', - 'transactiontype_scope' => 'required', - 'transactionstate_scope' => 'required', - 'date' => '', - 'owner_id' => 'required' - ]; - return $rc; - } - public static function routes() - { - Route::get('/transaction-index/{account}', [TransactionController::class, 'index'])->middleware('auth'); - Route::post('/transaction-index/{account}', [TransactionController::class, 'index'])->middleware('auth'); - Route::get('/transaction-create/{account}', [TransactionController::class, 'create'])->middleware('auth'); - Route::put('/transaction-store/{account}', [TransactionController::class, 'store'])->middleware('auth'); - Route::post('/transaction-edit/{transaction}', [TransactionController::class, 'edit'])->middleware('auth'); - Route::get('/transaction-edit/{transaction}', [TransactionController::class, 'edit'])->middleware('auth'); - Route::post('/transaction-editowner/{transaction}', [TransactionController::class, 'editOwner'])->middleware('auth'); - Route::get('/transaction-editowner/{transaction}', [TransactionController::class, 'editOwner'])->middleware('auth'); - Route::get('/transaction-show/{transaction}/delete', [TransactionController::class, 'show'])->middleware('auth'); - Route::delete('/transaction-show/{transaction}/delete', [TransactionController::class, 'destroy'])->middleware('auth'); - } - /** - * Display the specified resource. - */ - public function show(Transaction $transaction, Request $request) - { - if ($request->btnSubmit === 'btnCancel') { - $rc = redirect('/transaction-index')->middleware('auth'); - } else { - $optionsTransactiontype = SProperty::optionsByScope('transactiontype', $transaction->transactiontype_scope, ''); - $optionsTransactionstate = SProperty::optionsByScope('transactionstate', $transaction->transactionstate_scope, ''); - $optionsAccount = DbHelper::comboboxDataOfTable('accounts', 'name', 'id', $fields['account_id'], __('')); - $optionsTwin = DbHelper::comboboxDataOfTable('transactions', 'name', 'id', $fields['twin_id'], __('')); - $optionsOwner = DbHelper::comboboxDataOfTable('users', 'name', 'id', $fields['owner_id'], __('')); - $context = new ContextLaraKnife($request, null, $transaction); - $rc = view('transaction.show', [ - 'context' => $context, - 'optionsTransactiontype' => $optionsTransactiontype, - 'optionsTransactionstate' => $optionsTransactionstate, - 'optionsAccount' => $optionsAccount, - 'optionsTwin' => $optionsTwin, - 'optionsOwner' => $optionsOwner, - 'mode' => 'delete' - ]); - } - return $rc; - } - private function sendEmail(int $userId, Transaction $transaction) - { - $user = User::find($userId); - $account = Account::find($transaction->account_id); - $mandator = Mandator::find($account->mandator_id); - EmailHelper::sendMail('transaction.notification', $user->email, [ - 'name' => $user->name, - 'title' => "$account->name $transaction->name", - 'transaction' => $transaction->name, - 'mandator' => $mandator->name, - 'account' => $account->name, - 'body' => $transaction->info, - 'from' => auth()->user()->name, - 'link' => ViewHelper::buildLink("/transaction-edit/$transaction->id") - ]); - } - - /** - * Store a newly created resource in storage. - */ - public function store(Account $account, Request $request) - { - $rc = null; - if ($request->btnSubmit === 'btnStore') { - $fields = $request->all(); - $validator = Validator::make($fields, $this->rules(true)); - if ($validator->fails()) { - $rc = back()->withErrors($validator)->withInput(); - } else { - $validated = $validator->validated(); - $validated['info'] = strip_tags($validated['info']); - $validated['account_id'] = $account->id; - $transaction = Transaction::create($validated); - $rc = redirect("/transaction-edit/$transaction->id"); - } - } - if ($rc == null) { - $rc = redirect("/transaction-index/$account->id"); - } - return $rc; - } -} diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php new file mode 120000 index 0000000..c227819 --- /dev/null +++ b/app/Http/Controllers/TransactionController.php @@ -0,0 +1 @@ +../../../vendor/hamatoma/laraknife/templates/Http/Controllers/TransactionController.php \ No newline at end of file diff --git a/app/Models/Account.php b/app/Models/Account.php deleted file mode 100644 index f4869ac..0000000 --- a/app/Models/Account.php +++ /dev/null @@ -1,21 +0,0 @@ -=8.2", "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^6.4|^7.0", "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", @@ -4015,9 +4016,9 @@ "symfony/finder": "^6.4|^7.0", "symfony/http-client-contracts": "^2.5|^3", "symfony/process": "^6.4|^7.0", - "symfony/property-access": "^6.4|^7.0", + "symfony/property-access": "^7.1", "symfony/routing": "^6.4|^7.0", - "symfony/serializer": "^6.4.4|^7.0.4", + "symfony/serializer": "^7.1", "symfony/stopwatch": "^6.4|^7.0", "symfony/translation": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3", @@ -4053,7 +4054,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.0.7" + "source": "https://github.com/symfony/http-kernel/tree/v7.1.0" }, "funding": [ { @@ -4069,20 +4070,20 @@ "type": "tidelift" } ], - "time": "2024-04-29T12:20:25+00:00" + "time": "2024-05-31T07:46:30+00:00" }, { "name": "symfony/mailer", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "4ff41a7c7998a88cfdc31b5841ef64d9246fc56a" + "reference": "1528f3fb85d1cbed8bf68a19d5428de662c29d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/4ff41a7c7998a88cfdc31b5841ef64d9246fc56a", - "reference": "4ff41a7c7998a88cfdc31b5841ef64d9246fc56a", + "url": "https://api.github.com/repos/symfony/mailer/zipball/1528f3fb85d1cbed8bf68a19d5428de662c29d7e", + "reference": "1528f3fb85d1cbed8bf68a19d5428de662c29d7e", "shasum": "" }, "require": { @@ -4133,7 +4134,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v7.0.7" + "source": "https://github.com/symfony/mailer/tree/v7.1.0" }, "funding": [ { @@ -4149,20 +4150,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T07:45:05+00:00" }, { "name": "symfony/mime", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "3adbf110c306546f6f00337f421d2edca0e8d3c0" + "reference": "92d6b9b1217eebff2035577db505b7e1435ca78c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/3adbf110c306546f6f00337f421d2edca0e8d3c0", - "reference": "3adbf110c306546f6f00337f421d2edca0e8d3c0", + "url": "https://api.github.com/repos/symfony/mime/zipball/92d6b9b1217eebff2035577db505b7e1435ca78c", + "reference": "92d6b9b1217eebff2035577db505b7e1435ca78c", "shasum": "" }, "require": { @@ -4217,7 +4218,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.0.7" + "source": "https://github.com/symfony/mime/tree/v7.1.0" }, "funding": [ { @@ -4233,7 +4234,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-29T15:16:11+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4948,16 +4949,16 @@ }, { "name": "symfony/process", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + "reference": "56c8a1ea51eb70003fee94a78c7d6d0f44832ce7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "url": "https://api.github.com/repos/symfony/process/zipball/56c8a1ea51eb70003fee94a78c7d6d0f44832ce7", + "reference": "56c8a1ea51eb70003fee94a78c7d6d0f44832ce7", "shasum": "" }, "require": { @@ -4989,7 +4990,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.7" + "source": "https://github.com/symfony/process/tree/v7.1.0" }, "funding": [ { @@ -5005,20 +5006,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-17T10:55:18+00:00" }, { "name": "symfony/routing", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "9f82bf7766ccc9c22ab7aeb9bebb98351483fa5b" + "reference": "0ec2f36fbd769467f98c9c02cea1b76ed117115d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/9f82bf7766ccc9c22ab7aeb9bebb98351483fa5b", - "reference": "9f82bf7766ccc9c22ab7aeb9bebb98351483fa5b", + "url": "https://api.github.com/repos/symfony/routing/zipball/0ec2f36fbd769467f98c9c02cea1b76ed117115d", + "reference": "0ec2f36fbd769467f98c9c02cea1b76ed117115d", "shasum": "" }, "require": { @@ -5070,7 +5071,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.0.7" + "source": "https://github.com/symfony/routing/tree/v7.1.0" }, "funding": [ { @@ -5086,7 +5087,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-28T06:54:05+00:00" }, { "name": "symfony/service-contracts", @@ -5173,16 +5174,16 @@ }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "6f41b185e742737917e6f2e3eca37767fba5f17a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/6f41b185e742737917e6f2e3eca37767fba5f17a", + "reference": "6f41b185e742737917e6f2e3eca37767fba5f17a", "shasum": "" }, "require": { @@ -5196,6 +5197,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/emoji": "^7.1", "symfony/error-handler": "^6.4|^7.0", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", @@ -5239,7 +5241,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v7.1.0" }, "funding": [ { @@ -5255,20 +5257,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-17T10:55:18+00:00" }, { "name": "symfony/translation", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "1515e03afaa93e6419aba5d5c9d209159317100b" + "reference": "583d18e461eada8270ca44b7d99f07abf1ab048e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/1515e03afaa93e6419aba5d5c9d209159317100b", - "reference": "1515e03afaa93e6419aba5d5c9d209159317100b", + "url": "https://api.github.com/repos/symfony/translation/zipball/583d18e461eada8270ca44b7d99f07abf1ab048e", + "reference": "583d18e461eada8270ca44b7d99f07abf1ab048e", "shasum": "" }, "require": { @@ -5333,7 +5335,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.0.7" + "source": "https://github.com/symfony/translation/tree/v7.1.0" }, "funding": [ { @@ -5349,7 +5351,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-02T11:50:05+00:00" }, { "name": "symfony/translation-contracts", @@ -5431,16 +5433,16 @@ }, { "name": "symfony/uid", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "4f3a5d181999e25918586c8369de09e7814e7be2" + "reference": "3bbcb15f311b86f72486826ade080d8013231f96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/4f3a5d181999e25918586c8369de09e7814e7be2", - "reference": "4f3a5d181999e25918586c8369de09e7814e7be2", + "url": "https://api.github.com/repos/symfony/uid/zipball/3bbcb15f311b86f72486826ade080d8013231f96", + "reference": "3bbcb15f311b86f72486826ade080d8013231f96", "shasum": "" }, "require": { @@ -5485,7 +5487,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v7.0.7" + "source": "https://github.com/symfony/uid/tree/v7.1.0" }, "funding": [ { @@ -5501,20 +5503,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:32:20+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "d1627b66fd87c8b4d90cabe5671c29d575690924" + "reference": "595e4a4bc2118e7f4884315a684678b9403d44a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/d1627b66fd87c8b4d90cabe5671c29d575690924", - "reference": "d1627b66fd87c8b4d90cabe5671c29d575690924", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/595e4a4bc2118e7f4884315a684678b9403d44a6", + "reference": "595e4a4bc2118e7f4884315a684678b9403d44a6", "shasum": "" }, "require": { @@ -5568,7 +5570,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.0.7" + "source": "https://github.com/symfony/var-dumper/tree/v7.1.0" }, "funding": [ { @@ -5584,7 +5586,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-28T06:54:05+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -8183,16 +8185,16 @@ }, { "name": "symfony/yaml", - "version": "v7.0.7", + "version": "v7.1.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "0d3916ae69ea28b59d94b60c4f2b50f4e25adb5c" + "reference": "c5f718c94e3c37dd77b77484e6cf0b524b2d405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/0d3916ae69ea28b59d94b60c4f2b50f4e25adb5c", - "reference": "0d3916ae69ea28b59d94b60c4f2b50f4e25adb5c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c5f718c94e3c37dd77b77484e6cf0b524b2d405e", + "reference": "c5f718c94e3c37dd77b77484e6cf0b524b2d405e", "shasum": "" }, "require": { @@ -8234,7 +8236,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.0.7" + "source": "https://github.com/symfony/yaml/tree/v7.1.0" }, "funding": [ { @@ -8250,7 +8252,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-04-28T18:29:00+00:00" }, { "name": "theseer/tokenizer", diff --git a/database/migrations/2024_05_28_174935_create_mandators_table.php b/database/migrations/2024_05_28_174935_create_mandators_table.php deleted file mode 100644 index 9079c80..0000000 --- a/database/migrations/2024_05_28_174935_create_mandators_table.php +++ /dev/null @@ -1,30 +0,0 @@ -id(); - $table->timestamps(); - $table->string('name')->unique(); - $table->text('info')->nullable(); - $table->foreignId('group_id')->nullable()->references('id')->on('groups'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('mandators'); - } -}; diff --git a/database/migrations/2024_05_28_174935_create_mandators_table.php b/database/migrations/2024_05_28_174935_create_mandators_table.php new file mode 120000 index 0000000..90ee2d8 --- /dev/null +++ b/database/migrations/2024_05_28_174935_create_mandators_table.php @@ -0,0 +1 @@ +../../vendor/hamatoma/laraknife/templates/database/migrations/2024_05_28_174935_create_mandators_table.php \ No newline at end of file diff --git a/database/migrations/2024_05_28_184959_create_transactions_table.php b/database/migrations/2024_05_28_184959_create_transactions_table.php deleted file mode 100644 index 0dabad0..0000000 --- a/database/migrations/2024_05_28_184959_create_transactions_table.php +++ /dev/null @@ -1,36 +0,0 @@ -id(); - $table->timestamps(); - $table->string('name'); - $table->text('info')->nullable; - $table->decimal('amount'); - $table->integer('transactiontype_scope'); - $table->integer('transactionstate_scope'); - $table->date('date')->nullable; - $table->foreignId('account_id')->nullable()->references('id')->on('accounts'); - $table->foreignId('twin_id')->nullable()->references('id')->on('transactions'); - $table->foreignId('owner_id')->nullable()->references('id')->on('users'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('transactions'); - } -}; diff --git a/database/migrations/2024_05_28_190658_create_accounts_table.php b/database/migrations/2024_05_28_190658_create_accounts_table.php deleted file mode 100644 index 73a4ad2..0000000 --- a/database/migrations/2024_05_28_190658_create_accounts_table.php +++ /dev/null @@ -1,31 +0,0 @@ -id(); - $table->timestamps(); - $table->string('name'); - $table->text('info')->nullable(); - $table->decimal('amount'); - $table->foreignId('mandator_id')->nullable()->references('id')->on('mandators'); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('accounts'); - } -}; diff --git a/database/migrations/2024_05_28_190658_create_accounts_table.php b/database/migrations/2024_05_28_190658_create_accounts_table.php new file mode 120000 index 0000000..3abd934 --- /dev/null +++ b/database/migrations/2024_05_28_190658_create_accounts_table.php @@ -0,0 +1 @@ +../../vendor/hamatoma/laraknife/templates/database/migrations/2024_05_28_190658_create_accounts_table.php \ No newline at end of file diff --git a/database/migrations/2024_05_28_204959_create_transactions_table.php b/database/migrations/2024_05_28_204959_create_transactions_table.php new file mode 120000 index 0000000..43241a8 --- /dev/null +++ b/database/migrations/2024_05_28_204959_create_transactions_table.php @@ -0,0 +1 @@ +../../vendor/hamatoma/laraknife/templates/database/migrations/2024_05_28_204959_create_transactions_table.php \ No newline at end of file diff --git a/database/seeders/MandatorSeeder.php b/database/seeders/MandatorSeeder.php deleted file mode 100644 index 797fa37..0000000 --- a/database/seeders/MandatorSeeder.php +++ /dev/null @@ -1,20 +0,0 @@ -valueOf('mandator_id') }}" method="POST"> - @csrf - @method('PUT') - - - - - - - -@endsection diff --git a/resources/views/account/edit.blade.php b/resources/views/account/edit.blade.php deleted file mode 100644 index d1a2577..0000000 --- a/resources/views/account/edit.blade.php +++ /dev/null @@ -1,19 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - -
-@endsection diff --git a/resources/views/account/index.blade.php b/resources/views/account/index.blade.php deleted file mode 100644 index 2fce49f..0000000 --- a/resources/views/account/index.blade.php +++ /dev/null @@ -1,38 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - - - - {{ __('Name') }} - {{ __('Info') }} - {{ __('Amount') }} - - - - - @foreach ($records as $account) - - - {{ $account->name }} - {{ $account->info }} - {{ $account->amount }} - - - @endforeach - - - - -
-@endsection diff --git a/resources/views/account/show.blade.php b/resources/views/account/show.blade.php deleted file mode 100644 index 0112920..0000000 --- a/resources/views/account/show.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - @if($mode === 'delete') - @method('DELETE') - @endif - - - - - - -
-@endsection diff --git a/resources/views/mandator b/resources/views/mandator new file mode 120000 index 0000000..3d29dd1 --- /dev/null +++ b/resources/views/mandator @@ -0,0 +1 @@ +../../vendor/hamatoma/laraknife/resources/views/mandator \ No newline at end of file diff --git a/resources/views/mandator/create.blade.php b/resources/views/mandator/create.blade.php deleted file mode 100644 index e5bc2ae..0000000 --- a/resources/views/mandator/create.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - @method('PUT') - - - - - -
-@endsection diff --git a/resources/views/mandator/edit.blade.php b/resources/views/mandator/edit.blade.php deleted file mode 100644 index e3e8c47..0000000 --- a/resources/views/mandator/edit.blade.php +++ /dev/null @@ -1,17 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - -
-@endsection diff --git a/resources/views/mandator/index.blade.php b/resources/views/mandator/index.blade.php deleted file mode 100644 index 8563446..0000000 --- a/resources/views/mandator/index.blade.php +++ /dev/null @@ -1,35 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - - - {{__('Name')}} - {{__('Info')}} - {{__('Group')}} - - - - -@foreach ($records as $mandator) - - - {{$mandator->name}} - {{$mandator->info}} - {{$mandator->group}} - - -@endforeach - - - -
-@endsection diff --git a/resources/views/mandator/show.blade.php b/resources/views/mandator/show.blade.php deleted file mode 100644 index 6ff1e72..0000000 --- a/resources/views/mandator/show.blade.php +++ /dev/null @@ -1,16 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - @if($mode === 'delete') - @method('DELETE') - @endif - - - - - - -
-@endsection diff --git a/resources/views/transaction b/resources/views/transaction new file mode 120000 index 0000000..a782401 --- /dev/null +++ b/resources/views/transaction @@ -0,0 +1 @@ +../../vendor/hamatoma/laraknife/resources/views/transaction \ No newline at end of file diff --git a/resources/views/transaction/create.blade.php b/resources/views/transaction/create.blade.php deleted file mode 100644 index 0b5ba9f..0000000 --- a/resources/views/transaction/create.blade.php +++ /dev/null @@ -1,30 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - @method('PUT') - - - - - - - - - - - - - -
-@endsection diff --git a/resources/views/transaction/edit.blade.php b/resources/views/transaction/edit.blade.php deleted file mode 100644 index 06ffaba..0000000 --- a/resources/views/transaction/edit.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - - - - - -
-@endsection diff --git a/resources/views/transaction/edit_owner.blade.php b/resources/views/transaction/edit_owner.blade.php deleted file mode 100644 index 40c3736..0000000 --- a/resources/views/transaction/edit_owner.blade.php +++ /dev/null @@ -1,15 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - -@endsection diff --git a/resources/views/transaction/index.blade.php b/resources/views/transaction/index.blade.php deleted file mode 100644 index d9bc9a8..0000000 --- a/resources/views/transaction/index.blade.php +++ /dev/null @@ -1,62 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - - - - - - - - - - - - - - - - - - {{ __('Name') }} - {{ __('Info') }} - {{ __('Amount') }} - {{ __('Type') }} - {{ __('Status') }} - {{ __('Date') }} - {{ __('Owner') }} - - - - - @foreach ($records as $transaction) - - - - {{ __($transaction->transactiontype_scope) }} - {{ __($transaction->transactionstate_scope) }} - {{ $transaction->name }} - {{ $transaction->info }} - {{ $transaction->amount }} - {{ $transaction->date }} - {{ $transaction->owner }} - - - - @endforeach - - - - -
-@endsection diff --git a/resources/views/transaction/show.blade.php b/resources/views/transaction/show.blade.php deleted file mode 100644 index 85fb17e..0000000 --- a/resources/views/transaction/show.blade.php +++ /dev/null @@ -1,22 +0,0 @@ -@extends('layouts.backend') - -@section('content') -
- @csrf - @if($mode === 'delete') - @method('DELETE') - @endif - - - - - - - - - - - - -
-@endsection