Consolidar command
This commit is contained in:
@ -60,10 +60,19 @@ class Cuenta extends Model {
|
||||
return $this->consolidados;
|
||||
}
|
||||
public function hasConsolidados(): bool {
|
||||
$t = Carbon::now();
|
||||
return (bool) Model::factory(Consolidado::class)
|
||||
->whereEqual('cuenta_id', $this->id)
|
||||
->count('id');
|
||||
}
|
||||
public function hasConsolidadosPending(): bool {
|
||||
$t = Carbon::now();
|
||||
return !(bool) Model::factory(Consolidado::class)
|
||||
->whereEqual('cuenta_id', $this->id)
|
||||
->whereGte('fecha', $t->copy()->subMonthNoOverflow()->startOfMonth()->format('Y-m-d'))
|
||||
->orderByDesc('fecha')
|
||||
->count('id');
|
||||
}
|
||||
public function hasTransacciones(): bool {
|
||||
return (bool) Model::factory(Transaccion::class)
|
||||
->select('transacciones.*')
|
||||
|
Reference in New Issue
Block a user