This commit is contained in:
rrene
2020-06-18 21:32:12 -07:00
35 changed files with 1399 additions and 350 deletions

View File

@@ -573,6 +573,7 @@ Partial Class Bancos_IE
CveCredito = IfNull(Request("CveCredito"), "-1").ToString.ToEntero
CveCreditoDetalle = IfNull(Request("CveCreditoDetalle"), "-1").ToString.ToEntero
LtlTitulo.Text = "Pago de Créditos"
CveIE = -1
DVInteresMoratorio.Visible = True
@@ -4642,7 +4643,7 @@ Partial Class Bancos_IE
Dim Dep As New ClsGenerales
If Dep.GetCuentasDepositos(CveProveedor:=CveProveedor, CveCliente:=CveCliente, CvePersonal:=CvePersonal) Then
If DdlTipoTransaccion.SelectedValue = "9" Then
If DdlTipoTransaccion.SelectedValue = "9" And CveIE <= -1 Then
DdlCuentaDeposito.DataSource = Dep.DtResultados.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'")
@@ -4653,7 +4654,7 @@ Partial Class Bancos_IE
Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia)
End If
ElseIf DdlTipoTransaccion.SelectedValue = "17" Then
ElseIf DdlTipoTransaccion.SelectedValue = "17" And CveIE <= -1 Then
If Dep.DtResultados.Rows.Count > 0 Then
@@ -4685,7 +4686,7 @@ Partial Class Bancos_IE
Else
If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then
If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") And CveIE <= -1 Then
BtnGuardar.Enabled = False
Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia)

View File

