mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado problema con el resumen y valores totales a la hora de crear presupuestr
This commit is contained in:
@ -503,9 +503,10 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
|
||||
$result = [];
|
||||
$data = $this->db->table('facturas f')
|
||||
->select('sum(f.total)-sum(f.pendiente) as total')
|
||||
->select('sum(f.pendiente) as total')
|
||||
->where('f.cliente_id', $cliente_id)
|
||||
->where('f.deleted_at IS NULL')
|
||||
->where('f.estado', 'validada')
|
||||
->where('f.estado_pago', 'pendiente')
|
||||
->get()
|
||||
->getResultObject();
|
||||
@ -557,6 +558,7 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
->where("NOT EXISTS $subquery_facturas", null, false) // Implementación manual de NOT EXISTS
|
||||
->get()
|
||||
->getResultObject();
|
||||
$query = $this->db->getLastQuery();
|
||||
$result['total_pedidos_produccion'] =
|
||||
round(floatval(($data && $data[0]->total != null) ? $data[0]->total : 0), 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user