Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
2026-02-04 20:26:01 +09:00
3 changed files with 150 additions and 1 deletions

View File

@@ -0,0 +1,77 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('hometax_invoices', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
// 고유 식별자 (중복 방지)
$table->string('nts_confirm_num', 50)->comment('국세청승인번호');
$table->enum('invoice_type', ['sales', 'purchase'])->comment('매출/매입');
// 일자 정보
$table->date('write_date')->comment('작성일자');
$table->date('issue_date')->nullable()->comment('발급일자');
$table->date('send_date')->nullable()->comment('전송일자');
// 공급자 정보
$table->string('invoicer_corp_num', 20)->comment('공급자 사업자번호');
$table->string('invoicer_corp_name', 100)->comment('공급자 상호');
$table->string('invoicer_ceo_name', 50)->nullable()->comment('공급자 대표자');
// 공급받는자 정보
$table->string('invoicee_corp_num', 20)->comment('공급받는자 사업자번호');
$table->string('invoicee_corp_name', 100)->comment('공급받는자 상호');
$table->string('invoicee_ceo_name', 50)->nullable()->comment('공급받는자 대표자');
// 금액 정보
$table->bigInteger('supply_amount')->default(0)->comment('공급가액');
$table->bigInteger('tax_amount')->default(0)->comment('세액');
$table->bigInteger('total_amount')->default(0)->comment('합계');
// 구분 정보
$table->tinyInteger('tax_type')->default(1)->comment('과세유형 1:과세 2:영세 3:면세');
$table->tinyInteger('purpose_type')->default(1)->comment('영수/청구 1:영수 2:청구');
$table->tinyInteger('issue_type')->default(1)->comment('발급유형 1:정발행 2:역발행');
// 기타
$table->string('item_name', 200)->nullable()->comment('품목명');
$table->string('remark', 500)->nullable()->comment('비고');
// 자체 관리 필드
$table->string('memo', 500)->nullable()->comment('내부 메모');
$table->string('category', 50)->nullable()->comment('분류 태그');
$table->boolean('is_checked')->default(false)->comment('확인 여부');
// 동기화 정보
$table->timestamp('synced_at')->nullable()->comment('마지막 동기화 시간');
$table->timestamps();
$table->softDeletes();
// 인덱스
$table->unique(['tenant_id', 'nts_confirm_num', 'invoice_type'], 'hometax_invoices_unique');
$table->index(['tenant_id', 'invoice_type', 'write_date'], 'hometax_invoices_type_date');
$table->index(['tenant_id', 'invoicer_corp_num'], 'hometax_invoices_invoicer');
$table->index(['tenant_id', 'invoicee_corp_num'], 'hometax_invoices_invoicee');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('hometax_invoices');
}
};

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('vehicle_maintenances', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
$table->foreignId('vehicle_id')->constrained('corporate_vehicles')->cascadeOnDelete();
$table->date('date'); // 날짜
$table->string('category', 20); // 분류 (주유, 정비, 보험, 세차, 주차, 통행료, 검사, 기타)
$table->string('description', 200)->nullable(); // 내용
$table->unsignedBigInteger('amount')->default(0); // 금액
$table->unsignedInteger('mileage')->nullable(); // 주행거리(km)
$table->string('vendor', 100)->nullable(); // 거래처
$table->text('memo')->nullable(); // 메모
$table->timestamps();
$table->softDeletes();
// 인덱스
$table->index(['tenant_id', 'vehicle_id', 'date']);
$table->index(['tenant_id', 'category']);
});
}
public function down(): void
{
Schema::dropIfExists('vehicle_maintenances');
}
};