mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en totalizadores
This commit is contained in:
@ -695,7 +695,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
// precio del pliego de impresion
|
||||
$linea['fields'] = PresupuestoService::getCostesLineaRotativa($maquina, $papel, $datosPedido, $parametrosRotativa);
|
||||
|
||||
$precio_pliego_impresion = PresupuestoService::getPrecioPliego($maquina, $papel, $datosPedido->paginas);
|
||||
[$precio_pliego_impresion, $margen_pliego_impresion] = PresupuestoService::getPrecioPliego($maquina, $papel, $datosPedido->paginas);
|
||||
|
||||
$linea['fields']['tarifa_impresion_id'] = $tarifaId;
|
||||
|
||||
@ -703,7 +703,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
$linea['fields']['precio_libro'] = $linea['fields']['pliegos_libro'] * $precio_pliego_impresion;
|
||||
// Precio papel pedido
|
||||
$linea['fields']['precio_pedido'] = $linea['fields']['precio_libro'] * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$linea['fields']['precio_pedido'] = $linea['fields']['precio_libro'] * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$linea['fields']['margen_papel_pedido'] = $linea['fields']['pliegos_libro']*$margen_pliego_impresion* ($datosPedido->tirada + $datosPedido->merma); ;
|
||||
|
||||
$linea['fields']['a_favor_fibra'] = $parametrosRotativa->a_favor_fibra;
|
||||
$linea['fields']['maquina'] = $maquina->maquina;
|
||||
|
||||
0
ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineashoras.php
Normal file → Executable file
0
ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineashoras.php
Normal file → Executable file
@ -27,6 +27,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
"tarifa_impresion_id" => null,
|
||||
"click" => null,
|
||||
"precio" => null,
|
||||
"total_papel_pedido" => null,
|
||||
"margen_papel_pedido" => null,
|
||||
"rotativa_impresion" => null,
|
||||
"rotativa_pag_color" => 0,
|
||||
"rotativa_set_values" => false,
|
||||
@ -85,6 +87,8 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
||||
"tarifa_impresion_id" => "?int",
|
||||
"click" => "?float",
|
||||
"precio" => "?float",
|
||||
"total_papel_pedido" => "?float",
|
||||
"margen_papel_pedido" => "?float",
|
||||
"rotativa_pag_color" => "int",
|
||||
"rotativa_set_values" => "boolean",
|
||||
"rotativa_negro" => "float",
|
||||
|
||||
0
ci4/app/Entities/Tarifas/TarifaEncuadernacionLineaHoras.php
Normal file → Executable file
0
ci4/app/Entities/Tarifas/TarifaEncuadernacionLineaHoras.php
Normal file → Executable file
0
ci4/app/Language/en/datePicker.php
Normal file → Executable file
0
ci4/app/Language/en/datePicker.php
Normal file → Executable file
0
ci4/app/Language/es/datePicker.php
Normal file → Executable file
0
ci4/app/Language/es/datePicker.php
Normal file → Executable file
@ -33,6 +33,8 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
|
||||
"tarifa_impresion_id",
|
||||
"click",
|
||||
"precio",
|
||||
"total_papel_pedido",
|
||||
"margen_papel_pedido",
|
||||
"rotativa_impresion",
|
||||
"rotativa_pag_color",
|
||||
"rotativa_set_values",
|
||||
|
||||
0
ci4/app/Models/Tarifas/TarifaEncuadernacionLineaHorasModel.php
Normal file → Executable file
0
ci4/app/Models/Tarifas/TarifaEncuadernacionLineaHorasModel.php
Normal file → Executable file
@ -54,7 +54,8 @@ class PresupuestoService extends BaseService
|
||||
}
|
||||
|
||||
// precio del pliego de impresion
|
||||
$precio_pliego_impresion = PresupuestoService::getPrecioPliego($maquina, $papel_impresion, $datosPedido->paginas);
|
||||
[$precio_pliego_impresion, $margen_pliego_impresion] = PresupuestoService::getPrecioPliego($maquina, $papel_impresion, $datosPedido->paginas);
|
||||
|
||||
$precio_click = 0;
|
||||
$precio_click_pedido = 0;
|
||||
$pliegos_libro = 0;
|
||||
@ -69,6 +70,7 @@ class PresupuestoService extends BaseService
|
||||
$pliegos_libro = ($datosPedido->paginas / 2.0) / $response['fields']['num_formas']['value'];
|
||||
$pliegos_pedido = $pliegos_libro * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$precio_libro = $pliegos_libro * $precio_pliego_impresion;
|
||||
$margen_papel_pedido = $pliegos_libro * $margen_pliego_impresion * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$precio_pedido = $precio_libro * ($datosPedido->tirada + $datosPedido->merma);
|
||||
|
||||
$mano = PresupuestoService::computeLomoInterior($datosPedido->paginas, $papel_impresion->espesor);
|
||||
@ -94,6 +96,7 @@ class PresupuestoService extends BaseService
|
||||
$pliegos_libro = $pliegos_libro<1?1:$pliegos_libro;
|
||||
$pliegos_pedido = $pliegos_libro * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$precio_libro = $pliegos_libro * $precio_pliego_impresion;
|
||||
$margen_papel_pedido = $pliegos_libro * $margen_pliego_impresion * ($datosPedido->tirada + $datosPedido->merma);
|
||||
$precio_pedido = $precio_libro * ($datosPedido->tirada + $datosPedido->merma);
|
||||
|
||||
$mano = PresupuestoService::computeLomoPortada($papel_impresion->espesor);
|
||||
@ -120,6 +123,7 @@ class PresupuestoService extends BaseService
|
||||
$response['fields']['pliegos_pedido'] = $pliegos_pedido;
|
||||
$response['fields']['precios_pliegos'] = $precio_pliego_impresion;
|
||||
$response['fields']['precio_libro'] = $precio_libro;
|
||||
$response['fields']['margen_papel_pedido'] = $margen_papel_pedido;
|
||||
$response['fields']['precio_pedido'] = $precio_pedido;
|
||||
$response['fields']['mano'] = $mano;
|
||||
$response['fields']['peso'] = $peso;
|
||||
@ -356,8 +360,8 @@ class PresupuestoService extends BaseService
|
||||
if (count($margen) > 0) {
|
||||
$peso_por_pliego = $maquina->alto * $maquina->ancho * $papel_impresion->gramaje / 1000000;
|
||||
$precio_pliego = ($peso_por_pliego * $papel_impresion->precio_tonelada / 1000000.0) * (1 + (floatval($margen[0]['margen']) / 100.0));
|
||||
|
||||
return round($precio_pliego, 6);
|
||||
$margen_pliego = ($peso_por_pliego * $papel_impresion->precio_tonelada / 1000000.0) * (0 + (floatval($margen[0]['margen']) / 100.0));
|
||||
return [round($precio_pliego, 6), round($margen_pliego, 6)];
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
<th class="lp-header"><?= lang('Presupuestos.libro') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.totalPapelPedido') ?></th>
|
||||
<th class="lp-header"></th>
|
||||
<th class="lp-header"></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.lomo') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.peso') ?></th>
|
||||
<th class="lp-header"><?= lang('Presupuestos.click') ?></th>
|
||||
@ -74,12 +75,13 @@
|
||||
<td class="lp-td"><input id="lp_bn_precioPliego" name="lp_bn_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_libro" name="lp_bn_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_totalPapelPedido" name="lp_bn_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_checkPapel" name="lp_bn_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bn_margenPapelPedido" name="lp_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_checkPapel" name="lp_bn_checkPapel_bn" class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bn_lomo" name="lp_bn_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_peso" name="lp_bn_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_click" name="lp_bn_click" readonly class="lp-input lp-cell lp-cell-disabled lp-bn-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_totalClicks" name="lp_bn_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-bn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bn_checkClicks" name="lp_bn_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bn_checkClicks" name="lp_bn_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -118,12 +120,13 @@
|
||||
<td class="lp-td"><input id="lp_bnhq_precioPliego" name="lp_bnhq_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_libro" name="lp_bnhq_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_totalPapelPedido" name="lp_bnhq_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_checkPapel" name="lp_bnhq_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_margenPapelPedido" name="lp_bnhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_checkPapel" name="lp_bnhq_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_lomo" name="lp_bnhq_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_peso" name="lp_bnhq_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_click" name="lp_bnhq_click" readonly class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_totalClicks" name="lp_bnhq_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-bnhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_checkClicks" name="lp_bnhq_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_bnhq_checkClicks" name="lp_bnhq_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -162,12 +165,13 @@
|
||||
<td class="lp-td"><input id="lp_color_precioPliego" name="lp_color_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_libro" name="lp_color_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_totalPapelPedido" name="lp_color_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_checkPapel" name="lp_color_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_color_margenPapelPedido" name="lp_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_checkPapel" name="lp_color_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_color_lomo" name="lp_color_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_peso" name="lp_color_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_click" name="lp_color_click" readonly class="lp-input lp-cell lp-cell-disabled lp-color-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_totalClicks" name="lp_color_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-color-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_color_checkClicks" name="lp_color_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_color_checkClicks" name="lp_color_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -207,12 +211,13 @@
|
||||
<td class="lp-td"><input id="lp_colorhq_precioPliego" name="lp_colorhq_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_libro" name="lp_colorhq_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_totalPapelPedido" name="lp_colorhq_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_checkPapel" name="lp_colorhq_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_margenPapelPedido" name="lp_colorhq_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_checkPapel" name="lp_colorhq_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_lomo" name="lp_colorhq_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_peso" name="lp_colorhq_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_click" name="lp_colorhq_click" readonly class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_totalClicks" name="lp_colorhq_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-colorhq-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_checkClicks" name="lp_colorhq_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_colorhq_checkClicks" name="lp_colorhq_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -251,17 +256,18 @@
|
||||
<td class="lp-td"><input id="lp_rot_bn_precioPliego" name="lp_rot_bn_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_libro" name="lp_rot_bn_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_totalPapelPedido" name="lp_rot_bn_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_checkPapel" name="lp_rot_bn_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_margenPapelPedido" name="lp_rot_bn_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_checkPapel" name="lp_rot_bn_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_lomo" name="lp_rot_bn_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_peso" name="lp_rot_bn_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_click" name="lp_rot_bn_click" readonly class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_totalClicks" name="lp_rot_bn_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-rotbn-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_checkClicks" name="lp_rot_bn_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_bn_checkClicks" name="lp_rot_bn_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
<tr id="lp_rot_bn_data" class="lp-rot lp_rot_bn" style="display: none;">
|
||||
<td class="lp-td"></td>
|
||||
<td class="lp-td" colspan="18" style="padding-top: 0px;">
|
||||
<td class="lp-td" colspan="19" style="padding-top: 0px;">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-1">
|
||||
<button id="lp_rot_bn_defecto" name="lp_rot_bn_defecto" type="button" class="btn btn-label-primary waves-effect lp-button"><?= lang('Presupuestos.porDefecto') ?></button>
|
||||
@ -462,6 +468,7 @@
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
@ -501,18 +508,19 @@
|
||||
<td class="lp-td"><input id="lp_rot_color_precioPliego" name="lp_rot_color_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_libro" name="lp_rot_color_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_totalPapelPedido" name="lp_rot_color_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_checkPapel" name="lp_rot_color_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_margenPapelPedido" name="lp_rot_color_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_checkPapel" name="lp_rot_color_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_lomo" name="lp_rot_color_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_peso" name="lp_rot_color_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_click" name="lp_rot_color_click" readonly class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_totalClicks" name="lp_rot_color_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-rotcolor-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_checkClicks" name="lp_rot_color_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_rot_color_checkClicks" name="lp_rot_color_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
<tr id="lp_rot_color_data" class="lp-rot lp_rot_color" style="display: none;">
|
||||
<td class="lp-td"></td>
|
||||
<td class="lp-td" colspan="18" style="padding-top: 0px;">
|
||||
<td class="lp-td" colspan="19" style="padding-top: 0px;">
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-1">
|
||||
<button id="lp_rot_color_defecto" name="lp_rot_color_defecto" type="button" class="btn btn-label-primary waves-effect lp-button"><?= lang('Presupuestos.porDefecto') ?></button>
|
||||
@ -713,6 +721,7 @@
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
<td style="display: none;"></td>
|
||||
</tr>
|
||||
|
||||
<tr id="lp_cubierta" class="lp_cubierta" style="display: none;">
|
||||
@ -759,12 +768,13 @@
|
||||
<td class="lp-td"><input id="lp_cubierta_precioPliego" name="lp_cubierta_precioPliego" class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_libro" name="lp_cubierta_libro" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_totalPapelPedido" name="lp_cubierta_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_checkPapel" name="lp_cubierta_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_margenPapelPedido" name="lp_cubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_checkPapel" name="lp_cubierta_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_lomo" name="lp_cubierta_lomo" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_peso" name="lp_cubierta_peso" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_click" name="lp_cubierta_click" readonly class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_totalClicks" name="lp_cubierta_totalClicks" class="lp-input lp-cell lp-cell-disabled lp-cubierta-input" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_checkClicks" name="lp_cubierta_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_cubierta_checkClicks" name="lp_cubierta_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -803,12 +813,13 @@
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_precioPliego" name="lp_sobrecubierta_precioPliego" class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_libro" name="lp_sobrecubierta_libro" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_totalPapelPedido" name="lp_sobrecubierta_totalPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_checkPapel" name="lp_sobrecubierta_checkPapel_bn" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_margenPapelPedido" name="lp_sobrecubierta_margenPapelPedido" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_checkPapel" name="lp_sobrecubierta_checkPapel_bn"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_lomo" name="lp_sobrecubierta_lomo" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_peso" name="lp_sobrecubierta_peso" readonly class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_click" name="lp_sobrecubierta_click" readonly class="lp-input lp-cell lp-cell-disabled" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_totalClicks" name="lp_sobrecubierta_totalClicks" class="lp-input lp-cell lp-cell-disabled" type="text" value="0"></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_checkClicks" name="lp_sobrecubierta_checkClicks" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td class="lp-td"><input id="lp_sobrecubierta_checkClicks" name="lp_sobrecubierta_checkClicks"class="update-totales" style="width: 15px; padding: 0; margin:0;" type="checkbox" checked></td>
|
||||
<td style="padding: 0; margin:0;"><a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a></td>
|
||||
</tr>
|
||||
|
||||
@ -1296,6 +1307,7 @@ function fill_lp_bn(row, fromComparator=false){
|
||||
$('#lp_bn_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_bn_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_bn_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_bn_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_bn_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_bn_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_bn_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -1523,6 +1535,7 @@ function fill_lp_color(row, fromComparator=false){
|
||||
$('#lp_color_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_color_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_color_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_color_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_color_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_color_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_color_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -1748,6 +1761,7 @@ function fill_lp_bnhq(row, fromComparator=false){
|
||||
$('#lp_bnhq_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_bnhq_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_bnhq_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_bnhq_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "" : parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_bnhq_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_bnhq_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_bnhq_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -1975,6 +1989,7 @@ function fill_lp_colorhq(row, fromComparator=false){
|
||||
$('#lp_colorhq_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_colorhq_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_colorhq_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_colorhq_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_colorhq_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_colorhq_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_colorhq_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -2265,6 +2280,7 @@ function fill_lp_rot_bn(row, fromComparador=false){
|
||||
$('#lp_rot_bn_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_rot_bn_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_rot_bn_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_rot_bn_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_rot_bn_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_rot_bn_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_rot_bn_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -2606,6 +2622,7 @@ function fill_lp_rot_color(row, fromComparador=false){
|
||||
$('#lp_rot_color_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_rot_color_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_rot_color_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_rot_color_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_rot_color_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_rot_color_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_rot_color_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -2681,6 +2698,12 @@ var tableLineasPresupuesto = new DataTable('#tableLineasPresupuesto',{
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
/*columnDefs: [
|
||||
{
|
||||
target: 12,
|
||||
visible: false
|
||||
}
|
||||
]*/
|
||||
|
||||
});
|
||||
|
||||
@ -2901,7 +2924,6 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
|
||||
}
|
||||
else{
|
||||
console.log(row);
|
||||
|
||||
var portadaObjeto = {
|
||||
anchoLibro:row.dimensiones_libro[0],
|
||||
@ -2920,6 +2942,7 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
$('#lp_cubierta_precioPliego').val(isNaN(parseFloat(row.precios_pliegos)) ? "" : parseFloat(row.precios_pliegos).toFixed(6))
|
||||
$('#lp_cubierta_libro').val(isNaN(parseFloat(row.precio_libro)) ? "" : parseFloat(row.precio_libro).toFixed(2))
|
||||
$('#lp_cubierta_totalPapelPedido').val(isNaN(parseFloat(row.precio_pedido)) ? "" : parseFloat(row.precio_pedido).toFixed(2))
|
||||
$('#lp_cubierta_margenPapelPedido').val(isNaN(parseFloat(row.margen_papel_pedido)) ? "" : parseFloat(row.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_cubierta_lomo').val(isNaN(parseFloat(row.mano)) ? "" : parseFloat(row.mano).toFixed(2))
|
||||
$('#lp_cubierta_peso').val(isNaN(parseFloat(row.peso)) ? "" : parseFloat(row.peso).toFixed(2))
|
||||
$('#lp_cubierta_click').val(isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6))
|
||||
@ -2961,6 +2984,7 @@ function fill_lp_from_bbdd(){
|
||||
$('#lp_' + lp.tipo + '_precioPliego').val(isNaN(parseFloat(lp.pliegos_precio)) ? "" : parseFloat(lp.pliegos_precio).toFixed(6))
|
||||
$('#lp_' + lp.tipo + '_libro').val(isNaN(parseFloat(lp.libro)) ? "" : parseFloat(lp.libro).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_totalPapelPedido').val(isNaN(parseFloat(lp.total_papel_pedido)) ? "" : parseFloat(lp.total_papel_pedido).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_margenPapelPedido').val(isNaN(parseFloat(lp.margen_papel_pedido)) ? "" : parseFloat(lp.margen_papel_pedido).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_lomo').val(isNaN(parseFloat(lp.mano)) ? "" : parseFloat(lp.mano).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_peso').val(isNaN(parseFloat(lp.peso)) ? "" : parseFloat(lp.peso).toFixed(2))
|
||||
$('#lp_' + lp.tipo + '_click').val(isNaN(parseFloat(lp.precio_click)) ? "" : parseFloat(lp.precio_click).toFixed(6))
|
||||
@ -3057,6 +3081,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
|
||||
pliegos_precio: $('#lp_' + tipo_lp + '_precioPliego').val(),
|
||||
libro: $('#lp_' + tipo_lp + '_libro').val(),
|
||||
total_papel_pedido: $('#lp_' + tipo_lp + '_totalPapelPedido').val(),
|
||||
margen_papel_pedido: $('#lp_' + tipo_lp + '_margenPapelPedido').val(),
|
||||
mano: $('#lp_' + tipo_lp + '_lomo').val(),
|
||||
peso: $('#lp_' + tipo_lp + '_peso').val(),
|
||||
precio_click: $('#lp_' + tipo_lp + '_click').val(),
|
||||
|
||||
@ -18,15 +18,16 @@
|
||||
<!-- Price Details -->
|
||||
<h6>Detalles del presupuesto</h6>
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-6 fw-normal text-end">Coste papel</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen papel</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 py-1 fw-normal text-end">Coste papel</dt>
|
||||
<dd id="totalCostePapel" class="py-1 col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 py-1 fw-normal text-end">Margen papel</dt>
|
||||
<dd id="margenPapel" class="col-6 text-end py-1">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Coste impresión</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 fw-normal text-end">Margen impresión</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
<dd id="totalCosteImpresion" class="col-6 text-end">NaN €</dd>
|
||||
<dt class="col-6 py-1 fw-normal text-end">Margen impresión</dt>
|
||||
<div class="d-flex col-4 flex-row-reverse"><input id="margenImpresionValue" type='number' value="15" class="update-totales form-control" style="width:50% !important;"></div>
|
||||
<dd id="margenImpresion" class="col-2 py-1 text-end">NaN €</dd>
|
||||
|
||||
<dt class="col-6 fw-normal text-end">Coste servicios</dt>
|
||||
<dd class="col-6 text-end">NaN €</dd>
|
||||
@ -75,7 +76,28 @@
|
||||
<!------------------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
updateTotales()
|
||||
|
||||
$(".update-totales").on("change", updateTotales)
|
||||
|
||||
function updateTotales(){
|
||||
totalPapel = 0
|
||||
margenPapel = 0
|
||||
totalImpresion = 0
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(function(){
|
||||
if($('#' + this.id + '_checkPapel').prop('checked')){
|
||||
totalPapel += parseFloat($('#' + this.id + '_totalPapelPedido').val())
|
||||
margenPapel += parseFloat($('#' + this.id + '_margenPapelPedido').val())
|
||||
}
|
||||
if($('#' + this.id + '_checkClicks').prop('checked')){
|
||||
totalImpresion += parseFloat($('#' + this.id + '_totalClicks').val())
|
||||
}
|
||||
})
|
||||
$('#totalCostePapel').text(totalPapel.toFixed(2) + '€')
|
||||
$('#margenPapel').text(margenPapel.toFixed(2) + '€')
|
||||
$('#totalCosteImpresion').text(totalImpresion.toFixed(2) + '€')
|
||||
$('#margenImpresion').text((totalImpresion*$('#margenImpresionValue').val()/100.0).toFixed(2) + '€')
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user