mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
hecho el guardar de los envios, lineas y servicios
This commit is contained in:
@ -44,7 +44,7 @@ class Presupuestodirecciones extends \App\Controllers\BaseResourceController
|
|||||||
$att = $reqData['att'] ?? "";
|
$att = $reqData['att'] ?? "";
|
||||||
$email = $reqData['email'] ?? "";
|
$email = $reqData['email'] ?? "";
|
||||||
$direccion = $reqData['direccion'] ?? "";
|
$direccion = $reqData['direccion'] ?? "";
|
||||||
$pais_id = $reqData['paisId'] ?? -1;
|
$pais_id = $reqData['pais_id'] ?? -1;
|
||||||
$provincia = $reqData['provincia'] ?? "";
|
$provincia = $reqData['provincia'] ?? "";
|
||||||
$municipio = $reqData['municipio'] ?? "";
|
$municipio = $reqData['municipio'] ?? "";
|
||||||
$cp = $reqData['cp'] ?? "";
|
$cp = $reqData['cp'] ?? "";
|
||||||
|
|||||||
@ -59,7 +59,7 @@
|
|||||||
<dt class="col-5 fw-normal text-end">Total</dt>
|
<dt class="col-5 fw-normal text-end">Total</dt>
|
||||||
<dd id="totalAntesDescuento" class="col-6 text-end"></dd>
|
<dd id="totalAntesDescuento" class="col-6 text-end"></dd>
|
||||||
<dt class="col-5 py-1 fw-normal text-end">Descuento</dt>
|
<dt class="col-5 py-1 fw-normal text-end">Descuento</dt>
|
||||||
<dd id="dd" class="col-3 text-end py-1"><input id="total_descuentoPercent" type="number" value="" class="update-totales form-control" style="width:100% !important;">%</dd>
|
<dd id="dd" class="col-3 text-end py-1"><input id="total_descuentoPercent" type="number" value="" class="update-totales form-control" style="width:100% !important;"></dd>
|
||||||
<dd id="descuentoTotal" class="col-3 py-1 text-end"></dd>
|
<dd id="descuentoTotal" class="col-3 py-1 text-end"></dd>
|
||||||
<dt class="col-5 text-end">Total presupuesto</dt>
|
<dt class="col-5 text-end">Total presupuesto</dt>
|
||||||
<dd id="totalDespuesDecuento" class="col-6 fw-semibold text-end"></dd>
|
<dd id="totalDespuesDecuento" class="col-6 fw-semibold text-end"></dd>
|
||||||
|
|||||||
@ -116,9 +116,11 @@ class PresupuestoAdminEdit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
guardarPresupuesto() {
|
async guardarPresupuesto() {
|
||||||
|
|
||||||
this.servicios.guardar();
|
await this.servicios.guardar();
|
||||||
|
await this.envios.guardarEnvios();
|
||||||
|
await this.lineasPresupuesto.guardarLineasPresupuesto();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -231,18 +231,18 @@ class Envios {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
guardarEnvios() {
|
async guardarEnvios() {
|
||||||
/* TO-DO
|
|
||||||
var id = $('#presupuesto_id').val()
|
|
||||||
|
|
||||||
$.post(window.routes_envios.dataTableOfPresupuestoDirecciones,
|
var id = window.location.pathname.split('/').pop();
|
||||||
|
|
||||||
|
await $.post('/presupuestodirecciones/datatable',
|
||||||
Object.assign({ tipo: "clear_lineas", presupuesto_id: id }, window.token_ajax))
|
Object.assign({ tipo: "clear_lineas", presupuesto_id: id }, window.token_ajax))
|
||||||
.done(function (data) {
|
.done(function (data) {
|
||||||
|
|
||||||
$('#tableOfDireccionesEnvio').DataTable().rows().every(function (rowIdx, tableLoop, rowLoop) {
|
$('#tableOfDireccionesEnvio').DataTable().rows().every(async function (rowIdx, tableLoop, rowLoop) {
|
||||||
var data = this.data();
|
var data = this.data();
|
||||||
$.post('/presupuestos/presupuestodirecciones/add',
|
await $.post('/presupuestos/presupuestodirecciones/add',
|
||||||
Object.assign({
|
{
|
||||||
presupuesto_id: id,
|
presupuesto_id: id,
|
||||||
tarifa_id: data.tarifa_id,
|
tarifa_id: data.tarifa_id,
|
||||||
cantidad: data.cantidad,
|
cantidad: data.cantidad,
|
||||||
@ -250,7 +250,7 @@ class Envios {
|
|||||||
att: data.att,
|
att: data.att,
|
||||||
email: data.email,
|
email: data.email,
|
||||||
direccion: data.direccion,
|
direccion: data.direccion,
|
||||||
paisId: data.paisId,
|
pais_id: data.pais_id,
|
||||||
provincia: data.provincia,
|
provincia: data.provincia,
|
||||||
municipio: data.municipio,
|
municipio: data.municipio,
|
||||||
cp: data.cp,
|
cp: data.cp,
|
||||||
@ -260,13 +260,12 @@ class Envios {
|
|||||||
proveedor: data.proveedor,
|
proveedor: data.proveedor,
|
||||||
proveedor_id: data.proveedor_id,
|
proveedor_id: data.proveedor_id,
|
||||||
entregaPieCalle: data.entregaPieCalle
|
entregaPieCalle: data.entregaPieCalle
|
||||||
}, window.token_ajax))
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
})
|
})
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async updateTiradaBase() {
|
async updateTiradaBase() {
|
||||||
|
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|||||||
@ -484,9 +484,10 @@ class LineasPresupuesto {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
guardarLineasPresupuesto() {
|
async guardarLineasPresupuesto() {
|
||||||
|
|
||||||
data = [];
|
let data = [];
|
||||||
|
const presupuesto_id = window.location.href.split('/').pop();
|
||||||
|
|
||||||
this.table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
this.table.rows().every(function (rowIdx, tableLoop, rowLoop) {
|
||||||
|
|
||||||
@ -509,7 +510,7 @@ class LineasPresupuesto {
|
|||||||
if (t_maq_str.length == 3)
|
if (t_maq_str.length == 3)
|
||||||
t_maq = (+t_maq_str[0]) * 3600 + (+t_maq_str[1]) * 60 + (+t_maq_str[2]);
|
t_maq = (+t_maq_str[0]) * 3600 + (+t_maq_str[1]) * 60 + (+t_maq_str[2]);
|
||||||
|
|
||||||
linea_data = {
|
let linea_data = {
|
||||||
presupuesto_id: presupuesto_id,
|
presupuesto_id: presupuesto_id,
|
||||||
tipo: rowData.row_id,
|
tipo: rowData.row_id,
|
||||||
paginas: (rowData.row_id == 'lp_guardas') ? (($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3) ? 8 : 4) : rowData.paginas,
|
paginas: (rowData.row_id == 'lp_guardas') ? (($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3) ? 8 : 4) : rowData.paginas,
|
||||||
@ -611,31 +612,26 @@ class LineasPresupuesto {
|
|||||||
data.push(linea_data)
|
data.push(linea_data)
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
var datos = {
|
var datos = {
|
||||||
tipo: 'lineasPresupuesto',
|
tipo: 'lineasPresupuesto',
|
||||||
datos: data,
|
datos: data,
|
||||||
presupuesto_id: presupuesto_id,
|
presupuesto_id: presupuesto_id,
|
||||||
}
|
}
|
||||||
datos = Object.assign(datos, window.token_ajax);
|
|
||||||
|
|
||||||
await $.ajax({
|
await $.ajax({
|
||||||
type: 'post',
|
type: 'post',
|
||||||
url: window.routes_lp.updateDataOfPresupuestoAdmin,
|
url: '/presupuestoadmin/datatable_2',
|
||||||
|
|
||||||
data: datos,
|
data: datos,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
|
|
||||||
token = response[window.csrf_token];
|
token = response[window.csrf_token];
|
||||||
yeniden(token);
|
|
||||||
}
|
}
|
||||||
}).fail(function (jqXHR, textStatus, error) {
|
}).fail(function (jqXHR, textStatus, error) {
|
||||||
// Handle error here
|
// Handle error here
|
||||||
console.log(jqXHR)
|
console.log(jqXHR)
|
||||||
});*/
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -430,6 +430,7 @@ class ServiciosAcabado {
|
|||||||
datos.push(this.data());
|
datos.push(this.data());
|
||||||
});
|
});
|
||||||
const domain = window.location.origin;
|
const domain = window.location.origin;
|
||||||
|
const id = window.location.href.split('/').pop();
|
||||||
await fetch(domain + "/presupuestos/presupuestoacabados/edit/" + id , {
|
await fetch(domain + "/presupuestos/presupuestoacabados/edit/" + id , {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({datos: datos}),
|
body: JSON.stringify({datos: datos}),
|
||||||
@ -647,6 +648,7 @@ class ServiciosPreimpresion {
|
|||||||
datos.push(this.data());
|
datos.push(this.data());
|
||||||
});
|
});
|
||||||
const domain = window.location.origin;
|
const domain = window.location.origin;
|
||||||
|
const id = window.location.href.split('/').pop();
|
||||||
await fetch(domain + "/presupuestos/presupuestopreimpresiones/edit/" + id , {
|
await fetch(domain + "/presupuestos/presupuestopreimpresiones/edit/" + id , {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({datos: datos}),
|
body: JSON.stringify({datos: datos}),
|
||||||
@ -1028,6 +1030,7 @@ class ServiciosEncuadernacion {
|
|||||||
datos.push(this.data());
|
datos.push(this.data());
|
||||||
});
|
});
|
||||||
const domain = window.location.origin;
|
const domain = window.location.origin;
|
||||||
|
const id = window.location.href.split('/').pop();
|
||||||
await fetch(domain + "/presupuestos/presupuestoencuadernaciones/edit/" + id , {
|
await fetch(domain + "/presupuestos/presupuestoencuadernaciones/edit/" + id , {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({datos: datos}),
|
body: JSON.stringify({datos: datos}),
|
||||||
@ -1366,6 +1369,7 @@ class ServiciosManipulado {
|
|||||||
datos.push(this.data());
|
datos.push(this.data());
|
||||||
});
|
});
|
||||||
const domain = window.location.origin;
|
const domain = window.location.origin;
|
||||||
|
const id = window.location.href.split('/').pop();
|
||||||
await fetch(domain + "/presupuestos/presupuestomanipulados/edit/" + id , {
|
await fetch(domain + "/presupuestos/presupuestomanipulados/edit/" + id , {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({datos: datos}),
|
body: JSON.stringify({datos: datos}),
|
||||||
@ -1523,6 +1527,7 @@ class ServiciosExtra {
|
|||||||
datos.push(this.data());
|
datos.push(this.data());
|
||||||
});
|
});
|
||||||
const domain = window.location.origin;
|
const domain = window.location.origin;
|
||||||
|
const id = window.location.href.split('/').pop();
|
||||||
await fetch(domain + "/presupuestos/presupuestoserviciosextra/edit/" + id , {
|
await fetch(domain + "/presupuestos/presupuestoserviciosextra/edit/" + id , {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({datos: datos}),
|
body: JSON.stringify({datos: datos}),
|
||||||
|
|||||||
Reference in New Issue
Block a user