diff --git a/Compras/Proveedores.aspx.vb b/Compras/Proveedores.aspx.vb
index fe3667f6a..f35031cc5 100644
--- a/Compras/Proveedores.aspx.vb
+++ b/Compras/Proveedores.aspx.vb
@@ -506,6 +506,7 @@ Partial Class Compras_Proveedores
CargaAnticipos(CveProveedorSucursal)
CargaBancos(CveProveedorSucursal)
CargaProveedorSucursales()
+ CargaCuentasBancarias()
CargaOC()
CargaDocs()
@@ -3091,37 +3092,30 @@ Partial Class Compras_Proveedores
' CargaCuentasBancarias()
'End Sub
Private Sub CargaCuentasBancarias()
- Dim ObjCuentasBancos As New ClsGenerales
+
ViewState("OrdenCuentasBancos") = ""
DTCuentasBancos = New DataTable
TempDTCuentasBancos = New DataTable
- If ObjCuentasBancos.GetCuentasDepositos(CveProveedor) Then
- DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
- Else
- Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia)
+ If CveProveedor > 0 Then
+ Dim ObjCuentasBancos As New ClsGenerales
+ If ObjCuentasBancos.GetCuentasDepositos(CveProveedor, CveCliente:=-2, CvePersonal:=-2, CveEmpresa:=UsuarioActual.CveEmpresa) Then
+ DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados)
+ Else
+ Alert("No se pudieron cargar las cuentas bancarias. Por favor intente nuevamente.", TipoMensaje.MsgAdvertencia)
+ End If
+ ObjCuentasBancos.Dispose()
End If
+
If CveProveedor < 0 Then
'Alert("No hay proveedor", TipoMensaje.MsgInformacion)
TempDTCuentasBancos = DTCuentasBancos.Clone
- 'Esconde columna estatus
- 'THEstatus.Visible = False
- 'THEstatusTexto.Visible = False
- 'GvBancosCuentas.Columns(11).Visible = False 'Es la columna estatus CheckBox
-
- 'Mexicanada para acomadar las columnas'
- 'TDEstatusLayout.Visible = False
- 'TDEstatusTexto.Visible = False
-
End If
- ObjCuentasBancos.Dispose()
CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
- RecargaGlobalCuentasBancarias()
-
End Sub
Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
@@ -3213,21 +3207,22 @@ Partial Class Compras_Proveedores
CveMoneda As Integer, Moneda As String, Estatus As Boolean, Correo As String, BBVAAlias As String, EstatusPagoElectronico As Boolean, EstatusPagoElectronicoGrupos As Boolean, CveSATBanco As Integer,
ConceptoCIE As String)
- Dim ObjCuentasBancos As New ClsGenerales
+
If Modalidad = "A" Then
If CveProveedor > 0 Then
-
+ Dim ObjCuentasBancos As New ClsGenerales
If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, UsuarioActual.CveUsuario, CveMoneda, CveProveedor:=CveProveedor,
Correo:=Correo, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico, EstatusPagoElectronicoGrupos:=EstatusPagoElectronicoGrupos, CveSATBanco:=CveSATBanco, ConceptoCIE:=ConceptoCIE) Then
DTCuentasBancos.Clear()
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)))
Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddCuentasBancarias"))
+ CargaCuentasBancarias()
Else
Alert("Error al registrar la cuenta bancaria. Por favor intente nuevamente", TipoMensaje.MsgError)
End If
-
+ ObjCuentasBancos.Dispose()
Else
Dim Row As DataRow
Row = TempDTCuentasBancos.NewRow
@@ -3261,7 +3256,7 @@ Partial Class Compras_Proveedores
If CveProveedor > 0 Then
-
+ Dim ObjCuentasBancos As New ClsGenerales
If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(CveCuentaBancaria)("CveCuentaDeposito").ToString.ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor,
False, Estatus, CveMoneda, Correo:=Correo, BBVAAlias:=BBVAAlias, EstatusPagoElectronico:=EstatusPagoElectronico, EstatusPagoElectronicoGrupos:=EstatusPagoElectronicoGrupos, CveSATBanco:=CveSATBanco,
ConceptoCIE:=ConceptoCIE) Then
@@ -3269,9 +3264,11 @@ Partial Class Compras_Proveedores
DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)))
Alert("Cuenta actualizada con éxito.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddCuentasBancarias"))
+ CargaCuentasBancarias()
Else
Alert("Error al actualizar la cuenta bancaria. Por favor intente nuevamente.", TipoMensaje.MsgError)
End If
+ ObjCuentasBancos.Dispose()
Else
@@ -3301,7 +3298,7 @@ Partial Class Compras_Proveedores
End If
End If
- ObjCuentasBancos.Dispose()
+
LimpiaCuentasBancarias()
CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
RecargaGlobalCuentasBancarias()
@@ -3387,160 +3384,6 @@ Partial Class Compras_Proveedores
End If
End Sub
- ''Protected Sub GvBancosCuentas_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvBancosCuentas.RowEditing
- '' Dim id As Integer = e.NewEditIndex
- '' GvBancosCuentas.EditIndex = id
- '' CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
-
- '' 'Dim x As String = GvBancosCuentas.SelectedRowStyle("EstatusPagoElectronico")
-
- '' 'If CBool(e.Row.DBCampo("EstatusPagoElectronico")) AndAlso e.Row.DBCampo("Referencia").ToString <> "" Then
-
- '' 'End If
-
- ''End Sub
- 'Protected Sub GvBancosCuentas_RowCancelingEdit(sender As Object, e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GvBancosCuentas.RowCancelingEdit
- ' GvBancosCuentas.EditIndex = -1
- ' CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
- 'End Sub
- 'Protected Sub GvBancosCuentas_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvBancosCuentas.RowUpdating
-
- ' Dim NombreBanco = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNombreBanco").Text.Trim
- ' Dim NumeroSucursal = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroSucursal").Text.Trim
- ' Dim CLABE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtCLABE").Text.Trim
- ' Dim SWIFT = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtSWIFT").Text.Trim
- ' Dim Plaza = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtPlaza").Text.Trim
- ' Dim NumeroCuenta = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtNumeroCuenta").Text.Trim
- ' Dim ConvenioCIE = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtConvenioCIE").Text.Trim
- ' Dim Referencia = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtReferencia").Text.Trim
- ' Dim RefCrediProveedor = GvBancosCuentas.Rows(e.RowIndex).FCTextBox("TxtRefCrediProveedor").Text.Trim
- ' Dim CveMoneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedValue.ToString.ToEntero
- ' Dim Moneda = GvBancosCuentas.Rows(e.RowIndex).FCDropDownList("DdlMoneda").SelectedItem.Text
- ' Dim Estatus = GvBancosCuentas.Rows(e.RowIndex).FCCheckBox("ChkEstatus").Checked
-
- ' Dim EsBancomer = False
-
- ' If NombreBanco.ToUpper.Contains("BBVA") Or NombreBanco.ToUpper.Contains("BANCOMER") Or (CLABE.Length = 18 AndAlso CLABE.Substring(0, 3) = "012") Then
- ' EsBancomer = True
- ' End If
-
- ' ''COMENTADO PARA PERMITIR ENTRADA DE UNA CUENTA A PROVEEDOR, 22 DE SEPTIEMBRE, ISRAEL PIÑA
- ' 'If EsBancomer AndAlso (CLABE.Length <> 18 AndAlso Not CLABE.Substring(0, 3) = "012") Then
- ' ' Alert("La CLABE ingresada no pertenece a BANCOMER.", TipoMensaje.MsgAdvertencia)
- ' ' Exit Sub
- ' 'End If
-
- ' ''CLABE SIEMPRE OBLIGATORIA CUANDO NO ES BANCOMER CON CIE
- ' 'If (CLABE.Trim.Length <> 18 And Not EsBancomer) Or (EsBancomer And ConvenioCIE.Trim.Length <> 6 And CLABE.Trim.Length <> 18) Then
- ' ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' ' Exit Sub
- ' 'End If
-
- ' 'QUE TENGA ALGUN DATO DE TIPO DE CUENTA
- ' If NumeroCuenta.Length = 0 AndAlso CLABE.Length = 0 AndAlso SWIFT.Length = 0 AndAlso ConvenioCIE.Length = 0 Then
- ' Alert("Debe especificar al menos un numero de cuenta.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
-
- ' 'SI CLABE TIENE ALGO DEBE TENER UNA LOGITUD EXACTA DE 18
- ' If CLABE.Trim.Length <> 0 AndAlso CLABE.Trim.Length <> 18 Then
- ' Alert("La CLABE debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
-
- ' If UsuarioActual.CveEmpresa = 66 Then
- ' 'CLABE SIEMPRE OBLIGATORIA SI NO ES BANCOMER
- ' If CLABE.Trim.Length <> 18 And CLABE.Trim.Length = 0 And Not EsBancomer And SWIFT.Length = 0 Then
- ' Alert("La CLABE es obligatoria y debe tener una longitud de 18 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
-
- ' 'SI CUENTA TIENE ALGO Y BANCO BANCOMER DEBE TENER UNA LOGITUD EXACTA DE 10
- ' If NumeroCuenta.Trim.Length <> 0 AndAlso NumeroCuenta.Trim.Length <> 10 AndAlso EsBancomer Then
- ' Alert("El número de cuenta debe tener una longitud de 10 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
-
- ' 'SI CIE TIENE ALGO REFERENCIA OBLIGATORIA
- ' If ConvenioCIE.Trim.Length <> 0 And Referencia.Trim.Length < 3 Then
- ' Alert("Cuando se ingresa Convenio CIE se debe especificar una referencia. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
-
- ' 'CUANDO SEA "BBVA" O "BANCOMER" DEBE TENER "CIE" O "CUENTA"
- ' If EsBancomer AndAlso Not (NumeroCuenta.Trim.Length = 10 Or ConvenioCIE.Trim.Length <> 0) Then
- ' Alert("Para cuentas BBVA BANCOMER es obligatorio el Número de Cuenta o CIE.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
- ' Else
- ' 'SI CIE TIENE ALGO DEBE TENER UNA LOGITUD MINIMA DE 5
- ' If ConvenioCIE.Trim.Length <> 0 And ConvenioCIE.Trim.Length < 5 Then
- ' Alert("El Convenio CIE debe tener una longitud de al menos 5 dígitos. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
- ' Exit Sub
- ' End If
- ' End If
-
-
-
- ' Dim ObjCuentasBancos As New ClsGenerales
- ' If CveProveedor > 0 Then
- ' If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString.ToEntero, NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, False, Estatus, CveMoneda) Then
- ' DTCuentasBancos.Clear()
- ' DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)))
- ' Alert("Cuenta actualizada con éxito.", TipoMensaje.MsgInformacion)
- ' Else
- ' Alert("Error al actualizar la cuenta bancaria. Por favor intente nuevamente.", TipoMensaje.MsgError)
- ' End If
- ' Else
- ' Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1
- ' Dim Row As DataRow = TempDTCuentasBancos.Rows(index)
- ' Row("BancoNombre") = NombreBanco
- ' Row("Sucursal") = NumeroSucursal
- ' Row("CLABE") = CLABE
- ' Row("SWIFT") = SWIFT
- ' Row("Plaza") = Plaza
- ' Row("Cuenta") = NumeroCuenta
- ' Row("CIE") = ConvenioCIE
- ' Row("Referencia") = Referencia
- ' Row("RefCrediProveedor") = RefCrediProveedor
- ' Row("CveMoneda") = CveMoneda
- ' Row("Moneda") = Moneda
- ' Row("Estatus") = Estatus
- ' TempDTCuentasBancos.AcceptChanges()
- ' End If
-
- ' ObjCuentasBancos.Dispose()
-
- ' GvBancosCuentas.EditIndex = -1
- ' CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
- ' RecargaGlobalCuentasBancarias()
- 'End Sub
- 'Protected Sub GvBancosCuentas_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvBancosCuentas.RowDeleting
- ' Dim ObjCuentasBancos As New ClsGenerales
-
- ' If CveProveedor > 0 Then
- ' If ObjCuentasBancos.RemoveCuentasDepositos(GvBancosCuentas.DataKeys(e.RowIndex)("CveCuentaDeposito").ToString.ToEntero) Then
- ' DTCuentasBancos.Clear()
- ' DTCuentasBancos.Merge(ObjCuentasBancos.DtResultados.FiltraParametros(String.Format("CveProveedor = {0}", CveProveedor)))
-
- ' Alert("Cuenta Bancaria borrada con éxito.", TipoMensaje.MsgInformacion)
- ' Else
- ' Alert("No se pudo borrar la Cuenta Bancaria. Por favor intente nuevamente.", TipoMensaje.MsgError)
- ' End If
- ' Else
- ' Dim index = GvBancosCuentas.Rows(e.RowIndex).DataKey("CveCuentaDeposito").ToString.ToEntero - 1
- ' TempDTCuentasBancos.Rows.RemoveAt(index)
- ' End If
-
- ' If ObjCuentasBancos.GetCuentasDepositos Then
- ' GlobalDTProveedoresCuentas(CveProveedor, True) = ObjCuentasBancos.DtResultados
- ' End If
-
- ' CargaPSGridCuentasBancos(ViewState("OrdenCuentasBancos").ToString)
- ' ObjCuentasBancos.Dispose()
- ' RecargaGlobalCuentasBancarias()
- 'End Sub
-
Public Sub Delete_Click(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim ObjCuentasBancos As New ClsGenerales
@@ -3567,12 +3410,7 @@ Partial Class Compras_Proveedores
Private Sub RecargaGlobalCuentasBancarias(Optional ByVal CveCuenta As Integer = -1)
If CveProveedor > 0 Then
GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1) = Nothing
- 'Dim ObjCuentasBancos As New ClsGenerales
- 'If ObjCuentasBancos.GetCuentasDepositos() Then
- ' GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, -1, True) = ObjCuentasBancos.DtResultados
- 'End If
- 'ObjCuentasBancos.Dispose()
End If
End Sub