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['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
||||
|
||||
$this->viewData['direccionesList'] = $this->getDirecciones($id);
|
||||
|
||||
// Acabados exteriores
|
||||
$this->viewData['acabadosCubierta'] = $this->getAcabadosCubierta();
|
||||
$this->viewData['acabadosSobrecubierta'] = $this->getAcabadosSobrecubierta();
|
||||
@ -1295,4 +1297,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$model = model('App\Models\Configuracion\ConfiguracionSistemaModel');
|
||||
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 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(peso_envio>parseFloat(datos_tarifa.peso_max)){
|
||||
@ -307,8 +304,8 @@ var tableEnvios = $('#tableOfDireccionesEnvio').DataTable( {
|
||||
{ 'data': 'municipio' },
|
||||
{ 'data': 'paisId' ,
|
||||
render: function(data, type, row, meta) {
|
||||
var value = window.paisList.find(element => element.id === data);
|
||||
return value['nombre'];
|
||||
var pais = window.paisList.find(element => element.id == data);
|
||||
return pais['nombre'];
|
||||
},
|
||||
},
|
||||
{ 'data': 'telefono' },
|
||||
@ -383,54 +380,40 @@ function save_datos_envios(){
|
||||
|
||||
function load_datos_envios(){
|
||||
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
const id = url_parts[url_parts.length-1];
|
||||
}
|
||||
else{
|
||||
const id = -1;
|
||||
}
|
||||
|
||||
$.post( window.routes_envios.dataTableOfPresupuestoDirecciones,
|
||||
Object.assign({
|
||||
draw: 1,
|
||||
columns: 1,
|
||||
search: {value: ""},
|
||||
presupuesto_id: id},
|
||||
window.token_ajax))
|
||||
.done(function( data ) {
|
||||
data.data.forEach((linea) => {
|
||||
tableEnvios.row
|
||||
.add({
|
||||
'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
|
||||
window.direccionesList.forEach((linea) => {
|
||||
tableEnvios.row
|
||||
.add({
|
||||
'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
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -61,6 +61,7 @@
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
window.paisList = <?php echo json_encode($paisList); ?>;
|
||||
window.direccionesList = <?php echo json_encode($direccionesList); ?>;
|
||||
|
||||
window.routes_envios = {
|
||||
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.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
|
||||
|
||||
load_datos_envios()
|
||||
$( document ).ready(function() {
|
||||
load_datos_envios();
|
||||
});
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user