pull/3/head
Rustem 2024-12-22 18:24:21 +05:00
parent 73a922322f
commit 1078f7d973
18 changed files with 865 additions and 246 deletions

436
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Commands; namespace modules\Auth\Commands;
use A7kz\Platform\Commands\InstallCommand; use A7kz\Platform\Commands\InstallCommand;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; use Illuminate\Foundation\Auth\SendsPasswordResetEmails;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Accounting\Facades\Accounting; use A7kz\Accounting\Facades\Accounting;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Helpers\Facade\Helper; use A7kz\Platform\Helpers\Facade\Helper;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;
use A7kz\Platform\Models\UniModel; use A7kz\Platform\Models\UniModel;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Auth\Http\Controllers; namespace modules\Auth\Http\Controllers;
use A7kz\Platform\Http\Controllers\Controller; use A7kz\Platform\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider; use App\Providers\RouteServiceProvider;

View File

@ -1,34 +1,36 @@
<?php <?php
Route::get("/login", [App\Modules\Auth\Http\Controllers\LoginController::class,'showLoginForm'])->name('loginForm'); use Illuminate\Support\Facades\Route;
Route::post("/login", [App\Modules\Auth\Http\Controllers\LoginController::class,'login'])->name('login');
Route::any("/logout", [App\Modules\Auth\Http\Controllers\LoginController::class,'logout'])->name("logout"); Route::get("/login", [modules\Auth\Http\Controllers\LoginController::class,'showLoginForm'])->name('loginForm');
Route::post("/login", [modules\Auth\Http\Controllers\LoginController::class,'login'])->name('login');
Route::get('/register',[App\Modules\Auth\Http\Controllers\RegisterController::class,'showRegistrationForm'])->name('registerForm'); Route::any("/logout", [modules\Auth\Http\Controllers\LoginController::class,'logout'])->name("logout");
Route::post('/register',[App\Modules\Auth\Http\Controllers\RegisterController::class,'register'])->name('register');
Route::get('/register',[modules\Auth\Http\Controllers\RegisterController::class,'showRegistrationForm'])->name('registerForm');
Route::post('/register',[modules\Auth\Http\Controllers\RegisterController::class,'register'])->name('register');
Route::group([ Route::group([
'middleware' => ['auth', 'web'], 'middleware' => ['auth', 'web'],
], function () { ], function () {
Route::get('register_company/',[App\Modules\Auth\Http\Controllers\RegisterCompanyController::class,'showRegisterCompanyForm']) Route::get('register_company/',[modules\Auth\Http\Controllers\RegisterCompanyController::class,'showRegisterCompanyForm'])
->name('registerCompanyForm'); ->name('registerCompanyForm');
Route::post('register_company/',[App\Modules\Auth\Http\Controllers\RegisterCompanyController::class,'registerCompany']) Route::post('register_company/',[modules\Auth\Http\Controllers\RegisterCompanyController::class,'registerCompany'])
->name('registerCompany'); ->name('registerCompany');
Route::post('register_company/check_biniin_ajax',[App\Modules\Auth\Http\Controllers\RegisterCompanyController::class,'checkBiniinAjax']) Route::post('register_company/check_biniin_ajax',[modules\Auth\Http\Controllers\RegisterCompanyController::class,'checkBiniinAjax'])
->name('checkBiniinAjax'); ->name('checkBiniinAjax');
}); });
Route::get('/password/reset', [App\Modules\Auth\Http\Controllers\ForgotPasswordController::class,'showLinkRequestForm'])->name('password.request'); Route::get('/password/reset', [modules\Auth\Http\Controllers\ForgotPasswordController::class,'showLinkRequestForm'])->name('password.request');
Route::post('/password/email',[App\Modules\Auth\Http\Controllers\ForgotPasswordController::class,'sendResetLinkEmail'])->name('password.email'); Route::post('/password/email',[modules\Auth\Http\Controllers\ForgotPasswordController::class,'sendResetLinkEmail'])->name('password.email');
Route::get('/password/reset/{token}',[App\Modules\Auth\Http\Controllers\ResetPasswordController::class,'showResetForm'])->name('password.reset'); Route::get('/password/reset/{token}',[modules\Auth\Http\Controllers\ResetPasswordController::class,'showResetForm'])->name('password.reset');
Route::post('/password/reset',[App\Modules\Auth\Http\Controllers\ResetPasswordController::class,'reset'])->name('password.update'); Route::post('/password/reset',[modules\Auth\Http\Controllers\ResetPasswordController::class,'reset'])->name('password.update');
Route::get('password/confirm',[App\Modules\Auth\Http\Controllers\ConfirmPasswordController::class,'showConfirmForm'])->name('password.confirm'); Route::get('password/confirm',[modules\Auth\Http\Controllers\ConfirmPasswordController::class,'showConfirmForm'])->name('password.confirm');
Route::post('password/confirm',[App\Modules\Auth\Http\Controllers\ConfirmPasswordController::class,'confirm']); Route::post('password/confirm',[modules\Auth\Http\Controllers\ConfirmPasswordController::class,'confirm']);
Route::get('email/verify',[App\Modules\Auth\Http\Controllers\VerificationController::class,'show'])->name('verification.notice'); Route::get('email/verify',[modules\Auth\Http\Controllers\VerificationController::class,'show'])->name('verification.notice');
Route::get('email/verify/{id}/{hash}',[App\Modules\Auth\Http\Controllers\VerificationController::class,'verify'])->name('verification.verify'); Route::get('email/verify/{id}/{hash}',[modules\Auth\Http\Controllers\VerificationController::class,'verify'])->name('verification.verify');
Route::post('email/resend',[App\Modules\Auth\Http\Controllers\VerificationController::class,'resend'])->name('verification.resend'); Route::post('email/resend',[modules\Auth\Http\Controllers\VerificationController::class,'resend'])->name('verification.resend');

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Home\Applications; namespace modules\Home\Applications;
use A7kz\Platform\Models\UniModel; use A7kz\Platform\Models\UniModel;
use A7kz\Platform\Modules\Platform\Acl\Facades\Acl; use A7kz\Platform\Modules\Platform\Acl\Facades\Acl;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\Home\Commands; namespace modules\Home\Commands;
use A7kz\Platform\Commands\InstallCommand; use A7kz\Platform\Commands\InstallCommand;
use A7kz\Platform\Modules\Platform\Acl\Facades\Acl; use A7kz\Platform\Modules\Platform\Acl\Facades\Acl;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\UserProfile\Applications; namespace modules\UserProfile\Applications;
use A7kz\Accounting\Facades\Accounting; use A7kz\Accounting\Facades\Accounting;
use A7kz\Platform\Models\UniModel; use A7kz\Platform\Models\UniModel;

