editar factura

This commit is contained in:
2024-07-07 19:25:39 +02:00
parent c7d8d0c5cc
commit 5605a88846
21 changed files with 1132 additions and 31 deletions

View File

@ -315,4 +315,21 @@ class ClienteModel extends \App\Models\BaseModel
public function creditoDisponible($cliente_id){
return true;
}
public function getClienteDataFacturas($cliente_id){
$builder = $this->db
->table($this->table . " t1")
->select(
"
t1.nombre AS cliente_nombre, t1.direccion AS cliente_address, t1.cif AS cliente_cif,
t2.nombre AS cliente_pais, t1.cp AS cliente_cp, t1.ciudad AS cliente_ciudad,
t3.nombre AS cliente_provincia, t1.credito_asegurado AS creditoAsegurado"
)
->where("t1.is_deleted", 0)
->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();
}
}