mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Cribados campos de la base de datos y codigo en base al Excel acordado
This commit is contained in:
@ -7,15 +7,12 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"version" => 0,
|
||||
"cliente_id" => null,
|
||||
"user_created_id" => 1,
|
||||
"user_update_id" => null,
|
||||
"tipo_impresion_id" => null,
|
||||
"tipologia_id" => null,
|
||||
"pais_id" => 1,
|
||||
"serie_id" => null,
|
||||
"catalogo_id" => null,
|
||||
"estado_id" => 1,
|
||||
"inc_rei" => null,
|
||||
"causa_cancelacion" => null,
|
||||
@ -52,20 +49,12 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"comentarios_pdf" => null,
|
||||
"comentarios_tarifa" => null,
|
||||
"comentarios_produccion" => null,
|
||||
"paginas_color" => null,
|
||||
"lomo" => null,
|
||||
"total_presupuesto" => null,
|
||||
"envios_recoge_cliente" => false,
|
||||
"margen" => null,
|
||||
"margen_extra" => 0.0,
|
||||
"margen_manual" => null,
|
||||
"descuento" => 0.0,
|
||||
"base_imponible" => null,
|
||||
"forzar_total" => 0,
|
||||
"tirada_alternativa_json_data" => null,
|
||||
"aprobado_user_id" => null,
|
||||
"aprobado_at" => null,
|
||||
"aprobado_json_data" => null,
|
||||
"comparador_json_data" => null,
|
||||
"is_deleted" => 0,
|
||||
"deleted_at" => null,
|
||||
@ -93,15 +82,12 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"total_precio_unidad" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"version" => "int",
|
||||
"cliente_id" => "int",
|
||||
"user_created_id" => "int",
|
||||
"user_update_id" => "?int",
|
||||
"tipo_impresion_id" => "?int",
|
||||
"tipologia_id" => "?int",
|
||||
"pais_id" => "int",
|
||||
"serie_id" => "?int",
|
||||
"catalogo_id" => "?int",
|
||||
"estado_id" => "int",
|
||||
"inc_rei" => "?int",
|
||||
"retractilado" => "boolean",
|
||||
@ -126,16 +112,9 @@ class PresupuestoEntity extends \CodeIgniter\Entity\Entity
|
||||
"sobrecubiertas_ancho" => "float",
|
||||
"merma" => "float",
|
||||
"merma_cubierta" => "float",
|
||||
"paginas_color" => "?int",
|
||||
"lomo" => "?int",
|
||||
"total_presupuesto" => "?float",
|
||||
"envios_recoge_cliente" => "boolean",
|
||||
"margen" => "?float",
|
||||
"margen_extra" => "float",
|
||||
"margen_manual" => "?float",
|
||||
"descuento" => "float",
|
||||
"base_imponible" => "?float",
|
||||
"forzar_total" => "float",
|
||||
"aprobado_user_id" => "?int",
|
||||
"is_deleted" => "int",
|
||||
"total_coste_papel" => "?float",
|
||||
|
||||
@ -27,15 +27,12 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
];
|
||||
|
||||
protected $allowedFields = [
|
||||
"version",
|
||||
"cliente_id",
|
||||
"user_created_id",
|
||||
"user_update_id",
|
||||
"tipo_impresion_id",
|
||||
"tipologia_id",
|
||||
"pais_id",
|
||||
"serie_id",
|
||||
"catalogo_id",
|
||||
"estado_id",
|
||||
"inc_rei",
|
||||
"causa_cancelacion",
|
||||
@ -72,20 +69,12 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
"comentarios_pdf",
|
||||
"comentarios_tarifa",
|
||||
"comentarios_produccion",
|
||||
"paginas_color",
|
||||
"lomo",
|
||||
"total_presupuesto",
|
||||
"envios_recoge_cliente",
|
||||
"margen",
|
||||
"margen_extra",
|
||||
"margen_manual",
|
||||
"descuento",
|
||||
"base_imponible",
|
||||
"forzar_total",
|
||||
"tirada_alternativa_json_data",
|
||||
"aprobado_user_id",
|
||||
"aprobado_at",
|
||||
"aprobado_json_data",
|
||||
"comparador_json_data",
|
||||
"is_deleted",
|
||||
"comp_tipo_impresion",
|
||||
@ -196,9 +185,19 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
||||
$sql =
|
||||
"SELECT t1." .
|
||||
$selcols .
|
||||
", t2.nombre AS cliente, t3.nombre AS forma_pago, t4.nombre AS tipo_impresion, t5.nombre AS tipologia, t6.nombre AS pais, t8.estado AS estado, t9.id AS papel_formato, t10.nombre AS paginas_negro_papel, t11.nombre AS paginas_negro_papel_impresion, t12.nombre AS paginas_negro_maquina, t13.precio AS paginas_negro_tarifa_impresion, t14.nombre AS paginas_color_papel, t15.nombre AS paginas_color_papel_impresion, t16.nombre AS paginas_color_maquina, t17.precio AS paginas_color_tarifa_impresion, t18.nombre AS paginas_cubierta_papel, t19.nombre AS paginas_cubierta_papel_impresion, t20.nombre AS paginas_cubierta_maquina, t21.id AS paginas_cubierta_tarifa_impresion, t22.nombre AS paginas_sobrecubierta_papel, t23.nombre AS paginas_sobrecubierta_papel_impresion, t24.nombre AS paginas_sobrecubierta_maquina, t25.precio AS paginas_sobrecubierta_tarifa_impresion, t26.first_name AS total_confirmado_user, t27.first_name AS aprobado_user, t28.first_name AS pedido_espera_user FROM " .
|
||||
", t2.nombre AS cliente, t3.nombre AS forma_pago, t4.nombre AS tipo_impresion, t5.nombre AS tipologia, t6.nombre AS pais, t7.estado AS estado, t8.id AS papel_formato, t9.first_name AS total_confirmado_user, t10.first_name AS aprobado_user FROM " .
|
||||
$this->table .
|
||||
" t1 LEFT JOIN clientes t2 ON t1.cliente_id = t2.id LEFT JOIN lg_formas_pago t3 ON t1.forma_pago_id = t3.id LEFT JOIN lg_tipos_impresion t4 ON t1.tipo_impresion_id = t4.id LEFT JOIN lg_tipologias_libros t5 ON t1.tipologia_id = t5.id LEFT JOIN lg_paises t6 ON t1.pais_id = t6.id = t7.id LEFT JOIN presupuesto_estados t8 ON t1.estado_id = t8.id LEFT JOIN lg_papel_formato t9 ON t1.papel_formato_id = t9.id LEFT JOIN lg_papel_generico t10 ON t1.paginas_negro_papel_id = t10.id LEFT JOIN lg_papel_impresion t11 ON t1.paginas_negro_papel_impresion_id = t11.id LEFT JOIN lg_maquinas t12 ON t1.paginas_negro_maquina_id = t12.id LEFT JOIN lg_maquinas_tarifas_impresion t13 ON t1.paginas_negro_tarifa_impresion_id = t13.id LEFT JOIN lg_papel_generico t14 ON t1.paginas_color_papel_id = t14.id LEFT JOIN lg_papel_impresion t15 ON t1.paginas_color_papel_impresion_id = t15.id LEFT JOIN lg_maquinas t16 ON t1.paginas_color_maquina_id = t16.id LEFT JOIN lg_maquinas_tarifas_impresion t17 ON t1.paginas_color_tarifa_impresion_id = t17.id LEFT JOIN lg_papel_generico t18 ON t1.paginas_cubierta_papel_id = t18.id LEFT JOIN lg_papel_impresion t19 ON t1.paginas_cubierta_papel_impresion_id = t19.id LEFT JOIN lg_maquinas t20 ON t1.paginas_cubierta_maquina_id = t20.id LEFT JOIN lg_maquinas_tarifas_impresion t21 ON t1.paginas_cubierta_tarifa_impresion_id = t21.id LEFT JOIN lg_papel_generico t22 ON t1.paginas_sobrecubierta_papel_id = t22.id LEFT JOIN lg_papel_impresion t23 ON t1.paginas_sobrecubierta_papel_impresion_id = t23.id LEFT JOIN lg_maquinas t24 ON t1.paginas_sobrecubierta_maquina_id = t24.id LEFT JOIN lg_maquinas_tarifas_impresion t25 ON t1.paginas_sobrecubierta_tarifa_impresion_id = t25.id LEFT JOIN auth_user t26 ON t1.total_confirmado_user_id = t26.id_user LEFT JOIN auth_user t27 ON t1.aprobado_user_id = t27.id_user LEFT JOIN auth_user t28 ON t1.pedido_espera_user_id = t28.id_user";
|
||||
" t1 LEFT JOIN clientes
|
||||
t2 ON t1.cliente_id = t2.id LEFT JOIN lg_formas_pago
|
||||
t3 ON t1.forma_pago_id = t3.id LEFT JOIN lg_tipos_impresion
|
||||
t4 ON t1.tipo_impresion_id = t4.id LEFT JOIN lg_tipologias_libros
|
||||
t5 ON t1.tipologia_id = t5.id LEFT JOIN lg_paises
|
||||
t6 ON t1.pais_id = t6.id = t7.id LEFT JOIN presupuesto_estados
|
||||
t7 ON t1.estado_id = t8.id LEFT JOIN lg_papel_formato
|
||||
t8 ON t1.papel_formato_id = t9.id LEFT JOIN lg_papel_generico
|
||||
t9 ON t1.total_confirmado_user_id = t26.id_user LEFT JOIN auth_user
|
||||
t10 ON t1.aprobado_user_id = t27.id_user LEFT JOIN auth_user";
|
||||
|
||||
if (!is_null($limit) && intval($limit) > 0) {
|
||||
$sql .= " LIMIT " . intval($limit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user