View File

@ -7,7 +7,7 @@
* Астана * Астана
*/ */
namespace App\Modules\UserProfile\Commands; namespace modules\UserProfile\Commands;
use A7kz\Platform\Commands\InstallCommand; use A7kz\Platform\Commands\InstallCommand;
use A7kz\Platform\Helpers\Facade\Helper; use A7kz\Platform\Helpers\Facade\Helper;

View File

@ -0,0 +1,9 @@
{
"admin": [
"default",
"add",
"show",
"edit",
"delete"
]
}

View File

@ -0,0 +1,545 @@
{
"module": "pipicar",
"name": "pipicar.auto",
"type": "crud",
"title": "Автомобили",
"data": {
"table": "auto",
"pk": "id",
"limit": 25,
"sort_order": "asc",
"sort_field": "code",
"segment": true,
"timestamp": false,
"fields": {
"id": {
"type": "pk"
},
"code": {
"type": "string",
"validation": "required"
},
"name_ru": {
"type": "text"
},
"name_kz": {
"type": "text"
},
"account_type": {
"type": "foreign",
"table": "ref_base_group",
"foreign": "id",
"display": [
"data_name_{lk}"
],
"where": "data_type = 'T01'"
},
"article_source": {
"type": "string",
"validation": "nullable"
},
"element_source": {
"type": "string",
"validation": "nullable"
},
"mo_num": {
"type": "int",
"validation": "nullable|integer"
},
"used_by_documents": {
"type": "bool",
"validation": "nullable"
},
"used_by_system": {
"type": "bool",
"validation": "nullable"
},
"type_of_organization": {
"type": "foreign",
"table": "ref_property_types",
"foreign": "id",
"display": [
"value",
"name"
],
"validation": "nullable|int",
"label": "Тип собственности"
},
"accounts_plan_part": {
"type": "foreign",
"table": "ref_accounts_plan_part",
"foreign": "id",
"display": [
"code",
"name_{lk}"
],
"validation": "nullable|string",
"label": "Раздел плана счетов"
},
"accounts_plan_particle": {
"type": "foreign",
"table": "ref_accounts_plan_particle",
"foreign": "id",
"display": [
"code",
"name_{lk}"
],
"validation": "required|string",
"label": "Подраздел плана счетов"
},
"started_at": {
"type": "date",
"validation": "required|date"
},
"ended_at": {
"type": "date",
"validation": "nullable|date"
},
"whitespace": {
"type": "virtual"
}
}
},
"ui": {
"grid": {
"title": "План счетов",
"template": "app.base.crud.grid",
"cols": [
{
"name": "code",
"caption": "Счёт"
},
{
"name": "name_kz",
"caption": "Наименование на казахском"
},
{
"name": "name_ru",
"caption": "Наименование на русском"
},
{
"name": "account_type",
"caption": "Тип счёта"
},
{
"name": "used_by_documents",
"caption": "Исп. в первич. док-тах"
},
{
"name": "used_by_system",
"caption": "Исп. системой"
},
{
"name": "accounts_plan_particle",
"caption": "Подраздел плана счетов"
},
{
"name": "type_of_organization",
"caption": "Тип плана счетов"
},
{
"name": "started_at",
"caption": "Дата начала действия"
},
{
"name": "ended_at",
"caption": "Дата окончания действия"
},
{
"name": "id",
"caption": "ИД"
}
],
"action": {
"head": [
"add"
]
},
"filter": {
"template": "app.base.crud.filter",
"rows": [
{
"cols": [
{
"size": 1,
"input": {
"name": "code",
"label": "Cчёт"
}
},
{
"size": 3,
"input": {
"name": "account_type",
"label": "Тип счёта"
}
},
{
"size": 1,
"input": {
"name": "mo_num",
"label": "МО №"
}
},
{
"size": 1,
"input": {
"name": "id",
"label": "ИД"
}
},
{
"size": 3,
"input": {
"name": "used_by_documents",
"label": "Исп. только в первич. документах"
}
},
{
"size": 3,
"input": {
"name": "used_by_system",
"label": "Исп. только системой"
}
}
]
},
{
"cols": [
{
"size": 6,
"input": {
"name": "name_kz",
"label": "Наименование на казахском"
}
},
{
"size": 6,
"input": {
"name": "name_ru",
"label": "Наименование на русском"
}
},
{
"size": 4,
"input": {
"name": "accounts_plan_particle",
"label": "Подраздел плана счетов"
}
},
{
"size": 4,
"input": {
"name": "accounts_plan_part",
"label": "Раздел плана счетов"
}
},
{
"size": 4,
"input": {
"name": "type_of_organization",
"label": "Тип плана счетов"
}
},
{
"size": 4,
"input": {
"name": "started_at",
"label": "Дата начала действия"
}
},
{
"size": 4,
"input": {
"name": "ended_at",
"label": "Дата окончания действия"
}
}
]
}
]
}
},
"forms": {
"add": {
"title": "Добавление записи в справочник \"План счетов\"",
"template": "app.base.crud.form",
"form": {
"inject_component": [
"Js.Refs.AccountsPlan"
],
"submits": "struct:accounting.form.edit.submits",
"rows": [
{
"cols": [
{
"size": 2,
"input": {
"name": "code",
"label": "Cчёт"
}
},
{
"size": 2,
"input": {
"name": "mo_num",
"label": "МО №"
}
},
{
"size": 4,
"input": {
"name": "started_at",
"label": "Дата начала действия"
}
},
{
"size": 4,
"input": {
"name": "ended_at",
"label": "Дата окончания действия"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "type_of_organization",
"label": "Тип плана счетов",
"readonly": true
}
},
{
"size": 12,
"input": {
"name": "accounts_plan_part",
"label": "Раздел плана счетов",
"readonly": true
}
},
{
"size": 12,
"input": {
"name": "accounts_plan_particle",
"label": "Подраздел плана счетов",
"js_event": {
"onchange": "accountPlanParticleChange"
}
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "name_kz",
"label": "Наименование на казахском"
}
},
{
"size": 12,
"input": {
"name": "name_ru",
"label": "Наименование на русском"
}
}
]
},
{
"cols": [
{
"size": 4,
"input": {
"name": "account_type",
"label": "Тип счёта"
}
},
{
"size": 12,
"input": {
"name": "article_source",
"label": "Источник статьи"
}
},
{
"size": 12,
"input": {
"name": "element_source",
"label": "Источник элемента"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "used_by_documents",
"label": "Используется только в первичных документах"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "used_by_system",
"label": "Используется только системой"
}
}
]
}
]
}
},
"edit": {
"title": "Редактирование записи в справочнике \"План счетов\"",
"template": "app.base.crud.form",
"form": {
"inject_component": [
"Js.Refs.AccountsPlan"
],
"rows": [
{
"cols": [
{
"size": 2,
"input": {
"name": "code",
"label": "Cчёт"
}
},
{
"size": 2,
"input": {
"name": "mo_num",
"label": "МО №"
}
},
{
"size": 4,
"input": {
"name": "started_at",
"label": "Дата начала действия"
}
},
{
"size": 4,
"input": {
"name": "ended_at",
"label": "Дата окончания действия"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "type_of_organization",
"label": "Тип плана счетов",
"readonly": true
}
},
{
"size": 12,
"input": {
"name": "accounts_plan_part",
"label": "Раздел плана счетов",
"readonly": true
}
},
{
"size": 12,
"input": {
"name": "accounts_plan_particle",
"label": "Подраздел плана счетов",
"js_event": {
"onchange": "accountPlanParticleChange"
}
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "name_kz",
"label": "Наименование на казахском"
}
},
{
"size": 12,
"input": {
"name": "name_ru",
"label": "Наименование на русском"
}
}
]
},
{
"cols": [
{
"size": 4,
"input": {
"name": "account_type",
"label": "Тип счёта"
}
},
{
"size": 12,
"input": {
"name": "article_source",
"label": "Источник статьи"
}
},
{
"size": 12,
"input": {
"name": "element_source",
"label": "Источник элемента"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "used_by_documents",
"label": "Используется только в первичных документах"
}
}
]
},
{
"cols": [
{
"size": 12,
"input": {
"name": "used_by_system",
"label": "Используется только системой"
}
}
]
}
],
"submits": "struct:accounting.form.edit.submits"
}
}
}
},
"actions": "struct:crud.actions"
}

