mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadido CRUD para formas de pago
This commit is contained in:
@ -257,7 +257,7 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
LEFT JOIN lg_paises t4 ON t1.pais_id = t4.id
|
||||
LEFT JOIN users t5 ON t1.comercial_id = t5.id
|
||||
LEFT JOIN users t6 ON t1.soporte_id = t6.id
|
||||
LEFT JOIN lg_formas_pago t7 ON t1.forma_pago_id = t7.id";
|
||||
LEFT JOIN formas_pago t7 ON t1.forma_pago_id = t7.id";
|
||||
if (!is_null($limit) && intval($limit) > 0) {
|
||||
$sql .= " LIMIT " . intval($limit);
|
||||
}
|
||||
@ -287,7 +287,7 @@ class ClienteModel extends \App\Models\BaseModel
|
||||
)
|
||||
->where("is_deleted", 0);;
|
||||
$builder->join("users t5", "t1.comercial_id = t5.id", "left");
|
||||
$builder->join("lg_formas_pago t7", "t1.forma_pago_id = t7.id", "left");
|
||||
$builder->join("formas_pago t7", "t1.forma_pago_id = t7.id", "left");
|
||||
|
||||
|
||||
return empty($search)
|
||||
|
||||
@ -15,8 +15,6 @@ class FormaPagoModel extends \App\Models\BaseModel
|
||||
const SORTABLE = [
|
||||
1 => "t1.id",
|
||||
2 => "t1.nombre",
|
||||
3 => "t1.created_at",
|
||||
4 => "t1.updated_at",
|
||||
];
|
||||
|
||||
protected $allowedFields = ["nombre"];
|
||||
@ -26,15 +24,15 @@ class FormaPagoModel extends \App\Models\BaseModel
|
||||
|
||||
protected $validationRules = [
|
||||
"nombre" => [
|
||||
"label" => "FormasPagoes.nombre",
|
||||
"label" => "FormasPago.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"nombre" => [
|
||||
"max_length" => "FormasPagoes.validation.nombre.max_length",
|
||||
"required" => "FormasPagoes.validation.nombre.required",
|
||||
"max_length" => "FormasPago.validation.nombre.max_length",
|
||||
"required" => "FormasPago.validation.nombre.required",
|
||||
],
|
||||
];
|
||||
|
||||
@ -61,7 +59,7 @@ class FormaPagoModel extends \App\Models\BaseModel
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select("t1.id AS id, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at");
|
||||
->select("t1.id AS id, t1.nombre AS nombre");
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
@ -69,12 +67,6 @@ class FormaPagoModel extends \App\Models\BaseModel
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
||||
", t2.nombre AS cliente, t3.nombre AS forma_pago, t4.nombre AS tipo_impresion, t5.nombre AS tipologia, t6.nombre AS pais, t7.estado AS estado, t8.id AS papel_formato, t9.first_name AS total_confirmado_user, t10.first_name AS aprobado_user FROM " .
|
||||
$this->table .
|
||||
" t1 LEFT JOIN clientes
|
||||
t2 ON t1.cliente_id = t2.id LEFT JOIN lg_formas_pago
|
||||
t2 ON t1.cliente_id = t2.id LEFT JOIN formas_pago
|
||||
t3 ON t1.forma_pago_id = t3.id LEFT JOIN lg_tipos_impresion
|
||||
t4 ON t1.tipo_impresion_id = t4.id LEFT JOIN lg_tipologias_libros
|
||||
t5 ON t1.tipologia_id = t5.id LEFT JOIN lg_paises
|
||||
|
||||
Reference in New Issue
Block a user