<?php

namespace Hilco\Models;

/**
 * @deprecated
 */
class StateTax extends WebModel {
	protected $table = 'StateTaxes';
	public function customers()
	{
		return $this->hasMany(Customer::class,'state','state');
	}
	public function scopeInEffect($query) {
		return $query
			->where(function($query) {
				$query->where('effective_date', '=', '0000-00-00')
					->orWhere('effective_date', '<', date('Y-m-d'));
			})
			->where(function($query) {
				$query->where('expiration_date', '=', '0000-00-00')
					->orWhere('expiration_date', '>', date('Y-m-d'));
			});
	}
}
