diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb
index 4f8badf3f..b202f93b3 100644
--- a/App_Code/ClsAcumuladores.vb
+++ b/App_Code/ClsAcumuladores.vb
@@ -928,7 +928,7 @@ Public Class ClsAcumuladores
#End Region
Public Function DistribuidorMovtosAdd(CveCliente As Integer, Cantidad As Decimal, CveTamaño As Integer, CveConcepto As Integer, CveVenta As Integer, CveUsuario As Integer,
- CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, Optional CveMovimiento As Integer = -1) As Boolean
+ CveEmpresa As Integer, ImporteCompras As Decimal, Observaciones As String, FechaIng As DateTime, Optional CveMovimiento As Integer = -1) As Boolean
Dim Retorno As Boolean = False
'Data = New DataTable
@@ -945,6 +945,7 @@ Public Class ClsAcumuladores
.Add("@ImporteCompras", SqlDbType.Money).Value = ImporteCompras
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
.Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento
+ .Add("@FechaIng", SqlDbType.DateTime).Value = FechaIng
End With
Try
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 233100246..a9a2075a0 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -2078,7 +2078,7 @@ Namespace Modelos
For Each RowSalida As DataRow In DtMovimientos.Rows
Dim Cantidad As Decimal = RowSalida("Cantidad").ToString().ToDecimal() * -1
- If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then
+ If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Cantidad, RowSalida("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
Retorno = False
Exit For
End If
@@ -2100,7 +2100,7 @@ Namespace Modelos
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, 2, factura.CveVenta, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, 0D, "") Then
+ UsuarioActual.CveEmpresa, 0D, "", factura.Fecha) Then
Resultado = False
Exit For
End If
@@ -2159,7 +2159,7 @@ Namespace Modelos
If factura.Cliente.EsDistribuidor AndAlso factura.CveConceptoMovimiento = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Dr("Cantidad").ToString.ToDecimal(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
+ UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, factura.Fecha, CveMovimiento:=CveMovimiento) Then
' Mensaje = "Error al guardar Movimientos de distribuidor"
Resultado = False
Exit For
diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb
index 51caa9b03..968f80443 100644
--- a/Inventarios/RecepcionUsados.aspx.vb
+++ b/Inventarios/RecepcionUsados.aspx.vb
@@ -15,6 +15,15 @@ Partial Class Inventarios_RecepcionUsados
Private _dtDatos As DataTable
+ Public Property DtClientes() As DataTable
+ Get
+ Return CType(ViewState("DtClientes"), DataTable)
+ End Get
+ Set(value As DataTable)
+ ViewState("DtClientes") = value
+ End Set
+ End Property
+
Public Property DtMovimientos() As DataTable
Get
Return CType(ViewState("DtMovimientos"), DataTable)
@@ -331,6 +340,7 @@ Partial Class Inventarios_RecepcionUsados
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack Then
CargaInicial()
+ GeneraRNCFromURL()
End If
End Sub
@@ -405,7 +415,76 @@ Partial Class Inventarios_RecepcionUsados
'DdlProducto2.setEsWebService(True)
'DdlProducto2.Attributes.Add("data-metodo", "getpsusados")
End Sub
+ Private Sub GeneraRNCFromURL()
+ Dim RFC As String = IfNull(Request("RFC"), "").ToString()
+ Dim CveAlmacen As Integer = IfNull(Request("CveAlmacen"), "-1").ToString().ToEntero()
+ Dim Cantidad As Decimal = IfNull(Request("Cantidad"), "0").ToString().ToDecimal()
+ Dim Fecha As DateTime = IfNull(Request("Fecha"), Now.ToString("dd/MM/yyyy")).ToString().ToDateTime()
+ If Not String.IsNullOrEmpty(RFC) Then
+ If DtClientes Is Nothing Then
+ Alert("No se encontraron clientes para filtrar", TipoMensaje.MsgError)
+ Exit Sub
+ End If
+
+ Dim RowCliente = DtClientes.FiltroPrimero(String.Format("RFC='{0}'", RFC))
+ If RowCliente Is Nothing Then
+ Alert("No se encontro el cliente", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If CveAlmacen <= 0 Then
+ Alert("Es necesario especificar el almacen", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If Cantidad <= 0 Then
+ Alert("Es necesario especificar la cantidad", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim CveCliente As Integer = RowCliente("CveCliente").ToString().ToEntero()
+
+ DdlClientes.SelectedValueExist(CveCliente)
+ DdlClientes_SelectedIndexChanged(DdlClientes, EventArgs.Empty)
+
+ DdlAlmacen.SelectedValueExist(CveAlmacen)
+ TxtFecha.Text = Fecha.ToString("dd/MM/yyyy")
+
+
+ Dim CvePS As Integer = 403591 'EXTRA CHICO
+ Dim CveTamanio As Integer = 1
+ Dim CveUM As Integer = -1
+ Dim PU As Decimal = 0
+ Dim RowTamanio As DataRow = GlobalDTAcumTamaños.FiltroPrimero($"CveEmpresa = {UsuarioActual.CveEmpresa} AND CvePSCargo > 0 AND CvePSCargo={CvePS}")
+ Dim CodigoPS As String = ""
+ Dim UnidaMedida As String = ""
+
+ If RowTamanio IsNot Nothing Then
+ PU = RowTamanio("Cargo").ToString.ToDecimal()
+ CodigoPS = RowTamanio("CodigoPS").ToString()
+ CveTamanio = RowTamanio("CveTamaño").ToString().ToEntero()
+ CveUM = RowTamanio("CveUM").ToString().ToEntero()
+ UnidaMedida = "" 'RowTamanio("UnidadMedida").ToString()
+
+ AddNew(CvePS, CodigoPS, CveUM, UnidaMedida, Cantidad, PU, "", "-1", "-1", "-1", "", "", -1, "", "", CveTamanio)
+
+ Dim CveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
+
+ CreaRemisionNC(CveCliente, CveSubProyecto, 1)
+
+ If Me.ObjRemisionNC IsNot Nothing Then
+ Guardar(True)
+ Else
+ Alert("No se pudo generar la RNC", TipoMensaje.MsgError)
+ End If
+ Else
+ Alert("No se encontro el tamaño", TipoMensaje.MsgError)
+ End If
+ End If
+
+
+ End Sub
#Region " PERMISOS PAGINAS "
@@ -1165,7 +1244,7 @@ Partial Class Inventarios_RecepcionUsados
If EsDistribuidor AndAlso RBLOpcion.SelectedValue.ToEntero = 42 AndAlso Dr("CveTamaño").ToString.ToEntero > 0 Then
If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then
+ UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, Now, CveMovimiento:=CveMovimiento) Then
Mensaje = "Error al guardar Movimientos de distribuidor"
ErrorMovInv = True
Exit For
@@ -1850,9 +1929,11 @@ Partial Class Inventarios_RecepcionUsados
#Region "DDL CLIENTE / CLIENTE SUCURSAL - SELECTED INDEX CHANGED"
Private Sub InicializaClientes(Todos As Boolean)
+ DtClientes = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1"))
- DdlClientes.DataSource = GlobalDTCliente(UsuarioActual.CveEmpresa).FiltraParametros(If(Todos, "", "EsDistribuidor = 1"))
+ DdlClientes.DataSource = DtClientes
DdlClientes.DataBind()
+
DdlClientes.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlClientes.SelectedValue = "-1"
@@ -2219,11 +2300,12 @@ Partial Class Inventarios_RecepcionUsados
Me.ObjRemisionNC.TipoDocto = "RNC"
Me.ObjRemisionNC.RefDocto = ""
Me.ObjRemisionNC.CveMesa = -1
- Me.ObjRemisionNC.Fecha = Now
+ Dim Fecha As DateTime = TxtFecha.Text.ToDateTime()
+ Me.ObjRemisionNC.Fecha = Fecha
Me.ObjRemisionNC.CvePrePoliza = -1
- Me.ObjRemisionNC.FechaPago = Now
+ Me.ObjRemisionNC.FechaPago = Fecha
Me.ObjRemisionNC.MotivoDescuento = ""
- Me.ObjRemisionNC.FechaEjecucion = Now
+ Me.ObjRemisionNC.FechaEjecucion = Fecha
Me.ObjRemisionNC.UsuarioCreo = UsuarioActual.Usuario
Me.ObjRemisionNC.CveCondicionEntrega = -1
Me.ObjRemisionNC.CondicionEntrega = ""
diff --git a/Ventas/Clientes.aspx.vb b/Ventas/Clientes.aspx.vb
index 7c143cb75..5f3443ca4 100644
--- a/Ventas/Clientes.aspx.vb
+++ b/Ventas/Clientes.aspx.vb
@@ -7,18 +7,18 @@ Imports System.IO
Imports Microsoft.Reporting.WebForms
Imports System.Data
Imports System.Globalization
-Imports System.Net.Http
-Imports Newtonsoft.Json
-Imports System.Threading.Tasks
-Imports Newtonsoft.Json.Linq
-Imports System.Net
-Imports System.Collections.Generic
-Imports Newtonsoft.Json.Serialization
-
+Imports System.Net.Http
+Imports Newtonsoft.Json
+Imports System.Threading.Tasks
+Imports Newtonsoft.Json.Linq
+Imports System.Net
+Imports System.Collections.Generic
+Imports Newtonsoft.Json.Serialization
+
Partial Class Clientes
- Inherits ClsPaginas
-
- 'Configuración
+ Inherits ClsPaginas
+
+ 'Configuración
#Region "P R O P I E D A D E S"
Private Const NumeroDecimales As Integer = 2
Private CveVentaDeduccion As Integer
@@ -503,10 +503,10 @@ Partial Class Clientes
Set(value As String)
ViewState("linkDescargaPagare") = value
End Set
- End Property
-
+ End Property
+
#End Region
-
+
#Region "Documentacion"
Private Property DTDocumentacion As DataTable
Get
@@ -617,21 +617,21 @@ Partial Class Clientes
Set(value As String)
ViewState("AdjuntoDocumentacion") = value
End Set
- End Property
- 'Private ReadOnly Property CvePersonal As Integer
- ' Get
- ' If ViewState("CvePersonal") Is Nothing Then
- ' Return -1
- ' Else
- ' Return ViewState("CvePersonal").ToString().Toentero()
- ' End If
- ' End Get
- 'End Property
-
+ End Property
+ 'Private ReadOnly Property CvePersonal As Integer
+ ' Get
+ ' If ViewState("CvePersonal") Is Nothing Then
+ ' Return -1
+ ' Else
+ ' Return ViewState("CvePersonal").ToString().Toentero()
+ ' End If
+ ' End Get
+ 'End Property
+
#End Region
-
-
-
+
+
+
#Region " A C U M U L A D O R E S"
Property CveVentaNota As Integer
Get
@@ -671,10 +671,10 @@ Partial Class Clientes
Set(value As String)
ViewState("SerieNotaAcumulador") = value
End Set
- End Property
-
+ End Property
+
#End Region
-
+
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
@@ -683,10 +683,10 @@ Partial Class Clientes
CargaCombos()
CreaDTVentas()
CreaDtPago()
- RegistraScript("CargaHeader();")
- CargaCombosDirecionesClientesSAT()
-
-
+ RegistraScript("CargaHeader();")
+ CargaCombosDirecionesClientesSAT()
+
+
If UsuarioActual.Empresa.CvePlataforma = 3 Then 'SI ES USUARIO GPS
TabFiscalContable.Visible = True
TabRetenciones.Visible = False
@@ -813,8 +813,8 @@ Partial Class Clientes
Tab.ActiveTabIndex = Request("ATI").ToEntero()
End If
'CargaCuentasyConceptos()
- Else
- 'Configuración de Modalidad Insert
+ Else
+ 'Configuración de Modalidad Insert
CargaEstados()
If UsuarioActual.Empresa.Funcionalidad(525) = "1" Then
@@ -920,19 +920,19 @@ Partial Class Clientes
ChkPermiso5.Enabled = False
ChkPermiso6.Enabled = False
- End Sub
-
+ End Sub
+
#Region " PERMISOS PAGINAS "
-
- Private Sub MostrarTxtDireccionesClienteEnvio()
-
- If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
- DVDireccionCliente1.Visible = True
- DVDireccionCliente2.Visible = True
- End If
-
- End Sub
-
+
+ Private Sub MostrarTxtDireccionesClienteEnvio()
+
+ If UsuarioActual.CveEmpresa.Contiene(72, 80, 146) Then
+ DVDireccionCliente1.Visible = True
+ DVDireccionCliente2.Visible = True
+ End If
+
+ End Sub
+
Private Function PermiteGuardar() As Boolean
Return UsuarioActual.TienePermisoProceso(192)
End Function
@@ -957,21 +957,21 @@ Partial Class Clientes
ChkCargoUsado.Enabled = False
ChkBonificacionUsado.Enabled = False
- If Not ChkEsDistribuidor.Checked Then
- BtnGuardar.Visible = PermiteEditar()
+ If Not ChkEsDistribuidor.Checked Then
+ BtnGuardar.Visible = PermiteEditar()
End If
- End Sub
-
-
+ End Sub
+
+
#End Region
-
-
+
+
#Region "C A R G A S"
-
-
-
-
-
+
+
+
+
+
Private Sub CreaDtPago()
DtPagos = New DataTable
DtPagos.Columns.Add("CveTipoMovimiento", GetType(String))
@@ -1153,9 +1153,9 @@ Partial Class Clientes
Select Case HdnCuenta.Value
Case "1"
- CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero()
+ CargaDdlCuentasContables(DdlCtaContableClientes, 1)'UsuarioActual.Empresa.Funcionalidad(246).Toentero()
Case "2"
- CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero()
+ CargaDdlCuentasContables(DdlCtaContableAnticipos, 1)' UsuarioActual.Empresa.Funcionalidad(237).Toentero()
Case "3"
CargaDdlCuentasContables(DdlCtaContableRetIVA, -1)
Case "4"
@@ -1163,13 +1163,13 @@ Partial Class Clientes
Case "5"
CargaDdlCuentasContables(DdlCtaContableFondoGarantia, -1)
Case "6"
- CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero()
+ CargaDdlCuentasContables(DdlCtaContableCompClientes, 1)'UsuarioActual.Empresa.Funcionalidad(248).Toentero()
Case "7"
CargaDdlCuentasContables(DdlCtaContableCompAnticipos, -1)
Case "8"
- CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero()
+ CargaDdlCuentasContables(DdlMonedaExtranjeraClientes, 1)'UsuarioActual.Empresa.Funcionalidad(247).Toentero()
Case "9"
- CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).Toentero()
+ CargaDdlCuentasContables(DdlMonedaExtranjeraAnticipos, 1) 'UsuarioActual.Empresa.Funcionalidad(542).Toentero()
End Select
UpFiscalContable.Update()
@@ -1380,7 +1380,7 @@ Partial Class Clientes
DdlVendedorSucursalAsignar.DataBind()
DdlVendedor.Items.Insert(0, item)
- DdlVendedorSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
+ DdlVendedorSucursal.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlVendedorSucursalAsignar.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -1392,13 +1392,13 @@ Partial Class Clientes
If ObjCorporativo.GetCorporativo(UsuarioActual.CveEmpresa, 1) Then
If ObjCorporativo.DtResultados.Rows.Count > 0 Then
Dim dt As DataTable = ObjCorporativo.DtResultados
- DdlCorporativo.DataSource = dt
+ DdlCorporativo.DataSource = dt
DdlCorporativo.Items.Insert(0, New ListItem("Seleccione", "-1"))
Else
DdlCorporativo.DataSource = Nothing
End If
End If
- ObjCorporativo.Dispose()
+ ObjCorporativo.Dispose()
DdlCorporativo.DataBind()
End Sub
Protected Sub CargaCuentasExistentes()
@@ -1425,23 +1425,23 @@ Partial Class Clientes
If ObjClientes.GetClientes(CveCliente, "-1", "-1", "-1", "-1", "-1", "-1", -1, UsuarioActual.CveEmpresa, Estatus:=-1, TipoCliente:=-1) Then
If ObjClientes.DtResultados.Rows.Count > 0 Then
Existe = True
- Retorno = True
-
+ Retorno = True
+
CargaDdlSucursalCliente()
CargaDocumentosVenta(CveCliente)
- Dim RetSC As Boolean = CargaSucursalesCliente()
-
- CargaUsuariosPortal()
- 'CargaPersonalAsignado()
- 'CargaOrdenesServiciosCliente()
+ Dim RetSC As Boolean = CargaSucursalesCliente()
+
+ CargaUsuariosPortal()
+ 'CargaPersonalAsignado()
+ 'CargaOrdenesServiciosCliente()
CargaImpuestosLocales()
CargaCuentasContablesDdls()
CargaResponsables()
- CargaCondicionesEntrega()
- 'CargaClasificaciones()
- ' CargaGridRetenciones()
- ' CargaDocs()
+ CargaCondicionesEntrega()
+ 'CargaClasificaciones()
+ ' CargaGridRetenciones()
+ ' CargaDocs()
CargaCombos()
CargaDocumentacionCliente()
'CargaMetodosPago33()
@@ -1452,9 +1452,9 @@ Partial Class Clientes
If UsuarioActual.TienePermisoProceso(279) Then
LnkPorcentajeMarcas.Visible = True
LnkPorcentajePrecios.Visible = True
- End If
-
-
+ End If
+
+
If UsuarioActual.TienePermisoProceso(261) Then LnkVerGrafica.Visible = True
If UsuarioActual.Empresa.CvePlataforma = 3 Then ' SI ES USUARIO DE GPS.
@@ -1463,13 +1463,13 @@ Partial Class Clientes
CargaCuentasEquipos()
End If
- CargaCuentasCaracteristicas()
+ CargaCuentasCaracteristicas()
If ObjClientes.Pais = "" Then ObjClientes.Pais = "México"
- If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 Then
- LnkAgregarVendedorSucursal.Visible = True
+ If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CveCliente > 0 Then
+ LnkAgregarVendedorSucursal.Visible = True
End If
'Campos para Modificación
@@ -1525,8 +1525,8 @@ Partial Class Clientes
IdCtaAnticipos = ObjClientes.IdCtaContAnticipos.ToString()
IdCtaRetIVA = ObjClientes.IdCtaContRetIVA.ToString()
IdCtaRetISR = ObjClientes.IdCtaContRetISR.ToString()
- IdCtaFondoGarantia = ObjClientes.IdCtaContFondoGarantia.ToString()
- 'DdlMetodoPago.SelectedValue = ObjClientes.CveMetodoPago.ToString()
+ IdCtaFondoGarantia = ObjClientes.IdCtaContFondoGarantia.ToString()
+ 'DdlMetodoPago.SelectedValue = ObjClientes.CveMetodoPago.ToString()
TxtFormaFacturacion.Text = ObjClientes.FormaFacturacion
ChkPermiteCredito.Checked = ObjClientes.PermiteCredito
TxtLimiteCredito.Text = ObjClientes.LimiteCredito.FormatoNumero()
@@ -1605,7 +1605,7 @@ Partial Class Clientes
HDLT.Value = If(ObjClientes.DtResultados(0)("LT").ToString() = "", "0", ObjClientes.DtResultados(0)("LT").ToString())
HDLG.Value = If(ObjClientes.DtResultados(0)("LG").ToString() = "", "0", ObjClientes.DtResultados(0)("LG").ToString())
- DdlPais.SelectedValueExist(ObjClientes.CvePais)
+ DdlPais.SelectedValueExist(ObjClientes.CvePais)
CargaEstado()
@@ -1652,18 +1652,18 @@ Partial Class Clientes
End If
DdlMotivoTraslado.SelectedValueExist(ObjClientes.CveMotivoTraslado)
- TxtNumRegIdTrib.Text = ObjClientes.NumRegIdTrib
-
+ TxtNumRegIdTrib.Text = ObjClientes.NumRegIdTrib
+
DdlAdminTrayecto.SelectedValueExist(ObjClientes.DtResultados(0)("CveAdminTrayecto").ToString())
- DdlAdminTrayecto_SelectedIndexChanged(DdlAdminTrayecto, EventArgs.Empty)
- 'If ObjClientes.CveUsoCFDI > 0 Then DdlUsoCFDI.Items.RemoveAt(0)
- 'If ObjClientes.CveMetodoPago33 > 0 Then DdlMetodoPago33.Items.RemoveAt(0)
- 'If ObjClientes.CveFormaPago33 > 0 Then DdlFormaPago33.Items.RemoveAt(0)
-
-
-
-
- 'DIAS DE PAGO
+ DdlAdminTrayecto_SelectedIndexChanged(DdlAdminTrayecto, EventArgs.Empty)
+ 'If ObjClientes.CveUsoCFDI > 0 Then DdlUsoCFDI.Items.RemoveAt(0)
+ 'If ObjClientes.CveMetodoPago33 > 0 Then DdlMetodoPago33.Items.RemoveAt(0)
+ 'If ObjClientes.CveFormaPago33 > 0 Then DdlFormaPago33.Items.RemoveAt(0)
+
+
+
+
+ 'DIAS DE PAGO
If ObjClientes.RecepcionPagos <> "" AndAlso ObjClientes.RecepcionPagos.Length = 11 Then
Dim array As String() = ObjClientes.RecepcionPagos.Split(New Char() {"-"c})
If array(0) = "1" Then ChkLunes.Checked = True
@@ -1701,31 +1701,31 @@ Partial Class Clientes
TxtObsDiasRevision.Text = ObjClientes.ObservacionRevision
TxtReferenciaFiscal.Text = ObjClientes.ReferenciaFiscal
TxtCelular.Text = ObjClientes.Celular
- TxtExtOtro.Text = ObjClientes.ExtOtros
-
-
- If UsuarioActual.CveEmpresa.Contiene(119, 4, 7, 11, 12, 122, 145) Then
-
- If ObjClientes.IdCtaContClientes > 0 Then DdlCtaContableClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContClientes), ObjClientes.IdCtaContClientes.ToString())) : DdlCtaContableClientes.SelectedValue = ObjClientes.IdCtaContClientes.ToString()
- If ObjClientes.IdCtaContAnticipos > 0 Then
- DdlCtaContableAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContAnticipos), ObjClientes.IdCtaContAnticipos.ToString()))
- DdlCtaContableAnticipos.SelectedValue = ObjClientes.IdCtaContAnticipos.ToString()
- End If
- If ObjClientes.IdCtaContRetISR > 0 Then DdlCtaContableRetISR.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContRetISR), ObjClientes.IdCtaContRetISR.ToString())) : DdlCtaContableRetISR.SelectedValue = ObjClientes.IdCtaContRetISR.ToString()
- If ObjClientes.IdCtaContRetIVA > 0 Then DdlCtaContableRetIVA.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContRetIVA), ObjClientes.IdCtaContRetIVA.ToString())) : DdlCtaContableRetIVA.SelectedValue = ObjClientes.IdCtaContRetIVA.ToString()
- If ObjClientes.IdCtaContFondoGarantia > 0 Then DdlCtaContableFondoGarantia.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContFondoGarantia), ObjClientes.IdCtaContFondoGarantia.ToString())) : DdlCtaContableFondoGarantia.SelectedValue = ObjClientes.IdCtaContFondoGarantia.ToString()
-
-
- If ObjClientes.IdCtaContComplementaria > 0 Then DdlCtaContableCompClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContComplementaria), ObjClientes.IdCtaContComplementaria.ToString())) : DdlCtaContableCompClientes.SelectedValue = ObjClientes.IdCtaContComplementaria.ToString()
- If ObjClientes.IdCtaContCompAnticipos > 0 Then DdlCtaContableCompAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContCompAnticipos), ObjClientes.IdCtaContCompAnticipos.ToString())) : DdlCtaContableCompAnticipos.SelectedValue = ObjClientes.IdCtaContCompAnticipos.ToString()
-
- If ObjClientes.IdCtaMonedaExtranjera > 0 Then DdlMonedaExtranjeraClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaMonedaExtranjera), ObjClientes.IdCtaMonedaExtranjera.ToString())) : DdlMonedaExtranjeraClientes.SelectedValue = ObjClientes.IdCtaMonedaExtranjera.ToString()
- If ObjClientes.IdCtaMonedaExtranjeraAnticipos > 0 Then DdlMonedaExtranjeraAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaMonedaExtranjeraAnticipos), ObjClientes.IdCtaMonedaExtranjeraAnticipos.ToString())) : DdlMonedaExtranjeraAnticipos.SelectedValue = ObjClientes.IdCtaMonedaExtranjeraAnticipos.ToString()
- ActivarRegistroAutomatico()
- End If
-
-
- '7eleven
+ TxtExtOtro.Text = ObjClientes.ExtOtros
+
+
+ If UsuarioActual.CveEmpresa.Contiene(119, 4, 7, 11, 12, 122, 145) Then
+
+ If ObjClientes.IdCtaContClientes > 0 Then DdlCtaContableClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContClientes), ObjClientes.IdCtaContClientes.ToString())) : DdlCtaContableClientes.SelectedValue = ObjClientes.IdCtaContClientes.ToString()
+ If ObjClientes.IdCtaContAnticipos > 0 Then
+ DdlCtaContableAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContAnticipos), ObjClientes.IdCtaContAnticipos.ToString()))
+ DdlCtaContableAnticipos.SelectedValue = ObjClientes.IdCtaContAnticipos.ToString()
+ End If
+ If ObjClientes.IdCtaContRetISR > 0 Then DdlCtaContableRetISR.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContRetISR), ObjClientes.IdCtaContRetISR.ToString())) : DdlCtaContableRetISR.SelectedValue = ObjClientes.IdCtaContRetISR.ToString()
+ If ObjClientes.IdCtaContRetIVA > 0 Then DdlCtaContableRetIVA.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContRetIVA), ObjClientes.IdCtaContRetIVA.ToString())) : DdlCtaContableRetIVA.SelectedValue = ObjClientes.IdCtaContRetIVA.ToString()
+ If ObjClientes.IdCtaContFondoGarantia > 0 Then DdlCtaContableFondoGarantia.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContFondoGarantia), ObjClientes.IdCtaContFondoGarantia.ToString())) : DdlCtaContableFondoGarantia.SelectedValue = ObjClientes.IdCtaContFondoGarantia.ToString()
+
+
+ If ObjClientes.IdCtaContComplementaria > 0 Then DdlCtaContableCompClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContComplementaria), ObjClientes.IdCtaContComplementaria.ToString())) : DdlCtaContableCompClientes.SelectedValue = ObjClientes.IdCtaContComplementaria.ToString()
+ If ObjClientes.IdCtaContCompAnticipos > 0 Then DdlCtaContableCompAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaContCompAnticipos), ObjClientes.IdCtaContCompAnticipos.ToString())) : DdlCtaContableCompAnticipos.SelectedValue = ObjClientes.IdCtaContCompAnticipos.ToString()
+
+ If ObjClientes.IdCtaMonedaExtranjera > 0 Then DdlMonedaExtranjeraClientes.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaMonedaExtranjera), ObjClientes.IdCtaMonedaExtranjera.ToString())) : DdlMonedaExtranjeraClientes.SelectedValue = ObjClientes.IdCtaMonedaExtranjera.ToString()
+ If ObjClientes.IdCtaMonedaExtranjeraAnticipos > 0 Then DdlMonedaExtranjeraAnticipos.Items.Add(New ListItem(NombreCuenta(ObjClientes.IdCtaMonedaExtranjeraAnticipos), ObjClientes.IdCtaMonedaExtranjeraAnticipos.ToString())) : DdlMonedaExtranjeraAnticipos.SelectedValue = ObjClientes.IdCtaMonedaExtranjeraAnticipos.ToString()
+ ActivarRegistroAutomatico()
+ End If
+
+
+ '7eleven
TxtProveedor.Text = ObjClientes.SevenEleven_NumProveedor
'FORD
@@ -1752,34 +1752,34 @@ Partial Class Clientes
If Not ObjClientes.Estatus Then
Alert("El cliente actualmente se encuentra Inactivo.", TipoMensaje.MsgAdvertencia)
- End If
-
- 'watch.Stop()
+ End If
+
+ 'watch.Stop()
'Alert(watch.ElapsedMilliseconds.ToString())
- 'watch.Start()
+ 'watch.Start()
- CargaEventoBitacora()
- 'If UsuarioActual.Empresa.Funcionalidad(300) = "1" Then
- ' CargaCuentasConceptos()
- ' divCuentas.Visible = True
- ' divCuentasContp.Visible = False
- 'Else
- ' divCuentas.Visible = False
- ' divCuentasContp.Visible = True
- 'End If
-
- 'watch.Stop()
+ CargaEventoBitacora()
+ 'If UsuarioActual.Empresa.Funcionalidad(300) = "1" Then
+ ' CargaCuentasConceptos()
+ ' divCuentas.Visible = True
+ ' divCuentasContp.Visible = False
+ 'Else
+ ' divCuentas.Visible = False
+ ' divCuentasContp.Visible = True
+ 'End If
+
+ 'watch.Stop()
'Alert(watch.ElapsedMilliseconds.ToString())
- 'watch.Start()
-
- If UsuarioActual.Empresa.TipoContabilidad = 1 Then
+ 'watch.Start()
+
+ If UsuarioActual.Empresa.TipoContabilidad = 1 Then
CargaCuentasConceptos()
divCuentas.Visible = True
- divCuentasContp.Visible = False
- ElseIf UsuarioActual.Empresa.TipoContabilidad = 2 Then
- divCuentas.Visible = False
- divCuentasContp.Visible = True
+ divCuentasContp.Visible = False
+ ElseIf UsuarioActual.Empresa.TipoContabilidad = 2 Then
+ divCuentas.Visible = False
+ divCuentasContp.Visible = True
End If
@@ -1839,28 +1839,28 @@ Partial Class Clientes
ObjClientes.Dispose()
- watch.Stop()
- ' Alert(watch.ElapsedMilliseconds.ToString())
-
+ watch.Stop()
+ ' Alert(watch.ElapsedMilliseconds.ToString())
+
Return Retorno
End Function
- Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
- Dim ObjClientes As New ClsClientes()
- If ObjClientes.GetHistorialVentas(CveCliente, UsuarioActual.CveEmpresa, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
- If ObjClientes.DtResultados.Rows.Count > 0 Then
-
- 'Carga Grid
- DTHistorialVentas = ObjClientes.DtResultados
- GVHistorial.DataSource = ObjClientes.DtResultados
- Else
- GVHistorial.DataSource = Nothing
- End If
- Else
- GVHistorial.DataSource = Nothing
- End If
- ObjClientes.Dispose()
- GVHistorial.DataBind()
-
+ Private Sub CargaHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1)
+ Dim ObjClientes As New ClsClientes()
+ If ObjClientes.GetHistorialVentas(CveCliente, UsuarioActual.CveEmpresa, SelectTop, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
+ If ObjClientes.DtResultados.Rows.Count > 0 Then
+
+ 'Carga Grid
+ DTHistorialVentas = ObjClientes.DtResultados
+ GVHistorial.DataSource = ObjClientes.DtResultados
+ Else
+ GVHistorial.DataSource = Nothing
+ End If
+ Else
+ GVHistorial.DataSource = Nothing
+ End If
+ ObjClientes.Dispose()
+ GVHistorial.DataBind()
+
'DTHistorialVentas = ConsultarHistorial()
'GVHistorial.DataSource = DTHistorialVentas
'GVHistorial.DataBind()
@@ -2042,11 +2042,11 @@ Partial Class Clientes
DdlSucursalUsoCFDI.Items.Clear()
DdlSucursalUsoCFDI.DataSource = GlobalDTSATUsosCFDI(UsuarioActual.Empresa.EsPersonaFisica)
DdlSucursalUsoCFDI.DataBind()
- End Sub
+ End Sub
#End Region
-
+
#Region "V E R M Á S"
-
+
Protected Sub BtnVerMasVentas_Click(sender As Object, e As EventArgs)
If BtnVerMasVentas.Text = "Ver Más" Then
CargaHistorial(-1)
@@ -2076,12 +2076,12 @@ Partial Class Clientes
CargaBancos(51)
BtnVerMasBancos.Text = "Ver Más"
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "B A N C O S"
- 'CuentasxCobrar Activas (Pagos Recibidos)
+ 'CuentasxCobrar Activas (Pagos Recibidos)
Private Sub CargaBancos(Optional SelectTop As Integer = 51, Optional CveClienteSucursal As Integer = -1)
Dim ObjMovtos As New ClsMovimientos()
'CxC Activas
@@ -2144,9 +2144,9 @@ Partial Class Clientes
TxtParaMail.Text = TxtCobranzaCorreo.Text
UpSendMail.Update()
RegistraScript("$('#ModalDivMail').modal('show');")
- End Sub
+ End Sub
#End Region
-
+
#Region "B T N ´ S"
Protected Sub BtnEliminar_Click(sender As Object, e As System.EventArgs) Handles BtnEliminar.Click
Dim ObjClientes As New ClsClientes()
@@ -2218,11 +2218,11 @@ Partial Class Clientes
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = XML})
-
- If Dr("Adjunto").ToString() <> "" Then
- Adjunto = Dr("Adjunto").ToString()
- Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
+
+ If Dr("Adjunto").ToString() <> "" Then
+ Adjunto = Dr("Adjunto").ToString()
+ Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
End If
'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
@@ -2251,11 +2251,11 @@ Partial Class Clientes
Dim ResultadoMail As Integer = 0
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
- If Dr("Adjunto").ToString() <> "" Then
- Adjunto = Dr("Adjunto").ToString()
- Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
+ If Dr("Adjunto").ToString() <> "" Then
+ Adjunto = Dr("Adjunto").ToString()
+ Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
End If
'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
@@ -2283,11 +2283,11 @@ Partial Class Clientes
Dim ResultadoMail As Integer = 0
Dim LSRutasMail As New List(Of ClsSisMail.ArchivoMail)
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
- If Dr("Adjunto").ToString() <> "" Then
- Adjunto = Dr("Adjunto").ToString()
- Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
- LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = PDF})
+ If Dr("Adjunto").ToString() <> "" Then
+ Adjunto = Dr("Adjunto").ToString()
+ Dim ArchivoAdjunto As String = $"{Ruta}Ventas\{Adjunto}"
+ LSRutasMail.Add(New ClsSisMail.ArchivoMail With {.Ruta = ArchivoAdjunto})
End If
'If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, "Entrega de Factura", PDF, XML, ArrayCC, TxtBody.Text.Trim) Then
If ObjMail.SendMail(UsuarioActual.Empresa, TxtParaMail.Text.Trim, Asunto, Cuerpo, TxtCC.Text.Trim, LSRutasMail) Then
@@ -2469,85 +2469,85 @@ Partial Class Clientes
Dim errorContPaq As Boolean = False
Dim IdContPaqi As Integer = 0
- Dim CodigoPersona As Integer = 0
-
-
+ Dim CodigoPersona As Integer = 0
+
+
#Region "comentado"
- 'If UsuarioActual.Empresa.Funcionalidad(522).ToString() = "1" Then
-
- ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa)
-
- ' If ObjContPaqi.GetPersona(TxtRFC.Text) Then
-
- ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
-
- ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("Id").ToString().Toentero()
- ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero()
-
- ' Dim Cont_EsProveedor As Integer = If(Boolean.Parse(ObjContPaqi.DtResultados.Rows(0)("EsProveedor").ToString()), 1, 0)
- ' Dim Cont_Nombre As String = ObjContPaqi.DtResultados(0)("Nombre").ToString()
- ' Dim Cont_RFC As String = ObjContPaqi.DtResultados(0)("RFC").ToString()
-
- ' If ObjContPaqi.UpdatePersona(IdContPaqi, Cont_Nombre, Cont_RFC, 1, Cont_EsProveedor) Then
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
-
- ' Else
- ' If ObjContPaqi.AddPersona(TxtNombre.Text.Trim, TxtRFC.Text.Trim, 1, 0) Then
-
- ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiPersona").ToString().Toentero()
- ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero()
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
- ' End If
-
-
- ' If Not errorContPaq Then
- ' Dim IdContPaqiCliente As Integer
-
- ' If ObjContPaqi.GetCliente(-1, CodigoPersona) Then
-
- ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
-
- ' IdContPaqiCliente = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiClient").ToString().Toentero()
-
- ' If ObjContPaqi.UpdateCliente(IdContPaqiCliente, CodigoPersona, CodigoPersona, "", "") Then
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
- ' Else
- ' If ObjContPaqi.AddCliente(CodigoPersona, CodigoPersona, "", "") Then
- ' errorContPaq = False
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
- ' Else
- ' errorContPaq = True
- ' End If
- ' End If
-
-
- ' If Not errorContPaq Then
- ' ObjContPaqi.Commit()
- ' ObjContPaqi.Dispose()
- ' Else
- ' ObjContPaqi.RollBack()
- ' ObjContPaqi.Dispose()
- ' Alert("Se presento un error al guardar en ContPAQi", TipoMensaje.MsgError)
- ' Exit Sub
- ' End If
-
-
- 'End If
+ 'If UsuarioActual.Empresa.Funcionalidad(522).ToString() = "1" Then
+
+ ' Dim ObjContPaqi As New ClsContPAQi(UsuarioActual.Empresa)
+
+ ' If ObjContPaqi.GetPersona(TxtRFC.Text) Then
+
+ ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
+
+ ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("Id").ToString().Toentero()
+ ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero()
+
+ ' Dim Cont_EsProveedor As Integer = If(Boolean.Parse(ObjContPaqi.DtResultados.Rows(0)("EsProveedor").ToString()), 1, 0)
+ ' Dim Cont_Nombre As String = ObjContPaqi.DtResultados(0)("Nombre").ToString()
+ ' Dim Cont_RFC As String = ObjContPaqi.DtResultados(0)("RFC").ToString()
+
+ ' If ObjContPaqi.UpdatePersona(IdContPaqi, Cont_Nombre, Cont_RFC, 1, Cont_EsProveedor) Then
+ ' errorContPaq = False
+ ' Else
+ ' errorContPaq = True
+ ' End If
+
+ ' Else
+ ' If ObjContPaqi.AddPersona(TxtNombre.Text.Trim, TxtRFC.Text.Trim, 1, 0) Then
+
+ ' IdContPaqi = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiPersona").ToString().Toentero()
+ ' CodigoPersona = ObjContPaqi.DtResultados.Rows(0)("Codigo").ToString().Toentero()
+ ' errorContPaq = False
+ ' Else
+ ' errorContPaq = True
+ ' End If
+ ' End If
+ ' End If
+
+
+ ' If Not errorContPaq Then
+ ' Dim IdContPaqiCliente As Integer
+
+ ' If ObjContPaqi.GetCliente(-1, CodigoPersona) Then
+
+ ' If ObjContPaqi.DtResultados.Rows.Count > 0 Then
+
+ ' IdContPaqiCliente = ObjContPaqi.DtResultados.Rows(0)("IdContPaqiClient").ToString().Toentero()
+
+ ' If ObjContPaqi.UpdateCliente(IdContPaqiCliente, CodigoPersona, CodigoPersona, "", "") Then
+ ' errorContPaq = False
+ ' Else
+ ' errorContPaq = True
+ ' End If
+ ' Else
+ ' If ObjContPaqi.AddCliente(CodigoPersona, CodigoPersona, "", "") Then
+ ' errorContPaq = False
+ ' Else
+ ' errorContPaq = True
+ ' End If
+ ' End If
+ ' Else
+ ' errorContPaq = True
+ ' End If
+ ' End If
+
+
+ ' If Not errorContPaq Then
+ ' ObjContPaqi.Commit()
+ ' ObjContPaqi.Dispose()
+ ' Else
+ ' ObjContPaqi.RollBack()
+ ' ObjContPaqi.Dispose()
+ ' Alert("Se presento un error al guardar en ContPAQi", TipoMensaje.MsgError)
+ ' Exit Sub
+ ' End If
+
+
+ 'End If
#End Region
-
+
Dim LT As String = If(HDLT.Value.ToDouble <> 0, HDLT.Value, "0")
Dim LG As String = If(HDLG.Value.ToDouble <> 0, HDLG.Value, "0")
@@ -2708,7 +2708,7 @@ Partial Class Clientes
CveMotivoTraslado:=IIf(DdlMotivoTraslado.SelectedValue = "-1", "0", DdlMotivoTraslado.SelectedValue).ToString().ToEntero(), NumRegIdTrib:=IIf(TxtNumRegIdTrib.Text = "", "-1", TxtNumRegIdTrib.Text).ToString(),
ComExtEstado:=IIf(TxtComExtEstado.Text = "", "-1", TxtComExtEstado.Text).ToString(), ComExtMunicipio:=IIf(TxtComExtMunicipio.Text = "", "-1", TxtComExtMunicipio.Text).ToString(), ComExtColonia:=IIf(TxtComExtColonia.Text = "", "-1", TxtComExtColonia.Text).ToString(),
ApellidoPaternoPF:=IIf(TxtApellidoPaterno.Text = "", "-1", TxtApellidoPaterno.Text).ToString(), ApellidoMaternoPF:=IIf(TxtApellidoMaterno.Text = "", "-1", TxtApellidoMaterno.Text).ToString(), NombresPF:=IIf(TxtNombres.Text = "", "-1", TxtNombres.Text).ToString(),
- RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(),
+ RequiereOC:=ChkRequiereOC.Checked, LT:=LT, LG:=LG, EsDistribuidor:=ChkEsDistribuidor.Checked, TipoCliente:=DdlTipoCliente.SelectedValue.ToEntero(), CargoUsado:=ChkCargoUsado.Checked, BonificacionUsado:=ChkBonificacionUsado.Checked, CveTipoRetencion:=DdlTipoRetencion.SelectedValue.ToEntero(), CorreoEntregaCompras:=TxtCorreoEntregaCompras.Text, CorreoEntregaAlmacen:=TxtCorreoEntregaAlmacen.Text, CveSATEstado:=DdlEstadoSAT.SelectedValue.ToEntero(),
CveAdminTrayecto:=If(DdlAdminTrayecto.SelectedValue.ToEntero() <= 0, 0, DdlAdminTrayecto.SelectedValue.ToEntero()),
NoDesglosaIVA:=ChkNoDesglosaIVA.Checked) Then
@@ -2795,11 +2795,11 @@ Partial Class Clientes
ObjClientes.Dispose()
objDoc.Dispose()
RecargaGlobal()
- End Sub
-
+ End Sub
+
#End Region
-
-
+
+
#Region "G L O B L A L"
Private Sub RecargaGlobal()
'Dim Hilo As New System.Threading.Thread(AddressOf GeneraGlobalDT)
@@ -2813,10 +2813,10 @@ Partial Class Clientes
' Application("GlobalDTCliente") = Objclientes.DtResultados
'End If
'Objclientes.Dispose()
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region "G R I D V I E W S"
Protected Sub GVHistorial_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVHistorial.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -2977,11 +2977,11 @@ Partial Class Clientes
End If
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "R H"
-
+
Private Sub CargaPersonalAsignado()
Dim ObjPersonal As New ClsRH
If ObjPersonal.GetPersonal(-1, "-1", "-1", "-1", "-1", -1, -1, -1, -1, -1, -1, -1, -1, -1, CveCliente, "-1", -1, -1, -1, -1, -1, -1, "-1", "-1", "-1", "-1", UsuarioActual.CveEmpresa) Then
@@ -3054,9 +3054,9 @@ Partial Class Clientes
End If
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "S U C U R S A L E S"
Private Sub LbAgregarSucursal_Click(sender As Object, e As EventArgs) Handles LbAgregarSucursal.Click
ChkEstatusSucursal.Checked = True
@@ -3188,7 +3188,7 @@ Partial Class Clientes
UpModalDivMapa.Update()
- End Sub
+ End Sub
#Region "G V S U C U R S A L E S"
Protected Sub GvDatos_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GVSucursales.RowDataBound
@@ -3310,9 +3310,9 @@ Partial Class Clientes
Else
CargaGrid("", 0)
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "G V U S U A R I O S P O R T A L"
Protected Sub GvUsuariosPortal_RowCommand(sender As Object, e As GridViewCommandEventArgs) Handles GvUsuariosPortal.RowCommand
If e.CommandName = "RestablecerContraseña" Then
@@ -3464,9 +3464,9 @@ Partial Class Clientes
CargaGrid("", 1)
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "O R D E N A M I E N T O"
Private Sub CargaGrid(Orden As String, gvi As Integer)
If gvi = 0 Then
@@ -3498,12 +3498,12 @@ Partial Class Clientes
UPPUsuarios.Update()
End If
- End Sub
+ End Sub
#End Region
-
-
+
+
#End Region
-
+
#Region "U S U A R I O S"
Protected Sub LbSolicitudPortal_Click(sender As Object, e As EventArgs) Handles LbEnviarActivacionPortal.Click
Dim ObjUsuario As New ClsSisUsuarios
@@ -3685,9 +3685,9 @@ Partial Class Clientes
ChkPermiso5.Checked = False
ChkPermiso6.Checked = False
ChkPermiso7.Checked = False
- End Sub
+ End Sub
#End Region
-
+
#Region "E V E N T O - B I T A C O R A"
Protected Sub GVEventoBitacora_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvEB.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -3893,11 +3893,11 @@ Partial Class Clientes
BtnActivaRegistroISR.Visible = True
End If
- End Sub
+ End Sub
#End Region
-
+
#Region " I M P R I M I R P D F"
-
+
Protected Sub ChkAntIXCNC_CheckedChanged(sender As Object, e As EventArgs)
DdlTipoDocto.ClearSelection()
If ChkAntIXCNC.Checked Then
@@ -3996,7 +3996,7 @@ Partial Class Clientes
drr("SaldoAnticipo") = drt("Saldo")
drr("Fecha") = drt("Fecha")
drr("Moneda") = drt("Moneda")
- drr("CveMoneda") = drt("CveMoneda")
+ drr("CveMoneda") = drt("CveMoneda")
drr("TipoRNC") = If(drt("Tipo").ToString() = "RNC", If(drt("TipoRNC").ToString() = "2", "Bonificación", "Cargo"), "")
DtCxCFact.Rows.Add(drr)
@@ -4109,8 +4109,8 @@ Partial Class Clientes
lista.Add(New CrystalParametro("SaldoAntPesos", SaldoAntPesos.FormatoNumero()))
lista.Add(New CrystalParametro("TotalAnt", TotalAnt.FormatoNumero()))
lista.Add(New CrystalParametro("ContaIng", ContaIng))
- lista.Add(New CrystalParametro("ContaAnt", ContaAnt))
-
+ lista.Add(New CrystalParametro("ContaAnt", ContaAnt))
+
If Imagen.Exists Then
lista.Add(New CrystalParametro("LogoPath", logouri))
Else
@@ -4219,9 +4219,9 @@ Partial Class Clientes
End Using
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "E N V I O C O R R E O"
Private Sub EnviaCorreo(Liga As String, LigaActivar As String)
@@ -4289,11 +4289,11 @@ Partial Class Clientes
a.GuardaLog()
Dim Mail As New ClsSisMail()
Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
- End Sub
+ End Sub
#End Region
-
+
#Region " COTIZACIONES "
-
+
Protected Sub BtnVerMasCot_Click(sender As Object, e As EventArgs)
If BtnVerMasCot.Text = "Ver Más" Then
CargaCotizaciones(-1)
@@ -4363,60 +4363,60 @@ Partial Class Clientes
HLFacturar.HRef = $"/Ventas/Ventas.aspx?CveCotizacion={e.Row.DBCampo("CveVenta")}"
End If
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "D I R E C C I O N E N V I O "
-
- Private Sub CargaCombosDirecionesClientesSAT()
- CargaDirClientePais()
- CargaDirClienteEstado()
- CargaDirClienteMunicipio()
- CargaDirClienteLocalidad()
- CargaDirClienteColonia()
- End Sub
-
-
-
- Private Sub CargaDirClientePais()
-
+
+ Private Sub CargaCombosDirecionesClientesSAT()
+ CargaDirClientePais()
+ CargaDirClienteEstado()
+ CargaDirClienteMunicipio()
+ CargaDirClienteLocalidad()
+ CargaDirClienteColonia()
+ End Sub
+
+
+
+ Private Sub CargaDirClientePais()
+
DdlDirClientePais.DataSource = GlobalDTGralPaises()
DdlDirClientePais.DataBind()
DdlDirClientePais.SelectedValueExist("151")
End Sub
- Private Sub CargaDirClienteEstado()
+ Private Sub CargaDirClienteEstado()
DdlDirClienteEstado.Items.Clear()
If DdlDirClientePais.SelectedValue.ToEntero > 0 Then
DdlDirClienteEstado.DataSource = GlobalDTGralEstados("-1", DdlDirClientePais.SelectedValue.ToEntero)
End If
DdlDirClienteEstado.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlDirClienteEstado.DataBind()
- End Sub
-
+ End Sub
+
Private Sub CargaDirClienteColonia()
DdlDirClienteColonia.Items.Clear()
- If DdlDirClienteMunicipio.SelectedValue.ToEntero > 0 Then
- DdlDirClienteColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlDirClienteMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtEnvioCP.Text.Trim.Length > 0, TxtEnvioCP.Text.ToEntero, -1))
+ If DdlDirClienteMunicipio.SelectedValue.ToEntero > 0 Then
+ DdlDirClienteColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlDirClienteMunicipio.SelectedValue.ToEntero, CodigoPostal:=If(TxtEnvioCP.Text.Trim.Length > 0, TxtEnvioCP.Text.ToEntero, -1))
End If
DdlDirClienteColonia.Items.Insert(0, New ListItem("Seleccione", "-1"))
DdlDirClienteColonia.DataBind()
- End Sub
-
-
- Protected Sub CargaDirClienteLocalidad()
-
- DdlDirClienteLocalidad.Items.Clear()
- If DdlEstado.SelectedValue.ToEntero > 0 Then
- DdlDirClienteLocalidad.DataSource = GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero, DdlDirClienteMunicipio.SelectedValue.ToEntero)
- DdlDirClienteLocalidad.DataBind()
- End If
-
- DdlDirClienteLocalidad.Items.Insert(0, New ListItem("Seleccione una", "-1"))
-
- End Sub
-
-
+ End Sub
+
+
+ Protected Sub CargaDirClienteLocalidad()
+
+ DdlDirClienteLocalidad.Items.Clear()
+ If DdlEstado.SelectedValue.ToEntero > 0 Then
+ DdlDirClienteLocalidad.DataSource = GlobalDTLocalidad(DdlDirClienteEstado.SelectedValue.ToEntero, DdlDirClienteMunicipio.SelectedValue.ToEntero)
+ DdlDirClienteLocalidad.DataBind()
+ End If
+
+ DdlDirClienteLocalidad.Items.Insert(0, New ListItem("Seleccione una", "-1"))
+
+ End Sub
+
+
Protected Sub DdlDirClientePais_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaDirClienteEstado()
CargaDirClienteMunicipio()
@@ -4427,41 +4427,41 @@ Partial Class Clientes
CargaDirClienteMunicipio()
CargaDirClienteColonia()
CargaDirClienteLocalidad()
- End Sub
-
- Protected Sub DdlDirClienteMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
- CargaDirClienteColonia()
- CargaDirClienteLocalidad()
- End Sub
-
-
- Protected Sub BtnDirClienteValidar_Click(sender As Object, e As EventArgs)
- DirClientevalidaCodigoPostal()
- End Sub
-
-
- Protected Sub DdlDirClienteColonia_SelectedIndexChanged(sender As Object, e As EventArgs)
- DirClientevalidaCodigoPostal()
- End Sub
-
- Private Sub DirClientevalidaCodigoPostal()
-
- Dim CPTxt As Integer = TxtEnvioCP.Text.ToEntero()
-
- Dim CveColonia As Integer = DdlDirClienteColonia.SelectedValue.ToEntero
-
- If CPTxt > 0 And CveColonia > 0 Then
- Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
- If CPTxt <> CP Then
- Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
- End If
- End If
-
- End Sub
-
-
- Public Sub Edit_Click(sender As Object, e As EventArgs)
-
+ End Sub
+
+ Protected Sub DdlDirClienteMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
+ CargaDirClienteColonia()
+ CargaDirClienteLocalidad()
+ End Sub
+
+
+ Protected Sub BtnDirClienteValidar_Click(sender As Object, e As EventArgs)
+ DirClientevalidaCodigoPostal()
+ End Sub
+
+
+ Protected Sub DdlDirClienteColonia_SelectedIndexChanged(sender As Object, e As EventArgs)
+ DirClientevalidaCodigoPostal()
+ End Sub
+
+ Private Sub DirClientevalidaCodigoPostal()
+
+ Dim CPTxt As Integer = TxtEnvioCP.Text.ToEntero()
+
+ Dim CveColonia As Integer = DdlDirClienteColonia.SelectedValue.ToEntero
+
+ If CPTxt > 0 And CveColonia > 0 Then
+ Dim CP As Integer = GlobalDTGralColonias("-1", "-1", "-1", CveColonia:=CveColonia).FiltroPrimeroValor("CP", "").ToEntero
+ If CPTxt <> CP Then
+ Alert("El código postal selecionado es diferente del codigo postal de la Colonia.", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
+
+ End Sub
+
+
+ Public Sub Edit_Click(sender As Object, e As EventArgs)
+
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
CveDireccionEnvio = GvRow.DataKey("CveDireccionEnvio").ToEntero()
TxtEnvioDireccion.Text = GvRow.DataKey("EnvioDireccion")
@@ -4489,7 +4489,7 @@ Partial Class Clientes
ChkEstatus.Checked = If(GvRow.DataKey("Estatus").ToString() = "True", True, False)
If GvRow.DataKey("CveClienteSucursal").ToEntero() > 0 Then DdlClienteSucursalEnvio.SelectedValueExist(GvRow.DataKey("CveClienteSucursal")) Else DdlClienteSucursalEnvio.SelectedValueExist("-1")
UpAddDireccion.Update()
- RegistraScript("$('#divAddDireccionEnvio').modal();")
+ RegistraScript("$('#divAddDireccionEnvio').modal();")
End Sub
Private Sub BtnAgregarDireccion_Click(sender As Object, e As EventArgs) Handles BtnAgregarDireccion.Click
Dim ObjClientes As New ClsClientes
@@ -4497,7 +4497,7 @@ Partial Class Clientes
Dim Estatus = If(ChkEstatus.Checked, 1, 0)
If CveDireccionEnvio < 0 Then
- CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(CveCliente, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.ToEntero(), TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero(), EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""),
+ CveDireccionEnvio = ObjClientes.DireccionEnvioAdd(CveCliente, TxtEnvioDireccion.Text.Trim, TxtEnvioNoExt.Text.Trim, TxtEnvioNoInt.Text.Trim, TxtEnvioColonia.Text.Trim, TxtEnvioCiudad.Text.Trim, TxtEnvioEstado.Text.Trim, TxtEnvioCP.Text.ToEntero(), TxtEnvioContacto.Text.Trim, UsuarioActual.CveUsuario, Estatus, CveClienteSucursal:=DdlClienteSucursalEnvio.SelectedValue.ToEntero(), EnvioTel:=TxtEnvioTel.Text.Trim.Replace(" ", "").Replace("(", "").Replace(")", "").Replace("-", "").Replace("_", ""),
CvePais:=DdlDirClientePais.SelectedValue.ToEntero, CveEstado:=DdlDirClienteEstado.SelectedValue.ToEntero, CveMunicipio:=DdlDirClienteMunicipio.SelectedValue.ToEntero, CveLocalidad:=DdlDirClienteLocalidad.SelectedValue.ToEntero, CveColonia:=DdlDirClienteColonia.SelectedValue.ToEntero)
If CveDireccionEnvio < 0 Then
@@ -4531,10 +4531,10 @@ Partial Class Clientes
'TxtDepartamento.Text = ""
TxtEnvioCP.Text = ""
TxtEnvioTel.Text = ""
- DdlClienteSucursalEnvio.SelectedValue = "-1"
-
- CargaCombosDirecionesClientesSAT()
-
+ DdlClienteSucursalEnvio.SelectedValue = "-1"
+
+ CargaCombosDirecionesClientesSAT()
+
'DdlDirClientePais.SelectedValueExist(-1)
'DdlDirClienteEstado.SelectedValueExist(-1)
'DdlDirClienteMunicipio.SelectedValueExist(-1)
@@ -4562,12 +4562,12 @@ Partial Class Clientes
End If
CargaDireccionesEnvio()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region " IMPORTAR SALDOS "
-
+
Private Sub HLImportarSaldos_Click(sender As Object, e As EventArgs) Handles HLImportarSaldos.Click
CargaClientesImportarSaldos()
RegistraScript(String.Format("$('#{0}').modal();", "DivImportarSaldos"))
@@ -4673,9 +4673,9 @@ Partial Class Clientes
e.Row.FCCheckBox("Chk").Attributes.Add("onclick", String.Format("ChkSaldo(this,{0},{1});", e.Row.FCTextBox("TxtImporte").ClientID, e.Row.DBCampo("Saldo")))
e.Row.FCTextBox("TxtImporte").Attributes.Add("onKeyUp", String.Format("CambiaSaldo({0},this,{1});", e.Row.FCCheckBox("Chk").ClientID, e.Row.DBCampo("Saldo")))
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "Cuentas/Equipos"
Public Sub BtnAgregarCtaEquipo_Click(sender As Object, e As EventArgs)
HdnModalidad.Value = "I"
@@ -5263,9 +5263,9 @@ Partial Class Clientes
End If
Return Retorno
- End Function
+ End Function
#End Region
-
+
#Region "GPS"
Protected Sub btnCargaArrayDisp_Click(sender As Object, e As EventArgs) Handles btnCargaArrayDisp.Click
If hdnArrayDispositivo.Value.Length > 0 Then
@@ -5283,10 +5283,10 @@ Partial Class Clientes
GvDatosGPS.DataSource = Nothing
End If
ObjGPS.Dispose()
- GvDatosGPS.DataBind()
-
- GvDatosGPS.Columns(9).Visible = DdlAdminTrayecto.SelectedValue = "2"
- 'GvDatosGPS.Columns(10).Visible = DdlAdminTrayecto.SelectedValue = "2"
+ GvDatosGPS.DataBind()
+
+ GvDatosGPS.Columns(9).Visible = DdlAdminTrayecto.SelectedValue = "2"
+ 'GvDatosGPS.Columns(10).Visible = DdlAdminTrayecto.SelectedValue = "2"
UpDispositivos.Update()
End Sub
@@ -5305,60 +5305,60 @@ Partial Class Clientes
End Sub
Protected Sub GvDatosGPS_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvDatosGPS.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
- e.Row.VerticalAlign = VerticalAlign.Middle
- e.Row.FCLabel("Lblnumero").Text = (e.Row.RowIndex + 1).ToString()
-
+ e.Row.VerticalAlign = VerticalAlign.Middle
+ e.Row.FCLabel("Lblnumero").Text = (e.Row.RowIndex + 1).ToString()
+
If e.Row.DBCampo("Estatus").ToString().ToEntero() = 1 Then
e.Row.FCLabel("LblEstatus").Text = "Activo"
- e.Row.FCLabel("LblEstatus").CssClass = "label label-success"
+ e.Row.FCLabel("LblEstatus").CssClass = "label label-success"
e.Row.FindControl("imgD").Visible = True
Else
e.Row.FCLabel("LblEstatus").Text = "Inactivo"
- e.Row.FCLabel("LblEstatus").CssClass = "label label-danger"
- e.Row.FindControl("imgD").Visible = False
- End If
-
+ e.Row.FCLabel("LblEstatus").CssClass = "label label-danger"
+ e.Row.FindControl("imgD").Visible = False
+ End If
+
If CBool(e.Row.DBCampo("Dispuesto")) Then
- e.Row.FCLabel("LblDisponible").Text = "Si"
- e.Row.FCLabel("LblDisponible").CssClass = "label label-success"
-
- e.Row.FCLinkButton("imgDisponer").CssClass = "btn btn-circle btn-sm red"
- e.Row.FCLinkButton("imgDisponer").Text = ""
+ e.Row.FCLabel("LblDisponible").Text = "Si"
+ e.Row.FCLabel("LblDisponible").CssClass = "label label-success"
+
+ e.Row.FCLinkButton("imgDisponer").CssClass = "btn btn-circle btn-sm red"
+ e.Row.FCLinkButton("imgDisponer").Text = ""
Else
- e.Row.FCLabel("LblDisponible").Text = "No"
- e.Row.FCLabel("LblDisponible").CssClass = "label label-default"
-
- e.Row.FCLinkButton("imgDisponer").CssClass = "btn btn-circle btn-sm blue"
- e.Row.FCLinkButton("imgDisponer").Text = ""
- End If
-
+ e.Row.FCLabel("LblDisponible").Text = "No"
+ e.Row.FCLabel("LblDisponible").CssClass = "label label-default"
+
+ e.Row.FCLinkButton("imgDisponer").CssClass = "btn btn-circle btn-sm blue"
+ e.Row.FCLinkButton("imgDisponer").Text = ""
+ End If
+
e.Row.FCLinkButton("imgE").Attributes.Add("onclick", $"javascript:AbrirVentana('/GPS/WizardDispositivos.aspx?CveDispositivo={e.Row.DBCampo("CveDispositivo").ToString()}&CveCliente={CveCliente}&EsPopup=1', 801, 701);")
End If
End Sub
- Protected Sub GvDatosGPS_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosGPS.RowDeleting
+ Protected Sub GvDatosGPS_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvDatosGPS.RowDeleting
Dim continuar As Boolean = False
- Using GPS As New ClsGPS()
- Using ObjBitacora As New ClsOIEventos(GPS.IniciaTransacSQL())
- Dim CveDispositivo As Integer = GvDatosGPS.Rows(e.RowIndex).DataKey("CveDispositivo").ToEntero()
- If GPS.DispositivosDelete(CveDispositivo) Then
- If ObjBitacora.AddEventoBitacora(String.Format("Se eliminó el dispositivo ""{1} - {2} - {0}""", GvDatosGPS.Rows(e.RowIndex).DataKey("Display"), GvDatosGPS.Rows(e.RowIndex).DataKey("Modelo"), GvDatosGPS.Rows(e.RowIndex).DataKey("IMEI")), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=CveCliente) Then
- continuar = True
- End If
- End If
- If continuar Then
- GPS.Commit()
- Alert("El Dispositivo se eliminó correctamente", TipoMensaje.MsgInformacion)
- Else
- GPS.RollBack()
- End If
- End Using
+ Using GPS As New ClsGPS()
+ Using ObjBitacora As New ClsOIEventos(GPS.IniciaTransacSQL())
+ Dim CveDispositivo As Integer = GvDatosGPS.Rows(e.RowIndex).DataKey("CveDispositivo").ToEntero()
+ If GPS.DispositivosDelete(CveDispositivo) Then
+ If ObjBitacora.AddEventoBitacora(String.Format("Se eliminó el dispositivo ""{1} - {2} - {0}""", GvDatosGPS.Rows(e.RowIndex).DataKey("Display"), GvDatosGPS.Rows(e.RowIndex).DataKey("Modelo"), GvDatosGPS.Rows(e.RowIndex).DataKey("IMEI")), "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveCliente:=CveCliente) Then
+ continuar = True
+ End If
+ End If
+ If continuar Then
+ GPS.Commit()
+ Alert("El Dispositivo se eliminó correctamente", TipoMensaje.MsgInformacion)
+ Else
+ GPS.RollBack()
+ End If
+ End Using
End Using
- If continuar Then
- CargaDispositivos()
- CargaGlobalDispositos()
- CargaEventoBitacora()
-
+ If continuar Then
+ CargaDispositivos()
+ CargaGlobalDispositos()
+ CargaEventoBitacora()
+
End If
UpDispositivos.Update()
End Sub
@@ -5406,10 +5406,10 @@ Partial Class Clientes
UpMoverDispositivo.Update()
RegistraScript($"CargaModalMoverDispositivo({GvRow.DataKey("CveDispositivo")});")
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "Sucursales"
Public Sub CreaDTSucursales()
@@ -5643,14 +5643,14 @@ Partial Class Clientes
End If
End If
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "G P S"
-
-
-
+
+
+
Private Sub EnviaCorreoGPS(Liga As String, LigaActivar As String)
Try
@@ -5721,16 +5721,16 @@ Partial Class Clientes
End If
ObjClientes.Dispose()
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "C O N T R A T O S"
-
-
-
-
+
+
+
+
Private Sub CargaDatosContrato()
If CveCliente <= 0 Then
Exit Sub
@@ -5775,20 +5775,20 @@ Partial Class Clientes
e.Row.CssClass = "Totales white"
End If
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "M E T O D O S "
Protected Sub RblTipo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RblTipo.SelectedIndexChanged
If DTHistorialVentas IsNot Nothing AndAlso RblTipo.SelectedValue <> "-1" Then
Dim tmp As DataTable = Nothing
- If RblTipo.SelectedValue.Contiene("Ped") Then
- tmp = DTHistorialVentas.FiltraParametros($"TipoDocto IN('Ped','Pd2')")
- Else
- tmp = DTHistorialVentas.FiltraParametros($"TipoDocto = '{RblTipo.SelectedValue}'")
+ If RblTipo.SelectedValue.Contiene("Ped") Then
+ tmp = DTHistorialVentas.FiltraParametros($"TipoDocto IN('Ped','Pd2')")
+ Else
+ tmp = DTHistorialVentas.FiltraParametros($"TipoDocto = '{RblTipo.SelectedValue}'")
End If
If tmp IsNot Nothing AndAlso tmp.Rows.Count > 0 Then
@@ -5949,7 +5949,7 @@ Partial Class Clientes
If ObjContabilidad.GetCuentas(Id, "-1", -1) Then
Retorno = ObjContabilidad.DtResultados.FiltroPrimeroValor("CtaCodigo")
End If
- ObjContabilidad.Dispose()
+ ObjContabilidad.Dispose()
Return Retorno
End Function
Private Sub SetValues()
@@ -6188,13 +6188,13 @@ Partial Class Clientes
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "IMPRIMIR GVHistorial"
-
-
+
+
Protected Sub BtnExcelHistorial_Click(sender As Object, e As EventArgs)
Dim retorno As Byte() = Nothing
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
@@ -6277,18 +6277,18 @@ Partial Class Clientes
ObjClientes.Dispose()
Return retorno
- End Function
-
-
+ End Function
+
+
#End Region
-
+
#Region "C O B R A N Z A"
Public Sub Visitas_Click(sender As Object, e As EventArgs)
RegistraScript(String.Format("$('#{0}').modal();", "DivVisitas"))
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "Usuarios"
Protected Sub GvUsuarios_RowDeleting(sender As Object, e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvUsuarios.RowDeleting
Dim CveUsuario As Integer = GvUsuarios.Rows(e.RowIndex).DataKey("CveUsuario").ToEntero()
@@ -6323,12 +6323,12 @@ Partial Class Clientes
e.Row.Cells(5).Visible = False
End If
End If
- End Sub
+ End Sub
#End Region
-
-
+
+
#Region "C U E N T A S - B A N C A R I A S"
-
+
Private Sub CargaCuentasBancarias(Optional RecargaGlobal As Boolean = False)
If CveCliente <= 0 Then Exit Sub
@@ -6501,8 +6501,8 @@ Partial Class Clientes
TxtNumeroCuenta2.Text = ""
TxtConvenioCIE2.Text = ""
TxtReferencia2.Text = ""
- End Sub
-
+ End Sub
+
#Region "GRIDVIEW - CUENTAS BANCARIAS"
Protected Sub GvBancosCuentas_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GvBancosCuentas.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
@@ -6558,10 +6558,10 @@ Partial Class Clientes
GlobalDTCuentasDepositosClientes(UsuarioActual.CveEmpresa, -1, True) = Nothing
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
Private Sub CargaPSGridCuentasBancos()
If CveCliente > 0 Then
GvBancosCuentas.DataSource = DTCuentasBancos
@@ -6619,9 +6619,9 @@ Partial Class Clientes
divestatus.Visible = True
UpAddBancos.Update()
RegistraScript(String.Format("$('#{0}').modal('show');", "DivAddCuentasBancarias"))
- End Sub
+ End Sub
#End Region
-
+
#Region "C L I E N T E S P A G O S R E A L I Z A D O S I M P R I M I R P D F/Excel"
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkPagosClientesBancosExcel.Click
GenerarPDF("Excel")
@@ -6647,11 +6647,11 @@ Partial Class Clientes
ImprimirPDF("Empresas\Grales\Formatos\RepClientesPagosBancos.rdlc", DTCobrosRealizados, params, "RepClientesPagosBancos_" & Now.ToString("yyyyMMddhhmmss"), Formato:=Formato)
- End Sub
+ End Sub
#End Region
-
+
#Region "VENTAS"
-
+
Public Function imprimirFacturaVenta(CveVenta As Integer) As Byte()
Dim ObjVentas As New ClsVentas
Dim Vta As Modelos.Factura = Nothing
@@ -6882,10 +6882,10 @@ Partial Class Clientes
ObjVentas.Dispose()
Return PdfFactura(Vta)
- End Function
-
+ End Function
+
#End Region
-
+
#Region "COMERCIO EXTERIOR"
Public Sub CargaCombosComercioExterior()
@@ -6933,7 +6933,7 @@ Partial Class Clientes
DdlEstado.DataBind()
End Sub
- Private Sub CargaDirClienteMunicipio()
+ Private Sub CargaDirClienteMunicipio()
DdlDirClienteMunicipio.Items.Clear()
If DdlDirClienteEstado.SelectedValue.ToEntero > 0 Then
DdlDirClienteMunicipio.DataSource = GlobalDTGralMunicipios("-1", DdlDirClienteEstado.SelectedValue.ToEntero)
@@ -6957,8 +6957,8 @@ Partial Class Clientes
DdlColonia.DataSource = GlobalDTGralColonias("-1", "-1", "-1", DdlMunicipio.SelectedValue.ToEntero)
End If
DdlColonia.Items.Insert(0, New ListItem("Seleccione", "-1"))
- DdlColonia.DataBind()
-
+ DdlColonia.DataBind()
+
End Sub
Protected Sub DdlPais_SelectedIndexChanged(sender As Object, e As EventArgs)
@@ -7009,15 +7009,15 @@ Partial Class Clientes
End Sub
Protected Sub DdlMunicipio_SelectedIndexChanged(sender As Object, e As EventArgs)
CargaColonia()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "D O C U M E N T A C I O N "
-
+
Private Sub CargaDocumentacionCliente()
- Dim objRH As New ClsEdocumentacion()
-
+ Dim objRH As New ClsEdocumentacion()
+
If objRH.DocumentacionElectronicaGet(-1, If(CveCliente = -1, 0, CveCliente), -1, UsuarioActual.Empresa.CveEmpresa, -1, Modulo:=2) Then
DTDocumentacion = objRH.DtResultados
GvDocumentosCliente.DataSource = objRH.DtResultados
@@ -7037,8 +7037,8 @@ Partial Class Clientes
UPGvDocumentosCliente.Update()
'UpGvDocumentosFirma2.Update()
End Sub
- Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
-
+ Public Sub UploadModal_ClickDocumentacionFirmaContrato(sender As Object, e As EventArgs)
+
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim chkEstatus As CheckBox
@@ -7068,21 +7068,21 @@ Partial Class Clientes
End Sub
- Private Sub GvdocumentosEventosDescarga()
-
- For Each GvRow As GridViewRow In GvDocumentosCliente.Rows
-
- If GvRow.RowType = DataControlRowType.DataRow Then
-
- Dim LnkDownLoadDoc As LinkButton = GvRow.FCLinkButton("LnkDownLoadDoc")
- Dim ImgDownLoadFormato As LinkButton = GvRow.FCLinkButton("ImgDownLoadFormato")
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDownLoadDoc)
-
- End If
-
- Next
-
+ Private Sub GvdocumentosEventosDescarga()
+
+ For Each GvRow As GridViewRow In GvDocumentosCliente.Rows
+
+ If GvRow.RowType = DataControlRowType.DataRow Then
+
+ Dim LnkDownLoadDoc As LinkButton = GvRow.FCLinkButton("LnkDownLoadDoc")
+ Dim ImgDownLoadFormato As LinkButton = GvRow.FCLinkButton("ImgDownLoadFormato")
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(LnkDownLoadDoc)
+
+ End If
+
+ Next
+
End Sub
Private Sub GuardarDocumentosClientes(Optional _CveDocumentacionExcluir As Integer = -1)
@@ -7307,38 +7307,38 @@ Partial Class Clientes
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
Dim Adjunto As String = GvRow.DataKey("Adjunto")
- Dim stringDescargaDocumento As String = ""
-
- If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then
-
- stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
- TxtDireccionAval.Text = ""
- TxtAval.Text = ""
+ Dim stringDescargaDocumento As String = ""
+
+ If GvRow.DataKey("Documentacion") = "Pagaré" AndAlso UsuarioActual.CveEmpresa = 140 Then
+
+ stringDescargaDocumento = UsuarioActual.Empresa.Ruta & "Formatos\Pagaré.docx"
+ TxtDireccionAval.Text = ""
+ TxtAval.Text = ""
RegistraScript("$('#ModalDivPagare').modal('show')")
Else
- stringDescargaDocumento = UsuarioActual.Empresa.Ruta & String.Format("DocElectronica\Clientes\{0}\{1}", CveCliente, Adjunto)
-
- linkDescargaPagare = stringDescargaDocumento
-
- Dim File = New FileInfo(linkDescargaPagare)
-
- If File.Exists Then
-
- Response.Clear()
- Response.AddHeader("Content-Disposition", "attachment; filename=" + File.Name)
- Response.AddHeader("Content-Length", File.Length.ToString())
- Response.ContentType = "text/octet-stream"
- Response.Flush()
- Response.TransmitFile(File.FullName)
- Response.End()
-
- End If
- End If
-
-
-
-
+ stringDescargaDocumento = UsuarioActual.Empresa.Ruta & String.Format("DocElectronica\Clientes\{0}\{1}", CveCliente, Adjunto)
+
+ linkDescargaPagare = stringDescargaDocumento
+
+ Dim File = New FileInfo(linkDescargaPagare)
+
+ If File.Exists Then
+
+ Response.Clear()
+ Response.AddHeader("Content-Disposition", "attachment; filename=" + File.Name)
+ Response.AddHeader("Content-Length", File.Length.ToString())
+ Response.ContentType = "text/octet-stream"
+ Response.Flush()
+ Response.TransmitFile(File.FullName)
+ Response.End()
+
+ End If
+ End If
+
+
+
+
End Sub
Protected Sub ImprimirPagare(sender As Object, e As EventArgs) Handles BtnAgregarPagare.Click
@@ -7461,11 +7461,11 @@ Partial Class Clientes
If documentacionFormato = "" Then
ImgDownLoadFormato.Visible = False
LnkDownLoadDoc.Visible = False
- Else
- LnkDownLoadDoc.Visible = True
- ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
-
-
+ Else
+ LnkDownLoadDoc.Visible = True
+ ScriptManager.GetCurrent(Me).RegisterPostBackControl(ImgDownLoadFormato)
+
+
End If
txtFechaLimite.Text = e.Row.DBCampo("FechaLimite").ToString().ToDate().ToString("dd/MM/yyyy")
@@ -7528,45 +7528,45 @@ Partial Class Clientes
File.Delete(pathDesti)
End If
- File.Copy(PathSource, pathDesti)
-
+ File.Copy(PathSource, pathDesti)
+
Dim fileinfo As New FileInfo(pathDesti)
fname = fileinfo.Name
- If fileinfo.Extension.ToUpper = ".XLS" Or fileinfo.Extension.ToUpper = ".XLSX" Then
-
-
- Try
- Dim objDoc As New clsGemBoxDocument(pathDesti)
- Dim objRH As New ClsRH
- Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
-
-
- objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(-1, UsuarioActual.CveEmpresa)) ' Pendiente
- objRH.Dispose()
-
- objDoc.Guardar(pathDesti)
- Catch ex As Exception
-
- End Try
-
-
-
- End If
-
-
- Dim FileD = New FileInfo(pathDesti)
-
- If FileD.Exists Then
-
- Response.Clear()
- Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name)
- Response.AddHeader("Content-Length", FileD.Length.ToString())
- Response.ContentType = "text/octet-stream"
- Response.Flush()
- Response.TransmitFile(FileD.FullName)
- Response.End()
-
+ If fileinfo.Extension.ToUpper = ".XLS" Or fileinfo.Extension.ToUpper = ".XLSX" Then
+
+
+ Try
+ Dim objDoc As New clsGemBoxDocument(pathDesti)
+ Dim objRH As New ClsRH
+ Dim FechaActual As String = Now.Day.ToString("0#") & " de " & CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1).ToString() & " del " & Now.Year.ToString()
+
+
+ objDoc.SustituirTags(objRH.GetDatosTagsDocumentos(-1, UsuarioActual.CveEmpresa)) ' Pendiente
+ objRH.Dispose()
+
+ objDoc.Guardar(pathDesti)
+ Catch ex As Exception
+
+ End Try
+
+
+
+ End If
+
+
+ Dim FileD = New FileInfo(pathDesti)
+
+ If FileD.Exists Then
+
+ Response.Clear()
+ Response.AddHeader("Content-Disposition", "attachment; filename=" + FileD.Name)
+ Response.AddHeader("Content-Length", FileD.Length.ToString())
+ Response.ContentType = "text/octet-stream"
+ Response.Flush()
+ Response.TransmitFile(FileD.FullName)
+ Response.End()
+
End If
End Sub
@@ -7917,12 +7917,12 @@ Partial Class Clientes
RegistraScript("Download('" & baseUrl & "')")
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "D O C U M E N T O S V E N T A S"
-
+
Private Sub CargaDocumentosVenta(tCveCliente As Integer)
Dim objInv As New ClsEdocumentacion
@@ -8093,11 +8093,11 @@ Partial Class Clientes
objRH.Dispose()
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "PERSONA FISICA"
Protected Sub LnkPersonaFisica_Click(sender As Object, e As EventArgs)
RegistraScript("$('#DivModalPersonaFisica').modal();")
@@ -8122,9 +8122,9 @@ Partial Class Clientes
ObjCliente.Dispose()
UpDatos.Update()
- End Sub
+ End Sub
#End Region
-
+
#Region "USUARIOS PLATAFORMA CLIENTE - 6 "
Protected Sub CargaUsuariosPortalCliente()
Dim objUsuario As ClsSisUsuarios = New ClsSisUsuarios
@@ -8133,19 +8133,19 @@ Partial Class Clientes
GvUsuarios.DataBind()
End If
objUsuario.Dispose()
- End Sub
+ End Sub
#End Region
-
+
#Region " DEVOLVER DINERO ANT/NC "
Private Sub InicializaDevolverDinero()
If UsuarioActual.TienePermisoProceso(247) Then
GVAnticipos.Columns(6).Visible = True
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "MODAL GRAFICA/PEDIDOS"
-
+
Protected Sub LnkVerGrafica_Click(sender As Object, e As EventArgs)
If CargaDatatables() Then
RegistraScript("$('#DivModalGrafica').modal('show')")
@@ -8276,10 +8276,10 @@ Partial Class Clientes
Dim Row2 As DataRow = Nothing
Row2 = Dt2.NewRow()
LtlLimiteCreditoModal.Text = LimiteCredito.FormatoNumero()
- If LimiteCredito > 0 Then
- Row2("limite") = LimiteCredito - Saldo
- Else
- Row2("limite") = 0
+ If LimiteCredito > 0 Then
+ Row2("limite") = LimiteCredito - Saldo
+ Else
+ Row2("limite") = 0
End If
Row2("saldo") = Saldo
Dt2.Rows.Add(Row2)
@@ -8482,13 +8482,13 @@ Partial Class Clientes
RegistraScript($"CargaGraficaCompratamientoSaldoMensual({Dt5.ToJson},{Dt6.ToJson.Replace($"{Chr(34)}True{Chr(34)}", "true").Replace($"{Chr(34)}False{Chr(34)}", "false")})", "55")
UPModalProd.Update()
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "TAB - COMPORTAMIENTO DE VENTAS"
-
+
Private Sub CargaGrupo()
DdlGrupo.Items.Insert(0, New ListItem("Categoria", "3"))
DdlGrupo.Items.Insert(1, New ListItem("Clasificacion", "4"))
@@ -8574,8 +8574,8 @@ Partial Class Clientes
'CargaSubProyectos
DdlSubProyectoFiltro.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
- DdlSubProyectoFiltro.DataBind()
-
+ DdlSubProyectoFiltro.DataBind()
+
DdlSucursalVendedor.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa, -1, 1)
DdlSucursalVendedor.DataBind()
DdlSucursalVendedor.Items.Insert(0, New ListItem("Seleccione", "-1"))
@@ -8589,19 +8589,19 @@ Partial Class Clientes
DdlUsuario.DataBind()
'Carga Productos
- DdlPSFiltro.setEsWebService(True)
-
- 'If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
- DdlPSFiltro.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacionFilto.SelectedValue)
- DdlPSFiltro.SelectedText = ""
- DdlPSFiltro.SelectedValue = "-1"
- 'Else
- ' DdlPSFiltro.ddl.Items.Clear()
- ' DdlPSFiltro.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionFilto.SelectedValue.ToEntero())
- ' DdlPSFiltro.ddl.DataBind()
- ' DdlPSFiltro.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
- 'End If
-
+ DdlPSFiltro.setEsWebService(True)
+
+ 'If UsuarioActual.Empresa.Funcionalidad(105) = "1" Then
+ DdlPSFiltro.ddlWS.Attributes.Add("data-cveclasificacion", DdlClasificacionFilto.SelectedValue)
+ DdlPSFiltro.SelectedText = ""
+ DdlPSFiltro.SelectedValue = "-1"
+ 'Else
+ ' DdlPSFiltro.ddl.Items.Clear()
+ ' DdlPSFiltro.ddl.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacionFilto.SelectedValue.ToEntero())
+ ' DdlPSFiltro.ddl.DataBind()
+ ' DdlPSFiltro.ddl.Items.Insert(0, New ListItem("Seleccione el Producto", "-1"))
+ 'End If
+
CargaGrupo()
CargaTipoCentroCosto()
@@ -8672,12 +8672,12 @@ Partial Class Clientes
ObjVentas.Dispose()
GvComportamientoVenta.DataBind()
UpDatosComportamientoVenta.Update()
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "DISPOSITIVOS"
-
+
Protected Sub LnkMoverDispositivo_Click(sender As Object, e As EventArgs)
Dim CveDispositivo As Integer = HdnCveDispositivoMover.Value.ToEntero()
Dim CveCliente As Integer = DdlClienteDispositivo.SelectedValue.ToEntero()
@@ -8715,10 +8715,10 @@ Partial Class Clientes
CargaEventoBitacora()
NombreDispositivo = ""
RegistraScript("$('#DivMoverDispositivo').modal('hide');")
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "CRM"
Protected Sub CargaDatosCRM()
Dim ObjCRM = New ClsCRM()
@@ -8818,9 +8818,9 @@ Partial Class Clientes
Alert("Se Unificó correctamente al Cliente con la Empresa CRM.")
End If
End If
- End Sub
+ End Sub
#End Region
-
+
#Region "PORCENTAJE PRECIO DE MARCAS"
Private Sub LnkPorcentajeMarcas_Click(sender As Object, e As EventArgs) Handles LnkPorcentajeMarcas.Click
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajeMarcas"))
@@ -9024,9 +9024,9 @@ Partial Class Clientes
ObjPS.Dispose()
- End Sub
+ End Sub
#End Region
-
+
#Region "PORCENTAJE PRECIO DE PRODUCTOS"
Private Sub LnkPorcentajePrecios_Click(sender As Object, e As EventArgs) Handles LnkPorcentajePrecios.Click
RegistraScript(String.Format("$('#{0}').modal();", "DivPorcentajePrecios"))
@@ -9262,12 +9262,12 @@ Partial Class Clientes
Protected Sub BtnCambiaPorcentaje_Click(sender As Object, e As EventArgs)
DdlProducto2IndexChange(DdlProducto2.SelectedValue.ToEntero(), DdlProducto2)
- End Sub
+ End Sub
#End Region
-
+
#Region " A C U M U L A D O R E S"
-
-
+
+
Protected Sub LnkFacturaUsadosCargos_Click(sender As Object, e As EventArgs)
'CveVentaNota = 0
@@ -9468,19 +9468,19 @@ Partial Class Clientes
If ObjAcum.DistribuidorMovtosGet(CveCliente, UsuarioActual.CveEmpresa, TxtFechaIUsados.Text.ToDate(), TxtFechaFUsados.Text.ToDate(), CveConcepto:=DdlConceptoUsado.SelectedValue.ToEntero()) Then
GvAcum.DataSource = ObjAcum.DtResultados
- End If
-
- Dim ImporteBonificacion As Decimal = 0
- If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count >= 4 Then
- GvUsadosResumen.DataSource = ObjAcum.DtResultados
- ImporteBonificacion = ObjAcum.DtResultados.Rows(5)("Valor").ToString().ToDecimal()
End If
- GvUsadosResumen.DataBind()
-
-
- 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
- LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
-
+
+ Dim ImporteBonificacion As Decimal = 0
+ If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) AndAlso ObjAcum.DtResultados.Rows.Count >= 4 Then
+ GvUsadosResumen.DataSource = ObjAcum.DtResultados
+ ImporteBonificacion = ObjAcum.DtResultados.Rows(5)("Valor").ToString().ToDecimal()
+ End If
+ GvUsadosResumen.DataBind()
+
+
+ 'LnkFacturaUsadosCargos.Visible = If(ImporteCargo > 0, True, False)
+ LnkFacturaUsadosBonificacion.Visible = If(ImporteBonificacion > 0, True, False)
+
ObjAcum.Dispose()
GvAcum.DataBind()
@@ -9710,51 +9710,51 @@ Partial Class Clientes
End Function
Private Sub CreaObjetosVenta(Tipo As Integer)
-
+
Dim CveSubProyecto As Integer = -1
TmpDT.Rows.Clear()
- TmpDT.AcceptChanges()
-
+ TmpDT.AcceptChanges()
+
For Each GvRow As GridViewRow In GvAcum.Rows
- If GvRow.FCCheckBox("ChkBonificacion").Checked OrElse GvRow.FCCheckBox("ChkCargo").Checked Then
- CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
-
- Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
- Dim PU As Decimal = 0
- Dim CvePSCargo As Integer = GvRow.DataKey("CvePSCargo").ToEntero()
- Dim CveUnidadMedida As Integer = 0
- Dim CveClasificacion As Integer = 0
- Dim UnidadMedida As String = ""
- Dim Clasificacion As String = ""
- Dim PS As String = ""
- Dim PorcentajeIVA As Decimal = 0.16D
-
- If Tipo = 1 Then
- If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
- PU = GvRow.DataKey("Cargo").ToDecimal()
- End If
- ElseIf Tipo = 2 Then
- If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
- PU = GvRow.DataKey("Bonificacion").ToDecimal()
- End If
- End If
-
- If CvePSCargo > 0 AndAlso PU > 0 Then
- Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSCargo).Rows(0)
- If Dr IsNot Nothing Then
- CveUnidadMedida = Dr("CveUnidadMedida").ToString().ToEntero()
- CveClasificacion = Dr("CveClasificacion").ToString().ToEntero()
- PS = Dr("PSCodigo").ToString()
- UnidadMedida = Dr("UnidadMedida").ToString()
- Clasificacion = Dr("Clasificacion").ToString()
- End If
-
- AgregarProductoServicio(Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePSCargo, PS, "Clientes/Usados", PU, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
- DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
- End If
- End If
-
+ If GvRow.FCCheckBox("ChkBonificacion").Checked OrElse GvRow.FCCheckBox("ChkCargo").Checked Then
+ CveSubProyecto = GvRow.DataKey("CveSubProyecto").ToEntero()
+
+ Dim Cantidad As Decimal = GvRow.DataKey("Cantidad").ToDecimal
+ Dim PU As Decimal = 0
+ Dim CvePSCargo As Integer = GvRow.DataKey("CvePSCargo").ToEntero()
+ Dim CveUnidadMedida As Integer = 0
+ Dim CveClasificacion As Integer = 0
+ Dim UnidadMedida As String = ""
+ Dim Clasificacion As String = ""
+ Dim PS As String = ""
+ Dim PorcentajeIVA As Decimal = 0.16D
+
+ If Tipo = 1 Then
+ If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkCargo").Checked Then
+ PU = GvRow.DataKey("Cargo").ToDecimal()
+ End If
+ ElseIf Tipo = 2 Then
+ If GvRow.DataKey("CveConcepto").ToEntero() = 1 And GvRow.FCCheckBox("ChkBonificacion").Checked Then
+ PU = GvRow.DataKey("Bonificacion").ToDecimal()
+ End If
+ End If
+
+ If CvePSCargo > 0 AndAlso PU > 0 Then
+ Dim Dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePSCargo).Rows(0)
+ If Dr IsNot Nothing Then
+ CveUnidadMedida = Dr("CveUnidadMedida").ToString().ToEntero()
+ CveClasificacion = Dr("CveClasificacion").ToString().ToEntero()
+ PS = Dr("PSCodigo").ToString()
+ UnidadMedida = Dr("UnidadMedida").ToString()
+ Clasificacion = Dr("Clasificacion").ToString()
+ End If
+
+ AgregarProductoServicio(Cantidad, CveUnidadMedida, UnidadMedida, CveClasificacion, Clasificacion, CvePSCargo, PS, "Clientes/Usados", PU, 0, -1, "", DdlSubProyecto.SelectedValue.ToEntero(),
+ DdlSubProyecto.SelectedItem.Text, PorcentajeIVA:=PorcentajeIVA)
+ End If
+ End If
+
Next
Dim SubTotalFactura As Decimal = TmpDT.SUMD("Total")
@@ -9810,9 +9810,9 @@ Partial Class Clientes
ObjFactura.CondicionEntrega = ""
ObjFactura.CondicionesPago = 0 ' 0 - Contado, 1 - Credito, 2 - termianl
- ObjFactura.FormaPago = 0
-
-
+ ObjFactura.FormaPago = 0
+
+
Select Case ObjFactura.TipoDocto
Case "Ing"
ObjFactura.TipoDocumento = "Factura"
@@ -9834,10 +9834,10 @@ Partial Class Clientes
ObjFactura.Fech1 = Now
ObjFactura.Fech2 = Now
- ObjFactura.Fech3 = Now
-
-
- 'NUM 1- CARGO 2- BONIFICACION
+ ObjFactura.Fech3 = Now
+
+
+ 'NUM 1- CARGO 2- BONIFICACION
ObjFactura.Num1 = Tipo
ObjFactura.FechaPago = Now
@@ -9854,9 +9854,9 @@ Partial Class Clientes
ObjFactura.FechaEjecucion = Now
ObjFactura.CveSubProyecto = UsuarioActual.CveSubProyecto
ObjFactura.CveSubProyectoCobranza = UsuarioActual.CveSubProyecto
- ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto
-
-
+ ObjFactura.CveSubProyectoEjecucion = UsuarioActual.CveSubProyecto
+
+
ObjFactura.SubTotal = SubTotalFactura
ObjFactura.Descuento = 0
ObjFactura.Amortizacion = 0
@@ -9904,15 +9904,15 @@ Partial Class Clientes
Next
ObjFactura.UsadosBonificacion = UsadosBonificacion
- ObjFactura.TipoBonificacion = Tipo
-
- ' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
-
- End Sub
-
-
+ ObjFactura.TipoBonificacion = Tipo
+
+ ' ObjFactura.Timbre = PreParaTimbre(ObjFactura)
+
+ End Sub
+
+
#End Region
-
+
#Region "C L I E N T E S G R I D S I M P R I M I R P D F/Excel"
Private Sub LnkCotizacionesPDF_Click(sender As Object, e As EventArgs) Handles LnkCotizacionesPDF.Click
ImprimeGridsProveedores("PDF", DtCotizaciones, "RepClientesCotizaciones")
@@ -9982,12 +9982,12 @@ Partial Class Clientes
Dim Acum As New ClsAcumuladores
Dim Puntos As Decimal = -GvUsadosResumen.Rows.Cast(Of GridViewRow).Where(Function(x) x.RowType = DataControlRowType.DataRow).FirstOrDefault(Function(gvr) gvr.RowIndex = 3).DataKey("Puntos").ToEntero()
- If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado") Then
+ If Acum.DistribuidorMovtosAdd(CveCliente, 1, 1, 3, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Puntos, "Saldo Inicializado", Now) Then
Alert("Puntuación Inicializada")
End If
Acum.Dispose()
- End Sub
+ End Sub
#End Region
Protected Sub DdlTipoRetencion_SelectedIndexChanged(sender As Object, e As EventArgs)
If UsuarioActual.Empresa.Funcionalidad(579) = "1" Then
@@ -10035,130 +10035,130 @@ Partial Class Clientes
End Sub
- Private Sub CargarClientePersonalEntrega()
- Dim ObjVentas As New ClsVentas()
- If ObjVentas.GetClientesPersonalEntrega(-1, CveCliente, UsuarioActual.CveEmpresa, -1) Then
- GvClentesPersonalEntrega.DataSource = ObjVentas.DtResultados
- End If
- ObjVentas.Dispose()
- GvClentesPersonalEntrega.DataBind()
+ Private Sub CargarClientePersonalEntrega()
+ Dim ObjVentas As New ClsVentas()
+ If ObjVentas.GetClientesPersonalEntrega(-1, CveCliente, UsuarioActual.CveEmpresa, -1) Then
+ GvClentesPersonalEntrega.DataSource = ObjVentas.DtResultados
+ End If
+ ObjVentas.Dispose()
+ GvClentesPersonalEntrega.DataBind()
End Sub
- Protected Sub BtnAgregarClientePersonalEntrega_Click(sender As Object, e As EventArgs) Handles BtnAgregarClientePersonalEntrega.Click
- TxtPersonalEntrega.Text = ""
- ChkPersonalEntrega.Checked = True
- LnkClientePersonalEntrega.Text = "Agregar"
- UpClientePersonalEntrega.Update()
- RegistraScript("$('#DivModalClientePersonalEntrega').modal('show');")
+ Protected Sub BtnAgregarClientePersonalEntrega_Click(sender As Object, e As EventArgs) Handles BtnAgregarClientePersonalEntrega.Click
+ TxtPersonalEntrega.Text = ""
+ ChkPersonalEntrega.Checked = True
+ LnkClientePersonalEntrega.Text = "Agregar"
+ UpClientePersonalEntrega.Update()
+ RegistraScript("$('#DivModalClientePersonalEntrega').modal('show');")
End Sub
- Protected Sub LnkClientePersonalEntrega_Click(sender As Object, e As EventArgs)
- Dim ObjVentas As New ClsVentas()
- If LnkClientePersonalEntrega.Text = "Agregar" Then
- If ObjVentas.AddClientesPersonalEntrega(TxtPersonalEntrega.Text, CveCliente, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
- Alert("Usuario para entregar agregado correctamente")
- End If
- Else
- If ObjVentas.UpdateClientesPersonalEntrega(CveClientePersonalEntrega, TxtPersonalEntrega.Text, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
- Alert("Usuario para entregar actualizado correctamente")
- End If
- End If
- ObjVentas.Dispose()
- RegistraScript("$('#DivModalClientePersonalEntrega').modal('hide');")
- CargarClientePersonalEntrega()
- UpClentesPersonalEntrega.Update()
+ Protected Sub LnkClientePersonalEntrega_Click(sender As Object, e As EventArgs)
+ Dim ObjVentas As New ClsVentas()
+ If LnkClientePersonalEntrega.Text = "Agregar" Then
+ If ObjVentas.AddClientesPersonalEntrega(TxtPersonalEntrega.Text, CveCliente, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
+ Alert("Usuario para entregar agregado correctamente")
+ End If
+ Else
+ If ObjVentas.UpdateClientesPersonalEntrega(CveClientePersonalEntrega, TxtPersonalEntrega.Text, UsuarioActual.CveUsuario, ChkPersonalEntrega.Checked) Then
+ Alert("Usuario para entregar actualizado correctamente")
+ End If
+ End If
+ ObjVentas.Dispose()
+ RegistraScript("$('#DivModalClientePersonalEntrega').modal('hide');")
+ CargarClientePersonalEntrega()
+ UpClentesPersonalEntrega.Update()
End Sub
- Protected Sub EditClientesPersonalEntrega_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
- CveClientePersonalEntrega = GvRow.DataKey("CvePersonalEntrega").ToEntero()
- TxtPersonalEntrega.Text = GvRow.DataKey("PersonalEntrega")
- ChkPersonalEntrega.Checked = GvRow.DataKey("Estatus") = "True"
- LnkClientePersonalEntrega.Text = "Actualizar"
- UpClientePersonalEntrega.Update()
- RegistraScript("$('#DivModalClientePersonalEntrega').modal('show');")
+ Protected Sub EditClientesPersonalEntrega_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
+ CveClientePersonalEntrega = GvRow.DataKey("CvePersonalEntrega").ToEntero()
+ TxtPersonalEntrega.Text = GvRow.DataKey("PersonalEntrega")
+ ChkPersonalEntrega.Checked = GvRow.DataKey("Estatus") = "True"
+ LnkClientePersonalEntrega.Text = "Actualizar"
+ UpClientePersonalEntrega.Update()
+ RegistraScript("$('#DivModalClientePersonalEntrega').modal('show');")
End Sub
- Protected Sub DeleteClientesPersonalEntrega_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
- Dim ObjVentas As New ClsVentas()
- If ObjVentas.RemoveClientesPersonalEntrega(GvRow.DataKey("CvePersonalEntrega").ToEntero()) Then
- Alert("Usuario para entregar eliminado correctamente")
- End If
- ObjVentas.Dispose()
- CargarClientePersonalEntrega()
- UpClentesPersonalEntrega.Update()
- End Sub
- Protected Sub DdlTipoCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
- TabSistema.Enabled = DdlTipoCliente.SelectedValue = "1"
-
- UpDatos.Update()
- End Sub
-
- Private Sub CargaResumenHistorial()
+ Protected Sub DeleteClientesPersonalEntrega_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
+ Dim ObjVentas As New ClsVentas()
+ If ObjVentas.RemoveClientesPersonalEntrega(GvRow.DataKey("CvePersonalEntrega").ToEntero()) Then
+ Alert("Usuario para entregar eliminado correctamente")
+ End If
+ ObjVentas.Dispose()
+ CargarClientePersonalEntrega()
+ UpClentesPersonalEntrega.Update()
+ End Sub
+ Protected Sub DdlTipoCliente_SelectedIndexChanged(sender As Object, e As EventArgs)
+ TabSistema.Enabled = DdlTipoCliente.SelectedValue = "1"
+
+ UpDatos.Update()
+ End Sub
+
+ Private Sub CargaResumenHistorial()
Dim ObjClientes As New ClsClientes()
If ObjClientes.GetHistorialVentas(CveCliente, UsuarioActual.CveEmpresa, -1, CveClienteSucursal:=DdlSucursalCliente.SelectedValue.ToEntero()) Then
- If ObjClientes.DtResultados.Rows.Count > 0 Then
-
+ If ObjClientes.DtResultados.Rows.Count > 0 Then
+
Dim Cantidad As Double
- Dim Max As Double
- Dim Min As Double = 1000000000000
- Dim Total As Double
- Dim Promedio As Double
-
- For Each row As DataRow In ObjClientes.DtResultados.Rows
- If row.Item("Folio").ToString <> "" Then
- If row.Item("Total").ToString.ToDouble > Max Then
- Max = row.Item("Total").ToString.ToDouble
- End If
- If row.Item("Total").ToString.ToDouble < Min And row.Item("Total").ToString.ToDouble > 0 Then
- Min = row.Item("Total").ToString.ToDouble
- End If
-
- If row.Item("Total").ToString.ToDouble > 0 Then
- Total += row.Item("Total").ToString.ToDouble
- Cantidad += 1
-
- End If
- End If
- Next
-
- Promedio = Total / Cantidad
-
- 'Carga Generales
+ Dim Max As Double
+ Dim Min As Double = 1000000000000
+ Dim Total As Double
+ Dim Promedio As Double
+
+ For Each row As DataRow In ObjClientes.DtResultados.Rows
+ If row.Item("Folio").ToString <> "" Then
+ If row.Item("Total").ToString.ToDouble > Max Then
+ Max = row.Item("Total").ToString.ToDouble
+ End If
+ If row.Item("Total").ToString.ToDouble < Min And row.Item("Total").ToString.ToDouble > 0 Then
+ Min = row.Item("Total").ToString.ToDouble
+ End If
+
+ If row.Item("Total").ToString.ToDouble > 0 Then
+ Total += row.Item("Total").ToString.ToDouble
+ Cantidad += 1
+
+ End If
+ End If
+ Next
+
+ Promedio = Total / Cantidad
+
+ 'Carga Generales
LtlCantidad.Text = Cantidad.ToString.FormatoNumero(0)
LtlTotalVendido.Text = Total.ToString.FormatoNumero()
LtlMinima.Text = Min.ToString.FormatoNumero()
LtlPromedio.Text = Promedio.ToString.FormatoNumero()
- LtlMaxima.Text = Max.ToString.FormatoNumero()
- End If
- End If
- ObjClientes.Dispose()
- End Sub
-
+ LtlMaxima.Text = Max.ToString.FormatoNumero()
+ End If
+ End If
+ ObjClientes.Dispose()
+ End Sub
+
Public Function ConsultarHistorial2(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) As DataTable
Dim retorno As DataTable = Nothing
- Using cliente As New HttpClient()
- cliente.Timeout = New TimeSpan(0, 0, 15)
- cliente.DefaultRequestHeaders.Add("Accept", "application/json")
-
- Try
-
- Dim Parametros As JObject = New JObject(
- New JProperty("CveCliente", CveCliente),
- New JProperty("SelectTop", SelectTop),
- New JProperty("CveClienteSucursal", CveClienteSucursal),
- New JProperty("TipoDocto", "-1")
- )
-
+ Using cliente As New HttpClient()
+ cliente.Timeout = New TimeSpan(0, 0, 15)
+ cliente.DefaultRequestHeaders.Add("Accept", "application/json")
+
+ Try
+
+ Dim Parametros As JObject = New JObject(
+ New JProperty("CveCliente", CveCliente),
+ New JProperty("SelectTop", SelectTop),
+ New JProperty("CveClienteSucursal", CveClienteSucursal),
+ New JProperty("TipoDocto", "-1")
+ )
+
Dim Url = New Uri(String.Format("{0}api/cliente/GetHistorialVentas?CveCliente={1}&SelectTop={2}&CveClienteSucursal={3}&TipoDocto={4}", "https://localhost:5001/", CveCliente, SelectTop, CveClienteSucursal, "-1"))
- Dim response = cliente.GetAsync(Url).Result
-
- If response.StatusCode = 200 Then
- Dim json = response.Content.ReadAsStringAsync().Result
- retorno = Newtonsoft.Json.JsonConvert.DeserializeObject(Of DataTable)(json)
+ Dim response = cliente.GetAsync(Url).Result
+
+ If response.StatusCode = 200 Then
+ Dim json = response.Content.ReadAsStringAsync().Result
+ retorno = Newtonsoft.Json.JsonConvert.DeserializeObject(Of DataTable)(json)
End If
Url = Nothing
@@ -10168,47 +10168,47 @@ Partial Class Clientes
End Using
Return retorno
- End Function
+ End Function
Public Function ConsultarHistorial(Optional SelectTop As Integer = 21, Optional CveClienteSucursal As Integer = -1) As DataTable
Dim retorno As DataTable = Nothing
- Using cliente As New HttpClient()
+ Using cliente As New HttpClient()
cliente.Timeout = New TimeSpan(0, 0, 15)
cliente.DefaultRequestHeaders.Add("Authorization", String.Format("Bearer {0}", GetTokenAngular()))
- Try
-
- Dim Parametros As JObject = New JObject(
- New JProperty("CveCliente", CveCliente),
- New JProperty("SelectTop", SelectTop),
- New JProperty("CveClienteSucursal", CveClienteSucursal),
- New JProperty("TipoDocto", "-1")
- )
- System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
-
+ Try
+
+ Dim Parametros As JObject = New JObject(
+ New JProperty("CveCliente", CveCliente),
+ New JProperty("SelectTop", SelectTop),
+ New JProperty("CveClienteSucursal", CveClienteSucursal),
+ New JProperty("TipoDocto", "-1")
+ )
+ System.Net.ServicePointManager.SecurityProtocol = DirectCast(3072, SecurityProtocolType)
+
Dim Url = New Uri(String.Format("{0}api/cliente/GetHistorialVentas", "http://localhost:5000/"))
Dim response = cliente.PostAsync(Url, New StringContent(Parametros.ToString(), Encoding.UTF8, "application/json")).Result
-
- If response.StatusCode = 200 Then
- Dim json = response.Content.ReadAsStringAsync().Result
-
- Dim result = JsonConvert.DeserializeObject(Of MResult)(json)
-
- If result.isSuccess Then
-
- 'Dim contractResolver = New DefaultContractResolver With
- '{
- ' .NamingStrategy = New KebabCaseNamingStrategy()
- '}
- 'Dim options = New JsonSerializerSettings() With
- '{
- ' .ContractResolver = contractResolver,
- ' .Formatting = Formatting.Indented
- '}
-
- retorno = JsonConvert.DeserializeObject(Of DataTable)(result.result.ToString())
- End If
-
+
+ If response.StatusCode = 200 Then
+ Dim json = response.Content.ReadAsStringAsync().Result
+
+ Dim result = JsonConvert.DeserializeObject(Of MResult)(json)
+
+ If result.isSuccess Then
+
+ 'Dim contractResolver = New DefaultContractResolver With
+ '{
+ ' .NamingStrategy = New KebabCaseNamingStrategy()
+ '}
+ 'Dim options = New JsonSerializerSettings() With
+ '{
+ ' .ContractResolver = contractResolver,
+ ' .Formatting = Formatting.Indented
+ '}
+
+ retorno = JsonConvert.DeserializeObject(Of DataTable)(result.result.ToString())
+ End If
+
End If
response.Dispose()
@@ -10220,31 +10220,31 @@ Partial Class Clientes
End Using
Return retorno
- End Function
-
- Public Property Token As String = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDdmVQbGF0YWZvcm1hIjoiMSIsIkN2ZVVzdWFyaW8iOiIxNTM4IiwiQ3ZlRW1wcmVzYSI6IjIiLCJDdmVSb2wiOiIxIiwiRmVjaGEiOiJzw6FiYWRvLCAyMCBkZSBtYXJ6byBkZSAyMDIxIiwibmJmIjoxNjE2MjYzMzg2LCJleHAiOjE2MTYyNzQxODYsImlhdCI6MTYxNjI2MzM4Nn0.N_4yHZ0J41GgcXbAFfvyLvXiV-U8nRm85LoZhG1riNc"
+ End Function
+
+ Public Property Token As String = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJDdmVQbGF0YWZvcm1hIjoiMSIsIkN2ZVVzdWFyaW8iOiIxNTM4IiwiQ3ZlRW1wcmVzYSI6IjIiLCJDdmVSb2wiOiIxIiwiRmVjaGEiOiJzw6FiYWRvLCAyMCBkZSBtYXJ6byBkZSAyMDIxIiwibmJmIjoxNjE2MjYzMzg2LCJleHAiOjE2MTYyNzQxODYsImlhdCI6MTYxNjI2MzM4Nn0.N_4yHZ0J41GgcXbAFfvyLvXiV-U8nRm85LoZhG1riNc"
+
+ Public Class MResult
+ Public Property isSuccess As Boolean
+ Public Property message As String
+ Public Property result As JArray
+ End Class
- Public Class MResult
- Public Property isSuccess As Boolean
- Public Property message As String
- Public Property result As JArray
- End Class
-
Public Function GetTokenAngular() As String
- Dim retorno As String = ""
-
- Using cliente As New HttpClient()
-
- cliente.Timeout = New TimeSpan(0, 0, 15)
- cliente.DefaultRequestHeaders.Add("Accept", "text/json")
-
- Try
+ Dim retorno As String = ""
+
+ Using cliente As New HttpClient()
+
+ cliente.Timeout = New TimeSpan(0, 0, 15)
+ cliente.DefaultRequestHeaders.Add("Accept", "text/json")
+
+ Try
Dim Url = New Uri(String.Format("{0}ashx/SIGWeb.ashx?metodo=GetTokenAngular", "http://localhost:85/"))
- Dim response = cliente.GetAsync(Url).Result
-
- If response.StatusCode = 200 Then
- retorno = response.Content.ReadAsStringAsync().Result
+ Dim response = cliente.GetAsync(Url).Result
+
+ If response.StatusCode = 200 Then
+ retorno = response.Content.ReadAsStringAsync().Result
End If
Url = Nothing
@@ -10254,168 +10254,168 @@ Partial Class Clientes
End Using
Return retorno
- End Function
- Protected Sub DdlAdminTrayecto_SelectedIndexChanged(sender As Object, e As EventArgs)
- DivUnidadesDisponibles.Visible = DdlAdminTrayecto.SelectedValue = "1"
-
- GvDatosGPS.Columns(9).Visible = DdlAdminTrayecto.SelectedValue = "2"
-
- If DivUnidadesDisponibles.Visible AndAlso Me.CveCliente > 0 Then
- Using ObjGPS As New ClsGPS
- If ObjGPS.GetUnidadesDispuestas(-1, -1, UsuarioActual.CveEmpresa) Then
- GvUnidadesDisponibles.DataSource = ObjGPS.DtResultados
- End If
- End Using
- GvUnidadesDisponibles.DataBind()
- End If
-
- UpTrayectos.Update()
- UpDispositivos.Update()
- End Sub
- Protected Sub imgDisponer_Click(sender As Object, e As EventArgs)
- Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
- Dim CveDispositivo As Integer = GvRow.DataKey("CveDispositivo").ToEntero()
- Dim ValorDisposicion As Boolean = CBool(GvRow.DataKey("Dispuesto"))
-
- Using ObjGPS As New ClsGPS
- If ObjGPS.UpdateUnidadesDispuestas(CveDispositivo, Not ValorDisposicion) Then
- Alert("Se cambió el estatus de disposición")
- End If
- End Using
-
- CargaDispositivos(DdlEstatusDispositivos.SelectedValue.ToEntero())
- End Sub
- Protected Sub BtnCargaCxC_Click(sender As Object, e As EventArgs)
- If CveCliente > 0 Then
- CargaCxC()
- UpDatos.Update()
- End If
- End Sub
- Protected Sub BtnHistorialVentas_Click(sender As Object, e As EventArgs)
- If CveCliente > 0 Then
- CargaCotizaciones()
- CargaHistorial()
- CargaResumenHistorial()
-
- UpnHistorial.Update()
- UpDatos.Update()
- End If
- End Sub
- Protected Sub BtnCargaAnticipos_Click(sender As Object, e As EventArgs)
- If CveCliente > 0 Then
- CargaAnticipos()
- End If
- End Sub
- Protected Sub BtnCargaBancos_Click(sender As Object, e As EventArgs)
- If CveCliente > 0 Then
- CargaBancos()
- UpDatos.Update()
- End If
- End Sub
-
- Protected Sub BtnCargaContratos_Click(sender As Object, e As EventArgs)
- If CveCliente > 0 Then
- CargaDatosContrato()
- UpDatos.Update()
- End If
- End Sub
-
- Protected Sub LnkAgregarVendedorSucursal_Click(sender As Object, e As EventArgs) Handles LnkAgregarVendedorSucursal.Click
- If CveCliente > 0 Then
- DdlVendedorSucursalAsignar.SelectedValueExist("-1")
- DdlSucursalVendedor.SelectedValueExist("-1")
-
- CargaProveedoresSucursales()
- RegistraScript("$('#DivVendedoresSucursales').modal('show');")
- End If
- End Sub
-
- Private Sub CargaProveedoresSucursales()
- Using ObjVentas As New ClsVentas
- If ObjVentas.GetClientesVendedoresSubProyectos(Me.CveCliente, -1, -1, UsuarioActual.CveEmpresa) Then
- GvVendedoresSucursales.DataSource = ObjVentas.DtResultados
- End If
- End Using
- GvVendedoresSucursales.DataBind()
- UpVendedoresSucursales.Update()
- End Sub
-
-
- Protected Sub LnkEliminarVendedorSucursal_Click(sender As Object, e As EventArgs)
- Dim CveVendedor As Integer = DdlVendedorSucursalAsignar.SelectedValue.ToEntero()
- Dim CveSubProyecto As Integer = DdlSucursalVendedor.SelectedValue.ToEntero()
-
- Using ObjVentas As New ClsVentas
- If ObjVentas.RemoveClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
- Alert("Se eliminó el vendedor a la sucursal")
- End If
- End Using
-
- DdlVendedorSucursalAsignar.SelectedValueExist("-1")
- DdlSucursalVendedor.SelectedValueExist("-1")
-
- CargaProveedoresSucursales()
-
- RecargaGlobalDTVendedorSucursal()
- End Sub
- Protected Sub BtnAgregarVendedorSucursal_Click(sender As Object, e As EventArgs)
- Dim CveVendedor As Integer = DdlVendedorSucursalAsignar.SelectedValue.ToEntero()
- Dim CveSubProyecto As Integer = DdlSucursalVendedor.SelectedValue.ToEntero()
-
- Dim Guardar As Boolean = True
- Using ObjVentas As New ClsVentas
-
- If ObjVentas.GetClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
- If ObjVentas.DtResultados.Rows.Count > 0 Then
- Guardar = False
- Alert("El vendedor ya existe en esta sucursal", TipoMensaje.MsgAdvertencia)
- End If
- End If
-
- If Guardar AndAlso ObjVentas.AddClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
- Alert("Se agregó el vendedor a la sucursal")
- End If
-
- End Using
-
- DdlVendedorSucursalAsignar.SelectedValueExist("-1")
- DdlSucursalVendedor.SelectedValueExist("-1")
-
- CargaProveedoresSucursales()
-
- RecargaGlobalDTVendedorSucursal()
- End Sub
-
- Private Sub RecargaGlobalDTVendedorSucursal()
- GlobalDTClientesVendedoresSubProyectos(UsuarioActual.CveEmpresa) = Nothing
- End Sub
-
- Protected Sub LnkGuardarMaterialidad_Click(sender As Object, e As EventArgs)
- Using objRH As New ClsEdocumentacion()
-
- For Each gvrow As GridViewRow In GVDocMaterialidad.Rows
- Dim CveDocumentacionElectronica As Integer = gvrow.DataKey("CveDocumentacionElectronica").ToEntero()
- Dim CveDocumentacion As Integer = gvrow.DataKey("CveDocumentacion").ToEntero()
- Dim FechaLimite As Date = gvrow.FCTextBox("TxtFechaLimite").Text.ToDate()
- Dim estatus As Boolean = gvrow.FCCheckBox("chkEstatus").Checked
-
- If estatus Then
- If CveDocumentacionElectronica = -1 Then
- If objRH.DocumentacionElectronicaAdd(CveDocumentacion, -1, CveCliente, -1, 1, ObservacionDocumentacion, "", UsuarioActual.CveUsuario, FechaLimite) > 0 Then
-
- End If
- End If
- Else
- If CveDocumentacionElectronica > 1 Then
- If objRH.DocumentacionElectronicaRemove(CveDocumentacionElectronica, -1) Then
-
- End If
- End If
- End If
- Next
- Alert("Los cambios se guardaron satisfactoriamente.")
- End Using
-
- End Sub
+ End Function
+ Protected Sub DdlAdminTrayecto_SelectedIndexChanged(sender As Object, e As EventArgs)
+ DivUnidadesDisponibles.Visible = DdlAdminTrayecto.SelectedValue = "1"
+
+ GvDatosGPS.Columns(9).Visible = DdlAdminTrayecto.SelectedValue = "2"
+
+ If DivUnidadesDisponibles.Visible AndAlso Me.CveCliente > 0 Then
+ Using ObjGPS As New ClsGPS
+ If ObjGPS.GetUnidadesDispuestas(-1, -1, UsuarioActual.CveEmpresa) Then
+ GvUnidadesDisponibles.DataSource = ObjGPS.DtResultados
+ End If
+ End Using
+ GvUnidadesDisponibles.DataBind()
+ End If
+
+ UpTrayectos.Update()
+ UpDispositivos.Update()
+ End Sub
+ Protected Sub imgDisponer_Click(sender As Object, e As EventArgs)
+ Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
+ Dim CveDispositivo As Integer = GvRow.DataKey("CveDispositivo").ToEntero()
+ Dim ValorDisposicion As Boolean = CBool(GvRow.DataKey("Dispuesto"))
+
+ Using ObjGPS As New ClsGPS
+ If ObjGPS.UpdateUnidadesDispuestas(CveDispositivo, Not ValorDisposicion) Then
+ Alert("Se cambió el estatus de disposición")
+ End If
+ End Using
+
+ CargaDispositivos(DdlEstatusDispositivos.SelectedValue.ToEntero())
+ End Sub
+ Protected Sub BtnCargaCxC_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaCxC()
+ UpDatos.Update()
+ End If
+ End Sub
+ Protected Sub BtnHistorialVentas_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaCotizaciones()
+ CargaHistorial()
+ CargaResumenHistorial()
+
+ UpnHistorial.Update()
+ UpDatos.Update()
+ End If
+ End Sub
+ Protected Sub BtnCargaAnticipos_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaAnticipos()
+ End If
+ End Sub
+ Protected Sub BtnCargaBancos_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaBancos()
+ UpDatos.Update()
+ End If
+ End Sub
+
+ Protected Sub BtnCargaContratos_Click(sender As Object, e As EventArgs)
+ If CveCliente > 0 Then
+ CargaDatosContrato()
+ UpDatos.Update()
+ End If
+ End Sub
+
+ Protected Sub LnkAgregarVendedorSucursal_Click(sender As Object, e As EventArgs) Handles LnkAgregarVendedorSucursal.Click
+ If CveCliente > 0 Then
+ DdlVendedorSucursalAsignar.SelectedValueExist("-1")
+ DdlSucursalVendedor.SelectedValueExist("-1")
+
+ CargaProveedoresSucursales()
+ RegistraScript("$('#DivVendedoresSucursales').modal('show');")
+ End If
+ End Sub
+
+ Private Sub CargaProveedoresSucursales()
+ Using ObjVentas As New ClsVentas
+ If ObjVentas.GetClientesVendedoresSubProyectos(Me.CveCliente, -1, -1, UsuarioActual.CveEmpresa) Then
+ GvVendedoresSucursales.DataSource = ObjVentas.DtResultados
+ End If
+ End Using
+ GvVendedoresSucursales.DataBind()
+ UpVendedoresSucursales.Update()
+ End Sub
+
+
+ Protected Sub LnkEliminarVendedorSucursal_Click(sender As Object, e As EventArgs)
+ Dim CveVendedor As Integer = DdlVendedorSucursalAsignar.SelectedValue.ToEntero()
+ Dim CveSubProyecto As Integer = DdlSucursalVendedor.SelectedValue.ToEntero()
+
+ Using ObjVentas As New ClsVentas
+ If ObjVentas.RemoveClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
+ Alert("Se eliminó el vendedor a la sucursal")
+ End If
+ End Using
+
+ DdlVendedorSucursalAsignar.SelectedValueExist("-1")
+ DdlSucursalVendedor.SelectedValueExist("-1")
+
+ CargaProveedoresSucursales()
+
+ RecargaGlobalDTVendedorSucursal()
+ End Sub
+ Protected Sub BtnAgregarVendedorSucursal_Click(sender As Object, e As EventArgs)
+ Dim CveVendedor As Integer = DdlVendedorSucursalAsignar.SelectedValue.ToEntero()
+ Dim CveSubProyecto As Integer = DdlSucursalVendedor.SelectedValue.ToEntero()
+
+ Dim Guardar As Boolean = True
+ Using ObjVentas As New ClsVentas
+
+ If ObjVentas.GetClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ Guardar = False
+ Alert("El vendedor ya existe en esta sucursal", TipoMensaje.MsgAdvertencia)
+ End If
+ End If
+
+ If Guardar AndAlso ObjVentas.AddClientesVendedoresSubProyectos(Me.CveCliente, CveVendedor, CveSubProyecto, UsuarioActual.CveEmpresa) Then
+ Alert("Se agregó el vendedor a la sucursal")
+ End If
+
+ End Using
+
+ DdlVendedorSucursalAsignar.SelectedValueExist("-1")
+ DdlSucursalVendedor.SelectedValueExist("-1")
+
+ CargaProveedoresSucursales()
+
+ RecargaGlobalDTVendedorSucursal()
+ End Sub
+
+ Private Sub RecargaGlobalDTVendedorSucursal()
+ GlobalDTClientesVendedoresSubProyectos(UsuarioActual.CveEmpresa) = Nothing
+ End Sub
+
+ Protected Sub LnkGuardarMaterialidad_Click(sender As Object, e As EventArgs)
+ Using objRH As New ClsEdocumentacion()
+
+ For Each gvrow As GridViewRow In GVDocMaterialidad.Rows
+ Dim CveDocumentacionElectronica As Integer = gvrow.DataKey("CveDocumentacionElectronica").ToEntero()
+ Dim CveDocumentacion As Integer = gvrow.DataKey("CveDocumentacion").ToEntero()
+ Dim FechaLimite As Date = gvrow.FCTextBox("TxtFechaLimite").Text.ToDate()
+ Dim estatus As Boolean = gvrow.FCCheckBox("chkEstatus").Checked
+
+ If estatus Then
+ If CveDocumentacionElectronica = -1 Then
+ If objRH.DocumentacionElectronicaAdd(CveDocumentacion, -1, CveCliente, -1, 1, ObservacionDocumentacion, "", UsuarioActual.CveUsuario, FechaLimite) > 0 Then
+
+ End If
+ End If
+ Else
+ If CveDocumentacionElectronica > 1 Then
+ If objRH.DocumentacionElectronicaRemove(CveDocumentacionElectronica, -1) Then
+
+ End If
+ End If
+ End If
+ Next
+ Alert("Los cambios se guardaron satisfactoriamente.")
+ End Using
+
+ End Sub
End Class
diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb
index 5071be4a0..8db6257ee 100644
--- a/Ventas/Ventas.aspx.vb
+++ b/Ventas/Ventas.aspx.vb
@@ -8512,7 +8512,7 @@ Partial Class Ventas
End If
'SI ES AMORTIZACION 3.3
- Dim Obj2 As New List(Of Object)
+ Dim ListaNotasCreditoGeneradas As New List(Of Modelos.Factura)
Dim NCDescuento As Boolean = ((ListaNCDesc IsNot Nothing AndAlso ListaNCDesc.Count > 0) OrElse (ListaNCBonificacion IsNot Nothing AndAlso ListaNCBonificacion.Count > 0))
If ErrorList.Count = 0 Then
' cambiar la condicion para saber si hay seleccionado
@@ -8534,7 +8534,7 @@ Partial Class Ventas
CreaObjetosVentaAmortizacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento)
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaDevolucion, ObjBancos, Nothing,
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCDesc, IndexNC:=(If(DtVentasNC IsNot Nothing, DtVentasNC.Rows.Count - 1, 0))) Then
- Obj2.Add(ObjFacturaDevolucion)
+ ListaNotasCreditoGeneradas.Add(ObjFacturaDevolucion)
End If
End If
@@ -8547,7 +8547,7 @@ Partial Class Ventas
CreaObjetosVentaBonificacion(ObjVentas, FolioFiscalRelacionado, CveVentaRelacionada, NCDescuento:=NCDescuento)
If RegistrarNCAmortizacion(ObjVentas, ObjConta, ObjInventario, ObjContr, ObjContPaq, ObjFacturaBonificacion, ObjBancos, Nothing,
Nothing, NCDescuento:=NCDescuento, ListaNCDescuento:=ListaNCBonificacion, IndexNC:=(DtVentasNC.Rows.Count - 1)) Then
- Obj2.Add(ObjFacturaBonificacion)
+ ListaNotasCreditoGeneradas.Add(ObjFacturaBonificacion)
End If
End If
@@ -8556,7 +8556,7 @@ Partial Class Ventas
OnError("Ocurrió un error al generar nota de crédito de amortización", ex)
ErrorList.Add("No se pudo generar la nota de crédito de amortización")
End Try
- If Obj2 Is Nothing AndAlso Obj2.Count = 0 Then
+ If ListaNotasCreditoGeneradas Is Nothing AndAlso ListaNotasCreditoGeneradas.Count = 0 Then
ErrorList.Add("No se pudo generar la nota de crédito de amortización")
End If
End If
@@ -8583,7 +8583,7 @@ Partial Class Ventas
CveVentaNCProntoPago = RespFacturaProntoPago.Mensaje.CveVenta
SerieFolioNCProntoPago = RespFacturaProntoPago.Mensaje.SerieFolio
- Obj2.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
+ ListaNotasCreditoGeneradas.Add(RespFacturaProntoPago.ObjFacturaProntoPago)
End If
End If
Else
@@ -8774,7 +8774,7 @@ Partial Class Ventas
If UsuarioActual.Empresa.TipoFacturacion = "CFDi" AndAlso (UsuarioActual.Empresa.FacturaProduccion OrElse UsuarioActual.CveEmpresa = 1) Then
'FACTURA INGRESO/EGRESO
- Dim ObjTimbrado As New Timbrado
+
Dim FM As New Modelos.FemsaFactura
Dim TmpDT7Eleven As New DataTable
Dim TmpDTComplementosTimbrado As New DataTable
@@ -8785,34 +8785,35 @@ Partial Class Ventas
'DOCUMENTO ACTUAL
If DebeTimbrar Then
+
+ Dim ObjTimbrado As New Timbrado
SeTimbro = ObjTimbrado.TimbrarFactura(UsuarioActual, ObjFactura)
+ Dim FolioFiscalFactura As String = ObjTimbrado.UUID
+ Dim MsgErrorTimbrado = ObjTimbrado.MensajeErrorCFDI
+ ObjTimbrado = Nothing
+
'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
- If Not GeneroDescuentoProntoPago AndAlso Not IsNothing(Obj2) AndAlso Obj2.Count > 0 AndAlso SeTimbro Then
- Dim ofa As Modelos.Factura = CType(Obj2(0), Modelos.Factura)
- 'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
- If TieneAnticipo AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "2" Then
- ofa.Timbre.CFDIRelacionados.UUID.Clear()
- ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID)
- End If
-
- ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
- GeneraPDFFactura(ChkEnviarFactura.Checked)
- End If
-
- 'NOTA DE CREDITO - REFACTURADA - CASO ESPECIAL, TIMBRADO E IMPRESION
- If GeneroDescuentoProntoPago AndAlso Not IsNothing(Obj2) AndAlso Obj2.Count > 0 AndAlso SeTimbro Then
+ If ListaNotasCreditoGeneradas.Count > 0 Then
Try
- Dim ofa As Modelos.Factura = CType(Obj2(Obj2.Count - 1), Modelos.Factura)
- 'asigna el foliofiscal del ingreso que se acaba de timbrar, cuando es amortización de anticipo con NC
- ofa.Timbre.CFDIRelacionados.UUID.Clear()
- ofa.Timbre.CFDIRelacionados.UUID.Add(ObjTimbrado.UUID)
+ For Each NCGenerada In ListaNotasCreditoGeneradas
+ If NCGenerada.Timbre IsNot Nothing Then
+ NCGenerada.Timbre.CFDIRelacionados.UUID.Clear()
+ NCGenerada.Timbre.CFDIRelacionados.UUID.Add(FolioFiscalFactura)
- ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
- GeneraPDFFactura(ChkEnviarFactura.Checked)
+ Dim ObjTimbradoNC As New Timbrado
+ Dim TimbroNC = ObjTimbradoNC.TimbrarFactura(UsuarioActual, NCGenerada)
+
+ If Not TimbroNC Then
+ Alert(ObjTimbradoNC.MensajeErrorCFDI, TipoMensaje.MsgError)
+ End If
+ ObjTimbradoNC = Nothing
+ End If
+ Next
Catch ex As Exception
- OnError("Ocurrió un error al timbrar la nota de credito", ex)
+ OnError("Ocurrió un error al timbrar la NC.", ex)
End Try
+
End If
If SeTimbro AndAlso ObjFactura.TipoDocto.Contiene("Ing") Then
@@ -8820,29 +8821,26 @@ Partial Class Ventas
End If
If Not SeTimbro Then
- Alert(ObjTimbrado.MensajeErrorCFDI, TipoMensaje.MsgError)
+ Alert(MsgErrorTimbrado, TipoMensaje.MsgError)
End If
'CANCELAR FACTURA ANTERIOR
If SeTimbro AndAlso (Me.CveDevolucion > 0 AndAlso Me.NuevaFactura = 1) Then
If Me.ObjFacturaNC IsNot Nothing Then
Me.ObjFacturaNC.CveEstatusRefacturacion = 2 'MARCAR COMO REFACTURADA
- Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, ObjTimbrado.UUID)
+ Me.ObjFacturaNC.CancelarPorRefacturacion(Me.ObjFacturaNC.CveMotivoCancelacion, Me.ObjFacturaNC.MotivoCancelacion, FolioFiscalFactura)
End If
End If
End If
- 'NOTA DE CREDITO DE REFACTURACION
- If RefacturacionGeneroNC Then
- If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 Then
- Dim ofa As Modelos.Factura = CType(ObjNC(0), Modelos.Factura)
- SeTimbroNC = ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
- End If
- End If
-
- ElseIf UsuarioActual.Empresa.TipoFacturacion = "CBB" Then
- GeneraPDFCBB(ObjFactura.FechaCP, Nothing, ObjFactura.SerieFolio, False)
+ ''NOTA DE CREDITO DE REFACTURACION
+ 'If RefacturacionGeneroNC Then
+ ' If Not IsNothing(ObjNC) AndAlso ObjNC.Count > 0 Then
+ ' Dim ofa As Modelos.Factura = CType(ObjNC(0), Modelos.Factura)
+ ' SeTimbroNC = ObjTimbrado.TimbrarFactura(UsuarioActual, ofa)
+ ' End If
+ 'End If
End If
End If
@@ -9069,7 +9067,7 @@ Partial Class Ventas
End If
ObjFactura = Nothing
- Obj2 = Nothing
+ ListaNotasCreditoGeneradas = Nothing
End If
End If
@@ -9147,6 +9145,11 @@ Partial Class Ventas
ObjFacturaDevolucion.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero()
ObjFacturaDevolucion.TipoRelacion = "07"
+ If NCDescuento Then
+ ObjFacturaDevolucion.CveTipoRelacion = 1
+ ObjFacturaDevolucion.TipoRelacion = "01"
+ End If
+
Dim Fol As New List(Of String)
Fol.Add(FolioFiscalRelacionado)
ObjFacturaDevolucion.UUIDRelacionados = Fol
@@ -9421,8 +9424,8 @@ Partial Class Ventas
ObjFacturaBonificacion.UsoCFDI = DdlUsoCFDI.SelectedItem.Text
ObjFacturaBonificacion.ClaveUsoCFDI = GlobalDTSATUsosCFDI.FiltroPrimeroValor("UsoCFDI", $"CveUsoCFDI = {DdlUsoCFDI.SelectedValue}")
- ObjFacturaBonificacion.CveTipoRelacion = DdlTipoRelacionAnticipo.SelectedValue.ToEntero()
- ObjFacturaBonificacion.TipoRelacion = "07"
+ ObjFacturaBonificacion.CveTipoRelacion = 1
+ ObjFacturaBonificacion.TipoRelacion = "01"
Dim Fol As New List(Of String)
Fol.Add(FolioFiscalRelacionado)
@@ -11735,7 +11738,7 @@ Partial Class Ventas
Dim CveTamanio As Integer = GlobalDTAcumTamaños().FiltroPrimeroValor("CveTamaño", $"CvePSCargo={CvePSCargo}").ToEntero()
If CveTamanio > 0 Then
- If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Row("Cantidad").ToString().ToDecimal(), CveTamanio, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "") Then
+ If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, Row("Cantidad").ToString().ToDecimal(), CveTamanio, 6, factura.CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0D, "", Now) Then
ErrorList.Add("Ocurrió un error al agregar la venta detalle devolución.")
Exit For
End If
@@ -22937,7 +22940,7 @@ Partial Class Ventas
'Else
'End If
- If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs", "RNC") Then
+ If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Dev", "Egs") Then
Dim sb As New StringBuilder()
Dim sbExtra As New StringBuilder()
@@ -27423,10 +27426,14 @@ Partial Class Ventas
'Dim RNCCargo = ListaNC.Where(Function(f) f.CveVenta = RNCBonificacion.CveVentaRNCCargo).FirstOrDefault()
For Each RowCargo As DataRow In TmpDT.FiltraParametros("EsCargo = True", Orderby:="PU").Rows
+ Dim CantidadCargo = RowCargo("Cantidad").ToString().ToDecimal()
+ Dim ImportePU As Decimal = GlobalDTAcumTamaños().FiltroPrimeroValor("Bonificacion", $"CvePSCargo={RowCargo("CvePS")}").ToDecimal()
+ Dim TotalCalculableImpuestosCargo As Decimal = (CantidadCargo * ImportePU)
+ Dim TotalCargo As Decimal = TotalCalculableImpuestosCargo + (TotalCalculableImpuestosCargo * RowCargo("PorcentajeIVA").ToString().ToDecimal).RoundSQL(2)
- Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / RNCBonificacion.Total)
+ Dim PorcentajeAplicado = (RNCBonificacion.TotalRemNCAplicado / TotalCargo)
- Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() '* PorcentajeAplicado
+ Dim Cantidad As Decimal = RowCargo("Cantidad").ToString().ToDecimal() * PorcentajeAplicado
Dim Obs = RowCargo("CodigoPS").ToString()
@@ -27436,7 +27443,7 @@ Partial Class Ventas
'Dim ImportePU = RowCargo("PUBonificacion").ToString().ToDecimal
- Dim ImportePU As Decimal = GlobalDTAcumTamaños().FiltroPrimeroValor("Bonificacion", $"CvePSCargo={RowCargo("CvePS")}").ToDecimal()
+
Dim TotalCalculableImpuestos As Decimal = (Cantidad * ImportePU)
@@ -31051,7 +31058,7 @@ Partial Class Ventas
For Each drow As DataRow In factura.DtDetalle.Rows
If drow("CveTamaño").ToString.ToEntero > 0 And (CvePSPSA <> drow("CvePS").ToString.ToEntero) Then
If Not ObjAcum.DistribuidorMovtosAdd(factura.CveCliente, drow("Cantidad").ToString.ToDecimal, drow("CveTamaño").ToString.ToEntero, CveConcepto, factura.CveVenta, UsuarioActual.CveUsuario,
- UsuarioActual.CveEmpresa, 0D, "") Then
+ UsuarioActual.CveEmpresa, 0D, "", Now) Then
Resultado = False
Exit For
End If
@@ -31427,15 +31434,18 @@ Partial Class Ventas
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
- row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
+ If GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() > 0 Then
+ row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
- Dim TotalCalculableImpuestos As Decimal = row("Cantidad").ToString().ToDecimal() * row("PU").ToString().ToDecimal()
- Dim IVA As Decimal = (TotalCalculableImpuestos * row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL()
+ Dim TotalCalculableImpuestos As Decimal = row("Cantidad").ToString().ToDecimal() * row("PU").ToString().ToDecimal()
+ Dim IVA As Decimal = (TotalCalculableImpuestos * row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL()
- row("IVA") = IVA
- row("Total") = (TotalCalculableImpuestos + IVA).RoundSQL
+ row("IVA") = IVA
+ row("Total") = (TotalCalculableImpuestos + IVA).RoundSQL
+
+ TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
+ End If
- TmpDTRNCDetalleSelecciondas.Rows.Add(row.ItemArray)
Next
End If
End If
@@ -31461,18 +31471,25 @@ Partial Class Ventas
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
- Dim PU = GvRow.DataKey("PU").ToDecimal()
- Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
+ If Cantidad > 0 Then
+ Dim PU = GvRow.DataKey("PU").ToDecimal()
+ Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
- Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
- Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
+ Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
+ Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
- Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
+ Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
- TotalRNC += TotalRNCDetalle
+ TotalRNC += TotalRNCDetalle
- If RemNC.CveVentaRNCCargo <= 0 Then
- RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero()
+ If RemNC.CveVentaRNCCargo <= 0 Then
+ RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero()
+ End If
+ Else
+ Alert($"La cantidad seleccionada debe ser mayor a 0.", TipoMensaje.MsgAdvertencia)
+ ListaNCDesc.Clear()
+ ListaNCBonificacion.Clear()
+ Exit Sub
End If
End If
@@ -31581,15 +31598,17 @@ Partial Class Ventas
If GvRow.FCCheckBox("ChkAplicar").Checked Then
Dim Rows = TmpDTRNCBonificacionDetalle.Select($"CveVentaDetalleRNC = {GvRow.DataKey("CveVentaDetalleRNC").ToEntero()}")
For Each row In Rows
- row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
+ If GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal() > 0 Then
+ row("Cantidad") = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
- Dim TotalCalculableImpuestos As Decimal = row("Cantidad").ToString().ToDecimal() * row("PU").ToString().ToDecimal()
- Dim IVA As Decimal = (TotalCalculableImpuestos * row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL()
+ Dim TotalCalculableImpuestos As Decimal = row("Cantidad").ToString().ToDecimal() * row("PU").ToString().ToDecimal()
+ Dim IVA As Decimal = (TotalCalculableImpuestos * row("PorcentajeIVA").ToString().ToDecimal()).RoundSQL()
- row("IVA") = IVA
- row("Total") = (TotalCalculableImpuestos + IVA).RoundSQL
+ row("IVA") = IVA
+ row("Total") = (TotalCalculableImpuestos + IVA).RoundSQL
- TmpDTRNCBonificacionDetalleSeleccionadas.Rows.Add(row.ItemArray)
+ TmpDTRNCBonificacionDetalleSeleccionadas.Rows.Add(row.ItemArray)
+ End If
Next
End If
End If
@@ -31607,20 +31626,28 @@ Partial Class Ventas
If GvRow.FCCheckBox("ChkAplicar").Checked AndAlso GvRow.DataKey("CveVenta").ToEntero() = Dr("CveVenta").ToString().ToEntero() Then
Dim Cantidad As Decimal = GvRow.FCTextBox("TxtCantidadRNC").Text.ToDecimal()
- Dim PU = GvRow.DataKey("PU").ToDecimal()
- Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
+ If Cantidad > 0 Then
+ Dim PU = GvRow.DataKey("PU").ToDecimal()
+ Dim PorcentajeIVA As Decimal = GvRow.DataKey("PorcentajeIVA").ToDecimal()
- Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
- Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
+ Dim TotalCalculableImpuestos As Decimal = (Cantidad * PU)
+ Dim ImporteIVA As Decimal = (TotalCalculableImpuestos * PorcentajeIVA).RoundSQL(2)
- Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
+ Dim TotalRNCDetalle As Decimal = (TotalCalculableImpuestos + ImporteIVA)
- TotalRNC += TotalRNCDetalle
+ TotalRNC += TotalRNCDetalle
- If RemNC.CveVentaRNCCargo <= 0 Then
- RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero()
+ If RemNC.CveVentaRNCCargo <= 0 Then
+ RemNC.CveVentaRNCCargo = GvRow.DataKey("CveVenta").ToEntero()
+ End If
+ Else
+ Alert($"La cantidad seleccionada debe ser mayor a 0.", TipoMensaje.MsgAdvertencia)
+ ListaNCDesc.Clear()
+ ListaNCBonificacion.Clear()
+ Exit Sub
End If
+
End If
End If