diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb
index 251fa5deb..4777d29aa 100644
--- a/Inventarios/EntregaAlmacen.aspx.vb
+++ b/Inventarios/EntregaAlmacen.aspx.vb
@@ -790,7 +790,7 @@ Partial Class Inventarios_EntregaAlmacen
'CARGA LO PRECARGADO CON SERIE
Dim Contador = 0
For Each Gvr As GridViewRow In GvDatos.Rows
- If Gvr.DataKey("CvePS").ToEntero = CvePSSerie Then
+ If Gvr.DataKey("CvePS").ToEntero = CvePSSerie AndAlso DtDatosDetalle IsNot Nothing Then
Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Gvr.DataKey("Consec"))).Rows.Count
Gvr.FCCheckBox("cbInv").Enabled = False
Gvr.FCCheckBox("cbInv").Checked = True
@@ -809,9 +809,12 @@ Partial Class Inventarios_EntregaAlmacen
e.Row.FCButton("BtnSerie").CommandArgument = String.Format("{0}°{1}°{2}°{3}°{4}°{5}", e.Row.DBCampo("CvePS"), e.Row.DBCampo("CveUM"), e.Row.DBCampo("PS"), e.Row.DBCampo("CantidadF"), e.Row.DBCampo("Consec"), e.Row.DBCampo("Inv_CveMetodoInventario"))
e.Row.FCTextBox("TbCantidadF").Enabled = False
e.Row.FCCheckBox("cbInv").Enabled = False
- Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count
- e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
- 'e.Row.FCTextBox("TbCantidadF").Text = "0"
+ If e.Row.DBCampo("Consec") <> "" AndAlso DtDatosDetalle IsNot Nothing Then
+ Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count
+ e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString
+ 'e.Row.FCTextBox("TbCantidadF").Text = "0"
+ End If
+
If TipoDocto = "DPe" Then
CveConsecSerie = e.Row.DBCampo("Consec").ToString.ToEntero
diff --git a/Inventarios/RepApartados2.aspx b/Inventarios/RepApartados2.aspx
index aecae7b73..f40374908 100644
--- a/Inventarios/RepApartados2.aspx
+++ b/Inventarios/RepApartados2.aspx
@@ -110,7 +110,7 @@
<%--
--%>
<%--
- %>
+ --%>
diff --git a/Sistemas/CatSesiones.aspx.vb b/Sistemas/CatSesiones.aspx.vb
index f363c3e59..046bd3751 100644
--- a/Sistemas/CatSesiones.aspx.vb
+++ b/Sistemas/CatSesiones.aspx.vb
@@ -168,7 +168,7 @@ Partial Class Sistemas_CatSesiones
Private Sub CargaAlmacen()
Dim Objinventarios As New ClsInventarios
If Objinventarios.GetAlmacenes(-1, -1, -1, -1) Then Application("GlobalDTAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTAlmacen") = Nothing
- If Objinventarios.GetSeccionesAlmacenes(-1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing
+ If Objinventarios.GetSeccionesAlmacenes(-1, -1) Then Application("GlobalDTSeccionAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTSeccionAlmacen") = Nothing
If Objinventarios.GetTiposAlmacenes Then Application("GlobalDTTipoAlmacen") = Objinventarios.DtResultados Else Application("GlobalDTTipoAlmacen") = Nothing
If Objinventarios.GetConceptos Then Application("GlobalDTInvConceptos") = Objinventarios.DtResultados Else Application("GlobalDTInvConceptos") = Nothing
Objinventarios.Dispose()
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index aa5362795..212a0069d 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -24764,14 +24764,27 @@ Partial Class Ventas
If UsuarioActual.CveEmpresa = 141 Then
Dim Total As Decimal = TxtTotal.Text.ToDecimal()
- If Not PermiteCredito AndAlso ((DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0) AndAlso Total > 0) Then
+ Dim AmortizacionNC As Decimal = 0
+
+ Dim TienePagos As Boolean = ((Not (DtPagos Is Nothing OrElse DtPagos.Rows.Count = 0)) AndAlso (DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0)) OrElse AmortizacionNC > 0
+
+ 'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO
+ If DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
+ For Each gvr As GridViewRow In GVAnticipos.Rows
+ If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then
+ AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal
+ End If
+ Next
+ End If
+
+ If Not PermiteCredito AndAlso Not TienePagos AndAlso Total > 0 Then
Alert("Es necesario especificar un pago.", TipoMensaje.MsgAdvertencia)
Retorno = False
Return Retorno
End If
- If Not PermiteCredito AndAlso DtPagos IsNot Nothing AndAlso DtPagos.Rows.Count > 0 AndAlso Total > 0 Then
- Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal()
+ If Not PermiteCredito AndAlso TienePagos AndAlso Total > 0 Then
+ Dim TotalPago As Decimal = DtPagos.SUM("Importe").ToDecimal() + AmortizacionNC
If TotalPago < Total Then
Alert("La suma de los pagos debe ser igual al total de la venta.", TipoMensaje.MsgAdvertencia)