mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido plantilla id
This commit is contained in:
35
ci4/app/Entities/Clientes/ClientePreciosEntity.php
Normal file
35
ci4/app/Entities/Clientes/ClientePreciosEntity.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
namespace App\Entities\Cliente;
|
||||
|
||||
use CodeIgniter\Entity;
|
||||
|
||||
class ClientePreciosEntity extends \CodeIgniter\Entity\Entity
|
||||
{
|
||||
protected $attributes = [
|
||||
"id" => null,
|
||||
"cliente_id" => null,
|
||||
"plantilla_id" => null,
|
||||
"tipo" => null,
|
||||
"tipo_maquina" => null,
|
||||
"tipo_impresion" => null,
|
||||
"tiempo_min" => null,
|
||||
"tiempo_max" => null,
|
||||
"margen" => null,
|
||||
"is_deleted" => 0,
|
||||
"deleted_at" => null,
|
||||
"created_at" => null,
|
||||
"updated_at" => null,
|
||||
"user_updated_id" => null,
|
||||
"user_created_id" => null,
|
||||
];
|
||||
protected $casts = [
|
||||
"cliente_id" => "int",
|
||||
"plantilla_id" => "int",
|
||||
"tiempo_min" => "float",
|
||||
"tiempo_max" => "float",
|
||||
"margen" => "float",
|
||||
"is_deleted" => "int",
|
||||
"user_updated_id" => "int",
|
||||
"user_created_id" => "int",
|
||||
];
|
||||
}
|
||||
105
ci4/app/Models/Clientes/ClientePreciosModel.php
Normal file
105
ci4/app/Models/Clientes/ClientePreciosModel.php
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Clientes;
|
||||
|
||||
class ClientePlantillaPreciosLineasModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "cliente_precios";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
|
||||
protected $allowedFields = [
|
||||
"cliente_id",
|
||||
"plantilla_id"
|
||||
"tipo",
|
||||
"tipo_maquina",
|
||||
"tipo_impresion",
|
||||
"tiempo_min",
|
||||
"tiempo_max",
|
||||
"precio_hora",
|
||||
"margen",
|
||||
"is_deleted",
|
||||
"deleted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"user_created_id",
|
||||
"user_updated_id"];
|
||||
|
||||
protected $returnType = "App\Entities\Clientes\ClientePreciosEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "cliente_id";
|
||||
|
||||
protected $validationRules = [
|
||||
"cliente_id" => [
|
||||
"label" => "ClientePrecios.cliente_id",
|
||||
"rules" => "required",
|
||||
],
|
||||
"tipo" => [
|
||||
"label" => "ClientePrecios.tipo",
|
||||
"rules" => "required|in_list[interior,cubierta,sobrecubierta]",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"label" => "ClientePrecios.tipo_maquina",
|
||||
"rules" => "required|in_list[toner,inkjet]",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"label" => "ClientePrecios.tipo_impresion",
|
||||
"rules" => "required|in_list[negro,color,negrohq,colorhq]",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"label" => "ClientePrecios.tiempo_min",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"label" => "ClientePrecios.tiempo_max",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "ClientePrecios.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"cliente_id" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
|
||||
],
|
||||
"tipo" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"margen" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
@ -1063,21 +1063,23 @@
|
||||
|
||||
|
||||
|
||||
$('#tipoImpresion').on("change", function () {
|
||||
$('#tipoImpresion').on("change.select2", function () {
|
||||
updatePapelesComparador();
|
||||
$('#title_int_rot').html('<?= lang("Presupuestos.compInteriorRotativa") ?>');
|
||||
$('#title_int_plana').html('<?= lang("Presupuestos.compInteriorPlana") ?>');
|
||||
$('#paginas').change();
|
||||
|
||||
|
||||
if (($('#tipoImpresion').select2('data')[0].id == 'negro' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'color')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'negro'){
|
||||
$('#compPaginasColor').val('0')
|
||||
$('#compPaginasNegro').val($('#paginas').val())
|
||||
}
|
||||
|
||||
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
@ -1087,18 +1089,29 @@
|
||||
else if (($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
|
||||
$('#tipoImpresion').select2('data')[0].id == 'colorhq')){
|
||||
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'negrohq'){
|
||||
$('#compPaginasColorhq').val('0')
|
||||
$('#compPaginasNegrohq').val($('#paginas').val())
|
||||
$('#compGramajeNegohq').change().trigger()
|
||||
}
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
$('#tableCompIntPlana').DataTable().clear().draw();
|
||||
$('#total_comp_plana').html("0.00");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#tipoImpresion').on("select2:close", function () {
|
||||
|
||||
$('#paginas').change(),trigger();
|
||||
})
|
||||
|
||||
|
||||
function checkComparadorInt(is_color, is_hq, actualizarLinea=false) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user