diff --git a/App_Code/ClsCompras.vb b/App_Code/ClsCompras.vb index b1af7b204..4a59454ca 100644 --- a/App_Code/ClsCompras.vb +++ b/App_Code/ClsCompras.vb @@ -1630,7 +1630,7 @@ Public Class ClsCompras #Region "N O T A S - C R E D I T O" - Public Function GetNotasCreditoRep(CveProveedor As Integer, Opcion As Integer, FechaI As String, FechaF As String, CveEmpresa As Integer, Optional TipoReporte As Integer = 1) As Boolean + Public Function GetNotasCreditoRep(CveProveedor As Integer, Opcion As Integer, FechaI As String, FechaF As String, CveEmpresa As Integer, Optional TipoReporte As Integer = 1, Optional CveComprasAmortizadas As String = "-1") As Boolean Dim Retorno As Boolean = False @@ -1643,6 +1643,8 @@ Public Class ClsCompras .Add("@FechaF", SqlDbType.VarChar).Value = FechaF .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@TipoReporte", SqlDbType.Int).Value = TipoReporte + .Add("@CveComprasAmortizadas", SqlDbType.VarChar).Value = CveComprasAmortizadas + End With diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index c0c9e9e00..60aa183be 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -540,15 +540,15 @@ -
+ <%--
Remisión Nota de Crédito
- - <%----%> +
-
+ +
--%> @@ -957,43 +957,46 @@ +
+ + + + + + + + + Factura + + + + + + Fecha + + + + + + Saldo + + + + + + + Moneda + +   + + + + +
- - - - - - - - - Factura - - - - - - Fecha - - - - - - Saldo - - - - - - - Mon - -   - - - - +
diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 40e49a25c..8485f0651 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -12,6 +12,7 @@ Imports Extensiones Imports MoreLinq Imports System.Data.SqlClient Imports ClsPaginas +Imports System.Activities.Expressions Partial Class Compras_Compras Inherits ClsPaginas @@ -1225,6 +1226,17 @@ Partial Class Compras_Compras #End Region + 'Public Property ListaFacturasRealcionadasRNC As List(Of String) + ' Get + ' If ViewState("ListaFacturasRealcionadasRNC") Is Nothing Then + ' ViewState("ListaFacturasRealcionadasRNC") = New List(Of String) + ' End If + ' Return DirectCast(ViewState("ListaFacturasRealcionadasRNC"), List(Of String)) + ' End Get + ' Set(value As List(Of String)) + ' ViewState("ListaFacturasRealcionadasRNC") = value + ' End Set + 'End Property @@ -1648,8 +1660,8 @@ Partial Class Compras_Compras End If - 'SE OCUPAN AFUERA DEL POSTBACK ?? - cargaddlVinculacionServcios() + 'SE OCUPAN AFUERA DEL POSTBACK ?? + cargaddlVinculacionServcios() If UsuarioActual.TienePermisoProceso(117) Then HplAddClasificacion.Visible = False @@ -1686,28 +1698,28 @@ Partial Class Compras_Compras DdlTipoCompra_SelectedIndexChanged(Nothing, Nothing) - For Each gvRow As GridViewRow In GvFacturaNC.Rows - If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then - Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio")) - Dim seleccion As String = "" + 'For Each gvRow As GridViewRow In GvFacturaNC.Rows + ' If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then + ' Dim SerieFolioFacura As String = ObtenerUltimaParte(gvRow.DataKey("SerieFolio")) + ' Dim seleccion As String = "" - For Each item As ListItem In DdlRemisionNotaCredito.Items - Dim serieFolioItem As String = ObtenerUltimaParte(item.Text) - If SerieFolioFacura = serieFolioItem Then - 'seleccion = item.Value - AutoSelRNC = True - DdlRemisionNotaCredito.SelectedValueExist(item.Value) - Exit For - End If + ' For Each item As ListItem In DdlRemisionNotaCredito.Items + ' Dim serieFolioItem As String = ObtenerUltimaParte(item.Text) + ' If SerieFolioFacura = serieFolioItem Then + ' 'seleccion = item.Value + ' AutoSelRNC = True + ' DdlRemisionNotaCredito.SelectedValueExist(item.Value) + ' Exit For + ' End If - Next + ' Next - If AutoSelRNC Then - Exit For - End If + ' If AutoSelRNC Then + ' Exit For + ' End If - End If - Next + ' End If + 'Next If AutoSelRNC Then 'DdlRemisionNotaCredito_SelectedIndexChanged(Nothing, Nothing) @@ -19747,11 +19759,10 @@ Partial Class Compras_Compras If DdlTipoComprobante.SelectedValue = "NC" Then CargaGVRemisionNotaCredito() - 'bloquear la vinculación a la compra HLAplicaNCFact.Visible = False Else Alert("Para elegir Remisión de Nota de Crédito el tipo de documento debe de ser Nota de Crédito.", TipoMensaje.MsgAdvertencia) - DdlRemisionNotaCredito.SelectedValueExist(-1) + 'DdlRemisionNotaCredito.SelectedValueExist(-1) DdlTipoCompra.SelectedValueExist(-1) End If End If @@ -20414,6 +20425,7 @@ Partial Class Compras_Compras End Function Private Sub NCSeleccionFacturasRelacionadas(UUIDSListRelacionados As List(Of String)) + 'ListaFacturasRealcionadasRNC.Clear() If UUIDSListRelacionados.Count > 0 Then Dim SaldoNota As Decimal = TxtTotal.Text.ToDecimal @@ -20449,17 +20461,20 @@ Partial Class Compras_Compras SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero GvRow.FCCheckBox("ChkFacturaNC").Checked = True + 'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra")) Else If SaldoFactura >= SaldoNotaPorAplicar Then GvRow.FCTextBox("TxtImporte").Text = SaldoNotaPorAplicar.FormatoNumero GvRow.FCCheckBox("ChkFacturaNC").Checked = True + 'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra")) SaldoNotaPorAplicar = 0 TeminarAmortizacion = True Else GvRow.FCTextBox("TxtImporte").Text = SaldoFactura.FormatoNumero GvRow.FCCheckBox("ChkFacturaNC").Checked = True + 'ListaFacturasRealcionadasRNC.Add(GvRow.DataKey("CveCompra")) SaldoNotaPorAplicar = SaldoNotaPorAplicar - SaldoFactura TeminarAmortizacion = True @@ -21168,13 +21183,23 @@ Partial Class Compras_Compras End Sub Private Sub CargaGVRemisionNotaCredito() - DvDdlRemisionNotaCredito.Visible = True + 'DvDdlRemisionNotaCredito.Visible = True DTRemisionesNotaDeCredito = New DataTable GVRemisionesNotaDeCredito.DataSource = Nothing GVRemisionesNotaDeCredito.Visible = False + + Dim CveComprasAmortizadas As New List(Of String) + + For Each gvRow As GridViewRow In GvFacturaNC.Rows + If gvRow.DataKey("CveCompra").ToEntero > 0 AndAlso gvRow.FCCheckBox("ChkFacturaNC").Checked Then + CveComprasAmortizadas.Add(gvRow.DataKey("CveCompra")) + gvRow.FCCheckBox("ChkFacturaNC").Checked = False + End If + Next + Dim ObjCompras As New ClsCompras - If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2) Then + If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2, String.Join(",", CveComprasAmortizadas)) Then 'DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados DTRemisionesNotaDeCredito = ObjCompras.DtResultados GVRemisionesNotaDeCredito.DataSource = DTRemisionesNotaDeCredito diff --git a/Empresas/197/Formatos/OC.rdlc b/Empresas/197/Formatos/OC.rdlc index 2497110a5..694ca2c40 100644 --- a/Empresas/197/Formatos/OC.rdlc +++ b/Empresas/197/Formatos/OC.rdlc @@ -1754,7 +1754,7 @@ @@ -1762,7 +1762,7 @@ =IIF(LEN(Parameters!SubProyectoEntrega.Value) > 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"") @@ -1770,7 +1770,7 @@ @@ -1785,8 +1785,8 @@ =Parameters!SubProyectoEntregaDir.Value @@ -1867,7 +1867,7 @@ =Parameters!RFC.Value @@ -1884,7 +1884,7 @@ "(" & Mid(Parameters!Telefono.Value, 1, 3) & ") " & Mid(Parameters!Telefono.Value, 4)) @@ -1899,7 +1899,7 @@ USO CFDI: @@ -1907,7 +1907,7 @@ =Parameters!UsoCFDI.Value