feat: [client] 거래처 API 2차 필드 추가 및 견적 계획 업데이트
- 거래처 유형(client_type), 연락처(mobile, fax), 담당자 정보 필드 추가 - 발주처 설정(account_id/password, payment_day) 필드 추가 - 약정 세금(tax_agreement, tax_amount, tax_start/end_date) 필드 추가 - 악성채권(bad_debt 관련 5개 필드) 정보 필드 추가 - Model, Service, FormRequest, Swagger 문서 업데이트 - 견적 API 계획에 문서 발송 API(email/fax/kakao) 요구사항 추가
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
* 거래처 2차 확장 필드 추가 (sam-design 기준)
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('clients', function (Blueprint $table) {
|
||||
// 기본 정보
|
||||
$table->enum('client_type', ['매입', '매출', '매입매출'])->default('매입')->after('is_active')->comment('거래처 유형');
|
||||
|
||||
// 연락처 정보
|
||||
$table->string('mobile', 20)->nullable()->after('phone')->comment('모바일 번호');
|
||||
$table->string('fax', 20)->nullable()->after('mobile')->comment('팩스 번호');
|
||||
|
||||
// 담당자 정보
|
||||
$table->string('manager_name', 50)->nullable()->after('contact_person')->comment('담당자명');
|
||||
$table->string('manager_tel', 20)->nullable()->after('manager_name')->comment('담당자 전화');
|
||||
$table->string('system_manager', 50)->nullable()->after('manager_tel')->comment('시스템 관리자');
|
||||
|
||||
// 발주처 설정
|
||||
$table->string('account_id', 50)->nullable()->after('address')->comment('계정 ID');
|
||||
$table->string('account_password', 255)->nullable()->after('account_id')->comment('비밀번호 (암호화)');
|
||||
$table->string('purchase_payment_day', 20)->nullable()->after('account_password')->comment('매입 결제일');
|
||||
$table->string('sales_payment_day', 20)->nullable()->after('purchase_payment_day')->comment('매출 결제일');
|
||||
|
||||
// 약정 세금
|
||||
$table->boolean('tax_agreement')->default(false)->after('business_item')->comment('세금 약정 여부');
|
||||
$table->decimal('tax_amount', 15, 2)->nullable()->after('tax_agreement')->comment('약정 금액');
|
||||
$table->date('tax_start_date')->nullable()->after('tax_amount')->comment('약정 시작일');
|
||||
$table->date('tax_end_date')->nullable()->after('tax_start_date')->comment('약정 종료일');
|
||||
|
||||
// 악성채권 정보
|
||||
$table->boolean('bad_debt')->default(false)->after('tax_end_date')->comment('악성채권 여부');
|
||||
$table->decimal('bad_debt_amount', 15, 2)->nullable()->after('bad_debt')->comment('악성채권 금액');
|
||||
$table->date('bad_debt_receive_date')->nullable()->after('bad_debt_amount')->comment('채권 발생일');
|
||||
$table->date('bad_debt_end_date')->nullable()->after('bad_debt_receive_date')->comment('채권 만료일');
|
||||
$table->enum('bad_debt_progress', ['협의중', '소송중', '회수완료', '대손처리'])->nullable()->after('bad_debt_end_date')->comment('진행 상태');
|
||||
|
||||
// 기타 정보
|
||||
$table->text('memo')->nullable()->after('bad_debt_progress')->comment('메모');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('clients', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'client_type',
|
||||
'mobile',
|
||||
'fax',
|
||||
'manager_name',
|
||||
'manager_tel',
|
||||
'system_manager',
|
||||
'account_id',
|
||||
'account_password',
|
||||
'purchase_payment_day',
|
||||
'sales_payment_day',
|
||||
'tax_agreement',
|
||||
'tax_amount',
|
||||
'tax_start_date',
|
||||
'tax_end_date',
|
||||
'bad_debt',
|
||||
'bad_debt_amount',
|
||||
'bad_debt_receive_date',
|
||||
'bad_debt_end_date',
|
||||
'bad_debt_progress',
|
||||
'memo',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user