-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
-
-
+
+
+
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb
index bedc186b0..20e4c0d23 100644
--- a/Compras/Compras.aspx.vb
+++ b/Compras/Compras.aspx.vb
@@ -8291,6 +8291,16 @@ Partial Class Compras_Compras
End If
End If
Next
+
+ For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, CveCompra, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ErrorMovInv = True
+ Exit For
+ End If
+ End If
+ Next
+
End If
@@ -18791,6 +18801,7 @@ Partial Class Compras_Compras
HLAplicaNCFact.Visible = True
LblTotalNC.Text = TxtTotal.Text.FormatoNumero
CargaCuentasXPagar()
+ TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
End Sub
Private Sub CargaCuentasXPagar()
@@ -18924,6 +18935,9 @@ Partial Class Compras_Compras
ChkNCInv.Visible = True
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
+
+ GVNCInvAlmacen.DataSource = DtPendientesAlmacen
+ GVNCInvAlmacen.DataBind()
End If
End If
@@ -18953,20 +18967,22 @@ Partial Class Compras_Compras
SaldoAnticipo += gvr.FCTextBox("TxtAnticipo").Text.ToDouble
End If
Next
+
+ If SaldoAnticipo <= 0 Then
+ Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
End If
- If SaldoAnticipo <= 0 Then
- Alert("No hay movimientos seleccionados para aplicar", TipoMensaje.MsgAdvertencia)
- Exit Sub
- End If
-
LbNCInvSaldo.Text = SaldoAnticipo.FormatoNumero()
+ LbNCInvSaldoAlmacen.Text = SaldoAnticipo.FormatoNumero()
If ChkNCInvNC.Checked Then
Dim ObjInventarios As New ClsInventarios
- If ObjInventarios.RecepcionAlmacenGet(-1, -1, UsuarioActual.CveEmpresa, CveProveedor) AndAlso ObjInventarios.DtResultados.FiltraParametros($"CveCompra IN ({CveCompras}) AND CantidadF > 0").Rows.Count > 0 Then
- DtPendientesAlmacen = ObjInventarios.DtResultados.FiltraParametros($"CveCompra IN ({CveCompras}) AND CantidadF > 0").Copy
+ If ObjInventarios.RecepcionAlmacenGet(-1, -1, UsuarioActual.CveEmpresa, CveProveedor) AndAlso ObjInventarios.DtResultados.FiltraParametros($"CantidadF > 0").Rows.Count > 0 Then
+ DtPendientesAlmacen = ObjInventarios.DtResultados.FiltraParametros($"CantidadF > 0").Copy
End If
ObjInventarios.Dispose()
End If
@@ -18975,10 +18991,12 @@ Partial Class Compras_Compras
If ChkNCInvNC.Checked Then
GVNCInv.DataSource = DtPendientesAlmacen
GVNCInv.DataBind()
- UpNCInv.Update()
- RegistraScript("$('#FacturaNC').modal('hide');", "FacturaNC")
+
+ GVNCInvAlmacen.DataSource = DtPendientesAlmacen
+ GVNCInvAlmacen.DataBind()
+
End If
- RegistraScript("$('#ModalNCInv').modal('show');", "ModalNCInv")
+
Else
If ChkNCInvNC.Checked Then
Alert("Niguna de las facturas seleccionadas cuenta con productos pendientes de darles entrada.", TipoMensaje.MsgAdvertencia)
@@ -18991,14 +19009,22 @@ Partial Class Compras_Compras
End If
UpNCInv.Update()
+ UpFacturaNC.Update()
End Sub
+
Protected Sub GVNCInv_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVNCInv.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
'e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", "FnCambiaInvNC(this);")
e.Row.FCTextBox("TxtCantidadNCInv").Attributes.Add("onkeyup", $"ValidarCantidad(this,{e.Row.DBCampo("CantidadF")});FnCambiaInvNC(this);")
End If
End Sub
+ Protected Sub GVNCInvAlmacen_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GVNCInvAlmacen.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ 'e.Row.FCCheckBox("cbInv").Attributes.Add("onclick", "FnCambiaInvNC(this);")
+ e.Row.FCTextBox("TxtCantidadNCInv").Attributes.Add("onkeyup", $"ValidarCantidad(this,{e.Row.DBCampo("CantidadF")});FnCambiaInvNC(this);")
+ End If
+ End Sub
Protected Sub BtnNCInv_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
@@ -19056,6 +19082,34 @@ Partial Class Compras_Compras
Protected Sub BtnNCConfirmacion_Click(sender As Object, e As EventArgs)
GuardaAnticipos(Nothing, Nothing)
End Sub
+
+ Protected Sub BtnNCInvAlmacen_Click(sender As Object, e As EventArgs)
+
+ 'Dim ObjCompras As New ClsCompras
+ 'Dim ObjConta As New ClsContabilidad(ObjCompras.IniciaTransacSQL)
+ 'Dim TieneError = False
+
+ 'For Each Gvr As GridViewRow In GVNCInvAlmacen.Rows
+ ' If Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble > 0 Then
+ ' If Not ObjCompras.ComprasDetalleDevolucionesAdd(Gvr.DataKey("CveCompraDetalle").ToEntero, Gvr.DataKey("CveCompra").ToEntero, Gvr.FCTextBox("TxtCantidadNCInv").Text.ToDouble, UsuarioActual.CveEmpresa) Then
+ ' TieneError = True
+ ' Exit For
+ ' End If
+ ' End If
+ 'Next
+
+ 'If Not TieneError Then
+ ' Alert("Se guardo la devolución correctamente", TipoMensaje.MsgInformacion)
+ ' ObjCompras.Commit()
+ 'Else
+ ' Alert("Ocurrió un error al guardar la devolución", TipoMensaje.MsgError)
+ ' ObjCompras.RollBack()
+ 'End If
+
+ 'ObjCompras.Dispose()
+ RegistraScript("$('#FacturaNC').modal('hide');", "ModalNCInv")
+
+ End Sub
#End Region
#Region " INVENTARIO: MOVIMIENTOS DE LA COMPRA "
@@ -20203,6 +20257,10 @@ Partial Class Compras_Compras
Protected Sub BtnFacturaNC_Click(sender As Object, e As EventArgs)
If ChkNCInvNC.Checked Then
CargaNCINV()
+
+ TabModoNC.ActiveTabIndex = 1
+ TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
+ UpFacturaNC.Update()
Else
RegistraScript("$('#FacturaNC').modal('hide');", "FacturaNC")
End If
@@ -20696,6 +20754,20 @@ Partial Class Compras_Compras
End Sub
+ Protected Sub TabModoNC_ActiveTabChanged(sender As Object, e As EventArgs)
+ Select Case TabModoNC.ActiveTabIndex
+ Case 0
+ BtnFacturaNC.Visible = True
+ BtnNCInvAlmacen.Visible = False
+ TabNCAlmacen.Enabled = False
+ Case 1
+ BtnFacturaNC.Visible = False
+ BtnNCInvAlmacen.Visible = True
+ TabNCAlmacen.Enabled = True
+ End Select
+
+ UpFooterFacturaNC.Update()
+ End Sub
End Class
Public Class MMensajeDevolucion