Files
sam-api/app/Models/Tenants/JournalEntry.php
권혁성 c46b950fde feat: 회계 시스템 확장 — 계정과목·전표·세금계산서·카드·바로빌
- 계정과목 확장 및 더존 Smart A 표준 시딩 (전 테넌트)
- 전표 연동 시스템 구현 (JournalSyncService, SyncsExpenseAccounts)
- 세금계산서 매입/매출 필수값 조건 분리 + null 방어
- 카드거래 대시보드 리다이렉트 + 악성채권 집계 수정
- 바로빌 연동 API 엔드포인트 추가
- 복리후생 날짜 필터 + 바로빌 조인 컬럼 수정
- codebridge DB 커넥션 설정 추가
2026-03-10 11:29:39 +09:00

56 lines
1.3 KiB
PHP

<?php
namespace App\Models\Tenants;
use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
class JournalEntry extends Model
{
use BelongsToTenant, SoftDeletes;
protected $fillable = [
'tenant_id',
'entry_no',
'entry_date',
'entry_type',
'description',
'total_debit',
'total_credit',
'status',
'source_type',
'source_key',
'created_by_name',
'attachment_note',
];
protected $casts = [
'entry_date' => 'date',
'total_debit' => 'integer',
'total_credit' => 'integer',
];
// Status
public const STATUS_DRAFT = 'draft';
public const STATUS_CONFIRMED = 'confirmed';
// Source type
public const SOURCE_MANUAL = 'manual';
public const SOURCE_BANK_TRANSACTION = 'bank_transaction';
public const SOURCE_TAX_INVOICE = 'tax_invoice';
public const SOURCE_CARD_TRANSACTION = 'card_transaction';
// Entry type
public const TYPE_GENERAL = 'general';
/**
* 분개 행 관계
*/
public function lines(): HasMany
{
return $this->hasMany(JournalEntryLine::class)->orderBy('line_no');
}
}