Ajustes Layout Scotia

This commit is contained in:
Oscar Irigoyen
2025-07-15 23:33:50 -07:00
parent 3e75367772
commit 5339ee8aea
6 changed files with 224 additions and 118 deletions

View File

@@ -113,6 +113,11 @@
<td>
<asp:TextBox ID="TxtConvenio" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td>
</tr>
<tr id="TrConvenioNomina" runat="server" visible="false">
<td>Convenio:</td>
<td>
<asp:TextBox ID="TxtConvenioNomina" runat="server" MaxLength="18" Width="200px"></asp:TextBox></td>
</tr>
<tr runat="server" id="trFinicial">
<td>
<asp:Literal runat="server" ID="LtFInicial" Text="Folio Inicial:"></asp:Literal>

View File

@@ -216,6 +216,7 @@ Partial Class Bancos_CuentasBancariasDetalle
LblFecha.Text = ObjCuentasBancariasDetalle.Fecha.ToShortDateString
LblUsuario.Text = ObjCuentasBancariasDetalle.Usuario
TxtConvenio.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronico.ToString
TxtConvenioNomina.Text = ObjCuentasBancariasDetalle.ConvenioPagoElectronicoNomina
ChkLayout.Checked = ObjCuentasBancariasDetalle.UsaLayout
ChkLayoutGrupos.Checked = ObjCuentasBancariasDetalle.UsaLayoutGrupos
ChkUsaTarjeta.Checked = ObjCuentasBancariasDetalle.UsaTarjeta
@@ -296,7 +297,8 @@ Partial Class Bancos_CuentasBancariasDetalle
TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0, TxtLimiteCredito.Text.Trim.ToDouble,
"", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, If(ChkLayout.Checked, TxtConvenio.Text, ""), ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked,
TieneTerminal:=ChkTieneTerminal.Checked,
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim) Then
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim,
ConvenioPagoElectronicoNomina:=TxtConvenioNomina.Text) Then
ViewState("CveCuenta") = ObjCuentasBancariasDetalle.TCveCuenta
Else
ErrorUsuarios = True
@@ -331,7 +333,8 @@ Partial Class Bancos_CuentasBancariasDetalle
If ObjCuentasBancariasDetalle.UpdateBancosCuentas(DdlBanco.SelectedValue.ToEntero, DdlTipoCuenta.SelectedValue.ToEntero, TxtNumCuenta.Text.Trim, TxtCLABE.Text.Trim, DdlMoneda.SelectedValue.ToEntero, 0, TxtFInicial.Text.Trim.ToEntero, 0, 0,
TxtLimiteCredito.Text.Trim.ToDouble, "", ChkEstatus.Checked, CveCuenta, TxtConvenio.Text,
ChkLayout.Checked, ChkUsaTarjeta.Checked, UsaLayoutGrupos:=ChkLayoutGrupos.Checked, TieneTerminal:=ChkTieneTerminal.Checked,
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim) Then
CveCuentaPadre:=DdlCuentaPadre.SelectedValue.ToEntero, CveSubProyecto:=DdlSubProyectos.SelectedValue.ToEntero, NumeroSucursal:=TxtNumeroSucursal.Text.Trim,
ConvenioPagoElectronicoNomina:=TxtConvenioNomina.Text) Then
'CargaDatos()
GlobalDTBancosCuentas(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
GlobalDTBancosCuentasGral(UsuarioActual.CveEmpresa) = Nothing
@@ -688,8 +691,10 @@ Partial Class Bancos_CuentasBancariasDetalle
Private Sub InicializaConvenio()
If ChkLayout.Checked Then
TrConvenio.Visible = True
TrConvenioNomina.Visible = True
Else
TrConvenio.Visible = False
TrConvenioNomina.Visible = False
End If
End Sub
Protected Sub ChkLayout_CheckedChanged(sender As Object, e As EventArgs)

View File

@@ -8,6 +8,7 @@ Imports System.Data
Imports System.Data.Entity
Imports System.Data.SqlClient
Imports System.IO
Imports System.Runtime.ConstrainedExecution
Imports System.Runtime.Remoting
Imports AjaxControlToolkit.AsyncFileUpload.Constants
Imports Extensiones
@@ -656,9 +657,11 @@ Partial Class Bancos_PagoElectronico
End If
End Sub
Protected Sub LBRegenerar_Click(sender As Object, e As EventArgs)
Dim CveBLE As Integer = CType(sender, LinkButton).CommandArgument.ToEntero
Dim DtRegenerar As New DataTable
Dim ObjBancos As New ClsBancos
If ObjBancos.GetLayoutPagos(CveCuenta, CveBLE, "-1") Then
DtRegenerar = ObjBancos.DtResultados
@@ -676,11 +679,16 @@ Partial Class Bancos_PagoElectronico
End If
If OpBancos = 3 Then
If DtRegenerar IsNot Nothing Then
Dim Secuencia As Integer = DtRegenerar.Rows(0)("Secuencia").ToString.ToEntero
Secuencia = If(Secuencia <= 0, 1, Secuencia)
Dim ErrorScotia As Boolean = False
Using objScotia As New ClsPagoScotia
If objScotia.GeneraPagoScotiaBank(DtRegenerar, False, CveCuenta, UsuarioActual) Then
If objScotia.GeneraPagoScotiaBank(DtRegenerar, False, CveCuenta, UsuarioActual, Secuencia) Then
If objScotia.ErrorLayout = False And objScotia.TotalPagos > 0 Then
@@ -748,21 +756,41 @@ Partial Class Bancos_PagoElectronico
Dim fechaHoy As String = DateTime.Today.ToString("MM/dd/yyyy")
Dim ErrorCuentas As Boolean = False
Using objPagoScotia As New ClsPagoScotia
If objPagoScotia.AltaCuentasScotia(DTPendientes.FiltraParametros($" EstatusPagoElectronicoScotia = False Or FechaEliminacion < #{fechaHoy}#"), UsuarioActual) Then
DVDescargaPagos.Visible = False
DVDescargaReporte.Visible = False
LblCuentas.Text = "Cuentas Bajio"
DVDescargaCuentas1.Visible = True
LnkDescargaCuentas1.Text = objPagoScotia.NombreArchivo
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
UpModalDescarga.Update()
Else
Alert($"Errores detectados <br>{objPagoScotia.LayouErrorStr.ToString}", TipoMensaje.MsgAdvertencia)
ErrorCuentas = True
End If
End Using
Dim objBancos As New ClsBancos
objBancos.IniciaTransacSQL()
Dim NombreArchivoAltas = $"altacuentasScotia_{NowADS():ddMMyyyy}_001.txt"
Dim CveLayoutEnvio As Integer = objBancos.AddLayoutEnvios(NombreArchivoAltas, ClsPaginas.NowADS(), DdlCuenta.SelectedValue.ToEntero, PorGrupos:=True, GenSecuencia:=True, AltaCuenta:=True)
Dim Secuencia As Integer = objBancos.SecuenciaLayout
If CveLayoutEnvio > 0 AndAlso Secuencia > 0 Then
Using objPagoScotia As New ClsPagoScotia
If objPagoScotia.AltaCuentasScotia(DTPendientes.FiltraParametros($" EstatusPagoElectronicoScotia = False Or FechaEliminacion < #{fechaHoy}#"), UsuarioActual, Secuencia:=Secuencia) Then
DVDescargaPagos.Visible = False
DVDescargaReporte.Visible = False
LblCuentas.Text = "Cuentas Bajio"
DVDescargaCuentas1.Visible = True
LnkDescargaCuentas1.Text = objPagoScotia.NombreArchivo
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
UpModalDescarga.Update()
Else
Alert($"Errores detectados <br>{objPagoScotia.LayouErrorStr.ToString}", TipoMensaje.MsgAdvertencia)
ErrorCuentas = True
End If
End Using
End If
If Not ErrorCuentas Then
objBancos.Commit()
Else
objBancos.RollBack()
Alert("Se presento un error al gennerar el layout.")
End If
objBancos.Dispose()
'AltaCuentasScotia(DTPendientes.FiltraParametros($" EstatusPagoElectronicoScotia = False Or FechaEliminacion < #{fechaHoy}#"))
@@ -1130,30 +1158,68 @@ Partial Class Bancos_PagoElectronico
DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'").Rows.Count > 0 Then
Dim errorScotia As Boolean = False
Using objScotia As New ClsPagoScotia
If objScotia.GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'"), True, CveCuenta, UsuarioActual) Then
Dim NombreArchivoPagos = $"pagos_{ClsPaginas.NowADS.ToString("ddMMyyyy")}_001.txt"
If objScotia.ErrorLayout = False And objScotia.TotalPagos > 0 Then
Dim ObjBancos As New ClsBancos
ObjBancos.IniciaTransacSQL()
DVDescargaPagos.Visible = True
DVDescargaCuentas1.Visible = False
DVDescargaReporte.Visible = True
DT_PagosReporte = DTPendientes.Copy
LnkDescarga.Text = objScotia.NombreArchivo
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
UpModalDescarga.Update()
Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivoPagos, ClsPaginas.NowADS(), CveCuenta, PorGrupos:=False, GenSecuencia:=True, AltaCuenta:=False)
Dim SecuenciaLayout As Integer = ObjBancos.SecuenciaLayout
If CveLayoutEnvio > 0 AndAlso SecuenciaLayout > 0 Then
For Each dr As DataRow In DTPendientes.Rows
If dr("CveProveedor").ToString <> "" Or dr("CvePersonal").ToString <> "" Then
If Not ObjBancos.AddLayoutEnviosDetalle(CveLayoutEnvio, dr("CveIE").ToString.ToEntero, dr("CveProveedor").ToString.ToEntero, dr("CvePersonal").ToString.ToEntero, 1, "Observaciones") Then
errorScotia = True
Exit For
End If
End If
Next
Else
errorScotia = True
End If
'Dim objScotiaNombreArchivo As String = ""
If Not errorScotia AndAlso CveLayoutEnvio > 0 AndAlso SecuenciaLayout > 0 Then
Using objScotia As New ClsPagoScotia
If objScotia.GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'"), True, CveCuenta, UsuarioActual, SecuenciaLayout) Then
If objScotia.ErrorLayout = False And objScotia.TotalPagos > 0 Then
DVDescargaPagos.Visible = True
DVDescargaCuentas1.Visible = False
DVDescargaReporte.Visible = True
DT_PagosReporte = DTPendientes.Copy
LnkDescarga.Text = objScotia.NombreArchivo
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
UpModalDescarga.Update()
Else
Alert($"Errores detectados <br>{objScotia.LayouErrorStr.ToString}", TipoMensaje.MsgAdvertencia)
errorScotia = True
End If
Else
Alert($"Errores detectados <br>{objScotia.LayouErrorStr.ToString}", TipoMensaje.MsgAdvertencia)
errorScotia = True
Alert("Error al generar el pago de ScotiaBank. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End Using
End If
If Not errorScotia Then
ObjBancos.Commit()
Else
ObjBancos.RollBack()
End If
ObjBancos.Dispose()
Else
errorScotia = True
Alert("Error al generar el pago de ScotiaBank. Por favor vuelva a intentar.", TipoMensaje.MsgError)
End If
End Using
If Not errorScotia Then
CargaDatos()