View File

@ -0,0 +1,23 @@
<?php
use A7kz\Platform\Modules\Platform\Segment\Facades\Segment;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
$segments = Segment::listActive();
foreach ($segments as $segment) {
Schema::connection($segment->connector)->create('pipi_auto_colors', static function (Blueprint $table) {
$table->id();
$table->string('name')->nullable()->comment('Наименование');
$table->timestamps();
$table->softDeletes();
});
}
}
};

View File

@ -0,0 +1,38 @@
<?php
use A7kz\Platform\Models\UniModel;
use A7kz\Platform\Modules\Platform\Core\Facades\Core;
use A7kz\Platform\Modules\Platform\Segment\Facades\Segment;
use Carbon\Carbon;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;
use \A7kz\Platform\Commands\InstallScript;
return new class extends \A7kz\Platform\Commands\InstallScript {
public function install($module_name, $module_version)
{
}
public function update($module_name, $module_version): void
{
$this->upgrade();
}
private function upgrade(): void
{
$segments = Segment::listActive();
foreach ($segments as $segment) {
if (!Schema::connection($segment->connector)->hasTable('pipi_auto_colors')) {
Schema::connection($segment->connector)->create('pipi_auto_colors', static function (Blueprint $table) {
$table->id();
$table->string('name')->nullable()->comment('Наименование');
$table->timestamps();
$table->softDeletes();
});
}
}
}
};