Merge branch 'master' of http://agonzalez@192.168.10.111:8383/SIG.git
This commit is contained in:
10560
Compras/Compras.aspx
10560
Compras/Compras.aspx
File diff suppressed because it is too large
Load Diff
@@ -8295,6 +8295,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
|
||||
|
||||
|
||||
@@ -18816,6 +18826,7 @@ Partial Class Compras_Compras
|
||||
HLAplicaNCFact.Visible = True
|
||||
LblTotalNC.Text = TxtTotal.Text.FormatoNumero
|
||||
CargaCuentasXPagar()
|
||||
TabModoNC_ActiveTabChanged(TabModoNC, EventArgs.Empty)
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCuentasXPagar()
|
||||
@@ -18949,6 +18960,9 @@ Partial Class Compras_Compras
|
||||
ChkNCInv.Visible = True
|
||||
GVNCInv.DataSource = DtPendientesAlmacen
|
||||
GVNCInv.DataBind()
|
||||
|
||||
GVNCInvAlmacen.DataSource = DtPendientesAlmacen
|
||||
GVNCInvAlmacen.DataBind()
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -18978,20 +18992,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
|
||||
@@ -19000,10 +19016,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)
|
||||
@@ -19016,14 +19034,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
|
||||
@@ -19081,6 +19107,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 "
|
||||
@@ -20228,6 +20282,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
|
||||
@@ -20721,6 +20779,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
|
||||
|
||||
@@ -1152,6 +1152,29 @@ Partial Class PopUpVerFactura
|
||||
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados.FiltraParametros("FolioFiscal IS NOT NULL")
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso (Vta.DtDocumentosRelacionados Is Nothing OrElse Vta.DtDocumentosRelacionados.Rows.Count = 0) Then
|
||||
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
|
||||
Vta.DtNCVinculadas = ObjVentas.DtResultados
|
||||
Vta.DtDocumentosRelacionados = ObjVentas.DtResultados '.FiltraParametros("FolioFiscal IS NOT NULL")
|
||||
If Vta.DtDocumentosRelacionados.Rows.Count > 0 Then
|
||||
If Vta.TipoDocto.Contiene("Ing") Then
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
|
||||
End If
|
||||
|
||||
If Vta.TipoDocto.Contiene("Egs") Then
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacion = "01"
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Nota de Crédito aplicada a Ingreso"
|
||||
End If
|
||||
|
||||
If Vta.TipoDocto.Contiene("Dev") Then
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacion = "03"
|
||||
Vta.Timbre.CFDIRelacionados.TipoRelacionTexto = "Devolución aplicada a Ingreso"
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user