Compare commits

...

4 Commits

  1. 2
      Contracts/Catalogos/ITabuladorRepository.cs
  2. 6
      Controllers/Catalogos/TabuladorController.cs
  3. 3
      Models/Catalogos/Tabulador.cs
  4. 1
      Models/Catalogos/TabuladorDetalle.cs
  5. 1
      Models/Corresponsales/IPrecuenta.cs
  6. 1
      Repository/Catalogos/TabuladorDetalleRepository.cs
  7. 8
      Repository/Catalogos/TabuladorRepository.cs

@ -3,7 +3,7 @@ namespace CORRESPONSALBackend.Contracts.Catalogos
{ {
public interface ITabuladorRepository public interface ITabuladorRepository
{ {
public Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente); public Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal);
public Task<Tabulador> Append(Tabulador data); public Task<Tabulador> Append(Tabulador data);
public Task Delete(int id); public Task Delete(int id);
} }

@ -22,16 +22,16 @@ namespace CORRESPONSALBackend.Controllers.Catalogos
[HttpGet] [HttpGet]
[Route("getAll")] [Route("getAll")]
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente) public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal)
{ {
return await _Repo.GetAll(id, IdCliente); return await _Repo.GetAll(id, IdCliente, idCorresponsal);
} }
[HttpGet] [HttpGet]
[Route("getByCustomer")] [Route("getByCustomer")]
public async Task<IEnumerable<Tabulador>> GetByCustomer(int IdCliente) public async Task<IEnumerable<Tabulador>> GetByCustomer(int IdCliente)
{ {
return await _Repo.GetAll(0, IdCliente); return await _Repo.GetAll(0, IdCliente, 0);
} }

@ -6,5 +6,8 @@
public string Nombre { set; get; } = null!; public string Nombre { set; get; } = null!;
public int IdCliente { set; get; } = 0; public int IdCliente { set; get; } = 0;
public Boolean Activo { set; get; } = true; public Boolean Activo { set; get; } = true;
public int? IdCorresponsal {get;set;} = null;
public int? Tipo {get; set;} = 0;
public int? Moneda {get; set;} = 0;
} }
} }

@ -8,5 +8,6 @@
public string? Concepto { set; get; } = null!; public string? Concepto { set; get; } = null!;
public double Costo { set; get; } = 0; public double Costo { set; get; } = 0;
public int Activo { set; get; } = 0; public int Activo { set; get; } = 0;
public double CostoCorresponsal { set; get; } = 0;
} }
} }

@ -9,5 +9,6 @@
public string Concepto { get; set; } = null!; public string Concepto { get; set; } = null!;
public double Costo { get; set; } = 0; public double Costo { get; set; } = 0;
public byte Activo { get; set; } = 0; public byte Activo { get; set; } = 0;
public double CostoCorresponsal {get; set;} = 0;
} }
} }

@ -21,6 +21,7 @@ namespace CORRESPONSALBackend.Repository.Catalogos
data.IdTabulador, data.IdTabulador,
data.IdConcepto, data.IdConcepto,
data.Costo, data.Costo,
data.CostoCorresponsal
}, },
commandType: CommandType.StoredProcedure); commandType: CommandType.StoredProcedure);
return entrada; return entrada;

@ -12,14 +12,15 @@ namespace CORRESPONSALBackend.Repository.Catalogos
private readonly DapperContext _context; private readonly DapperContext _context;
public TabuladorRepository(DapperContext context) { _context = context; } public TabuladorRepository(DapperContext context) { _context = context; }
public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente) public async Task<IEnumerable<Tabulador>> GetAll(int id, int IdCliente, int? idCorresponsal)
{ {
var query = "[Catalogo.Tabulador.Get]"; var query = "[Catalogo.Tabulador.Get]";
using var connection = _context.CreateConnection(); using var connection = _context.CreateConnection();
var entrada = await connection.QueryAsync<Tabulador>(query, new var entrada = await connection.QueryAsync<Tabulador>(query, new
{ {
@id = id, @id = id,
@IdCliente = IdCliente @IdCliente = IdCliente,
@IdCorresponsal = idCorresponsal
}, },
commandType: CommandType.StoredProcedure); commandType: CommandType.StoredProcedure);
return entrada; return entrada;
@ -35,6 +36,9 @@ namespace CORRESPONSALBackend.Repository.Catalogos
data.id, data.id,
data.Nombre, data.Nombre,
data.IdCliente, data.IdCliente,
data.IdCorresponsal,
data.Tipo,
data.Moneda
}, },
commandType: CommandType.StoredProcedure); commandType: CommandType.StoredProcedure);
return entrada.First(); return entrada.First();

Loading…
Cancel
Save