cargando presupuesto datos generales

This commit is contained in:
2024-10-18 14:33:27 +02:00
parent 8a044d41fe
commit 464e136025
17 changed files with 12250 additions and 469 deletions

View File

@ -1,92 +0,0 @@
# safekat
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://git.imnavajas.es/jjimenez/safekat.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://git.imnavajas.es/jjimenez/safekat/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

View File

@ -1,133 +0,0 @@
Quitar Oauth
---------------------------------------------
Quitar packete con composer que se usa en la Oauth
composer remove hybridauth/hybridauth
Tablas en la BBDD.
wg_user_oauth
wg_settings_oauth
Se hace migración (hay que añadir el controlador Migrate a whiteListController)
Modelos
UserOauthModel.php
SettingsOauthModel.php
Controllers
Oauth.php
Realizar busqueda de UserOauthModel que está en varios Controllers
Buscar la variable que crea en cada controlador y ver para que la usa
Igual que la acción anterior pero con SettingsOauthModel
Está en el controlador Settings.php. Buscar la variable que crea y borrarla
Eliminar Views\themes\backend\focus2\form\settings\oauth.php
En Views\themes\backend\focus2\main\menu.
Quitar la línea php que invoca a la configuración de Oauth (site_url("settings/oauth"))
En Views\themes\frontend\tivo\main\menu.php
Quitar la línea php que invoca a la configuración de Oauth (site_url("settings/oauth"))
En en controlador Settings.php
Quitar las funciones oauth() y oauth_store()
En los idiomas quitar la key dashboard_chart_auth
En la vista quitar la carta de Solcial autenthification
<div class="col-lg-4">
<div class="card">
<div class="card-header">
<h4 class="card-title"><?=lang("App.dashboard_chart_auth")?></h4>
</div>
<div class="card-body">
<div class="row">
<div class="col-lg-12" id="ct-icon-chart"></div>
</div>
<div class="row">
<div class="col-lg-12"><div class="ct-pie-chart"></div></div>
</div>
</div>
</div>
</div>
Quitar los SMS
--------------------------------------------
Quitar packete con composer que se usa en la Oauth
twilio/sdk
Dentro de Controllers\Integration.php
Eliminar sendSMS (public y private)
Se hace migración de la BBDD
Del controlador Cron.php se elimina
la accion // Cron Notification SMS
la función test()
Del controlador Ajax.php
linea 368, quitar is_send_sms de la lista
linea 399, eliminar "is_send_sms"=>$record['is_send_sms'],
Del controlador Login.php eliminar
//Notification SMS User Welcome
//SMS Account Confirmation
Dentro de //Notification New Register, las dos líneas is_send_sms y send_sms_notification
linea 455 if($settings['send_sms_register']??false){ quitar if completo
Del controlador Notification.php
linea 117 , 148, 150
Del controlador Settings.php
linea 106, 109
De los idiomas, quitar los registros
settings_field_send_sms_register
notification_field_send_sms
Del modelo NotificationModel.php
Quitar los fields is_send_sms y send_sms_notification
Del modelo SettingsModel.php
Quitar los fields send_sms_register y send_sms_welcome
sms_gateway, sms_account_id, ,sms_auth_token, sms_info_add, sms_confirmation
De la vista Views\themes\backend\focus2\form\notification\form quitar
<div class="col-md-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.notification_field_send_sms")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_notification" name="send_sms_notification" class="custom-control-input" <?= $obj['send_sms_notification']??false ? 'checked' : ''?>>
<label for="send_sms_notification" class="custom-control-label"><?=lang("App.notification_field_send_label")?></label>
</div>
</div>
</div>
De la vista Views\themes\backend\focus2\form\notification\index.php quitar de la linea 129 { data: 'is_send_sms' },
De la vista Views\themes\backend\focus2\form\settings\index.php quitar los siguientes bloques
<div class="col-lg-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.settings_field_send_welcome_message_sms")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_welcome" name="send_sms_welcome" class="custom-control-input" <?= $obj['send_sms_welcome']??false ? 'checked' : ''?>>
<label for="send_sms_welcome" class="custom-control-label"><?=lang("App.global_activate")?></label>
</div>
</div>
</div>
y
<div class="col-lg-3">
<div class="form-group">
<label class="text-dark"><?=lang("App.settings_field_send_sms_register")?></label>
<div class="custom-control custom-switch">
<input type="checkbox" id="send_sms_register" name="send_sms_register" class="custom-control-input" <?= $obj['send_sms_register']??false ? 'checked' : ''?>>
<label for="send_sms_register" class="custom-control-label"><?=lang("App.global_activate")?></label>
</div>
</div>
</div>
En el controlador Ajax.php quitar if($records[$key]['sms_confirmed'] == 1)
En el controlador Login.php quitar
bloque // Check sms confirmed
if($confirmation['type'] == 'sms')
En el controlador Settings.php quitar
linea 104
case 'sms;
En el controlador User.php quitar linea 217 y 236
Del modelo UserModel.php quitar el campo sms_confirmed
En los idiomas buscar la key sms
En la vista Views\themes\backend\focus2\form\notification\index.php quitar linea 49
En la vista Views\themes\backend\focus2\form\settings\index.php quitar
linea 37
bloque en linea 298
linea 355
bloque en linea 679
linea 1033
En la vista Views\themes\backend\focus2\form\settings\template.php
bloque linea 87 hasta 131
En la vista Views\themes\backend\focus2\form\user\form.php
bloque linea 104 hasta 113
linea 210
Renombrar tablas a auth_ en lugar de wg_
-------------------------------------------------
La tabla wg_migrations hay que modificarla a mano.
En .env quitar el prefijo: database.default.DBPrefix =
En todos los modelos añadir auth_ al principio del nombre de la tabla

