mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'mod/tarifa_enc_swap_precio_minmax' into 'main'
realizados cambios (también algo que faltaba de lo del importe fijo precio min) See merge request jjimenez/safekat!219
This commit is contained in:
@ -117,6 +117,24 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_max.required'))
|
||||
),
|
||||
Field::inst('importe_fijo')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.decimal'))
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required'))
|
||||
),
|
||||
Field::inst('precio_min')
|
||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||
->validator('Validate::numeric', array(
|
||||
"decimal" => ',',
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.decimal'))
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_min.required'))
|
||||
),
|
||||
Field::inst('proveedor_id')
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('TarifaEncuadernacionTiradas.validation.tirada_max.required'))
|
||||
|
||||
@ -297,7 +297,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
||||
|
||||
private function calcularTarifa($tarifa, $paginas, $ejemplares, $is_POD=false){
|
||||
|
||||
$precio_unidad = floatval($tarifa->precio_min) - (floatval($tarifa->precio_min) - floatval($tarifa->precio_max))/($tarifa->paginas_max - $tarifa->paginas_min) * ($paginas - $tarifa->paginas_min);
|
||||
$precio_unidad = floatval($tarifa->precio_max) - (floatval($tarifa->precio_max) - floatval($tarifa->precio_min))/($tarifa->paginas_max - $tarifa->paginas_min) * ($paginas - $tarifa->paginas_min);
|
||||
if ($paginas > $tarifa->paginas_max)
|
||||
$precio_unidad = $tarifa->precio_max;
|
||||
$precio_unidad = $precio_unidad* (1+ floatval($tarifa->margen)/100.0);
|
||||
|
||||
@ -80,9 +80,9 @@
|
||||
<th>ID</th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.dimensiones') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th style="min-width:100px"></th>
|
||||
</tr>
|
||||
@ -472,11 +472,11 @@
|
||||
{
|
||||
name: "paginas_libro_min"
|
||||
}, {
|
||||
name: "precio_max"
|
||||
name: "precio_min"
|
||||
}, {
|
||||
name: "paginas_libro_max"
|
||||
}, {
|
||||
name: "precio_min"
|
||||
name: "precio_max"
|
||||
}, {
|
||||
name: "margen"
|
||||
}, {
|
||||
|
||||
@ -17,8 +17,6 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.tipo_encuadernacion') ?></th>
|
||||
<th><?= lang('Tarifaencuadernacion.servicio_encuadernacion') ?></th>
|
||||
@ -90,8 +88,6 @@
|
||||
],
|
||||
columns : [
|
||||
{ 'data': 'nombre' },
|
||||
{ 'data': 'precio_min' },
|
||||
{ 'data': 'importe_fijo' },
|
||||
{ 'data': 'mostrar_en_presupuesto' },
|
||||
{ 'data': 'tipo_encuadernacion' },
|
||||
{ 'data': 'servicio_encuadernacion' },
|
||||
@ -100,7 +96,7 @@
|
||||
});
|
||||
|
||||
theTable.on( 'draw.dt', function () {
|
||||
const boolCols = [3,4,5];
|
||||
const boolCols = [1,2,3];
|
||||
for (let coln of boolCols) {
|
||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||
|
||||
1736
xdebug.log
1736
xdebug.log
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user