mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado el flujo completo de facturas, incluyendo cambio en el texto de pedidos y facturas cuando no tiene factura validada
This commit is contained in:
@ -145,6 +145,27 @@ class FacturaModel extends \App\Models\BaseModel
|
||||
return $builder;
|
||||
}
|
||||
|
||||
|
||||
public function presupuestoHasFacturaValidada($presupuesto_id = null)
|
||||
{
|
||||
if ($presupuesto_id == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = $this->db->table($this->table . " t1")
|
||||
->select("t1.id")
|
||||
->join("facturas_lineas t2", "t2.factura_id = t1.id", "left")
|
||||
->join("pedidos_linea t3", "t2.pedido_linea_impresion_id = t3.id", "left")
|
||||
->where("t3.presupuesto_id", $presupuesto_id)
|
||||
->where("t1.deleted_at IS NULL")
|
||||
->where("t2.deleted_at IS NULL")
|
||||
->where("t1.estado", "validada")
|
||||
->get()
|
||||
->getResultObject();
|
||||
|
||||
return !empty($result);
|
||||
}
|
||||
|
||||
public function getSumatoriosFacturacionCliente($cliente_id = -1){
|
||||
|
||||
if($cliente_id == -1){
|
||||
|
||||
Reference in New Issue
Block a user