Fecha de sucursal al emitir complementos

This commit is contained in:
2020-11-13 10:23:33 -07:00
parent db365f8ce3
commit 6b6dd2763c
3 changed files with 64 additions and 21 deletions

View File

@@ -945,7 +945,7 @@ Public Class ClsBancos
Public Function GeneraTimbrePago(CveIE As Integer, CveVenta As Integer, UsuarioActual As Usuario, Optional CveCliente As Integer = -1, Optional CFDIRelacionado As String = "-1", Optional EsRegeneracion As Boolean = False, Optional CvePrePoliza As Integer = -1, Optional FechaTimbrado As DateTime = MinFecha) As Boolean
If FechaTimbrado = MinFecha Then FechaTimbrado = DateTime.Now
Dim Serie As String = "Pag"
Dim Folio As Integer = -1
Dim Retorno As Boolean = False
@@ -961,6 +961,33 @@ Public Class ClsBancos
'If EsCancelacion Then Estatus = 2
If EsRegeneracion Then Estatus = 3
If FechaTimbrado = MinFecha Then
Dim RowFiltro As DataRow = Nothing
RowFiltro = dttpagos.FiltroPrimero("")
If RowFiltro IsNot Nothing Then
If Now.EsHorarioVerano Then
Dim UTCOffsetVerano As Integer = RowFiltro("UTCOffsetVerano").ToString().ToEntero()
If UTCOffsetVerano <> 0 Then
FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetVerano)
Else
FechaTimbrado = DateTime.Now
End If
Else
Dim UTCOffsetInvierno As Integer = RowFiltro("UTCOffsetInvierno").ToString().ToEntero()
If UTCOffsetInvierno <> 0 Then
FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffsetInvierno)
Else
FechaTimbrado = DateTime.Now
End If
End If
Else
FechaTimbrado = DateTime.Now
End If
End If
Dim tCveComplementoPago As Integer = AddComplementoPago(If(CvePrePoliza > 0, CveIE, dr("CveIE").ToString.ToEntero), -1, Serie, Folio, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CvePrePoliza:=CvePrePoliza, Estatus:=Estatus)
If tCveComplementoPago > 0 Then

View File

@@ -114,7 +114,7 @@
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvD" runat="server" GridLines="None"
DataKeyNames="CobranzaCorreo,CveIE,CveVenta,CveEmpresa,FechaDocumento, PagoAbreviaturaSAT,Folio, ClaveFormaPagoSAT, NumCuenta,Importe, FolioFiscal,VentaSerie,VentaFolio,VentaAbreviaturaSAT, VentaImportePagado,MetodoPago,TipoCambio,NumParcialidad,ImpSaldoInsoluto,ImpSaldoAnterior,RFC,NombreCliente,PorcentajeIVA,PorcentajeIEPS,CuentaBeneficiario,SerieFolioPago,FolioFiscalComplemento,CveComplementoPago"
DataKeyNames="CobranzaCorreo,CveIE,CveVenta,CveEmpresa,FechaDocumento, PagoAbreviaturaSAT,Folio, ClaveFormaPagoSAT, NumCuenta,Importe, FolioFiscal,VentaSerie,VentaFolio,VentaAbreviaturaSAT, VentaImportePagado,MetodoPago,TipoCambio,NumParcialidad,ImpSaldoInsoluto,ImpSaldoAnterior,RFC,NombreCliente,PorcentajeIVA,PorcentajeIEPS,CuentaBeneficiario,SerieFolioPago,FolioFiscalComplemento,CveComplementoPago,UTCOffsetVerano,UTCOffsetInvierno"
CssClass="table table-striped table-advance table-hover Widthall mysmallbtn" CellSpacing="0" Width="100%" AutoGenerateColumns="False" EmptyDataText="No se encontraron registros">
<Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">

View File

@@ -52,11 +52,28 @@ Partial Class Bancos_RepComplementoPago
For Each gvr As GridViewRow In GvD.Rows
If gvr.FCCheckBox("Chk").Checked Then
Dim FechaTimbrado As DateTime = DateTime.Now
Dim UTCOffset As Integer = 0
If Now.EsHorarioVerano Then
If gvr.DataKey("UTCOffsetVerano").ToEntero() <> 0 Then
UTCOffset = gvr.DataKey("UTCOffsetVerano").ToEntero()
End If
Else
If gvr.DataKey("UTCOffsetInvierno").ToEntero() <> 0 Then
UTCOffset = gvr.DataKey("UTCOffsetInvierno").ToEntero()
End If
End If
If UTCOffset <> 0 Then
FechaTimbrado = DateTime.UtcNow.AddHours(UTCOffset)
End If
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual) Then
If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
@@ -72,7 +89,6 @@ Partial Class Bancos_RepComplementoPago
Banco.RollBack()
End If
Banco.Dispose()
End If
Next