Compras RNC Multiseleccion

This commit is contained in:
rakcsle
2024-07-19 11:18:45 -07:00
parent 862040a16f
commit 76ba3cceee
4 changed files with 104 additions and 74 deletions

View File

@@ -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

View File

@@ -540,15 +540,15 @@
</div>
</div>
<div class="form-group proveedoreespes" runat="server" id="DvDdlRemisionNotaCredito" visible="false" >
<%--<div class="form-group proveedoreespes" runat="server" id="DvDdlRemisionNotaCredito" visible="false" >
<span class="whitoutcol proveedoreespes">Remisión Nota de Crédito</span>
<div class="whitoutcol whitoutcol">
<asp:DropDownList ID="DdlRemisionNotaCredito" runat="server" DataTextField="SerieFolio" DataValueField="CveCompra" CssClass="form-control input-sm input-small select2me" AutoPostBack="true" >
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
</asp:DropDownList>
<%--<asp:Button ID="Button3" runat="server" Text="Resta" CssClass="default" OnClick="BtnFolioGarantiaRestantes_Click" />--%>
</asp:DropDownList>
</div>
</div>
</div>--%>
@@ -957,43 +957,46 @@
<asp:UpdatePanel ID="UpGVRemisionesNotaDeCredito" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="width:381px!important">
<asp:GridView ID="GVRemisionesNotaDeCredito" runat="server" CssClass="table table-striped table-hover ScrollAD" Width="380px" AutoGenerateColumns="False" Visible="false"
DataKeyNames="Tipo,CveCompra,Fecha,TipoDocto,SerieFolio,CveIE,Original,Abonado,Saldo,CveProveedor,RazonSocial,Descripcion,CveMoneda,Moneda,Abreviatura,Referencia,CvePersonal,TipoCambio,CveSubProyecto,CveTipoConcepto" ClientIDMode="Static" EmptyDataText="" data-height="200"
GridLines="None">
<Columns>
<asp:TemplateField ItemStyle-Width="40px">
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="80px">
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="100px">
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width="60px">
<HeaderTemplate>Moneda</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Abreviatura") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:GridView ID="GVRemisionesNotaDeCredito" runat="server" CssClass="table table-striped table-hover ScrollAD" Width="100%" AutoGenerateColumns="False" Visible="false"
DataKeyNames="Tipo,CveCompra,Fecha,TipoDocto,SerieFolio,CveIE,Original,Abonado,Saldo,CveProveedor,RazonSocial,Descripcion,CveMoneda,Moneda,Abreviatura,Referencia,CvePersonal,TipoCambio,CveSubProyecto,CveTipoConcepto" ClientIDMode="Static" EmptyDataText="" data-height="200"
GridLines="None">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox runat="server" ID="Chk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Factura</HeaderTemplate>
<ItemTemplate>
<asp:HyperLink ID="HplFactura" runat="server" CssClass="Texto" Text='<%# Eval("SerieFolio") %>' NavigateUrl='<%# Eval("CveCompra", "/Compras/Compras.aspx?CveCompra={0}")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Fecha</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Saldo</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="80px" HorizontalAlign="Right"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Mon</HeaderTemplate>
<ItemTemplate>
<asp:Literal ID="LtlMoneda" runat="server" Text='<%# Eval("Moneda") %>'></asp:Literal>&nbsp;
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

View File

@@ -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

View File

@@ -1754,7 +1754,7 @@
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro Light</FontFamily>
<FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
@@ -1762,7 +1762,7 @@
<TextRun>
<Value>=IIF(LEN(Parameters!SubProyectoEntrega.Value) &gt; 0,"Lugar de Entrega: " + Parameters!SubProyectoEntrega.Value,"")</Value>
<Style>
<FontFamily>Myriad Pro Light</FontFamily>
<FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
@@ -1770,7 +1770,7 @@
<TextRun>
<Value xml:space="preserve"> </Value>
<Style>
<FontFamily>Myriad Pro Light</FontFamily>
<FontFamily>Calibri</FontFamily>
<FontSize>9.16pt</FontSize>
<FontWeight>SemiBold</FontWeight>
</Style>
@@ -1785,8 +1785,8 @@
<TextRun>
<Value>=Parameters!SubProyectoEntregaDir.Value</Value>
<Style>
<FontFamily>Myriad Pro Light</FontFamily>
<FontSize>9pt</FontSize>
<FontFamily>Calibri</FontFamily>
<FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
@@ -1867,7 +1867,7 @@
<Value>=Parameters!RFC.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
@@ -1884,7 +1884,7 @@
"(" &amp; Mid(Parameters!Telefono.Value, 1, 3) &amp; ") " &amp; Mid(Parameters!Telefono.Value, 4))</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
@@ -1899,7 +1899,7 @@
<Value>USO CFDI: </Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>
@@ -1907,7 +1907,7 @@
<Value>=Parameters!UsoCFDI.Value</Value>
<Style>
<FontFamily>calibri</FontFamily>
<FontSize>9pt</FontSize>
<FontSize>8.5pt</FontSize>
<FontWeight>Normal</FontWeight>
</Style>
</TextRun>