Compras Pronto Pago
This commit is contained in:
@@ -499,6 +499,7 @@
|
||||
<asp:ListItem Text="Apoyo Logístico" Value="9"></asp:ListItem>
|
||||
<asp:ListItem Text="NC Por Devolución" Value="11"></asp:ListItem>
|
||||
<%--<asp:ListItem Text="Garantía" Value="12"></asp:ListItem>--%>
|
||||
<%--<asp:ListItem Text="Remision Nota De Crédito" Value="13"></asp:ListItem> Ocuado se carga con funcionalidad 574 --%>
|
||||
</asp:DropDownList>
|
||||
|
||||
</div>
|
||||
@@ -534,6 +535,19 @@
|
||||
<asp:Button ID="BtnRecolecciónAplicar" runat="server" Text="Aplicar" CssClass="default" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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" OnSelectedIndexChanged="DdlRemisionNotaCredito_SelectedIndexChanged">
|
||||
<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" />--%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -5512,6 +5526,43 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="DVModalConfirmaVinculacionProntoPago" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content" style="width: 500px; margin-left: 50px;">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Confirmar Vinculación</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalConfirmaVinculacionProntoPago" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<asp:Label runat="server" ID="LblModalConfirmaVinculacionProntoPago" ></asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<asp:UpdatePanel runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:Button ID="BtnModalConfirmaVinculacionProntoPago" OnClick="BtnModalConfirmaVinculacionProntoPago_Click" runat="server" Text="Vincular" CssClass="btn btn-primary" />
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1118,6 +1118,8 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#Region "PROPIEDADES PRONTO PAGO"
|
||||
''' <summary>
|
||||
''' Descuento por pronto pago proveedor
|
||||
''' </summary>
|
||||
@@ -1192,6 +1194,38 @@ Partial Class Compras_Compras
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property ImporteRNCSaldar As Decimal
|
||||
Get
|
||||
If ViewState("ImporteRNCSaldar") Is Nothing Then
|
||||
ViewState("ImporteRNCSaldar") = 0D
|
||||
End If
|
||||
Return ViewState("ImporteRNCSaldar").ToString.ToDecimal
|
||||
End Get
|
||||
Set(value As Decimal)
|
||||
ViewState("ImporteRNCSaldar") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTRemisionesNotaDeCredito As DataTable
|
||||
Get
|
||||
|
||||
If ViewState("DTRemisionesNotaDeCredito") Is Nothing Then
|
||||
ViewState("DTRemisionesNotaDeCredito") = New DataTable
|
||||
End If
|
||||
|
||||
Return DirectCast(ViewState("DTRemisionesNotaDeCredito"), DataTable)
|
||||
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTRemisionesNotaDeCredito") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1596,6 +1630,9 @@ Partial Class Compras_Compras
|
||||
DdlTipoComprobante.SelectedValueExist("DEV")
|
||||
End If
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
DdlTipoCompra.Items.Add(New ListItem("Remision Nota De Crédito", "13"))
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
@@ -6907,6 +6944,37 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 AndAlso ImporteRNCSaldar > 0 Then
|
||||
|
||||
'Dim importeMovimientoNC As Decimal = Gvr.FCTextBox("TxtImporte").Text.ToDecimal
|
||||
|
||||
Dim Pago As New CompraPago
|
||||
Pago.ImportePago = ImporteRNCSaldar
|
||||
Pago.CveMonedaPago = CompraActual.CveMoneda
|
||||
Pago.CveCompraAmortizacion = CompraActual.CveCompra
|
||||
Pago.Referencia = CompraActual.SerieFolio
|
||||
Pago.TCPago = CompraActual.TC
|
||||
Pago.AplicaAcreditable = False
|
||||
Pago.TipoPago = "NC"
|
||||
Pago.Fecha = CompraActual.Fecha 'toma la misma fecha de la provisión en el pago de NC
|
||||
|
||||
Dim CompraPago As New Compra
|
||||
''datos de la compra tipodocto:Fac, para sobreescribirlos
|
||||
'CompraPago.CveCompra = DdlRemisionNotaCredito.SelectedValue.ToEntero
|
||||
'CompraPago.CveProveedor = DdlProveedor.SelectedValue.ToEntero
|
||||
'CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
|
||||
'CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
|
||||
'CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
|
||||
'CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
|
||||
'CompraPago.Total = Gvr.DataKey("Total").ToDecimal
|
||||
'CompraPago.CveTipoConceptoProveedor = CveTipoConcepto
|
||||
CompraPago.CveSubProyecto = CompraActual.CveSubProyecto
|
||||
|
||||
ErrorPrepoliza = AplicaPrePolizaPagoCompra(CompraPago, Pago, CvePrePoliza, ObjConta)
|
||||
|
||||
End If
|
||||
|
||||
If ErrorPrepoliza Then
|
||||
ErrorMovtosCxP = True
|
||||
Exit Select
|
||||
@@ -7475,7 +7543,7 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 AndAlso (ImporteRNC > 0 Or ImporteRNCProntoPago > 0) Then
|
||||
If Not GeneraRemisionsNotadeCredito(ObjCompras.IniciaTransacSQL) Then
|
||||
If Not GeneraRemisionsNotadeCredito(ObjCompras.IniciaTransacSQL, CveCompra) Then
|
||||
TieneError = True
|
||||
End If
|
||||
End If
|
||||
@@ -14354,7 +14422,7 @@ Partial Class Compras_Compras
|
||||
|
||||
End Sub
|
||||
Protected Sub BtnVincularOC_Click(sender As Object, e As EventArgs)
|
||||
|
||||
VincularOcProntoPago = False
|
||||
AjusteProntoPagoPorcentajeIVA = 0D
|
||||
AjusteProntoPagoConIVA = 0D
|
||||
AjusteProntoPagoSinIVA = 0D
|
||||
@@ -14435,10 +14503,14 @@ Partial Class Compras_Compras
|
||||
Next
|
||||
|
||||
AjusteProntoPagoPorcentajeIVA = TmpDT.MAX("IVAPorcentaje").ToDecimal
|
||||
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA) '+ ((ImporteCompraConIVA) * PorcentajeProntoPago)
|
||||
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA) '+ ((ImporteCompraSinIVA) * PorcentajeProntoPago)
|
||||
AjusteProntoPagoConIVA = (ImporteCompraConIVA - ImporteOCConIVA)
|
||||
AjusteProntoPagoSinIVA = (ImporteCompraSinIVA - ImporteOCSinIVA)
|
||||
|
||||
If ConfirmaVinculacionOCProntoPago() Then
|
||||
Vinculacion()
|
||||
End If
|
||||
|
||||
|
||||
Vinculacion()
|
||||
|
||||
Else
|
||||
LbSubTotalDif.Visible = True
|
||||
@@ -14453,6 +14525,7 @@ Partial Class Compras_Compras
|
||||
UpEstatus.Update()
|
||||
End Sub
|
||||
Protected Sub BtnVincularOCCompleta_Click(sender As Object, e As EventArgs)
|
||||
VincularOcProntoPago = False
|
||||
Vinculacion(True)
|
||||
End Sub
|
||||
Private Sub Vinculacion(Optional VinculacionCompleta As Boolean = False)
|
||||
@@ -15356,6 +15429,9 @@ Partial Class Compras_Compras
|
||||
|
||||
Protected Sub DdlProveedores_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
CargarFacturas()
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
CargaDdlRemisionNotaCredito()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub CargarFacturas()
|
||||
@@ -19327,6 +19403,7 @@ Partial Class Compras_Compras
|
||||
dr("CveMetodoInventario") = 1
|
||||
Next
|
||||
CargaGvInv()
|
||||
|
||||
End If
|
||||
ElseIf DdlTipoComprobante.SelectedValue.Contiene("Fac") Then
|
||||
If DdlTipoCompra.SelectedValue.Contiene("14") Then 'Recolección
|
||||
@@ -19342,9 +19419,24 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
End If
|
||||
|
||||
If DdlTipoCompra.SelectedValue = "13" Then 'Remisión de nota de crédito
|
||||
|
||||
If DdlTipoComprobante.SelectedValue = "NC" Then
|
||||
CargaDdlRemisionNotaCredito()
|
||||
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)
|
||||
DdlTipoCompra.SelectedValueExist(-1)
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "GARANTÍAS"
|
||||
@@ -20514,24 +20606,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If resultadosFiltrados.Count > 0 Then
|
||||
|
||||
Dim EnumAgrupado = (From row In TmpDT.AsEnumerable()
|
||||
Group row By
|
||||
SubProyecto = row.Field(Of String)("SubProyecto"),
|
||||
CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"),
|
||||
Clasificacion = row.Field(Of String)("Clasificacion"),
|
||||
CveClasificacion = row.Field(Of Integer)("CveClasificacion"),
|
||||
TipoGasto = row.Field(Of String)("TipoGasto"),
|
||||
CveTipoGasto = row.Field(Of Integer)("CveTipoGasto")
|
||||
Into Group
|
||||
Select New With {
|
||||
.SubProyecto = SubProyecto,
|
||||
.CveSubProyecto = CveSubProyecto,
|
||||
.Clasificacion = Clasificacion,
|
||||
.CveClasificacion = CveClasificacion,
|
||||
.CveTipoGasto = CveTipoGasto,
|
||||
.TipoGasto = TipoGasto,
|
||||
.TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
|
||||
}).ToList()
|
||||
|
||||
|
||||
''.TotalSum = Group.Sum(Function(r) r.Field(Of Decimal)("Total"))
|
||||
If Opcion = 1 Then
|
||||
@@ -20568,6 +20643,48 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
Else
|
||||
|
||||
'Dim EnumAgrupado = (From row In TmpDT.AsEnumerable()
|
||||
' Group row By
|
||||
' SubProyecto = row.Field(Of String)("SubProyecto"),
|
||||
' CveSubProyecto = row.Field(Of Integer)("CveSubProyecto"),
|
||||
' Clasificacion = row.Field(Of String)("Clasificacion"),
|
||||
' CveClasificacion = row.Field(Of Integer)("CveClasificacion"),
|
||||
' TipoGasto = row.Field(Of String)("TipoGasto"),
|
||||
' CveTipoGasto = row.Field(Of Integer)("CveTipoGasto")
|
||||
' Into Group
|
||||
' Select New With {
|
||||
' .SubProyecto = SubProyecto,
|
||||
' .CveSubProyecto = CveSubProyecto,
|
||||
' .Clasificacion = Clasificacion,
|
||||
' .CveClasificacion = CveClasificacion,
|
||||
' .CveTipoGasto = CveTipoGasto,
|
||||
' .TipoGasto = TipoGasto,
|
||||
' .TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
|
||||
' }).ToList()
|
||||
|
||||
Dim EnumAgrupado = (
|
||||
From row In TmpDT.AsEnumerable()
|
||||
Group row By
|
||||
SubProyecto = If(row.IsNull("SubProyecto"), String.Empty, row.Field(Of String)("SubProyecto")),
|
||||
CveSubProyecto = If(row.IsNull("CveSubProyecto"), -1, row.Field(Of Integer)("CveSubProyecto")),
|
||||
Clasificacion = If(row.IsNull("Clasificacion"), String.Empty, row.Field(Of String)("Clasificacion")),
|
||||
CveClasificacion = If(row.IsNull("CveClasificacion"), -1, row.Field(Of Integer)("CveClasificacion")),
|
||||
TipoGasto = If(row.IsNull("TipoGasto"), String.Empty, row.Field(Of String)("TipoGasto")),
|
||||
CveTipoGasto = If(row.IsNull("CveTipoGasto"), -1, row.Field(Of Integer)("CveTipoGasto"))
|
||||
Into Group
|
||||
Select New With {
|
||||
.SubProyecto = SubProyecto,
|
||||
.CveSubProyecto = CveSubProyecto,
|
||||
.Clasificacion = Clasificacion,
|
||||
.CveClasificacion = CveClasificacion,
|
||||
.CveTipoGasto = CveTipoGasto,
|
||||
.TipoGasto = TipoGasto,
|
||||
.TotalSum = Group.Sum(Function(r) If(IsDBNull(r("Total")), 0D, Convert.ToDecimal(r("Total"))))
|
||||
}
|
||||
).ToList()
|
||||
|
||||
|
||||
For Each item In EnumAgrupado
|
||||
|
||||
|
||||
@@ -20633,7 +20750,7 @@ Partial Class Compras_Compras
|
||||
|
||||
#Region "PRONTO PAGO"
|
||||
|
||||
Public Function GeneraRemisionsNotadeCredito(ByRef trasaccion As SqlTransaction) As Boolean
|
||||
Public Function GeneraRemisionsNotadeCredito(ByRef trasaccion As SqlTransaction, CveCompraRegistrada As Integer) As Boolean
|
||||
Dim respuesta As Boolean = True
|
||||
|
||||
Dim CvePS_RNC As Integer = UsuarioActual.Empresa.Funcionalidad(580).ToEntero
|
||||
@@ -20669,6 +20786,8 @@ Partial Class Compras_Compras
|
||||
CompraRNC.CveMoneda = DdlMoneda.SelectedValue.ToEntero
|
||||
CompraRNC.Serie = TxtSerie.Text
|
||||
CompraRNC.Folio = TxtFolio.Text
|
||||
CompraRNC.CveCompraAmortizacion = CveCompraRegistrada
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20703,6 +20822,7 @@ Partial Class Compras_Compras
|
||||
CompraRNCProntoPAgo.CveMoneda = DdlMoneda.SelectedValue.ToEntero
|
||||
CompraRNCProntoPAgo.Serie = $"{TxtSerie.Text}_P"
|
||||
CompraRNCProntoPAgo.Folio = $"{TxtFolio.Text}_P"
|
||||
CompraRNCProntoPAgo.CveCompraAmortizacion = CveCompraRegistrada
|
||||
|
||||
CompraRNCProntoPAgo.ConfiguraRegistroRapidoRNC(CvePS_RNC, CveUM, UM, CveClasificacion, Clasificacion, PS, CveSubProyectoPrincipal, SubProyecto, ImporteRNCProntoPago, ImporteRNCProntoPago)
|
||||
If Not CompraRNCProntoPAgo.AddCompraRNC(trasaccion) Then
|
||||
@@ -20719,8 +20839,99 @@ Partial Class Compras_Compras
|
||||
Return respuesta
|
||||
End Function
|
||||
|
||||
|
||||
Public Property VincularOcProntoPago As Boolean
|
||||
Get
|
||||
If ViewState("VincularOcProntoPago") Is Nothing Then
|
||||
ViewState("VincularOcProntoPago") = False
|
||||
End If
|
||||
Return Boolean.Parse(ViewState("VincularOcProntoPago").ToString)
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
ViewState("VincularOcProntoPago") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Function ConfirmaVinculacionOCProntoPago() As Boolean
|
||||
|
||||
If VincularOcProntoPago Then
|
||||
Return True
|
||||
Else
|
||||
|
||||
If ImporteRNCProntoPago > 0 Then
|
||||
LblModalConfirmaVinculacionProntoPago.Text = $"Existe una diferencia de ${(ImporteRNC + ImporteRNCProntoPago).ToString("###,###,###.00")} entre la compra y la Orden de Compra, se generararan dos Remisiones de Nota de Crédito una por descuento de ${ImporteRNC.ToString("###,###,###.00")} y otra por pronto pago de ${ImporteRNCProntoPago.ToString("###,###,###.00")}"
|
||||
Else
|
||||
LblModalConfirmaVinculacionProntoPago.Text = $"Existe una diferencia de ${(ImporteRNC).ToString("###,###,###.00")} entre la compra y la Orden de Compra, se generara una Remision de Nota de Crédito una por descuento de ${ImporteRNC.ToString("###,###,###.00")}"
|
||||
End If
|
||||
|
||||
RegistraScript("$('#DVModalConfirmaVinculacionProntoPago').modal('show');")
|
||||
UpModalConfirmaVinculacionProntoPago.Update()
|
||||
|
||||
Return False
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Protected Sub BtnModalConfirmaVinculacionProntoPago_Click(sender As Object, e As EventArgs)
|
||||
|
||||
RegistraScript("$('#DVModalConfirmaVinculacionProntoPago').modal('hide');")
|
||||
VincularOcProntoPago = True
|
||||
BtnVincularOC_Click(Nothing, Nothing)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub CargaDdlRemisionNotaCredito()
|
||||
DvDdlRemisionNotaCredito.Visible = True
|
||||
DTRemisionesNotaDeCredito = New DataTable
|
||||
|
||||
Dim ObjCompras As New ClsCompras
|
||||
|
||||
If ObjCompras.GetNotasCreditoRep(DdlProveedor.SelectedValue.ToEntero, 0, "-1", "-1", UsuarioActual.CveEmpresa, 2) Then
|
||||
DdlRemisionNotaCredito.DataSource = ObjCompras.DtResultados
|
||||
DTRemisionesNotaDeCredito = ObjCompras.DtResultados
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener el catálogo de Notas de Crédito", Extensiones.TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjCompras.Dispose()
|
||||
|
||||
DdlRemisionNotaCredito.DataBind()
|
||||
DdlRemisionNotaCredito.Items.Insert(0, New ListItem("-", "-1"))
|
||||
|
||||
UpEstatus.Update()
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlRemisionNotaCredito_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
|
||||
'ImporteRNCSaldar = 0
|
||||
|
||||
'If DdlRemisionNotaCredito.SelectedValue.ToEntero > 0 Then
|
||||
' ImporteRNCSaldar = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
' SerieFolioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
' TipoCambioProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
' FechaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
' CveMonedaProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
' ProntoPago = DTRemisionesNotaDeCredito.FiltroPrimeroValor("Saldo", $" CveCompra = {DdlRemisionNotaCredito.SelectedValue.ToEntero} ").ToDecimal
|
||||
'End If
|
||||
|
||||
''Alert(ImporteRNCSaldar.ToString)
|
||||
'CompraPago.SerieFolio = Gvr.DataKey("SerieFolio")
|
||||
'CompraPago.TC = Gvr.DataKey("TipoCambio").ToDecimal
|
||||
'CompraPago.Fecha = Gvr.DataKey("Fecha").ToDate
|
||||
'CompraPago.CveMoneda = Gvr.DataKey("CveMoneda").ToEntero
|
||||
|
||||
'CompraPago.Total = Gvr.DataKey("Total").ToDecimal
|
||||
'CompraPago.CveTipoConceptoProveedor = CveTipoConcepto
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -22734,14 +22945,14 @@ Public Class ClsCompraManagerCompras
|
||||
|
||||
If ES_RNC Then
|
||||
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Me.Total, Me.Total, 370, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, Me.Total), TipoCambio:=TipoCambio,
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, Me.Total, Me.Total, 370, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=Me.CveCompraAmortizacion, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, Me.Total), TipoCambio:=TipoCambio,
|
||||
CveClasificacion:=-1, CveSubProyecto:=Me.CveSubProyecto, Contabilizable:=True) Then
|
||||
respuesta = False
|
||||
|
||||
End If
|
||||
|
||||
If respuesta Then
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Me.Total, Me.Total, 372, Referencia, Concepto, CveCompra:=CveCompra, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, Me.Total), TipoCambio:=TipoCambio,
|
||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, Me.Total, Me.Total, 372, Referencia, Concepto, CveCompra:=CveCompra, CveCompraAmortizacion:=Me.CveCompraAmortizacion, CveProveedor:=Me.CveProveedor, ImporteME:=If(TipoCambio = 1, 0, Me.Total), TipoCambio:=TipoCambio,
|
||||
CveClasificacion:=-1, CveSubProyecto:=Me.CveSubProyecto, Contabilizable:=True) Then
|
||||
respuesta = False
|
||||
|
||||
|
||||
@@ -104,108 +104,224 @@
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvDatos_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None"
|
||||
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,TipoCambio,CveSubProyecto,SerieFolio">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="2%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbSerieFolio" runat="server" CausesValidation="False" Text="" CommandArgument="SerieFolio" OnClick="LbOrden_Click">--%>
|
||||
Serie Folio
|
||||
<%-- <asp:Literal ID="ImgSerieFolio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLSerieFolio" runat="server" Text='<%# Eval("SerieFolio")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbFecha" runat="server" CausesValidation="False" Text="" CommandArgument="Fecha" OnClick="LbOrden_Click">--%>
|
||||
Fecha
|
||||
<%-- <asp:Literal ID="ImgFecha" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbRazonSocial" runat="server" CausesValidation="False" Text="" CommandArgument="RazonSocial" OnClick="LbOrden_Click">--%>
|
||||
Proveedor
|
||||
<%-- <asp:Literal ID="ImgRazonSocial" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLRazonSocial" runat="server" Text='<%# Eval("RazonSocial")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="350" HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbAbreviatura" runat="server" CausesValidation="False" Text="" CommandArgument="Abreviatura" OnClick="LbOrden_Click">--%>
|
||||
Moneda
|
||||
<%--<asp:Literal ID="ImgAbreviatura" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbreviatura" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbOriginal" runat="server" CausesValidation="False" Text="" CommandArgument="Original" OnClick="LbOrden_Click">--%>
|
||||
Original
|
||||
<%--<asp:Literal ID="ImgOriginal" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbAbonado" runat="server" CausesValidation="False" Text="" CommandArgument="Abonado" OnClick="LbOrden_Click">--%>
|
||||
Abonado
|
||||
<%--<asp:Literal ID="ImgAbonado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbSaldo" runat="server" CausesValidation="False" Text="" CommandArgument="Saldo" OnClick="LbOrden_Click">--%>
|
||||
Saldo
|
||||
<%--<asp:Literal ID="ImgSaldo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
|
||||
<ajax:TabContainer ID="Tab" runat="server" ActiveTabIndex="0" Width="100%">
|
||||
|
||||
<ajax:TabPanel ID="TabNotasCredito" runat="server" HeaderText="Notas de Crédito" Visible="true">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvDatos_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None"
|
||||
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,TipoCambio,CveSubProyecto,SerieFolio">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="2%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbSerieFolio" runat="server" CausesValidation="False" Text="" CommandArgument="SerieFolio" OnClick="LbOrden_Click">--%>
|
||||
Serie Folio
|
||||
<%-- <asp:Literal ID="ImgSerieFolio" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLSerieFolio" runat="server" Text='<%# Eval("SerieFolio")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbFecha" runat="server" CausesValidation="False" Text="" CommandArgument="Fecha" OnClick="LbOrden_Click">--%>
|
||||
Fecha
|
||||
<%-- <asp:Literal ID="ImgFecha" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbRazonSocial" runat="server" CausesValidation="False" Text="" CommandArgument="RazonSocial" OnClick="LbOrden_Click">--%>
|
||||
Proveedor
|
||||
<%-- <asp:Literal ID="ImgRazonSocial" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLRazonSocial" runat="server" Text='<%# Eval("RazonSocial")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="350" HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbAbreviatura" runat="server" CausesValidation="False" Text="" CommandArgument="Abreviatura" OnClick="LbOrden_Click">--%>
|
||||
Moneda
|
||||
<%--<asp:Literal ID="ImgAbreviatura" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbreviatura" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%--<asp:LinkButton ID="LbOriginal" runat="server" CausesValidation="False" Text="" CommandArgument="Original" OnClick="LbOrden_Click">--%>
|
||||
Original
|
||||
<%--<asp:Literal ID="ImgOriginal" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbAbonado" runat="server" CausesValidation="False" Text="" CommandArgument="Abonado" OnClick="LbOrden_Click">--%>
|
||||
Abonado
|
||||
<%--<asp:Literal ID="ImgAbonado" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%-- </asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<%-- <asp:LinkButton ID="LbSaldo" runat="server" CausesValidation="False" Text="" CommandArgument="Saldo" OnClick="LbOrden_Click">--%>
|
||||
Saldo
|
||||
<%--<asp:Literal ID="ImgSaldo" runat="server" Text=" <i class='fa fa-sort' style='color:#999' ></i>"></asp:Literal>--%>
|
||||
<%--</asp:LinkButton>--%>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
<ajax:TabPanel ID="TabRemisionesNotasCredito" runat="server" HeaderText="Remisiones Notas de Crédito" Visible="false">
|
||||
<ContentTemplate>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<asp:UpdatePanel ID="UpDatosRemsiones" UpdateMode="Conditional" runat="server">
|
||||
<ContentTemplate>
|
||||
<asp:GridView ID="GvRemisiones" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Notas de Crédito" OnRowDataBound="GvRemisiones_RowDataBound"
|
||||
CssClass="table table-striped table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None"
|
||||
DataKeyNames="CveCompra,Saldo,CveIE,CveProveedor,CvePersonal,CveMoneda,CveTipoConcepto,TipoCambio,CveSubProyecto,SerieFolio">
|
||||
<Columns>
|
||||
<asp:TemplateField ItemStyle-Width="2%">
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox ID="chk" Checked="false" Visible="false" runat="server" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Serie Folio
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLSerieFolio" runat="server" Text='<%# Eval("SerieFolio")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Fecha
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelFecha" runat="server" Text='<%# Eval("Fecha", "{0:d}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="75" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Proveedor
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:HyperLink ID="HLRazonSocial" runat="server" Text='<%# Eval("RazonSocial")%>' CssClass="Texto"></asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="350" HorizontalAlign="Left" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Moneda
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbreviatura" runat="server" Text='<%# Eval("Abreviatura")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="45" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Original
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelOriginal" runat="server" Text='<%# Eval("Original", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Abonado
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelAbonado" runat="server" Text='<%# Eval("Abonado", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
Saldo
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LabelSaldo" runat="server" Text='<%# Eval("Saldo", "{0:N2}")%>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
<ItemStyle Width="80" HorizontalAlign="Right" />
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<RowStyle CssClass="Texto" />
|
||||
<AlternatingRowStyle CssClass="TextoAlterno" />
|
||||
<HeaderStyle CssClass="Titulos" />
|
||||
</asp:GridView>
|
||||
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ContentTemplate>
|
||||
</ajax:TabPanel>
|
||||
|
||||
|
||||
</ajax:TabContainer>
|
||||
|
||||
|
||||
|
||||
<div id="DivSaldar" class="modal ADS fade" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
|
||||
@@ -4,6 +4,7 @@ Option Strict On
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
Imports Stimulsoft.Report.Check
|
||||
|
||||
Partial Class Compras_RepNotasCredito
|
||||
Inherits ClsPaginas
|
||||
@@ -11,15 +12,34 @@ Partial Class Compras_RepNotasCredito
|
||||
#Region "PROPIEDADES"
|
||||
Private Property DtDatos As DataTable
|
||||
Get
|
||||
DtDatos = CType(ViewState("DtDatos"), DataTable)
|
||||
If ViewState("DtDatos") Is Nothing Then
|
||||
ViewState("DtDatos") = New DataTable
|
||||
End If
|
||||
|
||||
Return CType(ViewState("DtDatos"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DtDatosRemisiones As DataTable
|
||||
Get
|
||||
If ViewState("DtDatosRemisiones") Is Nothing Then
|
||||
ViewState("DtDatosRemisiones") = New DataTable
|
||||
End If
|
||||
Return CType(ViewState("DtDatosRemisiones"), DataTable)
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DtDatosRemisiones") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||
If Not Page.IsPostBack Then
|
||||
ConfiguraTabs()
|
||||
|
||||
DdlProveedores.setEsWebService(True)
|
||||
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
|
||||
DdlProveedores.SelectedText = "Todos"
|
||||
@@ -27,10 +47,33 @@ Partial Class Compras_RepNotasCredito
|
||||
|
||||
TxtFechaSaldar.Text = NowADS().ToShortDateString
|
||||
CargaDatos()
|
||||
|
||||
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
CargaDatos()
|
||||
Else
|
||||
CargaDatosRemisiones()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ConfiguraTabs()
|
||||
Tab.ActiveTabIndex = 0
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
TabRemisionesNotasCredito.Visible = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "NOTAS DE CREDITO"
|
||||
Private Sub CargaDatos()
|
||||
DtDatos = New DataTable
|
||||
Dim ObjCompras As New ClsCompras
|
||||
Dim FechaI, FechaF As String
|
||||
|
||||
@@ -56,12 +99,95 @@ Partial Class Compras_RepNotasCredito
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs)
|
||||
CargaDatos()
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaGrid(Orden As String)
|
||||
Dim DV As DataView = Nothing
|
||||
DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
|
||||
If Orden <> String.Empty Then
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
Else
|
||||
GvDatos.DataSource = DtDatos
|
||||
End If
|
||||
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
DV.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
#Region "REMISIONES"
|
||||
Private Sub CargaDatosRemisiones()
|
||||
DtDatosRemisiones = New DataTable
|
||||
GvRemisiones.DataSource = Nothing
|
||||
Dim ObjCompras As New ClsCompras
|
||||
Dim FechaI, FechaF As String
|
||||
|
||||
If txtFechaI.Text <> "" Then FechaI = txtFechaI.Text Else FechaI = "-1"
|
||||
If txtFechaF.Text <> "" Then FechaF = txtFechaF.Text Else FechaF = "-1"
|
||||
|
||||
|
||||
If ObjCompras.GetNotasCreditoRep(DdlProveedores.SelectedValue.ToEntero, DdlOpcion.SelectedValue.ToEntero, FechaI, FechaF, UsuarioActual.CveEmpresa, 2) Then
|
||||
DtDatosRemisiones = ObjCompras.DtResultados
|
||||
GvRemisiones.DataSource = DtDatosRemisiones
|
||||
Else
|
||||
Alert("Ocurrió un error al obtener las remisiones", Extensiones.TipoMensaje.MsgError)
|
||||
End If
|
||||
|
||||
ObjCompras.Dispose()
|
||||
|
||||
GvRemisiones.DataBind()
|
||||
|
||||
UpDatosRemsiones.Update()
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub GvRemisiones_RowDataBound(sender As Object, e As GridViewRowEventArgs)
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
e.Row.FCHyperLink("HLRazonSocial").NavigateUrl = String.Format("/Compras/Proveedores.aspx?CveProveedor={0}", e.Row.DBCampo("CveProveedor"))
|
||||
e.Row.FCHyperLink("HLSerieFolio").NavigateUrl = String.Format("/Compras/Compras.aspx?CveCompra={0}", e.Row.DBCampo("CveCompra"))
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
|
||||
Protected Sub ImgExcel_Click(sender As Object, e As EventArgs) Handles ImgExcel.Click
|
||||
GvDatos.ExportToExcel("RepNotasCredito." & NowADS().ToShortDateString)
|
||||
|
||||
If Tab.ActiveTabIndex = 0 Then
|
||||
GvDatos.ExportToExcel("RepNotasCredito." & NowADS().ToShortDateString)
|
||||
Else
|
||||
GvRemisiones.ExportToExcel("RepRemisionesNotasCredito." & NowADS().ToShortDateString)
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -219,44 +345,5 @@ Partial Class Compras_RepNotasCredito
|
||||
End Sub
|
||||
|
||||
|
||||
#Region "O R D E N A M I E N T O"
|
||||
Protected Sub LbOrden_Click(ByVal sender As Object, ByVal e As EventArgs)
|
||||
Dim Orden As String = ""
|
||||
Dim Campo As String = ""
|
||||
Dim Literal As Literal = Nothing
|
||||
Const OrdenInicial As String = ""
|
||||
Dim Arg(2) As String
|
||||
|
||||
Arg = CType(sender, LinkButton).CommandArgument().ToString.Split(";"c)
|
||||
Campo = Arg(0)
|
||||
Literal = CType(CType(sender, LinkButton).NamingContainer.FindControl("Img" & Campo.Replace(", ", "_")), Literal)
|
||||
|
||||
If ViewState(String.Format("O{0}", Campo)) IsNot Nothing AndAlso ViewState(String.Format("O{0}", Campo)).ToString = String.Format("{0} DESC", Campo) Then
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} ASC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-asc' style='color:#999' ></i>")
|
||||
Else
|
||||
ViewState(String.Format("O{0}", Campo)) = String.Format("{0} DESC", Campo)
|
||||
Literal.Text = String.Format("<i class='fa fa-sort-desc' style='color:#999' ></i>")
|
||||
End If
|
||||
Orden = OrdenInicial & ViewState(String.Format("O{0}", Campo)).ToString
|
||||
ViewState("Orden") = Orden
|
||||
CargaGrid(Orden)
|
||||
End Sub
|
||||
|
||||
Protected Sub CargaGrid(Orden As String)
|
||||
Dim DV As DataView = Nothing
|
||||
DV = New DataView(DtDatos, "", Orden, DataViewRowState.CurrentRows)
|
||||
If Orden <> String.Empty Then
|
||||
GvDatos.DataSource = DV.ToTable()
|
||||
Else
|
||||
GvDatos.DataSource = DtDatos
|
||||
End If
|
||||
|
||||
GvDatos.DataBind()
|
||||
UpDatos.Update()
|
||||
DV.Dispose()
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user