mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado tirada flexible
This commit is contained in:
@ -416,7 +416,8 @@ function updateFooterLineas(table){
|
||||
base: totalSubtotal,
|
||||
total: totalTotal,
|
||||
total_pagos: total_pagos,
|
||||
pendiente: pendientePago
|
||||
pendiente: pendientePago,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
if(data.estado_pago == 'pagada'){
|
||||
@ -459,7 +460,8 @@ function deleteConfirmedLinea(params){
|
||||
data: {
|
||||
factura_id: <?= $facturaEntity->id ?>,
|
||||
pedido_linea_impresion_id: row_data.pedido_linea_impresion_id,
|
||||
cantidad: row_data.cantidad
|
||||
cantidad: row_data.cantidad,
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
|
||||
@ -500,18 +502,48 @@ $('#addLineaFactura').on('click', function() {
|
||||
editor_lineas.inlineCreate('end', formOptions);
|
||||
});
|
||||
|
||||
$('.btn-excedentes').on('click', function() {
|
||||
|
||||
$(document).on('click', '.btn-excedentes', function(e) {
|
||||
const row = $(this).data('row');
|
||||
console.row(row);
|
||||
/*
|
||||
const row_data = tableLineas.row(row).data();
|
||||
const url = '<?= route_to('excedentes') ?>';
|
||||
const formOptions= {
|
||||
submitTrigger: 0,
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
};
|
||||
editor_lineas.inlineCreate('end', formOptions);
|
||||
*/
|
||||
|
||||
const pedido_id = row_data.pedido_id;
|
||||
|
||||
var pedido_linea_impresion_id = null;
|
||||
var pedido_linea_maquetacion_id = null;
|
||||
|
||||
if(row_data.pedido_linea_impresion_id != null){
|
||||
pedido_linea_impresion_id = row_data.pedido_linea_impresion_id
|
||||
}
|
||||
else{
|
||||
pedido_linea_maquetacion_id = row_data.pedido_maquetacion_id
|
||||
}
|
||||
|
||||
var factura_id = <?= $facturaEntity->id ?>;
|
||||
|
||||
var url = '<?= route_to('addLineaExcedentes', ':factura_id') ?>';
|
||||
url = url.replace(':factura_id', factura_id );
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
method: 'POST',
|
||||
data: {
|
||||
pedido_id: pedido_id,
|
||||
pedido_linea_impresion_id: pedido_linea_impresion_id,
|
||||
pedido_linea_maquetacion_id: pedido_linea_maquetacion_id,
|
||||
precio_unidad: row_data.precio_unidad,
|
||||
descripcion: row_data.descripcion,
|
||||
iva: row_data.iva,
|
||||
descuento: row_data.descuento_tirada_flexible,
|
||||
cantidad: parseInt(row_data.cantidad_albaran)-parseInt(row_data.cantidad),
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||
}
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#tableOfLineasFactura').DataTable().clearPipeline();
|
||||
$('#tableOfLineasFactura').DataTable().draw();
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})
|
||||
});
|
||||
|
||||
<?=$this->endSection() ?>
|
||||
Reference in New Issue
Block a user