mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
falta terminar albaranes
This commit is contained in:
@ -19,8 +19,6 @@ class EnvioLineaModel extends Model
|
||||
'pedido_id',
|
||||
'unidades_envio',
|
||||
'unidades_total',
|
||||
'cajas',
|
||||
'unidades_cajas',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'created_by',
|
||||
@ -37,7 +35,7 @@ class EnvioLineaModel extends Model
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id, t1.pedido_id as pedido, t3.id as presupuesto,t1.cajas, t1.cajas as cajasRaw,
|
||||
"t1.id, t1.pedido_id as pedido, t3.id as presupuesto,
|
||||
t3.titulo as titulo, t1.unidades_envio as unidadesEnvio, t1.unidades_envio as unidadesEnvioRaw,
|
||||
t1.unidades_total as unidadesTotal,
|
||||
IFNULL((
|
||||
@ -62,17 +60,5 @@ class EnvioLineaModel extends Model
|
||||
return $builder;
|
||||
}
|
||||
|
||||
public function getMaxCaja()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1");
|
||||
$builder->selectMax('CAST(t1.cajas AS UNSIGNED)', 'max_caja');
|
||||
$builder->where('t1.cajas IS NOT NULL');
|
||||
$query = $builder->get();
|
||||
$row = $query->getRow();
|
||||
|
||||
$maxCaja = is_numeric($row->max_caja) ? (int) $row->max_caja : 0;
|
||||
|
||||
return $maxCaja + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user