- AccountCode 모델/서비스/컨트롤러 구현 - JournalEntry, JournalEntryLine 모델 구현 - GeneralJournalEntry 서비스/컨트롤러 구현 - FormRequest 검증 클래스 추가 - finance 라우트 등록 - i18n 메시지 키 추가 (message.php, error.php) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
961 B
PHP
46 lines
961 B
PHP
<?php
|
|
|
|
namespace App\Models\Tenants;
|
|
|
|
use App\Traits\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class JournalEntryLine extends Model
|
|
{
|
|
use BelongsToTenant;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'journal_entry_id',
|
|
'line_no',
|
|
'dc_type',
|
|
'account_code',
|
|
'account_name',
|
|
'trading_partner_id',
|
|
'trading_partner_name',
|
|
'debit_amount',
|
|
'credit_amount',
|
|
'description',
|
|
];
|
|
|
|
protected $casts = [
|
|
'line_no' => 'integer',
|
|
'debit_amount' => 'integer',
|
|
'credit_amount' => 'integer',
|
|
'trading_partner_id' => 'integer',
|
|
];
|
|
|
|
// DC Type
|
|
public const DC_DEBIT = 'debit';
|
|
public const DC_CREDIT = 'credit';
|
|
|
|
/**
|
|
* 전표 관계
|
|
*/
|
|
public function journalEntry(): BelongsTo
|
|
{
|
|
return $this->belongsTo(JournalEntry::class);
|
|
}
|
|
}
|