Revert "Merge branch 'feat/add-chat-presupuesto-cliente' into 'main'"

This reverts merge request !352
This commit is contained in:
Alvaro
2024-10-23 05:18:00 +00:00
parent 47e6cbb5f7
commit 7ce2723a09
147 changed files with 5666 additions and 9809 deletions

View File

@ -1,6 +1,4 @@
<?php
namespace App\Controllers\Clientes;
<?php namespace App\Controllers\Clientes;
@ -154,7 +152,7 @@ class Cliente extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message);
endif;
if ($this->request->getPost()) :
@ -312,9 +310,10 @@ class Cliente extends \App\Controllers\BaseResourceController
$onlyActiveOnes = false;
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
$onlyActiveOnes = false;
try {
try{
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr);
} catch (Exception $e) {
}
catch(Exception $e){
$menu = [];
}
@ -331,28 +330,6 @@ class Cliente extends \App\Controllers\BaseResourceController
}
public function getSelect2()
{
if ($this->request->isAJAX()) {
$query = $this->model->builder()->select(
[
"id",
"nombre as name"
]
)->where("deleted_at", null);
if ($this->request->getGet("q")) {
$query->groupStart()
->orLike("clientes.nombre", $this->request->getGet("q"))
->groupEnd();
}
return $this->response->setJSON($query->get()->getResultObject());
} else {
return $this->failUnauthorized('Invalid request', 403);
}
}
protected function getPaisListItems($selId = null)
{
$paisModel = model('App\Models\Configuracion\PaisModel');
@ -446,23 +423,24 @@ class Cliente extends \App\Controllers\BaseResourceController
}
protected function getPrecioTemplate($cliente_id)
{
protected function getPrecioTemplate($cliente_id){
$modelPreciosCliente = model('App\Models\Clientes\ClientePreciosModel');
$plantilla_id = $modelPreciosCliente->get_plantilla_precios($cliente_id);
if (is_null($plantilla_id)) {
if (is_null($plantilla_id)){
return null;
}
$modelPlantillaPreciosCliente = model('App\Models\Clientes\ClientePlantillaPreciosModel');
$plantilla = $modelPlantillaPreciosCliente->where("id", $plantilla_id)->where("is_deleted", 0)->first();
if ($plantilla == false) {
if ($plantilla == false){
return null;
} else {
}
else{
return (object)array(
"value" => $plantilla_id,
"label" => $plantilla->nombre
);
}
}
}