mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido margen a tarifas impresion
This commit is contained in:
@ -50,6 +50,7 @@
|
||||
<th><?= lang('MaquinasTarifasImpresions.uso') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.tipo') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.precio') ?></th>
|
||||
<th><?= lang('MaquinasTarifasImpresions.margen') ?></th>
|
||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -364,6 +365,11 @@
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
name: "margen",
|
||||
attr: {
|
||||
type: "number"
|
||||
}
|
||||
}, {
|
||||
"name": "maquina_id",
|
||||
"type": "hidden"
|
||||
@ -484,6 +490,7 @@
|
||||
}
|
||||
},
|
||||
{ 'data': 'precio' },
|
||||
{ 'data': 'margen' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
|
||||
@ -144,6 +144,7 @@ function format(d) {
|
||||
'<input id="' + d.row_id + '_checkClicks" name="' + d.row_id +'_checkClicks" class="update-totales" style="bottom:0;width: 15px; padding: 0; margin:0;" type="checkbox" ' + (d.check_impresion_total==true?'checked':'') + '>' +
|
||||
'</div>'+
|
||||
'<input id="' + d.row_id +'_margenImpresion" name="' + d.row_id +'_margenImpresion" readonly class="lp-input lp-cell lp-cell-disabled ' + d.row_class + '-input" type="text" value="' + d.margenImpresion +'" style="display: none;">' +
|
||||
'<input id="' + d.row_id +'_margenClicks" name="' + d.row_id +'_margenClicks" readonly class="lp-input lp-cell lp-cell-disabled ' + d.row_class + '-input" type="text" value="' + d.margenClicks +'" style="display: none;">' +
|
||||
'</div>' +
|
||||
'</td>'
|
||||
|
||||
@ -791,7 +792,8 @@ function processRowData(row, rowId, rowClass){
|
||||
'margenPapelPedido': isNaN(parseFloat(row.margen_papel_pedido)) ? "": parseFloat(row.margen_papel_pedido).toFixed(2),
|
||||
'click': isNaN(parseFloat(row.precio_click)) ? "" : parseFloat(row.precio_click).toFixed(6),
|
||||
'totalClicks': isNaN(parseFloat(row.precio_click_pedido)) ? "" : parseFloat(row.precio_click_pedido).toFixed(2),
|
||||
'horasMaquina': isNaN(parseFloat(row.horas_maquina)) ? "" : parseFloat(row.horas_maquina).toFixed(2),
|
||||
'margenClicks': isNaN(parseFloat(row.margen_click_pedido)) ? "" : parseFloat(row.margen_click_pedido).toFixed(2),
|
||||
'horasMaquina': isNaN(parseFloat(row.horas_maquina)) ? "" : parseFloat(row.horas_maquina).toFixed(4),
|
||||
'precioHora': isNaN(parseFloat(row.precio_hora)) ? "" : parseFloat(row.precio_hora).toFixed(2),
|
||||
'precioImpresion': isNaN(parseFloat(row.precio_impresion_horas)) ? "" : parseFloat(row.precio_impresion_horas).toFixed(2),
|
||||
'margenImpresion': isNaN(parseFloat(row.margen_impresion_horas)) ? "" : parseFloat(row.margen_impresion_horas).toFixed(2),
|
||||
@ -3471,6 +3473,7 @@ function fill_lp_cubierta(row, fromComparador=false){
|
||||
}
|
||||
else{
|
||||
|
||||
console.log(row)
|
||||
var portadaObjeto = {
|
||||
anchoLibro:row.dimensiones_libro[0],
|
||||
altoLibro:row.dimensiones_libro[1],
|
||||
@ -4170,6 +4173,7 @@ function fill_lp_from_bbdd(){
|
||||
lp['peso_gotas_cg'] = lp['rotativa_peso_gotas_cg']
|
||||
lp['clicks_pedido'] = lp['rotativa_clicks_total']
|
||||
lp['precio_click_pedido'] = lp['precio_click_pedido']
|
||||
lp['margen_click_pedido'] = lp['margen_click_pedido']
|
||||
lp['precio_tinta'] = lp['rotativa_precio_tinta']
|
||||
|
||||
|
||||
@ -4283,6 +4287,7 @@ async function fill_bbdd_from_lp(presupuesto_id){
|
||||
peso: rowData.peso,
|
||||
precio_click: rowData.click,
|
||||
precio_click_pedido: rowData.totalClicks,
|
||||
margen_click_pedido: rowData.margenClicks,
|
||||
check_papel_total: $('#' + rowData.row_id + '_checkPapel').is(":checked")?1:0,
|
||||
check_impresion_total: $('#' + rowData.row_id + '_checkClicks').is(":checked")?1:0,
|
||||
tarifa_impresion_id: rowData.tarifa_impresion_id,
|
||||
|
||||
@ -110,13 +110,13 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
if($('#' + rowData.row_id + '_checkClicks').prop('checked')){
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_precioImpresion').val())
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_totalClicks').val())
|
||||
totalImpresionforMargen += parseFloat($('#' + rowData.row_id + '_precioImpresion').val())
|
||||
|
||||
if(rowData.maquinaTipo=='inkjet'){
|
||||
totalImpresion += parseFloat(rowData.totalTinta)
|
||||
totalImpresion += parseFloat(rowData.totalCorte)
|
||||
}
|
||||
margenImpresion += parseFloat($('#' + rowData.row_id + '_margenImpresion').val())
|
||||
margenImpresion += parseFloat($('#' + rowData.row_id + '_margenClicks').val())
|
||||
if(!isNaN(parseFloat($('#' + rowData.row_id + 'lp_bn_totalTinta').val())))
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + 'lp_bn_totalTinta').val())
|
||||
}
|
||||
@ -124,15 +124,14 @@ function updateTotales(updateLP=true, updateServicios=true, updateEnvio=true){
|
||||
}
|
||||
|
||||
totalImpresion -= margenImpresion
|
||||
totalImpresionforMargen -= margenImpresion
|
||||
totalPapel -= margenPapel
|
||||
|
||||
var porcentajeMargenPapel = isNaN(margenPapel/(totalPapel)*100)?0:margenPapel/(totalPapel)*100
|
||||
var porcentajeMargenPapel = isNaN(margenPapel/(totalPapel)*100.0)?0:margenPapel/(totalPapel)*100.0
|
||||
$('#porcentajeMargenPapel').text(porcentajeMargenPapel.toFixed(0) + '%')
|
||||
$('#totalCostePapel').text(totalPapel.toFixed(2)+ '€')
|
||||
$('#margenPapel').text(margenPapel.toFixed(2) + '€')
|
||||
|
||||
var porcentajeMargenImpresion = isNaN(margenImpresion/(totalImpresionforMargen)*100)?0:margenImpresion/(totalImpresionforMargen)*100
|
||||
var porcentajeMargenImpresion = isNaN(margenImpresion/(totalImpresion)*100.0)?0:margenImpresion/(totalImpresion)*100.0
|
||||
$('#porcentajeMargenImpresion').text(porcentajeMargenImpresion.toFixed(0) + '%')
|
||||
$('#totalCosteImpresion').text(totalImpresion.toFixed(2) + '€')
|
||||
$('#margenImpresion').text(margenImpresion.toFixed(2) + '€')
|
||||
|
||||
Reference in New Issue
Block a user