diff --git a/Acumuladores/CatFoliosGarantia.aspx b/Acumuladores/CatFoliosGarantia.aspx
index ac47d269b..37ded6f64 100644
--- a/Acumuladores/CatFoliosGarantia.aspx
+++ b/Acumuladores/CatFoliosGarantia.aspx
@@ -84,15 +84,16 @@
|
+ |
| ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
+ |
+
+
+
+
+
+
@@ -79,7 +79,7 @@
-
+
@@ -127,7 +127,7 @@
-
+
@@ -178,7 +178,7 @@
-
+
diff --git a/Bancos/PagoElectronico.aspx.vb b/Bancos/PagoElectronico.aspx.vb
index a9414bc09..b058e60bb 100644
--- a/Bancos/PagoElectronico.aspx.vb
+++ b/Bancos/PagoElectronico.aspx.vb
@@ -277,6 +277,8 @@ Partial Class Bancos_PagoElectronico
If DTPendientes IsNot Nothing AndAlso DTPendientes.Rows.Count > 0 Then
CargaDatosInformativos()
+ Else
+ VistaComandoGeneracion()
End If
End Sub
@@ -946,7 +948,7 @@ Partial Class Bancos_PagoElectronico
Dim correo As String = dr("Correo").ToString.Trim
If correo.Trim.Length = 0 Then
- SBErrores.Append($"Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido. ") + SBErrores.Append($" {nombreBen} Email no definido en fila {idx + 1}. Debe ser un correo electrónico válido. ") ErrorLayout = True End If @@ -1044,35 +1046,35 @@ Partial Class Bancos_PagoElectronico Dim NombreArchivo As String = $"pagos_{NowADS.ToString("ddMMyyyy")}_001.txt" '"pagos_03062025_001.txt" - 'If InsertaEnDB Then + If InsertaEnDB Then - ' Dim ObjBancos As New ClsBancos - ' ObjBancos.IniciaTransacSQL() + Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() - ' Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True) + Dim CveLayoutEnvio As Integer = ObjBancos.AddLayoutEnvios(NombreArchivo, NowADS(), CveCuenta, PorGrupos:=True) - ' If CveLayoutEnvio > 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 - ' ErrorLayout = True - ' Exit For - ' End If - ' End If - ' Next - ' Else - ' ErrorLayout = True - ' End If + If CveLayoutEnvio > 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 + ErrorLayout = True + Exit For + End If + End If + Next + Else + ErrorLayout = True + End If - ' If ErrorLayout Then - ' ObjBancos.RollBack() - ' ObjBancos.Dispose() - ' Else - ' ObjBancos.Commit() - ' ObjBancos.Dispose() - ' End If + If ErrorLayout Then + ObjBancos.RollBack() + ObjBancos.Dispose() + Else + ObjBancos.Commit() + ObjBancos.Dispose() + End If - 'End If + End If Dim path As String = String.Format("{0}Layout\{1}", UsuarioActual.Empresa.Ruta, NombreArchivo) Dim pathDirectorio As String = String.Format("{0}Layout\", UsuarioActual.Empresa.Ruta) @@ -1499,11 +1501,23 @@ Partial Class Bancos_PagoElectronico End If ObjBancos.Dispose() - If DtRegenerar IsNot Nothing Then - GeneraPago(DtRegenerar, CveBLE) - Else - Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + If OpBancos = 1 Then + If DtRegenerar IsNot Nothing Then + GeneraPago(DtRegenerar, CveBLE) + Else + Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If End If + + If OpBancos = 3 Then + If DtRegenerar IsNot Nothing Then + GeneraPagoScotiaBank(DtRegenerar, False) + Else + Alert("Ocurrió un error al obtener los datos para generar el archivo. Por favor vuelva a intentar.", TipoMensaje.MsgError) + End If + End If + + End Sub #End Region @@ -1900,8 +1914,9 @@ Partial Class Bancos_PagoElectronico ElseIf OpBancos = 2 Then ElseIf OpBancos = 3 Then - If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing Then - GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronico > 0 AND EstatusCtaDeposito > 0"), False) + If DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'") IsNot Nothing AndAlso + DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'").Rows.Count > 0 Then + GeneraPagoScotiaBank(DTPendientes.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND EstatusCtaDeposito = 'True'"), True) Else Alert("No hay registros para generar pagos en ScotiaBank", TipoMensaje.MsgAdvertencia) End If @@ -2370,6 +2385,8 @@ Partial Class Bancos_PagoElectronico If OpBancos = 3 Then + TextoArreglo = File.ReadAllLines(path:=NombreArchivo) ' Texto.Split(CChar(vbCrLf)) + Dim SBCuentasAltas As New StringBuilder Dim SBErrores As New StringBuilder Dim ErrorArchivoScotia As Boolean = False @@ -2399,6 +2416,7 @@ Partial Class Bancos_PagoElectronico End If Dim ObjBancos As New ClsBancos + ObjBancos.IniciaTransacSQL() For i As Integer = 1 To TextoArreglo.Length - 2 Step 1 @@ -2406,12 +2424,17 @@ Partial Class Bancos_PagoElectronico If Linea.Length = 140 Then - Dim CodigoRespuesta As String = Linea.Substring(0, 3) + Dim CodigoRespuesta As String = Linea.Substring(109, 3) + Dim DTipoArchivo As String = Linea.Substring(0, 2) Dim Cuenta As String = Linea.Substring(12, 20) - 'Dim FechaEliminacion As Date = Linea.Substring(32, 8).ToDate Dim FechaEliminacion As Date = Date.ParseExact(Linea.Substring(32, 8), "yyyyMMdd", Globalization.CultureInfo.InvariantCulture) + If DTipoArchivo <> "SP" Then + SBErrores.Append($"Error Linea {i} el tipo de archivo no es un archivo de respuesta (SP), inicia con codigo {DTipoArchivo}.") + ErrorArchivoScotia = True + End If + If CodigoRespuesta = "000" Or CodigoRespuesta = " " Then Dim CveCuentaDeposito As Integer = Linea.Substring(40, 50).Trim.ToEntero @@ -2439,11 +2462,16 @@ Partial Class Bancos_PagoElectronico Next If ErrorArchivoScotia Then - Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Se dieron de alta {SBCuentasAltas.Length} cuentas.Altas:{SBCuentasAltas.ToString}. Errores: {SBErrores.ToString}", TipoMensaje.MsgAdvertencia) + ObjBancos.RollBack() + Alert($"El archivo presento errores en su procesamiento({SBErrores.Length}). Correctos {SBCuentasAltas.Length} cuentas.Altas:{SBCuentasAltas.ToString}. Errores: {SBErrores.ToString}", TipoMensaje.MsgAdvertencia) Else + ObjBancos.Commit() Alert($"El archivo se analizo correctamente y se efectuaron todos los cambios en el sistema. cuentas procesadas: {SBCuentasAltas.ToString}", TipoMensaje.MsgInformacion) End If + + + ObjBancos.Dispose() End If @@ -2944,6 +2972,8 @@ Partial Class Bancos_PagoElectronico If OpBancos = 3 Then + TextoArreglo = File.ReadAllLines(NombreArchivo) 'Texto.Split(CChar(vbCrLf)) + Dim CveIES As List(Of Integer) = New List(Of Integer) Dim LienasCount As Integer = TextoArreglo.Length Dim SBErrores As New StringBuilder @@ -2956,8 +2986,9 @@ Partial Class Bancos_PagoElectronico End If Dim Header As String = TextoArreglo(0) - Dim HCodigo As String = TextoArreglo(0).Substring(0, 3).Trim - If HCodigo <> "SVH" Then + Dim HCodigo As String = TextoArreglo(0).Substring(35, 3).Trim + Dim HTipoArchivo As String = TextoArreglo(0).Substring(0, 3).Trim + If HTipoArchivo <> "SVH" Then Alert("El archivo no es un archivo de respuesta, debe tener un encabezado con SVH.", TipoMensaje.MsgError) Exit Sub End If @@ -3130,13 +3161,14 @@ Partial Class Bancos_PagoElectronico End If Next Catch ex As Exception - Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgError) + Alert("Ocurrió un error al enviar los correos de notificación.", TipoMensaje.MsgAdvertencia) End Try Alert(Respuesta.ToString, TipoMensaje.MsgInformacion) Else + Alert("Ocurrió un error al procesar el archivo.", TipoMensaje.MsgAdvertencia) objIE.RollBack() End If diff --git a/Bancos/PagoElectronicoGrupos.aspx.vb b/Bancos/PagoElectronicoGrupos.aspx.vb index 94f068664..981d83af1 100644 --- a/Bancos/PagoElectronicoGrupos.aspx.vb +++ b/Bancos/PagoElectronicoGrupos.aspx.vb @@ -442,7 +442,7 @@ Partial Class Bancos_PagoElectronicoGrupos Case DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") - habilitada = (dr("EstatusPagoElectronicoGruposScotia").ToString = "True") + habilitada = (dr("EstatusPagoElectronicoScotia").ToString = "True") Case Else habilitada = False 'Otros bancos sin bandera propia @@ -689,7 +689,7 @@ Partial Class Bancos_PagoElectronicoGrupos CuentaDepositoSinAlta = True End If - If DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") AndAlso e.Row.DBCampo("EstatusPagoElectronicoGruposScotia").ToString <> "True" Then + If DdlCuenta.SelectedItem.Text.ToUpper.Contains("SCOTIA") AndAlso e.Row.DBCampo("EstatusPagoElectronicoScotia").ToString <> "True" Then CuentaDepositoSinAlta = True End If @@ -2037,15 +2037,15 @@ Partial Class Bancos_PagoElectronicoGrupos 'Motivo de pago If drow("Observaciones").ToString.Trim.Length > 30 Then - RegistrosPago.Append(drow("Observaciones").ToString.Substring(0, 30)) + RegistrosPago.Append(drow("Observaciones").ToString.Trim.Substring(0, 30)) Else - RegistrosPago.Append(drow("Observaciones").ToString.PadRight(30, EspacioRelleno)) + RegistrosPago.Append(drow("Observaciones").ToString.Trim.PadRight(30, EspacioRelleno)) End If If drow("Referencia").ToString.Trim.Length > 7 Then - RegistrosPago.Append(drow("Referencia").ToString.Substring(0, 7)) + RegistrosPago.Append(drow("Referencia").ToString.Trim.Substring(0, 7)) Else - RegistrosPago.Append(drow("Referencia").ToString.PadRight(7, EspacioRelleno)) + RegistrosPago.Append(drow("Referencia").ToString.Trim.PadRight(7, EspacioRelleno)) End If RegistrosPago.Append("H") diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb index 5d3eb3332..ee457fcd8 100644 --- a/Bancos/PopIECompras.aspx.vb +++ b/Bancos/PopIECompras.aspx.vb @@ -774,73 +774,178 @@ Partial Class Bancos_PopIECompras End Sub Private Sub CargaCuentasDepositos() - DdlCuentaDeposito.Items.Clear() - If DdlTipoTransaccion.SelectedValue.Contiene("2", "9", "17") Then ' transferencias y layout - trCuentaDeposito.Visible = False - - Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + 'DdlCuentaDeposito.Items.Clear() - If dtc IsNot Nothing Then + 'If DdlTipoTransaccion.SelectedValue.Contiene("2", "9", "17") Then ' transferencias y layout + ' trCuentaDeposito.Visible = False - If DdlTipoTransaccion.SelectedValue = "9" Then - - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") - - If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - Else - BtnGuardar.Enabled = False - Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) - End If - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + ' Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + ' If dtc IsNot Nothing Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnGuardar.Enabled = False + ' Alert("El Beneficiario no tiene una cuenta activa en BBVA, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc + ' trCuentaDeposito.Visible = True + ' BtnGuardar.ToolTip = "" + ' Else + + ' BtnGuardar.Enabled = False + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + ' End If + + ' UpGuardar.Update() + + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' Else + + ' If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + + ' BtnGuardar.Enabled = False + ' BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Else + ' trCuentaDeposito.Visible = True + ' BtnGuardar.Enabled = True + ' BtnGuardar.ToolTip = "" + ' End If + + ' UpGuardar.Update() + + ' End If + + ' DdlCuentaDeposito.DataBind() + + 'Else + ' trCuentaDeposito.Visible = False + ' DdlCuentaDeposito.Items.Clear() + ' 'TrReferenciaCIE.Visible = False + 'End If + + 'UpCuentaDeposito.Update() + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing + DdlCuentaDeposito.Items.Clear() + + trCuentaDeposito.Visible = False + + + Dim OpBanco As Integer = 1 + Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + OpBanco = 1 + 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' OpBanco = 2 + ElseIf CuentaBanco.Contains("SCOTIA") Then + OpBanco = 3 + End If + + If DdlCuenta.SelectedValue = "-1" Then + BtnGuardar.Enabled = False + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Items.Clear() + 'UpnCuentasPago.Update() + UpCuentaDeposito.Update() + Return + End If + + + Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + + If dtc IsNot Nothing Then + + If DdlTipoTransaccion.SelectedValue = "9" Then + + If OpBanco = 1 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + End If + + If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnGuardar.Enabled = False + 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 OpBanco = 3 Then + If dtc.Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnGuardar.Enabled = False + Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + End If + End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + If OpBanco = 1 Then + If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'").Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) trCuentaDeposito.Visible = True BtnGuardar.ToolTip = "" Else - BtnGuardar.Enabled = False BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - + Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - Else - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") - If dtc.Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - End If - End If - Else - - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then - - BtnGuardar.Enabled = False - BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito" Else - trCuentaDeposito.Visible = True - BtnGuardar.Enabled = True - BtnGuardar.ToolTip = "" + BtnGuardar.Enabled = False + BtnGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - - End If - DdlCuentaDeposito.DataBind() - - Else - trCuentaDeposito.Visible = False - DdlCuentaDeposito.Items.Clear() - 'TrReferenciaCIE.Visible = False + + Else + 'Respuesta = True + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + DdlCuentaDeposito.DataBind() + + If dtc.Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + BtnGuardar.Enabled = True + End If End If + 'UpnCuentasPago.Update() + UpGuardar.Update() UpCuentaDeposito.Update() End Sub @@ -896,6 +1001,9 @@ Partial Class Bancos_PopIECompras Banco.Dispose() End If + + CargaCuentasDepositos() + End Sub 'Private Sub DdlOtrosPagos_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlOtrosPagos.SelectedIndexChanged diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index 86cad07ec..3094fe5e3 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -1405,6 +1405,10 @@ Partial Class Bancos_ProveedoresAbonar TxtFolio.Text = "" End If + 'ValidaCuentasDepositoLayouts() + + CargaCuentasDepositos() + 'Dim dr2 As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("CveCuenta = " & DdlCuenta.SelectedValue) 'If dr2 IsNot Nothing Then @@ -1416,6 +1420,106 @@ Partial Class Bancos_ProveedoresAbonar 'End If End Sub + 'Function ValidaCuentasDepositoLayouts() As Boolean + + ' Dim Respuesta As Boolean = False + ' Dim OpBanco As Integer = 1 + + ' Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + ' If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + ' OpBanco = 1 + ' 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' ' OpBanco = 2 + ' ElseIf CuentaBanco.Contains("SCOTIA") Then + ' OpBanco = 3 + ' End If + + + ' Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + + ' If dtc IsNot Nothing Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' If OpBanco = 1 Then + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnIEGuardar.Enabled = False + ' 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 OpBanco = 3 Then + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' BtnIEGuardar.Enabled = False + ' Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + ' End If + ' End If + ' ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + ' If OpBanco = 1 Then + ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If + ' 'ElseIf OpBanco = 3 Then + ' ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' ' trCuentaDeposito.Visible = True + ' ' BtnIEGuardar.ToolTip = "" + ' ' Else + ' ' BtnIEGuardar.Enabled = False + ' ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' ' End If + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + ' Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) + ' End If + + + + ' Else + ' Respuesta = True + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' End If + + + + ' UpGuardar.Update() + + ' Return Respuesta + + 'End Function + 'Private Sub CargaGridTarjetas() @@ -1432,20 +1536,120 @@ Partial Class Bancos_ProveedoresAbonar #Region " CUENTAS DEPOSITOS" Private Sub CargaCuentasDepositos() + + DdlCuentaDeposito.ClearSelection() + DdlCuentaDeposito.SelectedValue = Nothing DdlCuentaDeposito.Items.Clear() trCuentaDeposito.Visible = False + 'Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + 'If dtc IsNot Nothing Then + + ' If dtc.FiltraParametros("Estatus ='True'").Rows.Count > 0 Then + + ' If DdlTipoTransaccion.SelectedValue = "9" Then + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + + ' If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' Else + ' 'BtnIEGuardar.Enabled = False + ' '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 + + ' If dtc.Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' 'BtnIEGuardar.Enabled = False + ' 'BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' 'Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If + ' UpGuardar.Update() + ' Else + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + ' If dtc.Rows.Count > 0 Then + ' trCuentaDeposito.Visible = True + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' End If + ' End If + ' DdlCuentaDeposito.DataBind() + ' Else + + ' If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then + ' 'BtnIEGuardar.Enabled = False + ' 'BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' 'Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' Else + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.Enabled = True + ' BtnIEGuardar.ToolTip = "" + ' End If + ' UpGuardar.Update() + ' End If + 'Else + + ' If DdlTipoTransaccion.SelectedValue = "17" Then + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Else + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.Enabled = True + ' BtnIEGuardar.ToolTip = "" + ' End If + + ' UpGuardar.Update() + 'End If + + 'Else + ' trCuentaDeposito.Visible = False + ' DdlCuentaDeposito.Items.Clear() + 'End If + 'RecargaGlobalCuentasBancarias() + + + Dim OpBanco As Integer = 1 + + Dim CuentaBanco As String = DdlCuenta.SelectedItem.Text.ToUpper + + If CuentaBanco.Contains("BBVA") Or CuentaBanco.Contains("BANCOMER") Then + OpBanco = 1 + 'ElseIf CuentaBanco.Contains("BAJIO") Then + ' OpBanco = 2 + ElseIf CuentaBanco.Contains("SCOTIA") Then + OpBanco = 3 + End If + + If DdlCuenta.SelectedValue = "-1" Then + BtnIEGuardar.Enabled = False + trCuentaDeposito.Visible = False + DdlCuentaDeposito.Items.Clear() + UpnCuentasPago.Update() + UpCuentaDeposito.Update() + Return + End If + + Dim dtc As DataTable = GlobalDTProveedoresCuentas(UsuarioActual.CveEmpresa, CveProveedor:=CveProveedor) + If dtc IsNot Nothing Then - If dtc.FiltraParametros("Estatus ='True'").Rows.Count > 0 Then - - If DdlTipoTransaccion.SelectedValue = "9" Then + If DdlTipoTransaccion.SelectedValue = "9" Then + If OpBanco = 1 Then If dtc.Rows.Count > 0 Then DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'") - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + DdlCuentaDeposito.DataBind() End If If dtc.FiltraParametros("EstatusPagoElectronico = 'True' AND Estatus ='True'").Rows.Count > 0 Then @@ -1456,10 +1660,27 @@ Partial Class Bancos_ProveedoresAbonar 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 OpBanco = 3 Then If dtc.Rows.Count > 0 Then - DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" Estatus ='True'") + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + + If dtc.FiltraParametros("EstatusPagoElectronicoScotia = 'True' AND Estatus ='True'").Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + Else + BtnIEGuardar.Enabled = False + Alert("El Beneficiario no tiene una cuenta activa en Scotiabank, dela de alta o seleccione otro método de pago", TipoMensaje.MsgAdvertencia) + End If + End If + ElseIf DdlTipoTransaccion.SelectedValue = "17" Then + + If OpBanco = 1 Then + If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'").Rows.Count > 0 Then + DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' AND Estatus ='True'") + DdlCuentaDeposito.DataBind() DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) trCuentaDeposito.Visible = True BtnIEGuardar.ToolTip = "" @@ -1468,47 +1689,39 @@ Partial Class Bancos_ProveedoresAbonar BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() + 'ElseIf OpBanco = 3 Then + ' If dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'").Rows.Count > 0 Then + ' DdlCuentaDeposito.DataSource = dtc.FiltraParametros(" EstatusPagoElectronicoGrupos = 'True' Estatus ='True'") + ' DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + ' trCuentaDeposito.Visible = True + ' BtnIEGuardar.ToolTip = "" + ' Else + ' BtnIEGuardar.Enabled = False + ' BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + ' Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) + ' End If Else - DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") - If dtc.Rows.Count > 0 Then - trCuentaDeposito.Visible = True - DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) - End If - End If - DdlCuentaDeposito.DataBind() - Else - - If DdlTipoTransaccion.SelectedValue.Contiene("9", "17") Then BtnIEGuardar.Enabled = False - BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" - Alert("El proveedor no tiene cuentas deposito.", TipoMensaje.MsgAdvertencia) - Else - trCuentaDeposito.Visible = True - BtnIEGuardar.Enabled = True - BtnIEGuardar.ToolTip = "" + BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito para layout grupos" + Alert("El proveedor no tiene cuentas deposito para layout grupos.", TipoMensaje.MsgAdvertencia) End If - UpGuardar.Update() - End If - Else - If DdlTipoTransaccion.SelectedValue = "17" Then - BtnIEGuardar.Enabled = False - BtnIEGuardar.ToolTip = "El proveedor no tiene cuentas deposito" + + Else - trCuentaDeposito.Visible = True - BtnIEGuardar.Enabled = True - BtnIEGuardar.ToolTip = "" - End If + 'Respuesta = True + DdlCuentaDeposito.DataSource = dtc.FiltraParametros("Estatus ='True'") + DdlCuentaDeposito.DataBind() - UpGuardar.Update() + If dtc.Rows.Count > 0 Then + trCuentaDeposito.Visible = True + DdlCuentaDeposito.Items.Insert(0, New ListItem("Seleccione una cuenta", "-1")) + End If + BtnIEGuardar.Enabled = True + End If End If - 'Else - ' trCuentaDeposito.Visible = False - ' DdlCuentaDeposito.Items.Clear() - 'End If - 'RecargaGlobalCuentasBancarias() + UpGuardar.Update() UpnCuentasPago.Update() UpCuentaDeposito.Update() End Sub diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index bf2ccb6ec..3d6d102d3 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -5042,7 +5042,7 @@
+
+
+
+
+
+
+ Agregar Partida+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Información
+
+
+
+
+
+
+
+
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" />
+ " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
+
+
+
+
+
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
- Vendedor
+
+
-
-
-
+
- Marca
+
+
+ Mes y Año
+
+
+
+
-
-
+
- Clasificación Superior
+
+
-
-
+
+
-
+
-
-
-
+
Cantidad meta
+
+
+ Importe meta
+
+
diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb
index b63444e01..33e5dc539 100644
--- a/Ventas/CatMetasVendedores.aspx.vb
+++ b/Ventas/CatMetasVendedores.aspx.vb
@@ -33,16 +33,31 @@ Partial Class CatMetasVendedores
Private Sub CargaDatos()
Dim Mes As Integer = -1, Anio As Integer = -1
- If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
- Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
- Mes = FechaRef.Month
- Anio = FechaRef.Year
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ If Not String.IsNullOrEmpty(txtMesAnio.Text) Then
+ Dim FechaRef As DateTime = txtMesAnio.Text.ToDate()
+ Mes = FechaRef.Month
+ Anio = FechaRef.Year
+ End If
+ Else
+ GvDatos.Columns(1).Visible = False
+ GvDatos.Columns(2).Visible = False
+ GvDatos.Columns(3).Visible = False
+ GvDatos.Columns(4).Visible = False
+
+ DivLblSucursal.Visible = False
+ DivSucursal.Visible = False
+ DivLblMes.Visible = False
+ DivMes.Visible = False
+ DivLblMarca.Visible = False
+ DivMarca.Visible = False
End If
Dim ObjVentas As New ClsVentas
- If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveMarca:=DdlMarca.SelectedValue.ToEntero(), Mes:=Mes, Anio:=Anio) Then
- GvDatos.DataSource = ObjVentas.DtResultados
- DtDatos = ObjVentas.DtResultados
+ If ObjVentas.GetMetasVendedores(UsuarioActual.CveEmpresa, CveSubProyecto:=DdlSubProyecto.SelectedValue.ToEntero(), CveVendedor:=DdlVendedor.SelectedValue.ToEntero(), CveMarca:=DdlMarca.SelectedValue.ToEntero(), Mes:=Mes, Anio:=Anio) Then
+ DtDatos = ObjVentas.DtResultados.Copy()
+ GvDatos.DataSource = DtDatos
End If
ObjVentas.Dispose()
GvDatos.DataBind()
@@ -64,7 +79,13 @@ Partial Class CatMetasVendedores
End Sub
- Private Sub CargaDatosModal()
+ Private Sub CargaDatosModal()
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ Div1.Visible = True
+ Div2.Visible = True
+ Div3.Visible = True
+ End If
+
DdlVendedores.DataSource = GlobalDTVendedores(UsuarioActual.CveEmpresa)
DdlVendedores.DataBind()
DdlVendedores.Items.Insert(0, New ListItem("Seleccionar", "-1"))
@@ -93,29 +114,50 @@ Partial Class CatMetasVendedores
Protected Sub BtnAgregarMetaVendedor_Click(sender As Object, e As EventArgs) Handles BtnAgregarMetaVendedor.Click
- If DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0 Then
+ Dim CveVendedor As Integer = DdlVendedores.SelectedValue.ToEntero()
+ Dim Fecha As Date = MinFecha
+ Dim CveMarca As Integer = -1
+ Dim CveClasificacionSuperior As Integer = -1
+ Dim CveClasificacion As Integer = -1
- Dim ObjVentas As New ClsVentas
+
+
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+
+ If Not (DdlVendedores.SelectedValue.ToEntero > 0 AndAlso TxtFechaI.Text <> "" AndAlso DdlMarcas.SelectedValue.ToEntero > 0 AndAlso DdlClasificacionSup.SelectedValue.ToEntero > 0) Then
+ Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
+ Exit Sub
+ End If
+ Fecha = TxtFechaI.Text.ToDate()
+ CveClasificacionSuperior = DdlClasificacionSup.SelectedValue.ToEntero
+ CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
+ CveMarca = DdlMarca.SelectedValue.ToEntero
+
+ Else
+ If Not (DdlVendedores.SelectedValue.ToEntero > 0) Then
+ Alert("Falta Seleccionar el vendedor")
+ Exit Sub
+ End If
+ End If
+
+ Using ObjVentas As New ClsVentas
If BtnAgregarMetaVendedor.Text = "Agregar" Then
- If ObjVentas.AddMetasVendedores(DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text.ToDate, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero,
- TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero, DdlClasificacionSup.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.AddMetasVendedores(CveVendedor, Fecha, DdlMarcas.SelectedValue.ToEntero, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior, UsuarioActual.CveEmpresa) Then
Alert("Se agregó la meta al vendedor")
Else
Alert("No se pudo agregar la meta al vendedor", TipoMensaje.MsgError)
End If
ElseIf BtnAgregarMetaVendedor.Text = "Actualizar" Then
- If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, DdlVendedores.SelectedValue.ToEntero, TxtFechaI.Text, DdlMarcas.SelectedValue.ToEntero,
- TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, DdlClasificacion.SelectedValue.ToEntero,
- DdlClasificacionSup.SelectedValue.ToEntero) Then
+ If ObjVentas.UpdateMetasVendedores(CveMetaVendedor, CveVendedor, Fecha.ToString("dd/MM/yyyy"), CveMarca, TxtMetaCantidad.Text.ToEntero, TxtMetaImporte.Text.ToDecimal, CveClasificacion, CveClasificacionSuperior) Then
Alert("Se actualizó la información de la meta del vendedor")
Else
Alert("No se pudo actualizar la meta del vendedor", TipoMensaje.MsgError)
End If
- End If
- Else
- Alert(String.Format("Falta Seleccionar {0}{1}{2}", If(DdlVendedores.SelectedValue.ToEntero > 0, "", "Vendedor, "), If(DdlMarcas.SelectedValue.ToEntero > 0, "", "Marca, "), If(TxtFechaI.Text <> "", "", "Fecha, ")))
- End If
+ End If
+ End Using
+
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD"))
+
ResetDatosSeleccionadosModal()
CargaDatos()
UpDatos.Update()
@@ -135,12 +177,17 @@ Partial Class CatMetasVendedores
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveMetaVendedor = GvRow.DataKey("CveMeta").ToEntero
DdlVendedores.SelectedValue = GvRow.DataKey("CveVendedor")
- TxtFechaI.Text = GvRow.DataKey("MesAño")
- DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
- DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+
+ TxtFechaI.Text = GvRow.DataKey("MesAño")
+
+ DdlClasificacionSup.SelectedValueExist(GvRow.DataKey("CveClasificacionSup"))
+ DdlClasificacion.SelectedValueExist(GvRow.DataKey("CveClasificacion"))
+
+ DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
+ End If
- DdlMarcas.SelectedValue = GvRow.DataKey("CveMarca")
TxtMetaCantidad.Text = GvRow.DataKey("MetaCantidad")
TxtMetaImporte.Text = GvRow.DataKey("MetaImporte")
UpModalTiposD.Update()
diff --git a/Ventas/Clientes.aspx b/Ventas/Clientes.aspx
index e3f74c920..c73ea4d84 100644
--- a/Ventas/Clientes.aspx
+++ b/Ventas/Clientes.aspx
@@ -2569,7 +2569,8 @@
Cuenta Bancaria
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
-
+
+
+
+
+
+
+
-
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index ec4deaea0..79361659d 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -1268,8 +1268,6 @@ Partial Class Clientes
CargaMetodosPago()
CargaPrecioLista()
CargaVendedores()
-
-
'CargaCorporativo()
CargaMetodosPago33()
@@ -1278,12 +1276,30 @@ Partial Class Clientes
CargaClasificaciones()
-
DdlRegimenFiscal.DataSource = GlobalDTRegimenesFiscales
DdlRegimenFiscal.DataBind()
CargaCombosComercioExterior()
+ CargaBancosSAT()
+ CargaMonedas()
+ End Sub
+
+ Private Sub CargaBancosSAT()
+
+ Dim ObjBancos As New ClsBancos
+
+ If ObjBancos.GetBancosSAT Then
+ DdlSatBanco.DataSource = ObjBancos.DtResultados
+ End If
+
+ ObjBancos.Dispose()
+
+ DdlSatBanco.DataBind()
+ DdlSatBanco.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+
+
+
End Sub
Private Sub CargaSubProyectos()
CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, Nothing, AplicaTodos:="Seleccione")
@@ -6790,14 +6806,16 @@ Partial Class Clientes
End If
ObjCuentasBancos.Dispose()
- CargaPSGridCuentasBancos()
-
- CargaMonedas()
+ CargaPSGridCuentasBancos()
+
+
End Sub
Protected Sub LbAgregarCuentaBanco_Click(sender As Object, e As EventArgs)
Dim EsBancomer As Boolean = False
- If TxtNombreBanco.Text.ToUpper.Contains("BBVA") Or TxtNombreBanco.Text.ToUpper.Contains("BANCOMER") Or (TxtCLABE.Text.Length = 18 AndAlso TxtCLABE.Text.Substring(0, 3) = "012") Then
+ If TxtNombreBanco.Text.ToUpper.Contains("BBVA") Or TxtNombreBanco.Text.ToUpper.Contains("BANCOMER") Or
+ DdlSatBanco.SelectedItem.Text.ToUpper.Contains("BBVA") Or
+ DdlSatBanco.SelectedItem.Text.ToUpper.Contains("BANCOMER") Or (TxtCLABE.Text.Length = 18 AndAlso TxtCLABE.Text.Substring(0, 3) = "012") Then
EsBancomer = True
End If
@@ -6852,15 +6870,19 @@ Partial Class Clientes
Dim Estatus As Boolean
If ChkEstatus2.Checked = True Then Estatus = True Else Estatus = False
- AgregarCuentaBanco(TxtNombreBanco.Text.Trim, TxtNumeroSucursal.Text.Trim, TxtCLABE.Text.Trim, TxtSWIFT.Text.Trim, TxtPlaza.Text.Trim, TxtNumeroCuenta2.Text.Trim, TxtConvenioCIE2.Text.Trim, TxtReferencia2.Text.Trim, "", DdlMoneda.SelectedValue.ToEntero(), DdlMoneda.SelectedItem.Text, Estatus)
+ AgregarCuentaBanco(TxtNombreBanco.Text.Trim, TxtNumeroSucursal.Text.Trim, TxtCLABE.Text.Trim, TxtSWIFT.Text.Trim, TxtPlaza.Text.Trim, TxtNumeroCuenta2.Text.Trim, TxtConvenioCIE2.Text.Trim, TxtReferencia2.Text.Trim, "",
+ DdlMoneda.SelectedValue.ToEntero(), DdlMoneda.SelectedItem.Text, Estatus, DdlSatBanco.SelectedValue.ToEntero)
End Sub
- Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, RefCrediProveedor As String, CveMoneda As Integer, Moneda As String, Estatus As Boolean)
+ Private Sub AgregarCuentaBanco(NombreBanco As String, NumeroSucursal As String, CLABE As String, SWIFT As String, Plaza As String, NumeroCuenta As String, ConvenioCIE As String, Referencia As String, RefCrediProveedor As String,
+ CveMoneda As Integer, Moneda As String, Estatus As Boolean, CveSATBanco As Integer)
+
Dim ObjCuentasBancos As New ClsGenerales
+
If Modalidad = "A" Then
If CveCliente > 0 Then
- If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, UsuarioActual.CveUsuario, CveMoneda, UsuarioActual.CveEmpresa, CveCliente:=CveCliente) Then
+ If ObjCuentasBancos.AddCuentasDepositos(NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, RefCrediProveedor, UsuarioActual.CveUsuario, CveMoneda, UsuarioActual.CveEmpresa, CveCliente:=CveCliente, CveSATBanco:=CveSATBanco) Then
DTCuentasBancos.Clear()
Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddCuentasBancarias"))
@@ -6871,6 +6893,31 @@ Partial Class Clientes
Else
Dim Row As DataRow
+
+ If TempDTCuentasBancos Is Nothing Then
+ TempDTCuentasBancos = New DataTable
+ TempDTCuentasBancos.Columns.Add("CveCuentaDeposito", GetType(Integer))
+ TempDTCuentasBancos.Columns.Add("BancoNombre", GetType(String))
+ TempDTCuentasBancos.Columns.Add("Sucursal", GetType(String))
+
+ TempDTCuentasBancos.Columns.Add("CLABE", GetType(String))
+ TempDTCuentasBancos.Columns.Add("SWIFT", GetType(String))
+ TempDTCuentasBancos.Columns.Add("Plaza", GetType(String))
+ TempDTCuentasBancos.Columns.Add("Cuenta", GetType(String))
+ TempDTCuentasBancos.Columns.Add("CIE", GetType(String))
+ TempDTCuentasBancos.Columns.Add("Referencia", GetType(String))
+ TempDTCuentasBancos.Columns.Add("RefCrediProveedor", GetType(String))
+ TempDTCuentasBancos.Columns.Add("CveMoneda", GetType(Integer))
+ TempDTCuentasBancos.Columns.Add("Moneda", GetType(String))
+ TempDTCuentasBancos.Columns.Add("EstatusPagoElectronico", GetType(Integer))
+ TempDTCuentasBancos.Columns.Add("Estatus", GetType(String))
+ TempDTCuentasBancos.Columns.Add("CveSATBanco", GetType(Integer))
+ TempDTCuentasBancos.Columns.Add("EstatusTexto", GetType(String))
+
+
+
+ End If
+
Row = TempDTCuentasBancos.NewRow
Row("BancoNombre") = NombreBanco
@@ -6886,6 +6933,7 @@ Partial Class Clientes
Row("Moneda") = Moneda
Row("EstatusPagoElectronico") = 0
Row("Estatus") = "True"
+ Row("CveSATBanco") = CveSATBanco
TempDTCuentasBancos.Rows.Add(Row)
Alert("Cuenta Bancaria agregada con éxito.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddCuentasBancarias"))
@@ -6896,7 +6944,8 @@ Partial Class Clientes
If CveCliente > 0 Then
- If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(CveCuentaBancaria)("CveCuentaDeposito").ToString().ToEntero(), NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", False, Estatus, CveMoneda, UsuarioActual.CveEmpresa) Then
+ If ObjCuentasBancos.UpdateCuentasDepositos(GvBancosCuentas.DataKeys(CveCuentaBancaria)("CveCuentaDeposito").ToString().ToEntero(), NombreBanco, Plaza, NumeroSucursal, NumeroCuenta, CLABE, ConvenioCIE, SWIFT, Referencia, "", False, Estatus, CveMoneda, UsuarioActual.CveEmpresa,
+ CveSATBanco:=CveSATBanco) Then
DTCuentasBancos.Clear()
CargaCuentasBancarias()
Alert("Cuenta actualizada con éxito.", TipoMensaje.MsgInformacion)
@@ -6920,6 +6969,7 @@ Partial Class Clientes
Row("CveMoneda") = CveMoneda
Row("Moneda") = Moneda
Row("Estatus") = Estatus
+ Row("CveSATBanco") = CveSATBanco
TempDTCuentasBancos.AcceptChanges()
Alert("Cuenta actualizada con éxito.", TipoMensaje.MsgInformacion)
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAddCuentasBancarias"))
@@ -6932,6 +6982,7 @@ Partial Class Clientes
RecargaGlobalCuentasBancarias()
End Sub
Private Sub LimpiaCuentasBancarias()
+ DdlSatBanco.SelectedValueExist(-1)
TxtNombreBanco.Text = ""
TxtNumeroSucursal.Text = ""
TxtCLABE.Text = ""
@@ -7014,7 +7065,8 @@ Partial Class Clientes
End Sub
Private Sub LnkCuentasBancarias_Click(sender As Object, e As EventArgs) Handles LnkCuentasBancarias.Click
- Modalidad = "A"
+ Modalidad = "A"
+ DdlSatBanco.SelectedValueExist(-1)
TxtNombreBanco.Text = ""
LbAgregarCuentaBanco.Text = "Agregar"
TxtNumeroSucursal.Text = ""
@@ -7033,6 +7085,9 @@ Partial Class Clientes
Public Sub Edit_Click2(sender As Object, e As EventArgs)
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+
+
+ DdlSatBanco.SelectedValueExist(GvRow.DataKey("CveSATBanco"))
TxtNombreBanco.Text = GvRow.DataKey("BancoNombre")
Modalidad = "U"
LbAgregarCuentaBanco.Text = "Actualizar"
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index a1ac6178e..0edbb82d6 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -1330,13 +1330,15 @@ Partial Class Ventas_ClientesAbonar
If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso TxtAnticipo.Text.ToDecimal > 0 AndAlso MsgError = "" Then '' si es empresa GDiaz
'generar un anticipo y registrarle el pago.
- Dim tCveMoneda As Integer = 1
+ Dim tCveMoneda As Integer = Me.CveMoneda
Dim tCveFormaPago As Integer = GlobalDTTipoTransacciones().FiltroPrimeroValor("CveFormaPago", $"CveTipoTransaccion={DdlTipoTransaccion.SelectedValue}").ToEntero
Dim tCvePS As Integer
Dim tCveUM As Integer = 0
Dim tCveSub As Integer = DdlSubProyectos.SelectedValue.ToEntero
ObjFacturaAnt = Modelos.Factura.CrearVentaNueva(UsuarioActual, tCveSub, CveCliente, tCveMoneda, "Ant")
ObjFacturaAnt.CveMoneda = tCveMoneda
+ ObjFacturaAnt.TipoCambio = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
+ ObjFacturaAnt.TipoCambioDolares = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
ObjFacturaAnt.CveFormaPago = tCveFormaPago
ObjFacturaAnt.CveMetodoPago = 1
ObjFacturaAnt.ClaveMetodoPagoSAT = "PUE"
@@ -1355,7 +1357,7 @@ Partial Class Ventas_ClientesAbonar
RespAnt = ObjFacturaAnt.EmitirFactura(False, Transac:=ObjMov.IniciaTransacSQL(), Modulo:="Ventas/ClientesAbonarAnt", MostrarURL:=True)
RespAnt.Factura = ObjFacturaAnt
- If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing Then
+ If RespAnt IsNot Nothing AndAlso RespAnt.Factura IsNot Nothing AndAlso RespAnt.Factura.CveVenta > 0 Then
Dim VentaActual As New Venta(UsuarioActual)
VentaActual.CveVenta = RespAnt.Factura.CveVenta
@@ -1365,7 +1367,7 @@ Partial Class Ventas_ClientesAbonar
VentaActual.TipoDocto = "Ant"
VentaActual.SerieFolio = RespAnt.Factura.SerieFolio
VentaActual.ClienteNombre = NombreComercial
- VentaActual.TC = 1
+ VentaActual.TC = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
VentaActual.Total = TxtAnticipo.Text.ToDecimal
VentaActual.IVA = (tPorIVA * tPU).RoundSQL(2)
@@ -1381,6 +1383,8 @@ Partial Class Ventas_ClientesAbonar
Pago.ImportePagoVenta = TxtAnticipo.Text.ToDecimal
Pago.Referencia = TxtFolio.Text
Pago.TipoPago = "XXX"
+ Pago.TCPago = If(tCveMoneda = 1, 1, TxtTCDolares.Text.ToDecimal())
+
'If RblTipoPago.SelectedValue = "3" Then
' Pago.TipoPago = "I"
' Pago.FechaDocumentoRelacionado = FechaIngreso
@@ -1390,6 +1394,8 @@ Partial Class Ventas_ClientesAbonar
If MsgError = "" AndAlso AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjMov) Then
MsgError = "No se pudo insertar la póliza"
End If
+ Else
+ MsgError = "Ocurrió un error al generar el anticipo"
End If
End If
diff --git a/Ventas/PV.aspx.vb b/Ventas/PV.aspx.vb
index e09397b17..10b93f22f 100644
--- a/Ventas/PV.aspx.vb
+++ b/Ventas/PV.aspx.vb
@@ -8482,6 +8482,9 @@ Partial Class PV
Case "MOTOBATERIA"
'20517 MOTOBATERIAS
ListaClasificacionesPermitidas.Add(20517) 'MOTOBATERIAS
+ Case "AUXILIAR"
+ '30043 AUXILIAR
+ ListaClasificacionesPermitidas.Add(30043) 'AUXILIAR
End Select
If ListaClasificacionesPermitidas.Contains(CveClasificacionPS) Then
diff --git a/Ventas/RepProductosServiciosDetalle.aspx b/Ventas/RepProductosServiciosDetalle.aspx
index bd9218813..4421568de 100644
--- a/Ventas/RepProductosServiciosDetalle.aspx
+++ b/Ventas/RepProductosServiciosDetalle.aspx
@@ -443,6 +443,8 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- |
+
- |
+
- |
+
- |
- |
- |
- |
- |
- |
- |
- |
+
+ |
-
|
|
- Kilometraje
+ Kilometraje
Próxima Rotación y Balanceo:
-
Próxima Alineación:
- - | ||||||