mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado a falta del resumen
This commit is contained in:
@ -141,6 +141,25 @@ class ClienteDireccionesModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getIdForPresupuestoCliente($cliente_id = -1, $att = "", $email = "", $direccion = "", $cp = "", $pais_id = -1, $telefono = "")
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select("t1.id AS id")
|
||||
->where("t1.cliente_id", $cliente_id)
|
||||
->where("t1.att", $att)
|
||||
->where("t1.email", $email)
|
||||
->where("t1.direccion", $direccion)
|
||||
->where("t1.cp", $cp)
|
||||
->where("t1.pais_id", $pais_id)
|
||||
->where("t1.telefono", $telefono)
|
||||
->limit(1);
|
||||
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getMenuDirecciones($cliente_id=-1){
|
||||
|
||||
@ -521,7 +521,7 @@ class PresupuestoLineaModel extends \App\Models\BaseModel
|
||||
}
|
||||
|
||||
if($new_linea['tipo_linea'] =='lp_guardas')
|
||||
array_push($data, ['paginas_impresion' => $new_linea['paginas_impresion']]);
|
||||
$data = array_merge($data, ['paginas_impresion' => $new_linea['paginas_impresion']]);
|
||||
|
||||
return $this->db
|
||||
->table($this->table . " t1")
|
||||
|
||||
@ -372,11 +372,11 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
$this->db
|
||||
->table($this->table . " t1")
|
||||
->where('t1.id', $presupuesto_id)
|
||||
->set('t1.estado', 2)
|
||||
->set('t1.estado_id', 2)
|
||||
->update();
|
||||
}
|
||||
|
||||
function insertarPresupuestoCliente($tirada, $data, $data_cabecera, $extra_info, $resumen_totales, $iva_reducido, $excluir_rotativa, $tiradas_alternativas)
|
||||
function insertarPresupuestoCliente($id, $tirada, $data, $data_cabecera, $extra_info, $resumen_totales, $iva_reducido, $excluir_rotativa, $tiradas_alternativas)
|
||||
{
|
||||
|
||||
helper('date');
|
||||
@ -462,9 +462,19 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
'excluir_rotativa' => $excluir_rotativa,
|
||||
|
||||
];
|
||||
if($id != 0){
|
||||
$fields['id'] = $id;
|
||||
$fields['updated_at'] = date('Y-m-d H:i:s', now());
|
||||
}
|
||||
|
||||
$this->db->table($this->table)->insert($fields);
|
||||
return $this->db->insertID();
|
||||
if($id != 0){
|
||||
$this->db->table($this->table)->where('id', $id)->update($fields);
|
||||
return $id;
|
||||
}
|
||||
else{
|
||||
$this->db->table($this->table)->insert($fields);
|
||||
return $this->db->insertID();
|
||||
}
|
||||
}
|
||||
|
||||
private function generateJson($data)
|
||||
|
||||
Reference in New Issue
Block a user