View File

@ -5,6 +5,8 @@ namespace App\Controllers\Presupuestos;
use App\Entities\Presupuestos\PresupuestoEntity;
use App\Libraries\SafekatFtpClient;
use App\Models\Collection;
use App\Models\Clientes\ClienteModel;
use App\Models\Configuracion\PapelFormatoModel;
use App\Models\Configuracion\PapelGenericoModel;
use App\Models\Configuracion\TipoPresupuestoModel;
use App\Models\Presupuestos\PresupuestoAcabadosModel;
@ -400,20 +402,35 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$coste_envio = 0.0;
foreach ($direcciones as $direccion) {
$coste_envio += $this->getCosteEnvio(
$coste_direccion = $this->getCosteEnvio(
$direccion['id'],
$return_data['peso'][$i],
$direccion['unidades'],
$direccion['entregaPalets'] == 'true' ? 1 : 0
)[0]->coste;
)[0];
if (!property_exists($coste_direccion, 'coste')) {
$return_data['errors']->envios = "No se ha podido calcular el coste de envío";
}else{
$coste_envio += $coste_direccion->coste;
}
}
$return_data['precio_u'][$i] = round(floatval($return_data['precio_u'][$i]) + $coste_envio / $tirada[$i], 4);
}
} else {
for ($i = 0; $i < count($tirada); $i++) {
$coste_envio = 0.0;
$coste_envio += $this->getCosteEnvio(null, $return_data['peso'][$i], $tirada[$i], false)[0]->coste;
$coste_direccion = $this->getCosteEnvio(null, $return_data['peso'][$i], $tirada[$i], false)[0];
if (!property_exists($coste_direccion, 'coste')) {
$return_data['errors']->envios = "No se ha podido calcular el coste de envío";
}else{
$coste_envio += $coste_direccion->coste;
}
$return_data['precio_u'][$i] = round(floatval($return_data['precio_u'][$i]) + $coste_envio / $tirada[$i], 4);
}
@ -596,6 +613,11 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$tamanio = $reqData['tamanio'];
$paginas = $reqData['paginas'] ?? 0;
$paginas_color = $reqData['paginasColor'] ?? 0;
$posPaginasColor = $reqData['posPaginasColor'] ?? "";
$papelInteriorDiferente = $reqData['papelInteriorDiferente'] ?? 0;
$paginasColorConsecutivas = $reqData['paginasColorConsecutivas'] ?? 0;
$prototipo = $reqData['prototipo'] ?? 0;
$tipo = $reqData['tipo'];
$paginasCuadernillo = $reqData['paginasCuadernillo'] ?? null;
@ -869,6 +891,8 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
if ($this->request->isAJAX()) {
$modelPapelGenerico = new PapelGenericoModel();
$modelPapelFormato = new PapelFormatoModel();
$modelCliente = new ClienteModel();
$reqData = $this->request->getPost();
@ -887,11 +911,15 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$data['datosGenerales']['ivaReducido'] = $presupuesto->iva_reducido;
$data['datosGenerales']['excluirRotativa'] = $presupuesto->excluir_rotativa;
$data['datosGenerales']['clienteId'] = $presupuesto->cliente_id;
$data['datosGenerales']['clienteNombre'] =
$data['datosGenerales']['clienteNombre'] = $modelCliente->getNombre($presupuesto->cliente_id);
model('App\Models\Clientes\ClienteModel')
->find($presupuesto->cliente_id)->nombre;
$data['datosGenerales']['papelFormatoId'] = $presupuesto->papel_formato_id;
$data['datosGenerales']['papelFormatoNombre'] = $modelPapelFormato->getNombre($presupuesto->papel_formato_id);
$data['datosGenerales']['papelFormatoPersonalizado'] = $presupuesto->papel_formato_personalizado;
$data['datosGenerales']['papelFormatoAncho'] = $presupuesto->papel_formato_ancho;
$data['datosGenerales']['papelFormatoAlto'] = $presupuesto->papel_formato_alto;
$data['datosGenerales']['papelInteriorDiferente'] = $presupuesto->papel_interior_diferente;
$data['tiradasPrecio'] = [
@ -1244,7 +1272,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$margen = 0;
if ($data > 0) {
$peso_envio = $peso * $unidades / 1000.0; // peso libro * unidades y se pasa a kilogramos
$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++) {
if ($peso_envio > $tarifas_envio[$i]->peso_max || floatval($tarifas_envio[$i]->precio_max) == 0) {
@ -1333,6 +1361,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
'guardas' => "",
'servicios' => "",
'serviciosDefecto' => "",
"envios" => "",
];
$coste_servicios = 0.0;
@ -1568,6 +1597,9 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$acabadoSobrecubierta = [];
foreach ($tarifaAcabadoSobrecubierta as $tarifa) {
// NONE
if($tarifaAcabadoSobrecubierta[0] == 0)
continue;
$model = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
$acabadoSobrecubierta = $model->getPrecioTarifa($tarifa, $datosPedido->tirada, -1, $POD);
@ -1705,7 +1737,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$margenServicios += floatval($resultado[0]->total) * floatval($resultado[0]->margen) / 100.0;
}
} else if (intval($servicio) == 9) {
// Servicios preimpresion
// Prototipo
$resultado = PresupuestoCLienteService::getServiciosExtra([
'tarifa_id' => $servicio,
]);
@ -2238,7 +2270,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$paginasColor = 0;
foreach ($lineas as $linea) {
if (strpos($linea->tipo, "lp_bn") !== false || strpos($linea->tipo, "lp_color") !== false) {
if (strpos($linea->tipo, "lp_bn") !== false || strpos($linea->tipo, "lp_bnhq") !== false) {
$paginasNegro = $linea->paginas;
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Clientes;
class ClienteModel extends \App\Models\BaseModel
@ -293,30 +294,32 @@ class ClienteModel extends \App\Models\BaseModel
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.nombre", $search)
->orLike("t1.alias", $search)
->orLike("t1.cif", $search)
->orLike("t1.email", $search)
->orLike("t1.soporte_id", $search)
->orLike("t1.forma_pago_id", $search)
->orLike("t1.vencimiento", $search)
->orLike("t5.id", $search)
->orLike("t5.first_name", $search)
->orLike("t5.last_name", $search)
->orLike("t7.id", $search)
->orLike("t7.nombre", $search)
->groupEnd();
->groupStart()
->like("t1.nombre", $search)
->orLike("t1.alias", $search)
->orLike("t1.cif", $search)
->orLike("t1.email", $search)
->orLike("t1.soporte_id", $search)
->orLike("t1.forma_pago_id", $search)
->orLike("t1.vencimiento", $search)
->orLike("t5.id", $search)
->orLike("t5.first_name", $search)
->orLike("t5.last_name", $search)
->orLike("t7.id", $search)
->orLike("t7.nombre", $search)
->groupEnd();
}
/*
TO-DO: Implementar la lógica de negocio para el crédito disponible
*/
public function creditoDisponible($cliente_id){
public function creditoDisponible($cliente_id)
{
return true;
}
public function getClienteDataFacturas($cliente_id){
public function getClienteDataFacturas($cliente_id)
{
$builder = $this->db
->table($this->table . " t1")
->select(
@ -329,27 +332,27 @@ class ClienteModel extends \App\Models\BaseModel
->where("t1.id", $cliente_id);
$builder->join("lg_paises t2", "t1.pais_id = t2.id", "left");
$builder->join("lg_provincias t3", "t1.provincia_id = t3.id", "left");
return $builder->get()->getResultArray();
}
public function getClienteDataPresupuestoPedidoFactura(int $cliente_id) : array
public function getClienteDataPresupuestoPedidoFactura(int $cliente_id): array
{
$query = $this->db
->table($this->table." t1")
->select([
"t1.id as clienteId",
"presupuestos.id as presupuestoId",
"pedidos.id as pedidoId",
"presupuesto_estados.estado as presupuestoEstado",
"facturas_pedidos_lineas.factura_id as facturaId",
->table($this->table . " t1")
->select([
"t1.id as clienteId",
"presupuestos.id as presupuestoId",
"pedidos.id as pedidoId",
"presupuesto_estados.estado as presupuestoEstado",
"facturas_pedidos_lineas.factura_id as facturaId",
])
->join("presupuestos","t1.id = presupuestos.cliente_id","left")
->join("presupuesto_estados","presupuestos.estado_id = presupuesto_estados.id","left")
->join("pedidos_linea","presupuestos.id = pedidos_linea.presupuesto_id","left")
->join("pedidos","pedidos.id = pedidos_linea.pedido_id","left")
->join("facturas_pedidos_lineas","facturas_pedidos_lineas.pedido_linea_id = pedidos_linea.id","left")
->where("t1.id",$cliente_id);
->join("presupuestos", "t1.id = presupuestos.cliente_id", "left")
->join("presupuesto_estados", "presupuestos.estado_id = presupuesto_estados.id", "left")
->join("pedidos_linea", "presupuestos.id = pedidos_linea.presupuesto_id", "left")
->join("pedidos", "pedidos.id = pedidos_linea.pedido_id", "left")
->join("facturas_pedidos_lineas", "facturas_pedidos_lineas.pedido_linea_id = pedidos_linea.id", "left")
->where("t1.id", $cliente_id);
$data = $query->get()->getResultObject();
$facturas = [];
$presupuestos = [];
@ -367,4 +370,23 @@ class ClienteModel extends \App\Models\BaseModel
return $result;
}
public function getNombre($id = -1)
{
try {
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS nombre"
)
->where("id", $id)
->where("is_deleted", 0);
return $builder->get()->getResultObject()[0]->nombre;
} catch (\Exception $e) {
return null;
}
}
}

View File

@ -1,4 +1,5 @@
<?php
namespace App\Models\Configuracion;
class PapelFormatoModel extends \App\Models\BaseModel
@ -72,21 +73,22 @@ class PapelFormatoModel extends \App\Models\BaseModel
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.ancho", $search)
->orLike("t1.alto", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t1.id", $search)
->orLike("t1.ancho", $search)
->orLike("t1.alto", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->groupEnd();
->groupStart()
->like("t1.id", $search)
->orLike("t1.ancho", $search)
->orLike("t1.alto", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t1.id", $search)
->orLike("t1.ancho", $search)
->orLike("t1.alto", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->groupEnd();
}
public function getElementsForMenu(){
public function getElementsForMenu()
{
return $this->db
->table($this->table . " t1")
->select(
@ -94,7 +96,8 @@ class PapelFormatoModel extends \App\Models\BaseModel
)->where('is_deleted', 0)->orderBy('orden_select', 'asc')->get()->getResultObject();
}
public function getElementsForMenu2($search = ""){
public function getElementsForMenu2($search = "")
{
$builder = $this->db
->table($this->table . " t1")
->select(
@ -108,9 +111,26 @@ class PapelFormatoModel extends \App\Models\BaseModel
return empty($search)
? $builder->get()->getResultObject()
: $builder
->groupStart()
->like('t1.ancho', $search)
->orLike('t1.alto', $search)
->groupEnd()->get()->getResultObject();
->groupStart()
->like('t1.ancho', $search)
->orLike('t1.alto', $search)
->groupEnd()->get()->getResultObject();
}
public function getNombre($id = -1)
{
try {
$builder = $this->db
->table($this->table . " t1")
->select(
"CONCAT(t1.ancho, ' x ', t1.alto) AS name"
)
->where('t1.id', $id);
return $builder->get()->getResultObject()[0]->name;
} catch (\Exception $e) {
return null;
}
}
}

View File

@ -256,7 +256,7 @@
</div>
</div>
<div class="col-sm-8 mt-5 mb-3 d-flex flex-column align-items-center">
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
<h3 class="mb-1 fw-bold"> Servicios extra </h3>
</div>

View File

@ -1,10 +1,18 @@
<div id="loader" class="loader" data-backdrop="static" data-keyboard="false" style="display: none;">
<div class="book">
<div class="book__pg-shadow"></div>
<div class="book__pg"></div>
<div class="book__pg book__pg--2"></div>
<div class="book__pg book__pg--3"></div>
<div class="book__pg book__pg--4"></div>
<div class="book__pg book__pg--5"></div>
<div id="loader" class="modal modal-transparent" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="loader">
<div class="book">
<div class="book__pg-shadow"></div>
<div class="book__pg"></div>
<div class="book__pg book__pg--2"></div>
<div class="book__pg book__pg--3"></div>
<div class="book__pg book__pg--4"></div>
<div class="book__pg book__pg--5"></div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,10 +0,0 @@
Database: testCI4
Usuario: testCI4
password: 1234
datos web guard:
email admin: jajaime.jim@gmail.com
password: 1234
FTP SK-IMN: pjS9~l138

View File

@ -1,71 +0,0 @@
Pasos para usar ficheros del mac
1.- Copiar controlador, modelo, vistas y entidad
2.- Copiar los ficheros de idioma. Le pone nombre raro (por ejemplo: Manipuladoes.php en lugar de Tarifamanipulado.php). Buscar y reemplazar en todos los ficheros. En este ejemplo: lang('Manipuladoes -> lang('Tarifamanipulado)
3.- Editar los idiomas
4.- En las vistas (formulario y lista) cambiar la segunda linea
Esto: <?= $this->extend("themes" . config("Basics")->theme["name"] . "/AdminLayout/defaultLayout") ?>
por esto: <?=$this->extend('themes/vuexy/main/defaultlayout') ?>
5.- En las vistas cambiar Themes por themes
6.- Quitar de la tabla la primera columna para que no se repitan los botones. Es decir:
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
<td class="align-middle text-center text-nowrap">
<?=anchor(route_to('editTarifamanipulado', $item->id), lang('Basic.global.edit'), ['class'=>'btn btn-sm btn-warning btn-edit me-1', 'data-id'=>$item->id,]); ?>
<?=anchor('#confirm2delete', lang('Basic.global.Delete'), ['class'=>'btn btn-sm btn-danger btn-delete ms-1', 'data-href'=>route_to('deleteTarifamanipulado', $item->id), 'data-bs-toggle'=>'modal', 'data-bs-target'=>'#confirm2delete']); ?>
</td>
7.- Modificar las fechas de esto: date('mm/dd/YYYY H:i' a esto date('d/m/Y H:m:s'
8.- Cambiar los botones de exportar de sitio: "dom": 'lfrtipB' por "dom": 'lfBrtip'
9.- Poner el botón de añadir debajo del h3 del card header en lugar del footer
10.- Copiar las nuevas rutas
Pasos para añadir el soft delete a una tabla
1.- En la bbdd añadir la columna is_deleted (TINYINT, 4 bits, sin signo, valor predeterminado '0')
2.- En la bbdd añadir la columna deleted_at (TIMESTAMP, permitir NULL, valor predeterminado NULL)
3.- En la entidad añadir a los atributos:
"deleted_at" => null,
"is_deleted" => 0,
4.- En el modelo. Añadir en allowedFields:
"deleted_at",
"is_deleted",
También añadir la variable protected $deletedField = 'deleted_at';
5a.- Sin lazy tables:
En el controlador:
En el index añadir debajo de $this->view..
// Se indica que este controlador trabaja con soft_delete
$this->soft_delete = true;
// Se indica el flag para los ficheros borrados
$this->delete_flag = 1;
En el edit: justo al principio
// JJO
$session = session();
debajo de $sanitizedData = $this->sanitized($postData, $nullIfEmpty);
// JJO
if(isset($this->model->user_updated_id)){
$sanitizedData['user_updated_id'] = $session->id_user;
}
5b.- Con lazy-tables:
En el modelo cambiar:
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client"
);
por
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot, t1.show_in_client AS show_in_client"
)
->where("is_deleted", 0);

View File

@ -1,12 +0,0 @@
Crear nueva rama:
git checkout -b dev/nombre_rama
Reflejar nueva rama en repositorio remoto
git push --set-upstream origin dev/nombre_rama
Commit con mensaje
git commit -am "<mensaje>"
Subir cambios de un commit
git push

View File

@ -212,7 +212,7 @@ class DatosGenerales {
// Get the selected options
const value = $("#paginasColor").val();
if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
if (parseInt(value) % 2 != 0) {
return {
valid: false,
@ -227,14 +227,14 @@ class DatosGenerales {
}
},
paginasNegro: {
validators: {
callback: {
validators: {
callback: {
message: window.translations["validation"].integer_greatherThan_0,
callback: function (input) {
// Get the selected options
const value = $("#paginasNegro").val();
if (value.length >= 0 && Number.isInteger(parseInt(value)) && parseInt(value) >= 0) {
if (parseInt(value) % 2 != 0) {
return {
valid: false,
@ -353,11 +353,28 @@ class DatosGenerales {
this.tirada3.val(parseInt(datos.tirada3));
if (datos.tirada4)
this.tirada4.val(parseInt(datos.tirada4));
if (datos.checkFormatoPersonalizado) {
this.checkFormatoPersonalizado.prop(':checked', datos.checkFormatoPersonalizado);
this.checkFormatoPersonalizado.trigger('change');
this.papel_formato_alto.val(datos.papelFormatoAlto);
this.papel_formato_ancho.val(datos.papelFormatoAncho);
}
else {
this.formatoLibro.setOption(datos.papelFormatoId, datos.papelFormatoNombre);
this.formatoLibro.setVal(datos.papelFormatoId);
}
this.cliente.setOption(datos.clienteId, datos.clienteNombre);
this.cliente.setVal(datos.clienteId);
$(this.cliente).trigger('change');
this.paginas.val(parseInt(datos.paginas));
this.paginasNegro.val(parseInt(datos.paginasNegro));
this.paginasColor.val(parseInt(datos.paginasColor));
this.paginasColor.trigger('change');
this.posPaginasColor.val(datos.posPaginasColor);
/*
@ -423,9 +440,9 @@ class DatosGenerales {
return tiradas;
}
getIsColor() {
if(this.paginasColor.val() > 0) {
if (this.paginasColor.val() > 0) {
return true;
}
return false;
@ -464,11 +481,11 @@ class DatosGenerales {
if (this.fresado.hasClass('selected') || this.cosido.hasClass('selected')) {
$('#tapaDuraLomoRedondo').removeClass('d-none');
if(this.cosido.hasClass('selected')){
if (this.cosido.hasClass('selected')) {
$('#tapaDuraLomoRedondo').addClass('selected');
this.divPaginasCuaderillo.removeClass('d-none');
}
else{
else {
this.divPaginasCuaderillo.addClass('d-none');
}
}
@ -558,7 +575,7 @@ class DatosGenerales {
$(".papel-interior").removeClass('selected');
$(".interior-color").removeClass('d-none');
this.#handleInteriorLayout('mixto');
}
else {
$(".interior-color").addClass('d-none');

View File

@ -212,12 +212,12 @@ class Direcciones {
if (unidades == null || unidades <= 0 || unidades == undefined)
return;
$('#loader').show();
$('#loader').modal('show');
let peticion = new Ajax('/misdirecciones/get/' + id, {}, {},
(response) => {
if (this.direcciones.length == 0) {
$('#loader').hide();
$('#loader').modal('hide');
if (entregaPalets) {
this.calcularPresupuesto = true;
}
@ -237,13 +237,13 @@ class Direcciones {
},
() => {
console.error('Error getting address');
$('#loader').hide();
$('#loader').modal('hide');
});
peticion.get();
} catch (e) {
console.error(e);
$('#loader').hide();
$('#loader').modal('hide');
}
}

View File

@ -39,7 +39,7 @@ class PresupuestoCliente {
this.ajax_calcular = new Ajax('/presupuestocliente/calcular',
{}, this.datos,
this.#procesarPresupuesto.bind(this),
() => { $('#loader').hide(); });
() => { $('#loader').modal('hide'); });
this.actualizarTiradasEnvio = false;
}
@ -66,12 +66,10 @@ class PresupuestoCliente {
this.btnPrev.on('click', this.#prevtStep.bind(this));
this.btnSave.on('click', this.#savePresupuesto.bind(this));
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
//this.RELLENAR_PRESUPUESTO(true);
if (window.location.href.includes("edit")) {
$(".calcular-presupuesto").off('change');
$(".calcular-presupuesto").on('change', ()=>{});
this.#cargarPresupuesto();
const successMessage = sessionStorage.getItem('message');
if (successMessage) {
@ -79,6 +77,10 @@ class PresupuestoCliente {
sessionStorage.removeItem('message');
}
}
else{
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
}
}
@ -87,7 +89,7 @@ class PresupuestoCliente {
if (event.target.id === 'divDirecciones') {
if (!this.direcciones.calcularPresupuesto) {
this.actualizarTiradasEnvio = false;
$('#loader').hide();
$('#loader').modal('hide');
return;
}
@ -108,7 +110,7 @@ class PresupuestoCliente {
if (Object.values(datos_to_check).every(this.#isValidDataForm)) {
try {
$('#loader').show();
$('#loader').modal('show');
// Si se está ejecutando la petición, abortar la petición anterior
this.ajax_calcular.abort();
@ -119,7 +121,7 @@ class PresupuestoCliente {
}
catch (e) {
console.log(e);
$('#loader').hide();
$('#loader').modal('hide');
}
}
@ -225,7 +227,7 @@ class PresupuestoCliente {
this.#getDatos(true);
try {
$('#loader').show();
$('#loader').modal('show');
if (window.location.href.includes("edit")) {
this.datos["id"] = window.location.href.split("/").pop();
@ -234,7 +236,7 @@ class PresupuestoCliente {
this.datos,
{},
(response) => {
$('#loader').hide();
$('#loader').modal('hide');
console.log(response);
if (this.datos["confirmar"] || window.location.href.includes("add")) {
sessionStorage.setItem('message', response.message);
@ -244,20 +246,20 @@ class PresupuestoCliente {
popSuccessAlert(response.message);
}
},
() => { $('#loader').hide(); }
() => { $('#loader').modal('hide'); }
).post();
}
catch (e) {
console.log(e);
$('#loader').hide();
$('#loader').modal('hide');
}
}
#procesarPresupuesto(response) {
$('#loader').hide();
$('#loader').modal('hide');
if (Object.values(response.errors).some((value) => value !== "")) {
popErrorAlert("No se ha podido calcular el presupuesto para los datos proporcionados. Por favor, póngase en contacto con el departamento comercial."
@ -336,8 +338,11 @@ class PresupuestoCliente {
tirada: this.datosGenerales.getTiradas(),
paginas: this.datosGenerales.paginas.val(),
paginasColor: this.datosGenerales.paginasColor.val(),
paginasCuadernillo: this.datosGenerales.paginasCuadernillo.val(),
posPaginasColor: this.datosGenerales.posPaginasColor.val(),
paginasColorConsecutivas: this.datosGenerales.paginasColorConsecutivas.is(':checked') ? 1 : 0,
papelInteriorDiferente: this.datosGenerales.papelDiferente.is(':checked') ? 1 : 0,
$prototipo: this.datosGenerales.prototipo.is(':checked') ? 1 : 0,
paginasCuadernillo: this.datosGenerales.paginasCuadernillo.val(),
tipo: this.datosGenerales.tiposLibro.filter('.selected').attr('id'),
@ -409,7 +414,7 @@ class PresupuestoCliente {
#cargarPresupuesto() {
$('#loader').show();
$('#loader').modal('show');
let id = window.location.href.split("/").pop()
new Ajax('/presupuestocliente/cargar/' + id,
{},
@ -423,11 +428,11 @@ class PresupuestoCliente {
*/
}
console.log(response);
$('#loader').hide();
$('#loader').modal('hide');
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
},
() => {
$('#loader').hide();
$('#loader').modal('hide');
$(".calcular-presupuesto").on('change', this.checkForm.bind(this));
}
).get();

View File

@ -1,7 +1,11 @@
.image-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
margin-bottom: 20px;
position: relative;
display: inline-block;
max-height: 150px;
max-width: 200px;
}
@ -13,19 +17,19 @@
/* Pseudo-elemento que muestra el tick */
.image-container.selected::after {
content: '✔';
/* Símbolo de tick */
content: '✔'; /* Símbolo de tick */
position: absolute;
top: 90px;
right: 25px;
top: calc(50% + 5px);
left: calc(100%/2 + 65px); /* Mueve 75px a la derecha fuera del contenedor */
font-size: 50px;
font-weight: bold;
color: green;
background-color: rgba(255, 255, 255, 0);
background-color: rgba(255, 255, 255, 0); /* Fondo transparente */
border-radius: 100%;
padding: 5px;
}
.image-presupuesto {
transition: transform 1s ease;
}
@ -88,17 +92,28 @@
color: var(--fg);
font: 1em/1.5 sans-serif;
height: 100vh;
position: fixed; /* Fijo para cubrir la pantalla */
left: 50%; /* Centramos horizontalmente */
top: 50%; /* Centramos verticalmente */
transform: translate(-50%, -50%); /* Ajuste para centrar el loader */
width: auto; /* Se ajusta automáticamente */
height: auto; /* Se ajusta automáticamente */
z-index: 9999; /* Mantener por encima de otros elementos */
display: flex; /* Para centrar contenido */
justify-content: center; /* Centrar horizontalmente */
align-items: center; /* Centrar verticalmente */
background-color: rgba(255, 255, 255, 0); /* Fondo completamente transparente */
position: fixed;
/* Fijo para cubrir la pantalla */
left: 50%;
/* Centramos horizontalmente */
top: 50%;
/* Centramos verticalmente */
transform: translate(-50%, -50%);
/* Ajuste para centrar el loader */
width: auto;
/* Se ajusta automáticamente */
height: auto;
/* Se ajusta automáticamente */
z-index: 9999;
/* Mantener por encima de otros elementos */
display: flex;
/* Para centrar contenido */
justify-content: center;
/* Centrar horizontalmente */
align-items: center;
/* Centrar verticalmente */
background-color: rgba(255, 255, 255, 0);
/* Fondo completamente transparente */
}
.book,

View File

@ -1,38 +0,0 @@
@echo off
REM Obtener la fecha y hora actual
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a
set year=%datetime:~0,4%
set month=%datetime:~4,2%
set day=%datetime:~6,2%
set hour=%datetime:~8,2%
set minute=%datetime:~10,2%
set second=%datetime:~12,2%
REM Formatear la fecha y hora
set fecha_hora=%year%-%month%-%day% %hour%:%minute%:%second%
REM Mensaje de commit automático
set mensaje_automatico=Actualizacion automatica: %fecha_hora%
REM Solicitar al usuario un mensaje personalizado
set /p mensaje_usuario=Ingrese un mensaje personalizado (o presione Enter para el automatico):
REM Utilizar el mensaje automático si no se proporciona uno
if "%mensaje_usuario%"=="" (
set mensaje_commit=%mensaje_automatico%
) else (
set mensaje_commit=%mensaje_usuario%
)
REM Añadir todos los cambios al área de preparación
git add .
REM Realizar el commit con el mensaje seleccionado
git commit -m "%mensaje_commit%"
REM Subir al respositorio remoto
git push
REM Imprimir mensaje informativo
echo Se ha realizado el commit con el mensaje: %mensaje_commit%

Binary file not shown.

File diff suppressed because one or more lines are too long