diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index a89c07bd9..262651cb4 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -11067,6 +11067,7 @@ Public Class ClsPaginas
'Reportes de Anticipos-NC-IXC
PaginaDict.Add("/Ventas/RepAnticipo-NC-IXC.aspx".ToUpper(), 869)
PaginaDict.Add("/Ventas/RepAnticipo-NC-IXCDetalle.aspx".ToUpper(), 869)
+ PaginaDict.Add("/Ventas/RepAnticipo-NC-IXCAplicados.aspx".ToUpper(), 877)
PaginaDict.Add("/Ventas/CatAutorizacionDescuentos.aspx".ToUpper(), 1037)
PaginaDict.Add("/Ventas/RepPUESinPago.aspx".ToUpper(), 672)
PaginaDict.Add("/Ventas/RepVentasResumen.aspx".ToUpper(), 674)
diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb
index 223f40d59..9250bda95 100644
--- a/App_Code/ClsVentas.vb
+++ b/App_Code/ClsVentas.vb
@@ -4771,6 +4771,31 @@ Public Class ClsVentas
Return Retorno
End Function
+ Public Function GetRepAnticiposNCIXCAplicados(CveCliente As Integer, CveSubProyecto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, FechaICorte As Date, FechaFCorte As Date, TipoCambio As Integer, TCEspecifico As Double, Optional CveVendedor As Integer = -1, Optional ConSaldo As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Vta_RepAnt-NC-IXCAplicadosGet")
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@FechaI", SqlDbType.Date).Value = FechaI
+ .Add("@FechaF", SqlDbType.Date).Value = FechaF
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@FechaICorte", SqlDbType.Date).Value = FechaICorte
+ .Add("@FechaFCorte", SqlDbType.Date).Value = FechaFCorte
+ .Add("@TipoCambio", SqlDbType.Int).Value = TipoCambio
+ .Add("@TCEspecifico", SqlDbType.Float).Value = TCEspecifico
+ .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor
+ .Add("@ConSaldo", SqlDbType.Int).Value = ConSaldo
+ End With
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener el reporte de aplicaiones de anticipos - nc - ixc .", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+ Return Retorno
+ End Function
+
Public Function GetRepAnticiposNCIXCDetalle(CveCliente As Integer, CveSubProyecto As Integer, FechaI As Date, FechaF As Date, CveEmpresa As Integer, ConSaldo As Integer, Tipo As Integer, CveMoneda As Integer, FechaICorte As Date, FechaFCorte As Date, TipoCambio As Integer, TCEspecifico As Double, Optional CveVendedor As Integer = -1,
Optional SaldoMayorA As Decimal = -999999999999, Optional SaldoMenorA As Decimal = 999999999999) As Boolean
Dim Retorno As Boolean = False
diff --git a/Bancos/RepCortes.aspx.vb b/Bancos/RepCortes.aspx.vb
index 5827880e9..75c14e827 100644
--- a/Bancos/RepCortes.aspx.vb
+++ b/Bancos/RepCortes.aspx.vb
@@ -200,32 +200,7 @@ Partial Class Bancos_RepCortes
Fecha = gvr.DataKey("FechaInicial")
Nombre = gvr.DataKey("Nombre")
- 'If ObjPuntoVenta.GetCortesDetalleVentas(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, 2) Then
- ' DtCortesVentas = ObjPuntoVenta.DtResultados.Copy()
- ' GvD.DataSource = DtCortesVentas
-
- ' divDetalle.Visible = True
- 'End If
-
- 'If ObjVentas.GetCortesDetalleVentasResumen(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
- ' GvP.DataSource = ObjVentas.DtResultados
- ' DtCortesVentasResumen = ObjVentas.DtResultados
- 'End If
-
- 'If UsuarioActual.CveEmpresa.Contiene(190, 192) Then
- ' DivIVA.Visible = True
- ' If ObjVentas.GetCortesDetalleVentasResumenIVA(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
- ' GvPorIVA.DataSource = ObjVentas.DtResultados
- ' End If
- 'End If
- Dim FechaConsulta = ModExtensiones.MaxFecha
-
- Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
-
- If ConsultaPorSucursal Then
- 'CveCorte = -1
- FechaConsulta = gvr.DataKey("FechaInicial").ToDate()
- End If
+ Dim FechaConsulta = gvr.DataKey("FechaInicial").ToDate()
Dim ObjVentas As New ClsVentas
If ObjVentas.GetVta_ReporteCortesDetalle(CveCorte, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, Opcion:=2, ConsultaIVA:=UsuarioActual.CveEmpresa.Contiene(190, 192), FechaConsulta:=FechaConsulta) Then
diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index b81b0efbe..b518789fa 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -1736,20 +1736,13 @@ Partial Class PopUpVerFactura
Dim OpcionDetallado As Integer = 1
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(197, 189) Then OpcionDetallado = 2
- Dim ConsultaPorSucursal As Boolean = UsuarioActual.Empresa.Funcionalidad(382) = "1"
-
- If ConsultaPorSucursal Then
- 'SI NO TIENE ESTOS VALORES, SARCALOS DEL CORTE
- If CveCorte > 0 AndAlso (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then
- Using ObjVta As New ClsPuntoVenta
- If ObjVta.GetVta_Cortes("-1", "-1", -1, CveCorte, UsuarioActual.CveEmpresa, -1) AndAlso ObjVta.DtResultados.Rows.Count > 0 Then
- FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date
- CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero()
- End If
- End Using
- End If
-
- 'CveCorte = -1
+ If CveCorte > 0 AndAlso (FechaConsulta = ModExtensiones.MaxFecha OrElse CveSubProyecto <= 0) Then
+ Using ObjVta As New ClsPuntoVenta
+ If ObjVta.GetVta_Cortes("-1", "-1", -1, CveCorte, UsuarioActual.CveEmpresa, -1) AndAlso ObjVta.DtResultados.Rows.Count > 0 Then
+ FechaConsulta = ObjVta.DtResultados.FiltroPrimeroValor("FechaInicial").ToString().ToDate().Date
+ CveSubProyecto = ObjVta.DtResultados.FiltroPrimeroValor("CveSubProyecto").ToEntero()
+ End If
+ End Using
End If
Dim ObjVenta As New ClsVentas
@@ -1774,16 +1767,9 @@ Partial Class PopUpVerFactura
End If
If UsuarioActual.Empresa.Funcionalidad(109) = "1" OrElse UsuarioActual.CveEmpresa.Contiene(189, 197) Then
- If ConsultaPorSucursal Then
- If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
- DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
- Fecha = FechaConsulta.ToString("dd/MM/yyyy")
- End If
- Else
- If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, MinFecha, MaxFecha, CveSubProyecto, CveCorte:=CveCorte) Then
- DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("CveCorte > 0")
- Fecha = DtReporteCorte.FiltroPrimeroValor("FechaInicial", "")
- End If
+ If ObjVenta.GetVta_ReporteCortes(UsuarioActual.CveEmpresa, FechaConsulta, FechaConsulta, CveSubProyecto) Then
+ DtReporteCorte = ObjVenta.DtResultados.FiltraParametros("FechaInicial IS NOT NULL")
+ Fecha = FechaConsulta.ToString("dd/MM/yyyy")
End If
If ObjVenta.GetVta_MovimientosCajas(CveCorte, -1, CveSubProyecto:=CveSubProyecto, FechaConsulta:=FechaConsulta) Then
@@ -1799,7 +1785,7 @@ Partial Class PopUpVerFactura
Dim FechaCorte As String = $" Fecha fin {Fecha}"
- If ConsultaPorSucursal Then
+ If OpcionDetallado = 2 Then
FechaCorte = $" Fecha: {Fecha}"
End If
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 92714d0e2..0a8cb9485 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -4888,7 +4888,8 @@ Partial Class Clientes
ImporteAplicar = Importe
CveVenta = Gvr.DataKey("CveVenta").ToEntero()
- If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar * -1, ImporteAplicar * -1, 12, "Traspaso de saldos de anticipos", "Traspaso de saldos de anticipos", CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), CveVenta:=CveVenta) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImporteAplicar, ImporteAplicar * -1, 91, "Traspaso de saldos de anticipos", "Traspaso de saldos de anticipos",
+ CveCliente:=Gvr.DataKey("CveCliente").ToEntero(), CveIE:=Gvr.DataKey("CveIE").ToEntero(), CveVenta:=CveVenta, CveVentaAmortizacion:=CveVenta) Then
TieneError = True
End If
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
index cc878b939..881be80e9 100644
--- a/Ventas/PVCobranza.aspx.vb
+++ b/Ventas/PVCobranza.aspx.vb
@@ -963,6 +963,13 @@ Partial Class Ventas_PVCobranza
Else
'SI NO TIENE SALDO PENDIENTE NO GENERAR POLIZA PARA EL PAGO
RegistrarPago = False
+
+ If DebeTenerCorteCaja Then
+ If MsgError = "" AndAlso Not ObjVentas2.UpdateVentaCorte(CveVenta, UsuarioActual.CveEmpresa, tCveCorte) Then
+ MsgError = "Error al aplicar el corte"
+ End If
+ End If
+
End If
End If
Catch ex As Exception
@@ -1452,7 +1459,7 @@ Partial Class Ventas_PVCobranza
ObjFactura.CveVendedor = CveVendedor
ObjFactura.ObservacionesAlmacen = ObservacionesAlmacen
- ObjFactura.Observaciones = Observaciones
+ ObjFactura.Observaciones = $"Remisión: {VentaRemision.SerieFolio} {Observaciones}"
ObjFactura.PedidoContrato = PedidoContrato
ObjFactura.OrdenCompra = OrdenCompra
diff --git a/Ventas/RepAnticipo-NC-IXCAplicados.aspx b/Ventas/RepAnticipo-NC-IXCAplicados.aspx
new file mode 100644
index 000000000..c47a680dd
--- /dev/null
+++ b/Ventas/RepAnticipo-NC-IXCAplicados.aspx
@@ -0,0 +1,182 @@
+<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="RepAnticipo-NC-IXCAplicados.aspx.cs" Inherits="Ventas_RepAnticipo_NC_IXCAplicados" %>
+
+
+
+
+
+
+
+ Reporte de aplicaciones de Anticipos - NC - Ingresos X Comprobar
+
+
+
+
+