- Ganti penggunaan model TempAccount dengan Account. - Perbarui jalur file CSV yang digunakan untuk pemrosesan. - Tambahkan logika untuk mengatur nilai default untuk 'start_year_bal' dan 'closure_date'. - Gunakan firstOrNew untuk menyimpan data akun.
36 lines
765 B
PHP
36 lines
765 B
PHP
<?php
|
|
|
|
namespace Modules\Webstatement\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
// use Modules\Webstatement\Database\Factories\AccountFactory;
|
|
|
|
class Account extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected $fillable = [
|
|
'account_number',
|
|
'customer_no',
|
|
'currency',
|
|
'opening_date',
|
|
'co_code',
|
|
'open_category',
|
|
'start_year_bal',
|
|
'closure_date',
|
|
'account_type',
|
|
'stmt_email',
|
|
'stmt_sent_type'
|
|
];
|
|
|
|
// Relationships
|
|
public function customer()
|
|
{
|
|
return $this->belongsTo(Customer::class, 'customer_code', 'customer_code');
|
|
}
|
|
}
|