mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado tiradas
This commit is contained in:
@ -339,6 +339,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['papelGenericoRotativaNegroList'] = $this->getPapelGenericoRotativaNegro();
|
$this->viewData['papelGenericoRotativaNegroList'] = $this->getPapelGenericoRotativaNegro();
|
||||||
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
||||||
|
|
||||||
|
$this->viewData['direccionesList'] = $this->getDirecciones($id);
|
||||||
|
|
||||||
// Acabados exteriores
|
// Acabados exteriores
|
||||||
$this->viewData['acabadosCubierta'] = $this->getAcabadosCubierta();
|
$this->viewData['acabadosCubierta'] = $this->getAcabadosCubierta();
|
||||||
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
||||||
@ -1295,4 +1297,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$model = model('App\Models\Configuracion\ConfiguracionSistemaModel');
|
$model = model('App\Models\Configuracion\ConfiguracionSistemaModel');
|
||||||
return $model->getPOD();
|
return $model->getPOD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getDirecciones($presupuesto_id){
|
||||||
|
$model = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||||
|
return $model->where('presupuesto_id', $presupuesto_id)->findAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,9 +59,6 @@ async function get_coste_envio_tiradasAlternativas(tirada){
|
|||||||
const peso_envio = cantidad*peso_libro/1000.0;
|
const peso_envio = cantidad*peso_libro/1000.0;
|
||||||
const datos_tarifa = await get_precio_envio(peso_envio, rowData.paisId, rowData.cp, parseInt(rowData.entregaPieCalle)==1?'palets':'cajas');
|
const datos_tarifa = await get_precio_envio(peso_envio, rowData.paisId, rowData.cp, parseInt(rowData.entregaPieCalle)==1?'palets':'cajas');
|
||||||
|
|
||||||
console.log({porcentaje, cantidad, tirada, tirada_inicial});
|
|
||||||
|
|
||||||
|
|
||||||
if(datos_tarifa.id!=null){
|
if(datos_tarifa.id!=null){
|
||||||
|
|
||||||
if(peso_envio>parseFloat(datos_tarifa.peso_max)){
|
if(peso_envio>parseFloat(datos_tarifa.peso_max)){
|
||||||
@ -307,8 +304,8 @@ var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
|||||||
{ 'data': 'municipio' },
|
{ 'data': 'municipio' },
|
||||||
{ 'data': 'paisId' ,
|
{ 'data': 'paisId' ,
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
var value = window.paisList.find(element => element.id === data);
|
var pais = window.paisList.find(element => element.id == data);
|
||||||
return value['nombre'];
|
return pais['nombre'];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ 'data': 'telefono' },
|
{ 'data': 'telefono' },
|
||||||
@ -383,54 +380,40 @@ function save_datos_envios(){
|
|||||||
|
|
||||||
function load_datos_envios(){
|
function load_datos_envios(){
|
||||||
|
|
||||||
const url = window.location.href;
|
window.direccionesList.forEach((linea) => {
|
||||||
const url_parts = url.split('/');
|
tableEnvios.row
|
||||||
if(url_parts[url_parts.length-2] == 'edit'){
|
.add({
|
||||||
const id = url_parts[url_parts.length-1];
|
'tarifa_id': linea.tarifa_id,
|
||||||
}
|
'cantidad': linea.cantidad,
|
||||||
else{
|
'peso': linea.peso,
|
||||||
const id = -1;
|
'att': linea.att,
|
||||||
}
|
'email': linea.email,
|
||||||
|
'direccion': linea.direccion,
|
||||||
$.post( window.routes_envios.dataTableOfPresupuestoDirecciones,
|
'cp': linea.cp,
|
||||||
Object.assign({
|
'municipio': linea.municipio,
|
||||||
draw: 1,
|
'provincia': linea.provincia,
|
||||||
columns: 1,
|
'paisId': linea.pais_id,
|
||||||
search: {value: ""},
|
'telefono': linea.telefono,
|
||||||
presupuesto_id: id},
|
'proveedor': linea.proveedor,
|
||||||
window.token_ajax))
|
'proveedor_id': linea.proveedor_id,
|
||||||
.done(function( data ) {
|
'precio': linea.precio,
|
||||||
data.data.forEach((linea) => {
|
'margen': linea.margen,
|
||||||
tableEnvios.row
|
'entregaPieCalle': linea.entregaPieCalle,
|
||||||
.add({
|
'actionBtns_direcciones': actionBtns_direcciones,
|
||||||
'tarifa_id': linea.tarifa_id,
|
|
||||||
'cantidad': linea.cantidad,
|
|
||||||
'peso': linea.peso,
|
|
||||||
'att': linea.att,
|
|
||||||
'email': linea.email,
|
|
||||||
'direccion': linea.direccion,
|
|
||||||
'cp': linea.cp,
|
|
||||||
'municipio': linea.municipio,
|
|
||||||
'provincia': linea.provincia,
|
|
||||||
'paisId': linea.pais_id,
|
|
||||||
'telefono': linea.telefono,
|
|
||||||
'proveedor': linea.proveedor,
|
|
||||||
'proveedor_id': linea.proveedor_id,
|
|
||||||
'precio': linea.precio,
|
|
||||||
'margen': linea.margen,
|
|
||||||
'entregaPieCalle': linea.entregaPieCalle,
|
|
||||||
'actionBtns_direcciones': actionBtns_direcciones,
|
|
||||||
})
|
|
||||||
.draw();
|
|
||||||
checkInsertar()
|
|
||||||
|
|
||||||
updatePresupuesto({
|
|
||||||
update_lineas: false,
|
|
||||||
update_servicios: false,
|
|
||||||
update_envios: false,
|
|
||||||
update_resumen: true,
|
|
||||||
update_tiradas_alternativas: false
|
|
||||||
})
|
})
|
||||||
});
|
.draw();
|
||||||
})
|
checkInsertar()
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
updatePresupuesto({
|
||||||
|
update_lineas: false,
|
||||||
|
update_servicios: false,
|
||||||
|
update_envios: false,
|
||||||
|
update_resumen: true,
|
||||||
|
update_tiradas_alternativas: false
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,7 @@
|
|||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
|
||||||
window.paisList = <?php echo json_encode($paisList); ?>;
|
window.paisList = <?php echo json_encode($paisList); ?>;
|
||||||
|
window.direccionesList = <?php echo json_encode($direccionesList); ?>;
|
||||||
|
|
||||||
window.routes_envios = {
|
window.routes_envios = {
|
||||||
dataTableOfPresupuestoDirecciones: '<?= route_to('dataTableOfPresupuestoDirecciones') ?>'
|
dataTableOfPresupuestoDirecciones: '<?= route_to('dataTableOfPresupuestoDirecciones') ?>'
|
||||||
@ -70,6 +71,8 @@ window.url_get_precio_envio = '<?= route_to('processDataDirecciones') ?>';
|
|||||||
window.error_no_tarifa_envio = '<?= lang('PresupuestosDirecciones.validation.no_tarifa') ?>'
|
window.error_no_tarifa_envio = '<?= lang('PresupuestosDirecciones.validation.no_tarifa') ?>'
|
||||||
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||||
|
|
||||||
load_datos_envios()
|
$( document ).ready(function() {
|
||||||
|
load_datos_envios();
|
||||||
|
});
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
Reference in New Issue
Block a user