diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb
index 13fde3fbe..c68979dc6 100644
--- a/App_Code/ClsContabilidad.vb
+++ b/App_Code/ClsContabilidad.vb
@@ -2275,7 +2275,7 @@ Public Class ClsContabilidad
- Public Function GetDiarioPagosCompras(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveCuenta As Integer, CveTipoTransaccion As Integer, CveEmpresa As Integer) As DataSet
+ Public Function GetDiarioPagosCompras(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, Opcion As Integer, CveCuenta As Integer, CveTipoTransaccion As Integer, CveEmpresa As Integer, Optional CvePersonal As Integer = -1) As DataSet
Dim Retorno As New DataSet
DataAdapter("PA_Conta_DiarioPagosComprasGet33")
@@ -2287,6 +2287,7 @@ Public Class ClsContabilidad
.Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta
.Add("@CveTipoTransaccion", SqlDbType.Int).Value = CveTipoTransaccion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
End With
Try
diff --git a/App_Code/ClsMovimientos.vb b/App_Code/ClsMovimientos.vb
index 123eec236..32eda4c1c 100644
--- a/App_Code/ClsMovimientos.vb
+++ b/App_Code/ClsMovimientos.vb
@@ -317,26 +317,23 @@ Public Class ClsMovimientos
Return Retorno
End Function
- Public Function GetCxCDetalle(FechaI As String, FechaF As String, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, Anio As Integer, Mes As Integer,
+ Public Function GetCxCDetalle(FechaInicio As Date, FechaFin As Date, CveCliente As Integer, CveSubProyecto As Integer, CveVendedor As Integer, CveUsuario As Integer, Anio As Integer, Mes As Integer,
AnioMes As String, Fecha As String, CveClienteSucursal As Integer, Opcion As String, CveEstatus As Integer, IVA As String, Agrupador As Integer, CveEmpresa As Integer,
CveResponsable As Integer, TipoCambio As Integer, Optional TCEspecifico As Double = -1, Optional TipoDocto As String = "-1",
- Optional FechaVI As String = "-1", Optional FechaVF As String = "1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1,
+ Optional FechaVI As String = "-1", Optional FechaVF As String = "-1", Optional FechaCorte As Date = Nothing, Optional CveUsuarioConsulta As Integer = -1,
Optional CveCobranzaEstatus As Integer = -1, Optional CveClienteClasificacion As Integer = -1, Optional LimiteCredito As Decimal = -1,
Optional TipoCliente As Integer = -1, Optional CveMoneda As Integer = -1, Optional EstatusCliente As Integer = -1, Optional AplicaAnticiposPagados As Integer = 1,
Optional TieneLineaAdicional As Integer = -1, Optional CveContrato As Integer = -1) As Boolean
Dim Retorno As Boolean = False
- DS = New DataSet
- 'Data = New DataTable
- 'SqlAdapter = New SqlDataAdapter("PA_RepCxCDetalle", SqlConexion)
- 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
-
+ DS = New DataSet
+
DataAdapter("PA_RepCxCDetalle")
With SqlAdapter.SelectCommand.Parameters
'.Add("@CveVenta", SqlDbType.Int).Value = CveVenta
- .Add("@FechaI", SqlDbType.VarChar).Value = FechaI
- .Add("@FechaF", SqlDbType.VarChar).Value = FechaF
+ .Add("@FechaInicio", SqlDbType.Date).Value = FechaInicio
+ .Add("@FechaFin", SqlDbType.Date).Value = FechaFin
.Add("@CveCliente", SqlDbType.Int).Value = CveCliente
.Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
.Add("@CveVendedor", SqlDbType.VarChar).Value = CveVendedor
diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb
index bcc544f2b..ca1a663a7 100644
--- a/App_Code/ClsPaginas.vb
+++ b/App_Code/ClsPaginas.vb
@@ -9342,7 +9342,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Ventas/RepVentasUtilidad.aspx".ToUpper(), 590)
PaginaDict.Add("/Ventas/RepVentasUtilidadDetalle.aspx".ToUpper(), 590)
PaginaDict.Add("/Ventas/PV.aspx".ToUpper(), 163)
- PaginaDict.Add("/Ventas/PVRene.aspx".ToUpper(), 163)
+ PaginaDict.Add("/Ventas/PVCobranza.aspx".ToUpper(), 319)
PaginaDict.Add("/Ventas/Corporativo.aspx".ToUpper(), 807)
PaginaDict.Add("/Ventas/RepRecuperacion.aspx".ToUpper(), 88)
PaginaDict.Add("/Ventas/RepRecuperacionDetalle.aspx".ToUpper(), 88)
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index eee002123..286a10cb5 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -5,7 +5,6 @@ Imports System.Data
Imports System.IO
Imports System.Net.Http
Imports System.Xml
-Imports DocumentFormat.OpenXml.VariantTypes
Imports Extensiones
Imports Microsoft.Reporting.WebForms
@@ -7557,7 +7556,7 @@ Namespace Modelos
Public Property ClaveUsoCFDI As String = ""
Public Property CveTipoRelacion As Integer = -1
Public Property CveEstatusFactura As Integer
- Public Property CveVendedor As Integer
+ Public Property CveVendedor As Integer = 0
Public Property VendedorCodigo As String = ""
Public Property CveSucursalEjecucion As Integer
Public Property FechaEjecucion As Date
@@ -7572,7 +7571,7 @@ Namespace Modelos
Public Property Entrega As String = ""
Public Property TiempoEntrega As String = ""
Public Property Vigencia As Date
- Public Property TipoEstatus As Integer
+ Public Property TipoEstatus As Integer = 0
Public Property CveCondicionEntrega As Integer = -1
Public Property CondicionEntrega As String = ""
diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb
index f0f2001cf..7ca31a268 100644
--- a/App_Code/modExtensiones.vb
+++ b/App_Code/modExtensiones.vb
@@ -326,7 +326,7 @@ Namespace Extensiones
Public Sub GuardaLogAD(Mensaje As String, Optional Archivo As String = "Log")
Dim ArchivoW As StreamWriter
- Dim MensajeFormato = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm"))
+ Dim MensajeFormato As String = String.Format("{0}{1}Log: {2} | Fecha:{3}", Chr(13), Chr(10), Mensaje, ClsPaginas.NowADS().ToString("dd/MM/yyyy HH:mm"))
Try
ArchivoW = New StreamWriter(String.Format("{0}\Log\{1}.txt", AppDomain.CurrentDomain.BaseDirectory, Archivo), True, System.Text.Encoding.UTF8)
@@ -2893,7 +2893,7 @@ Namespace Extensiones
'CUERPO (TABLAS DEL REPORTE)
'Se tiene que convertir la salida en elementos y posteriormente agregarlos al documento para que se respeten los márgenes
- Dim els = HtmlConverter.ConvertToElements(sw.ToString(), properties)
+ Dim els As IList(Of Element.IElement) = HtmlConverter.ConvertToElements(sw.ToString(), properties)
For Each el As Element.IBlockElement In els
document.Add(el)
Next
@@ -3867,19 +3867,19 @@ Namespace Extensiones
End Sub
Public Overrides Sub OnAuthorization(ByVal actionContext As HttpActionContext)
- Dim authHeader = actionContext.Request.Headers.Authorization
+ Dim authHeader As Headers.AuthenticationHeaderValue = actionContext.Request.Headers.Authorization
Dim noautorizado As Boolean = True
If authHeader IsNot Nothing Then
If Left(actionContext.Request.RequestUri.AbsolutePath, 11).ToUpper() = SigfoxPath.ToUpper() Then
- Dim usernamePasswordArray = Encoding.UTF8.GetString(Convert.FromBase64String(authHeader.Parameter)).Split(":"c)
- Dim userName = usernamePasswordArray(0)
- Dim password = usernamePasswordArray(1)
+ Dim usernamePasswordArray As String() = Encoding.UTF8.GetString(Convert.FromBase64String(authHeader.Parameter)).Split(":"c)
+ Dim userName As String = usernamePasswordArray(0)
+ Dim password As String = usernamePasswordArray(1)
noautorizado = Not (userName = Me.Usuario AndAlso password = Me.Contra)
Else
Try
If actionContext.Request.RequestUri.AbsolutePath.ToUpper() <> LoginPath.ToUpper() Then
- Dim dataArray = Extensiones.Decripta(authHeader.Parameter).Split("|"c)
+ Dim dataArray As String() = Extensiones.Decripta(authHeader.Parameter).Split("|"c)
If dataArray.Length > 4 AndAlso IsNumeric(dataArray(0)) AndAlso IsNumeric(dataArray(1)) AndAlso IsNumeric(dataArray(4)) Then
Dim CveUsuario As Integer = dataArray(0).ToEntero()
diff --git a/Ashx/E119.ashx b/Ashx/E119.ashx
index 24e9e93bf..addea2096 100644
--- a/Ashx/E119.ashx
+++ b/Ashx/E119.ashx
@@ -444,8 +444,14 @@ Public Class E119 : Implements IHttpHandler
Resp = ObjFactura.EmitirFactura(False, Transac:=ObjClientes.IniciaTransacSQL())
If Resp.CveVenta > 0 Then
+ Dim data As New JArray
+ Dim objSucursal As New JObject(
+ New JProperty("Cve", Resp.CveVenta),
+ New JProperty("SerieFolio", Resp.SerieFolio)
+ )
+ data.Add(objSucursal)
Respuesta.status = "success"
- Respuesta.data = Resp.SerieFolio
+ Respuesta.data = data
Else
TieneError = True
End If
diff --git a/Bancos/IE.aspx b/Bancos/IE.aspx
index 9106c2511..544262f6e 100644
--- a/Bancos/IE.aspx
+++ b/Bancos/IE.aspx
@@ -247,10 +247,8 @@
-
-
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 81155906e..150540823 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -606,7 +606,6 @@ Partial Class Bancos_IE
CargaTipoTransaccion()
CargaCuenta()
- CargaDDLPersonal()
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
@@ -628,11 +627,9 @@ Partial Class Bancos_IE
If Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
CveProveedor = Request("CveProveedor").ToEntero
-
CargaProveedor(CveProveedor, "-1")
End If
-
If Request("Opcion") IsNot Nothing AndAlso Request("Opcion") = "DevDinC" AndAlso Request("CveProveedor") IsNot Nothing AndAlso IsNumeric(Request("CveProveedor")) AndAlso Request("CveProveedor").ToEntero > 0 Then
If Masivonotas Then
'CargaNotas()
@@ -719,7 +716,6 @@ Partial Class Bancos_IE
DdlProveedores.Enabled = False
DdlPersonal.Visible = False
-
CargaDatos()
BtnGuardar.Visible = False
@@ -784,8 +780,6 @@ Partial Class Bancos_IE
'End If
-
-
DdlMotivoCancelacion.DataSource = GlobalDTMotivosCancelacionEmpresa(UsuarioActual.CveEmpresa).FiltraParametros("CveSATMotivoCancelacion IN (2,3)")
DdlMotivoCancelacion.DataBind()
DdlMotivoCancelacion.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
@@ -794,7 +788,6 @@ Partial Class Bancos_IE
DvFolioACCondiciones.Visible = True
End If
-
If UsuarioActual.CveEmpresa.Contiene(13, 1) Then
TRImporteDeduccionesPago.Visible = True
End If
@@ -816,7 +809,6 @@ Partial Class Bancos_IE
End Try
-
CveIEDeposito = ObjIE.DtResultados(0)("CveIEDepositoPadre").ToString.ToEntero
CuentaDepositoPadre = ObjIE.DtResultados(0)("CuentaDepositoPadre").ToString
Cuenta = ObjIE.DtResultados(0)("NumCuenta").ToString
@@ -1404,15 +1396,7 @@ Partial Class Bancos_IE
DdlPersonal.DataSource = GlobalDTRHPersonal(UsuarioActual.CveEmpresa)
DdlPersonal.DataBind()
DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1"))
- 'Dim ObjPersonal As New ClsRH
- 'If ObjPersonal.GetPersonal(-1, UsuarioActual.CveEmpresa) Then
- ' If ObjPersonal.DtResultados.Rows.Count > 0 Then
- ' DdlPersonal.DataSource = ObjPersonal.DtResultados
- ' DdlPersonal.DataBind()
- ' DdlPersonal.Items.Insert(0, New ListItem("Seleccione Personal", "-1"))
- ' End If
- 'End If
- 'ObjPersonal.Dispose()
+
End Sub
Protected Sub DdlPersonal_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -3601,7 +3585,7 @@ Partial Class Bancos_IE
ChkAplicaViatico.Visible = False
If RBL.SelectedValue = "FE" Then
If UsuarioActual.CveRol = 1 Then ChkAplicaViatico.Visible = True
-
+ If DdlPersonal.Items.Count = 0 Then CargaDDLPersonal()
DdlPersonal.Visible = True
DdlProveedores.Visible = False
DdlCliente.Visible = False
@@ -4301,24 +4285,16 @@ Partial Class Bancos_IE
If Not ErrorCompra Then
If ObjAC IsNot Nothing Then ObjAC.Commit()
-
If Banc.ExisteConexion Then
Banc.Commit()
Alert($"El documento bancario quedó eliminado. {MsgEliminar}", TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
End If
-
Else
-
Alert($"El documento no ha sido eliminado. {If(UsuarioActual.CveRol = 1, MsgEliminar, "")}", TipoMensaje.MsgAdvertencia)
-
If ObjAC IsNot Nothing Then ObjAC.RollBack()
-
If Banc.ExisteConexion Then
Banc.RollBack()
-
-
End If
-
End If
If ObjAC IsNot Nothing Then ObjAC.Dispose()
diff --git a/Bancos/Transferencias.aspx b/Bancos/Transferencias.aspx
index 80800329a..02e1234d8 100644
--- a/Bancos/Transferencias.aspx
+++ b/Bancos/Transferencias.aspx
@@ -53,10 +53,10 @@
-
+
Cuenta Destino:
-
+
@@ -182,7 +182,7 @@
-
+
<%--
@@ -192,7 +192,7 @@
--%>
-
+
diff --git a/Bancos/Transferencias.aspx.vb b/Bancos/Transferencias.aspx.vb
index 7134865b9..bcfdd3191 100644
--- a/Bancos/Transferencias.aspx.vb
+++ b/Bancos/Transferencias.aspx.vb
@@ -60,12 +60,13 @@ Partial Class Bancos_Transferencias
If Opcion = 1 Then
LtlTitulo.Text = "Domicialización de tarjeta"
RBLOpcion.Visible = True
- TrCuentaOrigen.Visible = False
+ TrCuentaDestino.Visible = False
chkMovimientoTarjeta.Checked = True
chkMovimientoTarjeta.Enabled = False
+ CargaCuenta(-1, DdlCuentaOrigen)
chkMovimientoTarjeta_CheckedChanged(Nothing, Nothing)
- CargaCuenta(-1, DdlCuentaDestino)
- CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
+
+ 'CargaFolio(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
Else
CargaCuenta(-1, DdlCuentaOrigen)
CargaCuenta(DdlCuentaOrigen.SelectedValue.ToEntero, DdlCuentaDestino)
@@ -89,7 +90,7 @@ Partial Class Bancos_Transferencias
End If
Ddl.DataBind()
- DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing)
+ 'DdlCuentaDestino_SelectedIndexChanged(Nothing, Nothing)
If CveCuenta > 0 Then VerificaMonedas()
@@ -155,43 +156,41 @@ Partial Class Bancos_Transferencias
End Sub
- Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged
+ 'Protected Sub DdlCuentaDestino_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlCuentaDestino.SelectedIndexChanged
- VerificaMonedas()
+ ' VerificaMonedas()
- If Opcion = 1 Then
- CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
- End If
+ ' If Opcion = 1 Then
+ ' CargaFolio(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero)
+ ' End If
- If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then
- CargaGridTarjetas()
- Else
- GvTC.Visible = False
- End If
+ ' If chkMovimientoTarjeta.Checked AndAlso GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveCuenta = {0} AND UsaTarjeta = 1", DdlCuentaDestino.SelectedValue.ToEntero)).Rows.Count > 0 Then
+ ' CargaGridTarjetas()
+ ' Else
+ ' GvTC.Visible = False
+ ' End If
- End Sub
+ 'End Sub
Private Sub CargaGridTarjetas()
Dim ObjCreditos As New ClsBancos
- If ObjCreditos.GetTarjetasCreditos(DdlCuentaDestino.SelectedValue.ToEntero) Then
+ If ObjCreditos.GetTarjetasCreditos(DdlCuentaOrigen.SelectedValue.ToEntero) Then
If ObjCreditos.DtResultados.Rows.Count > 0 Then
GvTC.DataSource = ObjCreditos.DtResultados
+ GvTC.Visible = True
End If
-
- GvTC.DataBind()
UpGvTC.Update()
-
- GvTC.Visible = True
End If
ObjCreditos.Dispose()
+ GvTC.DataBind()
End Sub
Protected Sub BtnGuardar_Click(sender As Object, e As System.EventArgs) Handles BtnGuardar.Click
'VALIDACIONES
Dim SumaImportesTarjeta As Decimal = 0D
- If GvTC.Visible Then
+ If GvTC.Visible AndAlso GvTC.Rows.Count > 0 Then
For Each row As GridViewRow In GvTC.Rows
SumaImportesTarjeta += row.FCTextBox("TxtAbono").Text.ToDecimal
Next
@@ -202,8 +201,8 @@ Partial Class Bancos_Transferencias
End If
End If
- If DdlCuentaDestino.SelectedValue = "" Then
- Alert("Seleccione cuenta destino", TipoMensaje.MsgAdvertencia)
+ If DdlCuentaOrigen.SelectedValue = "" Then
+ Alert("Seleccione cuenta origen", TipoMensaje.MsgAdvertencia)
Exit Sub
End If
@@ -225,8 +224,7 @@ Partial Class Bancos_Transferencias
Dim ObjIE As New ClsBancos()
Dim ObjMov As New ClsContabilidad(ObjIE.IniciaTransacSQL)
- 'Dim ObjComp As New ClsCompras(ObjIE.IniciaTransacSQL)
- Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 0)
+ Dim TipoCambio As Double = If(TxtTipoCambio.Visible, TxtTipoCambio.Text.ToDecimal, 1)
Dim CveMonedaOrigen, CveMonedaDestino As Integer
Dim FolioOrigen As String = TxtFolio.Text.Trim
Dim FolioDestino As String = GetFolio(DdlCuentaDestino.SelectedValue.ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3))
@@ -246,15 +244,14 @@ Partial Class Bancos_Transferencias
filemove = fileItem.filename
Next
-
- dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue))
- If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero
+ dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue))
+ If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero
If Opcion = -1 Then
- dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaOrigen.SelectedValue))
- If dr IsNot Nothing Then CveMonedaOrigen = dr("CveMoneda").ToString.ToEntero
+ dr = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero(String.Format("CveCuenta={0}", DdlCuentaDestino.SelectedValue))
+ If dr IsNot Nothing Then CveMonedaDestino = dr("CveMoneda").ToString.ToEntero
Else
- CveMonedaOrigen = CveMonedaDestino
+ CveMonedaDestino = CveMonedaOrigen
End If
If CveMonedaOrigen = 1 AndAlso CveMonedaDestino <> 1 Then
@@ -275,21 +272,18 @@ Partial Class Bancos_Transferencias
If CveMonedaOrigen = 2 AndAlso CveMonedaDestino = 2 Then
TipoCambio = TxtTipoCambio.Text.ToDouble 'GlobalTipoCambio(TxtFechaDocumento.Text.ToDate)
End If
-
-
Dim CvePrePoliza As Integer = ObjMov.AddPrePolizas("Bancos/Transferencias", 13, TxtImporte.Text.Trim.ToDouble, TxtImporte.Text.Trim.ToDouble, CveMonedaOrigen, TxtFechaDocumento.Text.ToDate, $"Transferencia entre cuentas {TxtObservaciones.Text}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If UsuarioActual.CveEmpresa = 48 Then
CuentaDestino = "Alumbrado publico de Hermosillo S.A de C.V"
Observaciones = String.Format("{0} {1}", DdlCuentaDestino.SelectedItem.Text, TxtObservaciones.Text.Trim)
Else
- CuentaDestino = String.Format("Transferencia Cta: {0}", DdlCuentaDestino.SelectedItem.Text)
+ CuentaDestino = String.Format("Transferencia Cta: {0}", If(DdlCuentaDestino.SelectedItem IsNot Nothing, DdlCuentaDestino.SelectedItem.Text, ""))
Observaciones = TxtObservaciones.Text.Trim
End If
-
If Opcion = 1 Then 'ESTO ES TRANSFERENCIA ENTRE
- CveIE = ObjIE.AddBancos_IE(DdlCuentaDestino.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ CveIE = ObjIE.AddBancos_IE(DdlCuentaOrigen.SelectedValue.ToEntero, DdlTipoMovto.SelectedValue.ToEntero, TxtFechaDocumento.Text.Trim.ToDate, TxtFolio.Text.Trim, CuentaDestino, ImporteMXOrigen, CveMonedaOrigen, TipoCambio, Observaciones, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIEDestino = CveIE
Else
@@ -321,19 +315,10 @@ Partial Class Bancos_Transferencias
If (CveIE > 0 AndAlso CveIEDestino > 0 Or CveIE > 0 AndAlso chkMovimientoTarjeta.Checked AndAlso SumaImportesTarjeta <> 0) Then
- If filemove <> "" Then
- filemove.FilesMove(CveIE.ToString, String.Format("{0}IE", UsuarioActual.Empresa.Ruta), ConcatenarDirectorioBase:=False)
- End If
-
'inserto los movimientos de la conta para abonar al saldo
If MsgError = "" Then
If CvePrePoliza > 0 Then
-
- Dim alertaContabilizacion As String = "Se envió correctamente la siguiente póliza:
"
- Dim CuentasContablesInvalidas As New StringBuilder
- Dim RowCuentaOrigen As DataRow = Nothing
-
Dim TipoMovtoDetalle As Boolean = True
If RBLOpcion.SelectedValue = "2" Then TipoMovtoDetalle = False ' cuando sea un reembolso/devolución, es ingreso a bancos
Dim TC As Decimal = TxtTipoCambio.Text.ToDecimal
@@ -354,7 +339,6 @@ Partial Class Bancos_Transferencias
TipoCambio:=TC) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
-
End If
'Agregamos los Movimientos de Acreedor cuando es tarjeta
@@ -365,13 +349,12 @@ Partial Class Bancos_Transferencias
For Each row As GridViewRow In GvTC.Rows
If row.FCTextBox("TxtAbono").Text.ToDecimal > 0 Then
- FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccioSQL:=ObjIE.IniciaTransacSQL())
+ FolioDestino = GetFolio(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TransaccionSQL:=ObjIE.IniciaTransacSQL())
If FolioDestino.Trim.Length = 0 Then
MsgError = "Ocurrio un error al obtener el folio destino."
Exit For
End If
-
Dim PagueseA As String = $"Transferencia Cta: {If(DdlCuentaOrigen.SelectedItem Is Nothing, DdlCuentaDestino.SelectedItem.Text, DdlCuentaOrigen.SelectedItem.Text)}"
CveIEDestino = ObjIE.AddBancos_IE(row.DataKey("CveCuenta").ToEntero, If(DdlTipoMovto.SelectedValue = "2", 8, 3), TxtFechaDocumento.Text.Trim.ToDate, FolioDestino, PagueseA, row.FCTextBox("TxtAbono").Text.ToDecimal, CveMonedaDestino, TipoCambio, TxtObservaciones.Text.Trim, "", False, False, -1, CvePrePoliza, Comprobante, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
@@ -385,9 +368,6 @@ Partial Class Bancos_Transferencias
AlertaGlobal.AppendFormat("{1} ", CveIEDestino, FolioDestino)
End If
End If
-
-
-
Next
'Agregamos la contraria a bancos cuando es cuenta
@@ -408,7 +388,6 @@ Partial Class Bancos_Transferencias
ImporteME:=ImporteDestino, TipoCambio:=TC) Then
MsgError = "Ocurrió un error al registrar el asiento del ingreso."
End If
-
End If
End If
@@ -424,22 +403,15 @@ Partial Class Bancos_Transferencias
End If
If MsgError = "" Then
-
If CveIE > 0 Then
AlertaGlobal.AppendFormat("
Movimiento: {1}", CveIE, FolioOrigen)
End If
If CveIEDestino > 0 AndAlso CveIE <> CveIEDestino Then
-
If Not chkMovimientoTarjeta.Checked Then
AlertaGlobal.AppendFormat("
+
+
+
+
+
+
diff --git a/Ventas/PVCobranza.aspx.vb b/Ventas/PVCobranza.aspx.vb
new file mode 100644
index 000000000..ba2db00f7
--- /dev/null
+++ b/Ventas/PVCobranza.aspx.vb
@@ -0,0 +1,235 @@
+Option Explicit On
+Option Strict On
+
+Imports System.Data
+Imports System.Runtime.Remoting
+Imports Extensiones
+
+Partial Class Ventas_PVCobranza
+ Inherits ClsPaginas
+
+ Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+ If Not Page.IsPostBack Then
+ CargaFiltros()
+ End If
+ End Sub
+
+ Private Sub CargaFiltros()
+
+ DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
+ DdlSubProyecto.DataBind()
+
+ txtFechaI.Text = Now.AddYears(-1).ToShortDateString
+ txtFechaF.Text = Now.ToShortDateString
+
+ 'DdlCuentaEfectivo.Items.Clear()
+ 'DdlCuentaTarjetaCredito.Items.Clear()
+ 'DdlCuentaTarjetaDebito.Items.Clear()
+ 'DdlCuentaCheque.Items.Clear()
+ 'DdlCuentaTransferencia.Items.Clear()
+
+ Dim DtCC As DataTable = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa)
+ Dim CveMon As Integer = 1
+
+ 'MOSTRAR SOLO CUENTAS DE CONTADO EN BDH
+ 'If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon))
+ DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 0", CveMon))
+ 'Else
+ ' DdlCuentaEfectivo.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon))
+ ' DdlCuentaCheque.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1", CveMon))
+ 'End If
+
+ 'If UsuarioActual.Empresa.Funcionalidad(558) = "1" OrElse UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
+ DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
+ DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta = 1 AND TieneTerminal = 1", CveMon))
+ 'Else
+ ' DdlCuentaTarjetaCredito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon))
+ 'DdlCuentaTarjetaDebito.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND (CveTipoCuenta <> 1 OR TieneTerminal = 1)", CveMon))
+ 'End If
+
+ DdlCuentaTransferencia.DataSource = DtCC.FiltraParametros(String.Format("CveMoneda = {0} AND CveTipoCuenta <> 1", CveMon))
+
+ DtCC.Dispose()
+
+ DdlCuentaEfectivo.DataBind()
+ DdlCuentaTarjetaCredito.DataBind()
+ DdlCuentaTarjetaDebito.DataBind()
+ DdlCuentaCheque.DataBind()
+ DdlCuentaTransferencia.DataBind()
+
+ End Sub
+
+ Private Sub CargaDatos()
+
+ Dim ObjMovtos As New ClsMovimientos()
+ Dim FechaI, FechaF As Date
+ FechaI = If(IsDate(txtFechaI.Text.Trim()), txtFechaI.Text.Trim().ToDate, MinFecha)
+ FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim().ToDate, MaxFecha).AddDays(1)
+
+ If ObjMovtos.GetCxCDetalle(FechaI, FechaF, -1, DdlSubProyecto.SelectedValue.ToEntero, -1, -1, -1, -1, "-1", "-1", -1, "-1", -1,
+ "-1", 1, UsuarioActual.CveEmpresa, -1, 1,
+ TipoDocto:="Rem", FechaCorte:=NowADS.AddDays(1), CveUsuarioConsulta:=UsuarioActual.CveUsuario, AplicaAnticiposPagados:=0) Then
+
+ Dim dtt As DataTable = ObjMovtos.DSResultados.Tables(0).FiltraParametros("CveVenta > 0")
+ 'si hay ya asignado, solo la mostrará
+ Dim Dtta As DataTable = dtt.FiltraParametros($"CveUsuarioCobranza = {UsuarioActual.CveUsuario}")
+ If Dtta IsNot Nothing AndAlso Dtta.Rows.Count > 0 Then dtt = Dtta
+ GvDatos.DataSource = dtt
+ End If
+ ObjMovtos.Dispose()
+ GvDatos.DataBind()
+ UpL.Update()
+
+ End Sub
+
+ Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
+ CargaDatos()
+ End Sub
+
+ Private Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
+ If e.Row.RowType = DataControlRowType.DataRow Then
+
+ If e.Row.DBCampo("CveUsuarioCobranza") <> "" Then
+ e.Row.BackColor = Drawing.ColorTranslator.FromHtml("#3598dc")
+ 'e.Row.CssClass = "blue-madison"
+ End If
+ End If
+ End Sub
+
+ Private Sub GvDatos_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvDatos.RowCommand
+ If e.CommandName = "Cobrar" Then
+ Dim ImgBtn As LinkButton = DirectCast(e.CommandSource, LinkButton)
+ Dim GvRow As GridViewRow = DirectCast(ImgBtn.BindingContainer, GridViewRow)
+ Dim TieneError As Boolean = False
+
+ Dim CveVenta As Integer = e.CommandArgument.ToString.ToEntero
+ Dim ObjVentas As New ClsVentas
+ ObjVentas.IniciaTransacSQL()
+ If Not ObjVentas.UpdateAsignaVentaCobranza(CveVenta, 1, UsuarioActual.CveUsuario, -1, "", Now) Then
+ TieneError = True
+ End If
+ HdnCveVenta.Value = CveVenta.ToString
+ TxtImporteEfectivo.Text = GvRow.DataKey("Saldo")
+ TxtImporteEfectivo.Focus()
+ LtlNombre.Text = GvRow.DataKey("DescripcionVenta")
+ LtlSaldo.Text = GvRow.DataKey("Saldo").ToDecimal.FormatoNumero
+ 'carga información para cobranza
+
+ If Not TieneError Then
+ ObjVentas.Commit()
+ PnlContado.Visible = True
+ Else
+ ObjVentas.RollBack()
+ PnlContado.Visible = False
+ Alert("Hubo un error al asignar datos de cobranza", TipoMensaje.MsgInformacion)
+ End If
+
+ ObjVentas.Dispose()
+ 'CargaDatos()
+ End If
+ End Sub
+
+ Private Sub BtnPagar_Click(sender As Object, e As EventArgs) Handles BtnPagar.Click
+ 'registrar pago
+
+ 'validaciones
+ If TxtImporteEfectivo.Text.ToDecimal + TxtImporteCredito.Text.ToDecimal + TxtImporteDebito.Text.ToDecimal + TxtImporteCheque.Text.ToDecimal = 0 Then
+ Alert("Favor de especificar importe", TipoMensaje.ToastAdventencia)
+ Exit Sub
+ End If
+
+ Dim CveVenta As Integer = HdnCveVenta.Value.ToEntero
+ Dim ObjVentas As New ClsVentas
+ If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
+ Dim DbRowVenta As DataRow = ObjVentas.DtResultados.FiltroPrimero("")
+
+ Dim VentaActual As New Venta(UsuarioActual)
+ VentaActual.CveVenta = CveVenta
+
+ VentaActual.Fecha = DbRowVenta("Fecha").ToString.ToDate
+ VentaActual.CveCliente = DbRowVenta("CveCliente").ToString.ToEntero
+ VentaActual.CveMoneda = DbRowVenta("CveMoneda").ToString.ToEntero
+ VentaActual.SerieFolio = DbRowVenta("SerieFolio").ToString
+ VentaActual.ClienteNombre = DbRowVenta("ClienteNombre").ToString
+ VentaActual.TC = DbRowVenta("TipoCambio").ToString.ToDecimal
+ VentaActual.Total = DbRowVenta("Total").ToString.ToDecimal
+ VentaActual.IVA = DbRowVenta("IVA").ToString.ToDecimal
+ VentaActual.IEPS = DbRowVenta("IEPS").ToString.ToDecimal
+ VentaActual.RetIVA = DbRowVenta("RetIVA").ToString.ToDecimal
+ VentaActual.RetISR = DbRowVenta("RetISR").ToString.ToDecimal
+
+ VentaActual.PorcentajeIVA = DbRowVenta("PorcentajeIVA").ToString.ToDecimal
+ VentaActual.UsuarioActual = UsuarioActual
+ VentaActual.CveSubProyecto = DbRowVenta("CveSubProyecto").ToString.ToEntero
+
+ Dim ObjConta As New ClsContabilidad
+ Dim ObjIE As New ClsBancos(ObjConta.IniciaTransacSQL())
+
+ Dim CvePrePoliza As Integer
+ Dim Fecha As Date = NowADS()
+ Dim Mensaje As String = ""
+
+ CvePrePoliza = ObjConta.AddPrePolizas("PVCobranza", 5, 0, 0, 1, Fecha, $"Pago {VentaActual.SerieFolio}", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+ If CvePrePoliza > 0 Then
+
+ If TxtImporteEfectivo.Text.ToDecimal > 0 Then
+ Mensaje = RegistraIE(13, DdlCuentaEfectivo.SelectedValue.ToEntero, TxtImporteEfectivo.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
+ End If
+ If TxtImporteCredito.Text.ToDecimal > 0 Then
+ Mensaje = RegistraIE(12, DdlCuentaTarjetaCredito.SelectedValue.ToEntero, TxtImporteCredito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
+ End If
+ If TxtImporteDebito.Text.ToDecimal > 0 Then
+ Mensaje = RegistraIE(11, DdlCuentaTarjetaDebito.SelectedValue.ToEntero, TxtImporteDebito.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
+ End If
+ If TxtImporteCheque.Text.ToDecimal > 0 Then
+ Mensaje = RegistraIE(3, DdlCuentaCheque.SelectedValue.ToEntero, TxtImporteCheque.Text.ToDecimal, Fecha, CvePrePoliza, VentaActual, ObjIE, ObjConta)
+ End If
+
+ Else
+ Mensaje = "Error al registrar prepólizas"
+ End If
+
+ If Mensaje = "" Then
+ PnlContado.Visible = False
+ ObjConta.Commit()
+ CargaDatos()
+ Alert("Pago Registrado correctamente.", TipoMensaje.MsgInformacion)
+ Else
+ ObjConta.RollBack()
+ End If
+
+ End If
+
+
+
+ End Sub
+
+ Private Function RegistraIE(Metodo As Integer, CveBancoCuenta As Integer, ImportePago As Decimal, Fecha As Date, CvePrePoliza As Integer, VentaActual As Venta, ByRef ObjIE As ClsBancos, ByRef ObjConta As ClsContabilidad) As String
+ Dim Retorno As String = ""
+ Dim CveIEPago As Integer = 0
+ Dim ErrorConta As Boolean
+ CveIEPago = ObjIE.AddBancos_IE(CveBancoCuenta, Metodo, Fecha, "-1", VentaActual.ClienteNombre, ImportePago, 1, 1, VentaActual.SerieFolio, "", False, True, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ If CveIEPago > 0 Then
+ Dim Pago As New VentaPago
+ Pago.ImportePagoVenta = ImportePago
+ Pago.ImportePago = ImportePago
+ Pago.CveIE = CveIEPago
+ Pago.CveMonedaPago = VentaActual.CveMoneda
+ Pago.Fecha = NowADS()
+ Pago.Referencia = VentaActual.SerieFolio
+
+ ErrorConta = AplicaPrePolizaPagoVenta(VentaActual, Pago, CvePrePoliza, ObjConta)
+ If ErrorConta Then
+ Retorno = "Error en aplicación de pago"
+ End If
+ Else
+ Retorno = "Pago en Bancos no registrado"
+ ErrorConta = True
+ End If
+
+ Return Retorno
+ End Function
+
+End Class
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index f25d14e3b..476164075 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -2772,6 +2772,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then BtnCrearApartirDe.Visible = False
If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Egs") Then BtnEditar.Visible = True
+ If UsuarioActual.TienePermisoProceso(302) AndAlso DdlTipoComprobante.SelectedValue.Contiene("Rem") Then BtnPermisoEditarRemision.Visible = True
DivFechaAnticipoCliente.Visible = True
TxtFechaAnticipoCliente.Text = NowADS().ToShortDateString
@@ -21219,6 +21220,7 @@ Partial Class Ventas
DdlFormaPago33.Enabled = True
UPCondicionesPago.Update()
If Me.PermiteCredito Then RBLPago.Enabled = True
+ DdlVendedor.Enabled = True
ModalidadEdicion = True