@@ -1979,7 +1979,7 @@ Partial Class Bancos_PagoElectronico
'Dim CveTipoTransaccion As Integer = Parametros(4).ToEntero
'Dim Estatus As Integer = If(CveTipoTransaccion = 2, 2, 1) ' cuando es transferencia, no lo pasa por entregar
' Mail.MandaCorreo(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
'Mail.MandaCorreo(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
End Sub
@@ -2756,10 +2756,15 @@ Partial Class Bancos_PagoElectronico
params.Add(New ReportParameter("LogoPath", ""))
End If
params.Add(New ReportParameter("Empresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
params.Add(New ReportParameter("Direccion", UsuarioActual.Empresa.Direccion))
params.Add(New ReportParameter("RFC", UsuarioActual.Empresa.RFC))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout"))
ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DtPago, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
End If

View File

@@ -732,7 +732,7 @@
<asp:BoundField HeaderText="Banco" DataField="BancoNombre" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Cuenta" DataField="Cuenta" ItemStyle-Width="100" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Clabe" DataField="CLABEDestino" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="CLABE" DataField="CLABE" ItemStyle-HorizontalAlign="Left" />
<asp:TemplateField HeaderText="Banco" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="150px">
@@ -855,19 +855,20 @@
<div class="col-md-12" runat="server" id="DVDescargaCuentas2" visible=" false">
<p> Cuentas Interbancarias <asp:LinkButton runat="server" ID="LnkDescargaCuentas2" OnClick="LnkDescargaCuentas2_Click" CssClass="Texto"></asp:LinkButton> </p>
</div>
<div class="col-md-12" runat="server" id="DVDescargaCuentas3" visible=" false">
<p> Cuentas Convennios CIE <asp:LinkButton runat="server" ID="LnkDescargaCuentas3" OnClick="LnkDescargaCuentas3_Click" CssClass="Texto"></asp:LinkButton> </p>
</div>
<div class="col-md-12" runat="server" id="DVDescargaReporte" visible=" false">
<p> <asp:LinkButton runat="server" ID="LnkDescargaReporte" OnClick="LnkDescargaReporte_Click" CssClass="Texto" Text="Descargar Reporte"></asp:LinkButton> </p>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkDescarga" />
<asp:PostBackTrigger ControlID="LnkDescargaCuentas1" />
<asp:PostBackTrigger ControlID="LnkDescargaCuentas2" />
<asp:PostBackTrigger ControlID="LnkDescargaCuentas3" />
<asp:PostBackTrigger ControlID="LnkDescargaReporte" />
</Triggers>
</asp:UpdatePanel>

View File

@@ -202,6 +202,16 @@ Partial Class Bancos_PagoElectronicoGrupos
End Set
End Property
Private Property NombreArchivoCIE As String
Get
Return ViewState("NombreArchivoCIE").ToString
End Get
Set(value As String)
ViewState("NombreArchivoCIE") = value
End Set
End Property
Property DTSATBancos As DataTable
Get
If ViewState("DTSATBancos") Is Nothing Then
@@ -216,6 +226,63 @@ Partial Class Bancos_PagoElectronicoGrupos
End Property
Property CveIEPagoActual As Integer
Get
If ViewState("CveIEPagoActual") Is Nothing Then
Return -1
Else
Return ViewState("CveIEPagoActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveIEPagoActual") = value
End Set
End Property
Property CveLayoutEnvioDetalleActual As Integer
Get
If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then
Return -1
Else
Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveLayoutEnvioDetalleActual") = value
End Set
End Property
Property GvIndexActual As Integer
Get
If ViewState("GvIndexActual") Is Nothing Then
Return -1
Else
Return ViewState("GvIndexActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("GvIndexActual") = value
End Set
End Property
Property DTFoliosPrefijos As DataTable
Get
If ViewState("DTFoliosPrefijos") Is Nothing Then
Crate_DTFoliosPrefijos()
Return DirectCast(ViewState("DTFoliosPrefijos"), DataTable)
Else
Return DirectCast(ViewState("DTFoliosPrefijos"), DataTable)
End If
End Get
Set(value As DataTable)
ViewState("DTFoliosPrefijos") = value
End Set
End Property
#End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -244,6 +311,20 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub
Private Sub Crate_DTFoliosPrefijos()
Dim DTFolios As New DataTable
DTFolios.Columns.Add("CveIE", GetType(Integer))
DTFolios.Columns.Add("Folio", GetType(String))
DTFolios.AcceptChanges()
ViewState("DTFoliosPrefijos") = DTFolios.Copy
End Sub
#Region " C A R G A - D A T O S "
Private Sub CargaCuentas()
DdlCuenta.DataSource = GlobalDTBancosCuentas(UsuarioActual.CveUsuario).FiltraParametros("UsaLayoutGrupos = 1")
@@ -412,6 +493,13 @@ Partial Class Bancos_PagoElectronicoGrupos
End If
Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo)
If File.Exists(path) Then
File.Delete(path)
End If
Dim fs As FileStream = File.Create(path)
' Add text to the file.
@@ -622,9 +710,16 @@ Partial Class Bancos_PagoElectronicoGrupos
NombreArchivoBancomer = ""
NombreArchivoInterbancario = ""
NombreArchivoCIE = ""
DVDescargaCuentas1.Visible = False
DVDescargaCuentas2.Visible = False
DVDescargaCuentas3.Visible = False
NombreArchivo = ""
Dim RegistrosAltaBancomer As New StringBuilder
Dim RegistrosAltaBancomerCIE As New StringBuilder
Dim RegistrosAltaInterbancario As New StringBuilder
Dim SBErrores As New StringBuilder
@@ -643,12 +738,13 @@ Partial Class Bancos_PagoElectronicoGrupos
DtCuentasPendientesTemp.CaseSensitive = False
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias"})
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias"})
Dim DtCuentasPendientesBancomer As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND CveBanco = '012' AND LEN(CIE) = 0) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
Dim DtCuentasPendientesCIE As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre like '%BBVA%' OR BancoNombre like '%BANCOMER%' AND LEN(CIE) > 0 AND CveBanco = '012') ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
Dim DtCuentasPendientesInterbancarias As DataTable = DtCuentasPendientesTemp.FiltraParametros($" (EstatusPagoElectronicoGrupos IS NULL OR EstatusPagoElectronicoGrupos = False) AND (BancoNombre not like '%BBVA%' AND BancoNombre not like '%BANCOMER%' ) ", "", {"CveCuentaDeposito", "BancoNombre", "CLABEDestino", "Abreviatura", "RazonSocial", "CveProveedor", "CveBanco", "Cuenta", "BBVAAlias", "CIE"})
'Dim ObjGrales As New ClsGenerales
'Cuentas bancomer
If DtCuentasPendientesBancomer.Rows.Count > 0 Then
For Each dRow As DataRow In DtCuentasPendientesBancomer.Rows
@@ -707,10 +803,60 @@ Partial Class Bancos_PagoElectronicoGrupos
NombreArchivoBancomer = NombreArchivo
End If
End If
'Cuentas bancomer CIE
If DtCuentasPendientesCIE.Rows.Count > 0 Then
For Each dRow As DataRow In DtCuentasPendientesCIE.Rows
Dim SBTmpBancomerCIE As New StringBuilder
Dim SBErroresBancomerCIE As New StringBuilder
Dim ErrorLineaBancomerCIE As Boolean = False
SBErroresBancomerCIE.Append($"{dRow("RazonSocial").ToString } ")
SBErroresBancomerCIE.Append($"Cuenta: {dRow("Cuenta").ToString } ")
SBTmpBancomerCIE.Append("CV")
SBTmpBancomerCIE.Append(dRow("CIE").ToString.PadLeft(18, CeroRelleno))
If dRow("Abreviatura").ToString.Length = 3 Then
SBTmpBancomerCIE.Append(dRow("Abreviatura"))
Else
SBErroresBancomerCIE.Append("El tamaño de la divisa es incorrecto, ")
ErrorLineaBancomerCIE = True
End If
SBTmpBancomerCIE.Append("0999999999999.99")
If dRow("RazonSocial").ToString.Trim.Length < 31 Then 'Tamaño maximo 30
SBTmpBancomerCIE.Append(dRow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
Else
SBTmpBancomerCIE.Append(dRow("RazonSocial").ToString.Trim.Substring(0, 30))
End If
'ALIAS DE LA CUENTA PENDIENTE TAMAÑO MAXIMO 30
SBTmpBancomerCIE.Append(dRow("BBVAAlias").ToString.PadRight(30, EspacioRelleno))
SBTmpBancomerCIE.Append(vbCrLf)
If Not ErrorLineaBancomerCIE Then
RegistrosAltaBancomerCIE.Append(SBTmpBancomerCIE.ToString)
Else
SBErroresBancomerCIE.Append("<br>")
SBErrores.AppendLine(SBErroresBancomerCIE.ToString)
End If
Next
TextoCompleto = RegistrosAltaBancomerCIE.ToString
If CreaArchivo(2, True) Then
NombreArchivoCIE = NombreArchivo
End If
End If
If DtCuentasPendientesInterbancarias.Rows.Count > 0 Then
@@ -799,17 +945,13 @@ Partial Class Bancos_PagoElectronicoGrupos
If NombreArchivoBancomer.Trim.Length > 0 Then
DVDescargaCuentas1.Visible = True
' Mensaje.Append($"Cuentas Bancomer <a class='Texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoBancomer}' download > Descarga Archivo cuentas Bancomer</a> <br><br>")
End If
If NombreArchivoInterbancario.Trim.Length > 0 Then
DVDescargaCuentas2.Visible = True
'Mensaje.Append($"Cuentas Interbancarias <a class='Texto' href='../Empresas/{UsuarioActual.CveEmpresa}/Layout/{NombreArchivoInterbancario}' download >Descarga Archivo cuentas Bancomer</a> <br><br>")
End If
If NombreArchivoCIE.Trim.Length > 0 Then
DVDescargaCuentas3.Visible = True
End If
@@ -820,21 +962,18 @@ Partial Class Bancos_PagoElectronicoGrupos
Mensaje.Append("</div>")
End If
If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Then
If NombreArchivoBancomer.Length > 0 Or NombreArchivoInterbancario.Length > 0 Or NombreArchivoCIE.Length > 0 Then
LnkDescargaCuentas1.Text = NombreArchivoBancomer
LnkDescargaCuentas2.Text = NombreArchivoInterbancario
LnkDescargaCuentas3.Text = NombreArchivoCIE
RegistraScript("$('#ModalDescarga').modal({ backdrop: 'static', keyboard: false});")
UpModalDescarga.Update()
Else
Alert(Mensaje.ToString, TipoMensaje.MsgAdvertencia)
End If
CargaDatos()
End Sub
@@ -1000,6 +1139,7 @@ Partial Class Bancos_PagoElectronicoGrupos
'Alert("Hola")
End If
End Sub
Protected Sub FormarTexto(Registros As Integer)
'''''' LLENADO HEADER
Dim convenio As String = DTPendienteActual(0)("ConvenioPagoElectronico").ToString
@@ -1050,7 +1190,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim RegistrosPago As New StringBuilder
Dim MENSAJEError As New StringBuilder
Dim EsCIE As Boolean = False
Dim CeroRelleno As Char = "0"c
Dim EspacioRelleno As Char = Chr(32)
Dim ErrorLayout = False
@@ -1064,40 +1204,53 @@ Partial Class Bancos_PagoElectronicoGrupos
MENSAJEError.AppendLine($"Error al generar pago <br>")
MENSAJEError.AppendLine($" Proveedor: {drow("RazonSocial").ToString} detalle: { drow("Observaciones").ToString} <br>")
'CveBanco = '012'
If drow("CveBanco").ToString.Trim = "012" Then
If drow("CIE").ToString.Trim.Length > 0 Then 'cuenta bancomer Con convenio CIE
EsCIE = True
If drow("CIE").ToString.Trim.Length > 0 Then
RegistrosPago.Append("CIL")
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR en tamaño de CIE")
End If
Else
RegistrosPago.Append("PTC") 'cuenta bancomer
End If
If drow("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Or drow("BancoNombre").ToString.ToUpper.Contains("BBVA") Then
RegistrosPago.Append("PTC")
Else
RegistrosPago.Append("PSC")
End If
If drow("CLABEDestino").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
Exit For
End If
If EsCIE Then
If drow("ConceptoCIE").ToString.Length <= 30 Then
RegistrosPago.Append(drow("ConceptoCIE").ToString.PadRight(30, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR Tamaño de ConceptoCIE.")
Exit For
End If
If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then
If drow("CIE").ToString.Length < 5 Or drow("CIE").ToString.Length > 7 Then
ErrorLayout = True
MENSAJEError.AppendLine("ERROR Tamaño de CIE (rango 5-7).")
Exit For
Else
RegistrosPago.Append(drow("CIE").ToString.PadLeft(7, CeroRelleno))
End If
RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno))
If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta origen")
Exit For
End If
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta origen")
Exit For
End If
RegistrosPago.Append(drow("Abreviatura").ToString)
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))
If drow("BancoNombre").ToString.ToUpper.Contains("BANCOMER") Or drow("BancoNombre").ToString.ToUpper.Contains("BBVA") Then
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))
If drow("Observaciones").ToString.Trim.Length = 0 Then
@@ -1117,7 +1270,78 @@ Partial Class Bancos_PagoElectronicoGrupos
End If
Else
If drow("Referencia").ToString.Trim.Length > 20 Then
RegistrosPago.Append(drow("Referencia").ToString.Substring(0, 20))
Else
RegistrosPago.Append(drow("Referencia").ToString.PadRight(20, EspacioRelleno))
End If
ElseIf drow("CveBanco").ToString.Trim = "012" And drow("CIE").ToString.Trim.Length = 0 Then
'cuentas Inicio
If drow("CLABEDestino").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
Exit For
End If
If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta origen")
Exit For
End If
'cuentas Fin
RegistrosPago.Append(drow("Abreviatura").ToString)
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))
If drow("Observaciones").ToString.Trim.Length = 0 Then
If drow("RazonSocial").ToString.Trim.Length > 30 Then
RegistrosPago.Append(drow("RazonSocial").ToString.Substring(0, 30))
Else
RegistrosPago.Append(drow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
End If
Else
If drow("Observaciones").ToString.Trim.Length > 30 Then
RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30))
Else
RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno))
End If
End If
ElseIf drow("CveBanco").ToString <> "012" Then 'I N T E R B A N C A R I O
'cuentas Inicio
If drow("CLABEDestino").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEDestino").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta destino")
Exit For
End If
If drow("CLABEOrigen").ToString.Trim.Length.Contiene(10, 18) Then
RegistrosPago.Append(drow("CLABEOrigen").ToString.PadLeft(18, CeroRelleno))
Else
ErrorLayout = True
MENSAJEError.AppendLine("ERROR EN CLABE cuenta origen")
Exit For
End If
'cuentas Fin
RegistrosPago.Append(drow("Abreviatura").ToString)
RegistrosPago.Append(drow("Abonado").ToString.ToDecimal.ToString("0000000000000.00"))
If drow("RazonSocial").ToString.Length <= 30 Then
RegistrosPago.Append(drow("RazonSocial").ToString.PadRight(30, EspacioRelleno))
@@ -1149,8 +1373,14 @@ Partial Class Bancos_PagoElectronicoGrupos
RegistrosPago.Append("H")
Else
ErrorLayout = True
MENSAJEError.AppendLine("Parametros incorrecots")
Exit For
End If
If ErrorLayout Then
Alert(MENSAJEError.ToString(), TipoMensaje.MsgAdvertencia)
Exit For
@@ -1232,6 +1462,7 @@ Partial Class Bancos_PagoElectronicoGrupos
DVDescargaPagos.Visible = True
DVDescargaCuentas1.Visible = False
DVDescargaCuentas2.Visible = False
DVDescargaCuentas3.Visible = False
DVDescargaReporte.Visible = True
DT_PagosReporte = DTPendientesTemp.Copy
@@ -1866,7 +2097,7 @@ Partial Class Bancos_PagoElectronicoGrupos
If ObjBancos.GetLayoutProveedores(DdlCuenta.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, PorGrupos:=True) Then
DTProveedores = ObjBancos.DtResultados.FiltraParametros("LEN(RFC) IN (12,13)")
Else
DTProveedores = Nothing
DTProveedores = New DataTable
End If
ObjBancos.Dispose()
@@ -1984,20 +2215,20 @@ Partial Class Bancos_PagoElectronicoGrupos
strBody.AppendFormat("<div style='width: 600px'>")
strBody.AppendFormat(" <fieldset>")
strBody.AppendFormat(" <legend><b> </b></legend>")
strBody.AppendFormat(" <table class='TextoG' style='width:100%'>")
If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Usted puede pasar a recorger el cheque en las oficinas administrativas.</td> ")
strBody.Append(" </tr> ")
End If
If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
strBody.Append(" <tr style=""height: 22px""> ")
strBody.AppendFormat(" <table class='TextoG' style='width:100%'>")
'If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
' strBody.Append(" <tr style=""height: 22px""> ")
' strBody.Append(" <td>Usted puede pasar a recorger el cheque en las oficinas administrativas.</td> ")
' strBody.Append(" </tr> ")
'End If
' If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Se notifica el envío de transferencia de pago.</td> ")
strBody.Append(" </tr> ")
End If
strBody.Append(" </tr> ")
' End If
strBody.Append(" <tr style=""height: 22px""> ")
strBody.AppendFormat(" <td>&nbsp;</td> ")
strBody.Append(" </tr> ")
@@ -2491,7 +2722,7 @@ Partial Class Bancos_PagoElectronicoGrupos
params.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy")))
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Nombre))
params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout"))
params.Add(New ReportParameter("Titulo", "Reporte Pago Proveedor Layout Grupos"))
ImprimirPDF("Empresas/Grales/Formatos/LayoutPagoProveedor.rdlc", DT_PagosReporte, params, "LayoutPagoProveedor", RDSName:="DSPagoElectronicoV2")
End If
@@ -2531,7 +2762,7 @@ Partial Class Bancos_PagoElectronicoGrupos
ObjBancos.Dispose()
Dim DTGvCuentasPendientes As DataTable = DTPendientes.Copy.FiltraParametros("CveCuentaDeposito > 0", "", {"CveCuentaDeposito", "BancoNombre", "RazonSocial", "Cuenta", "CLABEDestino", "BBVAAlias", "EstatusPagoElectronicoGrupos", "CveSATBanco"})
Dim DTGvCuentasPendientes As DataTable = DTPendientes.Copy.FiltraParametros("CveCuentaDeposito > 0", "", {"CveCuentaDeposito", "BancoNombre", "RazonSocial", "Cuenta", "CLABEDestino", "BBVAAlias", "EstatusPagoElectronicoGrupos", "CveSATBanco", "CLABE"})
GvCuentasModal.DataSource = DTGvCuentasPendientes
GvCuentasModal.DataBind()
@@ -2574,7 +2805,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim DdlSatBanco As DropDownList = GvRow.FCDropDownList("DdlSatBanco")
If Not ObjGenerales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito, ChkCuentasEstatus.Checked, DdlSatBanco.SelectedValue.ToEntero, TxtBBVAAlias.Text) Then
If Not ObjGenerales.UpdateCuentasDepositosEstatusPagoElectronicoGrupos(CveCuentaDeposito, If(ChkCuentasEstatus.Checked, 1, 0), DdlSatBanco.SelectedValue.ToEntero, TxtBBVAAlias.Text, "-1", "-1") Then
ErrorProceso = True
Exit For
End If
@@ -2626,44 +2857,6 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub
Property CveIEPagoActual As Integer
Get
If ViewState("CveIEPagoActual") Is Nothing Then
Return -1
Else
Return ViewState("CveIEPagoActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveIEPagoActual") = value
End Set
End Property
Property CveLayoutEnvioDetalleActual As Integer
Get
If ViewState("CveLayoutEnvioDetalleActual") Is Nothing Then
Return -1
Else
Return ViewState("CveLayoutEnvioDetalleActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("CveLayoutEnvioDetalleActual") = value
End Set
End Property
Property GvIndexActual As Integer
Get
If ViewState("GvIndexActual") Is Nothing Then
Return -1
Else
Return ViewState("GvIndexActual").ToString.ToEntero
End If
End Get
Set(value As Integer)
ViewState("GvIndexActual") = value
End Set
End Property
@@ -2759,7 +2952,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim ErrorProceso As Boolean = False
Dim ObjBanco As New ClsBancos
'ObjBanco.IniciaTransacSQL()
ObjBanco.IniciaTransacSQL()
Dim CveLayoutEnvioDetalle As Integer = GvRow.DataKey("CveLayoutEnvioDetalle").ToEntero
Dim CveLayoutEnvio As Integer = GvRow.DataKey("CveLayoutEnvio").ToEntero
@@ -2767,12 +2960,32 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim CveProveedor As Integer = GvRow.DataKey("CveProveedor").ToEntero
Dim NotificarA As String = GvRow.DataKey("NotificarA")
Dim FOrigen As String = $"{UsuarioActual.Empresa.Ruta}..\Temp\{Comprobante}"
Dim FDestino As String = $"{UsuarioActual.Empresa.Ruta}\IE\{Comprobante}"
If Not ObjBanco.UpdateLayoutEnviosDetalle(CveLayoutEnvioDetalle, CveLayoutEnvio, CveIE, CveProveedor, 2, "", True) Then
ErrorProceso = True
End If
DTFoliosPrefijos.Clear()
For Each RowGV As GridViewRow In GvEnviadas.Rows
If RowGV.RowType = DataControlRowType.DataRow Then
Dim nRow As DataRow
nRow = DTFoliosPrefijos.NewRow
nRow("CveIE") = RowGV.DataKey("CveIE").ToEntero
nRow("Folio") = RowGV.FCTextBox("TxtFolio").Text.Trim
DTFoliosPrefijos.Rows.Add(nRow)
End If
Next
DTFoliosPrefijos.AcceptChanges()
If NuevoFolio <> "-1" Or Comprobante <> "-1" And Not ErrorProceso Then
If Not ObjBanco.UpdateBancos_IEFolio(CveIE, NuevoFolio, Comprobante) Then
ErrorProceso = True
@@ -2784,8 +2997,7 @@ Partial Class Bancos_PagoElectronicoGrupos
Try
Dim FOrigen As String = $"{UsuarioActual.Empresa.Ruta}..\Temp\{Comprobante}"
Dim FDestino As String = $"{UsuarioActual.Empresa.Ruta}\IE\{Comprobante}"
If File.Exists(FDestino) Then
File.Delete(FDestino)
@@ -2797,22 +3009,32 @@ Partial Class Bancos_PagoElectronicoGrupos
ErrorProceso = True
Alert("Error al guardar comprobante.", TipoMensaje.MsgError)
End Try
End If
If ErrorProceso Then
ObjBanco.RollBack()
Else
ObjBanco.Commit()
Alert("Confirmado Correctamente")
NotificacionPago(CveIE, NotificarA)
If Comprobante = "-1" Then
FDestino = ""
End If
NotificacionPago(CveIE, NotificarA, FDestino)
CargaEnviados()
End If
For Each RowGV As GridViewRow In GvEnviadas.Rows
If RowGV.RowType = DataControlRowType.DataRow Then
RowGV.FCTextBox("TxtFolio").Text = DTFoliosPrefijos.FiltroPrimeroValor("Folio", $"CveIE = {RowGV.DataKey("CveIE").ToEntero}")
End If
Next
UpEnviados.Update()
End If
ObjBanco.Dispose()
@@ -3029,12 +3251,6 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub
Protected Sub LnkDescarga_Click(sender As Object, e As EventArgs)
Dim FileName As String = NombreArchivo
@@ -3058,8 +3274,8 @@ Partial Class Bancos_PagoElectronicoGrupos
Response.End()
End Sub
Protected Sub LnkDescargaCuentas2_Click(sender As Object, e As EventArgs)
Dim FileName As String = NombreArchivo
Dim FilePath As String = $"{UsuarioActual.Empresa.Ruta}Layout\{NombreArchivo}"
Dim FileName As String = NombreArchivoInterbancario
Dim FilePath As String = $"{UsuarioActual.Empresa.Ruta}Layout\{NombreArchivoInterbancario}"
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName)
@@ -3067,6 +3283,17 @@ Partial Class Bancos_PagoElectronicoGrupos
Response.End()
End Sub
Protected Sub LnkDescargaCuentas3_Click(sender As Object, e As EventArgs)
Dim FileName As String = NombreArchivoCIE
Dim FilePath As String = $"{UsuarioActual.Empresa.Ruta}Layout\{NombreArchivoCIE}"
Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" & FileName)
Response.TransmitFile(FilePath)
Response.End()
End Sub
@@ -3075,14 +3302,8 @@ Partial Class Bancos_PagoElectronicoGrupos
Dim Archivo As New System.IO.FileInfo(String.Format("{0}Formatos/LayoutAltaProveedor.rdlc", UsuarioActual.Empresa.Ruta))
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
' Dim DT_PagosReporte As New DataTable
DT_PagosReporte = DT_PagosReporte.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0").Copy()
'DT_PagosReporte.Columns(7).ColumnName = "Proveedor"
'DT_PagosReporte.Columns(2).ColumnName = "Importe"
'DT_PagosReporte.Columns(22).ColumnName = "Moneda"
DT_PagosReporte = DT_PagosReporte.FiltraParametros("EstatusPagoElectronicoGrupos = 'True' AND EstatusCtaDeposito > 0").Copy()
Dim params As New List(Of ReportParameter)
If Archivo.Exists Then
@@ -3112,33 +3333,20 @@ Partial Class Bancos_PagoElectronicoGrupos
End Sub
Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String)
Private Sub NotificacionPago(CveIE As Integer, CorreoNotificarA As String, RutaComprobante As String)
'If Not DdlTipoTransaccion.SelectedValue.ToEntero.Contiene(9, 17) Then
'Dim Param As New List(Of String)
'Param.Add(CorreoNotificarA) 'Para
'Param.Add("Notificaciones de pago") 'Asunto
'Param.Add(GeneraCorreo(CveIE)) 'Body
'Param.Add(CveIE.ToString) 'CveIE
Dim Body As String = GeneraCorreo(CveIE)
'Dim Comprobante As String = ""
'Dim Comprobante = If(ComprobanteIE <> "", String.Format("{0}IE\{1}", UsuarioActual.Empresa.Ruta, ComprobanteIE), "") 'Archivo Adjunto
Dim Comprobante As String = ""
Dim File As Byte() = Nothing
'If UsuarioActual.Empresa.Funcionalidad(545).ToEntero > 0 Then
' File = NewGeneraBytesCxP(CveProveedor, UsuarioActual.Nombre)
'End If
Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, CveIE, Comprobante, File))
Dim Hilo As New Threading.Thread(Sub() MandaCorreo(CorreoNotificarA, "Notificaciones de pago", Body, CveIE, RutaComprobante, File))
Hilo.Start()
'End If
End Sub
Private Sub MandaCorreo(Para As String, Asunto As String, Body As String, CveIE As Integer, Comprobante As String, File As Byte())
'Dim Parametros As List(Of String) = DirectCast(Data, List(Of String))
Dim Mail As New ClsSisMail()
Para = If(Para IsNot Nothing, Para, "")
@@ -3242,17 +3450,17 @@ Partial Class Bancos_PagoElectronicoGrupos
strBody.AppendFormat(" <legend><b> </b></legend>")
strBody.AppendFormat(" <table class='TextoG' style='width:100%'>")
If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Favor de pasar a nuestras oficinas por el cheque con la siguientes instrucciones.</td> ")
strBody.Append(" </tr> ")
End If
'If objIE.CveTipoTransaccion = 1 Then ' cuando es cheque
' strBody.Append(" <tr style=""height: 22px""> ")
' strBody.Append(" <td>Favor de pasar a nuestras oficinas por el cheque con la siguientes instrucciones.</td> ")
' strBody.Append(" </tr> ")
'End If
If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
strBody.Append(" <tr style=""height: 22px""> ")
'If objIE.CveTipoTransaccion = 2 Then ' cuando es transf
strBody.Append(" <tr style=""height: 22px""> ")
strBody.Append(" <td>Notificación de transferencia de pago realizada.</td> ")
strBody.Append(" </tr> ")
End If
'End If
strBody.Append(" <tr style=""height: 22px""> ")
strBody.AppendFormat(" <td>&nbsp;</td> ")
@@ -3374,4 +3582,6 @@ Partial Class Bancos_PagoElectronicoGrupos
End Function
End Class