mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
diseño interior con selector de papeles
This commit is contained in:
@ -303,12 +303,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$lomoRedondo = $cubierta['lomoRedondo'] ?? 0;
|
||||
|
||||
if ($papelInteriorDiferente) {
|
||||
$papel['negro'] = $modelPapelGenerico->getIdFromCode($interior['papelInterior']['negro']);
|
||||
$papel['color'] = $modelPapelGenerico->getIdFromCode($interior['papelInterior']['color']);
|
||||
$papel['negro'] = $modelPapelGenerico->where('id', $interior['papelInterior']['negro'])->first()->toArray();
|
||||
$papel['color'] = $modelPapelGenerico->where('id', $interior['papelInterior']['color'])->first()->toArray();
|
||||
$gramaje['negro'] = intval($interior['gramajeInterior']['negro']);
|
||||
$gramaje['color'] = intval($interior['gramajeInterior']['color']);
|
||||
} else {
|
||||
$papel = $modelPapelGenerico->getIdFromCode($interior['papelInterior']);
|
||||
$papel = $modelPapelGenerico->where('id', $interior['papelInterior'])->first()->toArray();
|
||||
$gramaje = intval($interior['gramajeInterior']);
|
||||
}
|
||||
// Interior
|
||||
@ -464,7 +464,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
|
||||
return $this->respond($return_data);
|
||||
} catch (Exception $e) {
|
||||
return $this->failServerError($e->getMessage());
|
||||
return $this->failServerError($e->getMessage() . ' - ' . $e->getFile() . ' - ' . $e->getLine());
|
||||
}
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
@ -673,12 +673,12 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$tipo_impresion_id = $this->getTipoImpresion($tipo, $cubierta['tipoCubierta']);
|
||||
|
||||
if ($papelInteriorDiferente) {
|
||||
$papel['negro'] = $modelPapelGenerico->getIdFromCode($interior['papelInterior']['negro']);
|
||||
$papel['color'] = $modelPapelGenerico->getIdFromCode($interior['papelInterior']['color']);
|
||||
$papel['negro'] = $modelPapelGenerico->where('id', $interior['papelInterior']['negro'])->first()->toArray();
|
||||
$papel['color'] = $modelPapelGenerico->where('id', $interior['papelInterior']['color'])->first()->toArray();
|
||||
$gramaje['negro'] = intval($interior['gramajeInterior']['negro']);
|
||||
$gramaje['color'] = intval($interior['gramajeInterior']['color']);
|
||||
} else {
|
||||
$papel = $modelPapelGenerico->getIdFromCode($interior['papelInterior']);
|
||||
$papel = $modelPapelGenerico->where('id', $interior['papelInterior'])->first()->toArray();
|
||||
$gramaje = intval($interior['gramajeInterior']);
|
||||
}
|
||||
// Interior
|
||||
@ -1288,7 +1288,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$coste = 0;
|
||||
$margen = 0;
|
||||
|
||||
if ($data > 0) {
|
||||
if (count($data) > 0) {
|
||||
$peso_envio = round(floatval($peso * $unidades / 1000.0)); // peso libro * unidades y se pasa a kilogramos
|
||||
$tarifas_envio = $modelTarifaEnvio->getTarifaEnvio($data[0]->pais_id, $data[0]->cp, $peso_envio, $entregaPieCalle ? 'palets' : 'cajas');
|
||||
for ($i = 0; $i < count($tarifas_envio); $i++) {
|
||||
@ -2300,13 +2300,16 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
if ($linea->tipo == 'lp_bn' || $linea->tipo == 'lp_bnhq' || $linea->tipo == 'lp_rot_bn') {
|
||||
$return_data['interior']['negro']['tipo'] = $linea->tipo == 'lp_bn' || $linea->tipo == 'lp_rot_bn' ? 'negroEstandar' : 'negroPremium';
|
||||
$return_data['interior']['negro']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['interior']['negro']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['interior']['negro']['gramaje'] = $linea->gramaje;
|
||||
} else if ($linea->tipo == 'lp_color' || $linea->tipo == 'lp_colorhq' || $linea->tipo == 'lp_rot_color') {
|
||||
$return_data['interior']['color']['tipo'] = $linea->tipo == 'lp_color' || $linea->tipo == 'lp_rot_color' ? 'colorEstandar' : 'colorPremium';
|
||||
$return_data['interior']['color']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['interior']['color']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['interior']['color']['gramaje'] = $linea->gramaje;
|
||||
} else if ($linea->tipo == 'lp_cubierta') {
|
||||
$return_data['cubierta']['papel'] = $modelPapelGenerico->getCodeFromId($linea->papel_id);
|
||||
$return_data['cubierta']['papel']['id'] = $linea->papel_id;
|
||||
$return_data['cubierta']['gramaje'] = $linea->gramaje;
|
||||
$return_data['cubierta']['paginas'] = $linea->paginas;
|
||||
} else if ($linea->tipo == 'lp_sobrecubierta') {
|
||||
|
||||
Reference in New Issue
Block a user