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

@@ -51,28 +51,44 @@ Partial Class Bancos_RepComplementoPago
For Each gvr As GridViewRow In GvD.Rows
If gvr.FCCheckBox("Chk").Checked Then
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
Str.AppendFormat("Folio: <b>{0}</b> &nbsp;", Banco.ComplementoSerieFolio)
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">XML &nbsp;<i class=""fa fa-file""></i></i></a>&nbsp;&nbsp;", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">PDF &nbsp;<i class=""fa fa-ad-pdf""></i></i></i></a>&nbsp;", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a style='color:#337ab7' target='_blank' href='./IE.aspx?CveIE={0}'>{1}</a> &nbsp; {2}<br>", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
End If
Else
Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
Banco.RollBack()
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, FechaTimbrado:=FechaTimbrado) Then
If Banco.Mensaje = "" Then
Banco.Commit()
PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
Str.AppendFormat("Folio: <b>{0}</b> &nbsp;", Banco.ComplementoSerieFolio)
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">XML &nbsp;<i class=""fa fa-file""></i></i></a>&nbsp;&nbsp;", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a class=""texto"" style='color:#337ab7' href=""/Compras/PopUpVerFactura.aspx?P={0}"" target=""_blank"">PDF &nbsp;<i class=""fa fa-ad-pdf""></i></i></i></a>&nbsp;", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
Str.AppendFormat("<a style='color:#337ab7' target='_blank' href='./IE.aspx?CveIE={0}'>{1}</a> &nbsp; {2}<br>", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
End If
Else
Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
Banco.RollBack()
End If
Banco.Dispose()
End If
Next