FormaPago Service
This commit is contained in:
@ -52,4 +52,13 @@ class BonoPie extends Ideal\Repository
|
||||
->where('pago = ?');
|
||||
return $this->fetchOne($query, [$pago_id]);
|
||||
}
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\BonoPie
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.bono_pie = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,13 @@ class Credito extends Ideal\Repository
|
||||
->where('pago = ?');
|
||||
return $this->fetchOne($query, [$pago_id]);
|
||||
}
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\Credito
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.credito = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
@ -55,4 +55,13 @@ class Escritura extends Ideal\Repository
|
||||
->where('pago = ?');
|
||||
return $this->fetchOne($query, [$pago_id]);
|
||||
}
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\Escritura
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.escritura = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
@ -108,4 +108,13 @@ WHERE venta_id = ?";
|
||||
->where('valor = ? OR ROUND(valor/uf, 3) = ?');
|
||||
return $this->fetchMany($query, [$value, $value]);
|
||||
}
|
||||
public function fetchDevolucionByVenta(int $venta_id): Model\Venta\Pago
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.devolucion = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
@ -72,4 +72,13 @@ class Pie extends Ideal\Repository
|
||||
->where('reajuste = ?');
|
||||
return $this->fetchOne($query, [$reajuste_id]);
|
||||
}
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\Pie
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.pie = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,13 @@ class Subsidio extends Ideal\Repository
|
||||
->where('subsidio = ? OR pago = ?');
|
||||
return $this->fetchOne($query, [$pago_id, $pago_id]);
|
||||
}
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\Subsidio
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select('a.*')
|
||||
->from("{$this->getTable()} a")
|
||||
->joined('JOIN venta ON venta.subsidio = a.id')
|
||||
->where('venta.id = ?');
|
||||
return $this->fetchOne($query, [$venta_id]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user