- GET /payrolls/export: 급여 현황 엑셀 다운로드 (필터 지원) - POST /payrolls/journal-entries: 연월 기준 급여 전표 일괄 생성 - JournalEntry SOURCE_PAYROLL 상수 추가 - StorePayrollJournalRequest 유효성 검증 추가
68 lines
1.5 KiB
PHP
68 lines
1.5 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';
|
|
|
|
public const SOURCE_BAROBILL_CARD = 'barobill_card';
|
|
|
|
public const SOURCE_BAROBILL_BANK = 'barobill_bank';
|
|
|
|
public const SOURCE_HOMETAX_INVOICE = 'hometax_invoice';
|
|
|
|
public const SOURCE_PAYROLL = 'payroll';
|
|
|
|
// Entry type
|
|
public const TYPE_GENERAL = 'general';
|
|
|
|
/**
|
|
* 분개 행 관계
|
|
*/
|
|
public function lines(): HasMany
|
|
{
|
|
return $this->hasMany(JournalEntryLine::class)->orderBy('line_no');
|
|
}
|
|
}
|