diff --git a/App_Code/ClsClientes.vb b/App_Code/ClsClientes.vb
index 69ac29dc8..42e66ad44 100644
--- a/App_Code/ClsClientes.vb
+++ b/App_Code/ClsClientes.vb
@@ -1680,6 +1680,63 @@ Public Class ClsClientes
Return Retorno
End Function
+ Public Function UpdateClienteNoFrencuente(CveCliente As Integer, Nombre As String, Direccion As String, NoExt As String, NoInt As String, Colonia As String, Localidad As String, Ciudad As String, CveEstado As Integer,
+ RFC As String, CP As String, Telefono As String, Mail As String, CveSubProyecto As Integer, CveUsuario As Integer, CveEmpresa As Integer,
+ NumCuentaPago As String, CveMetodoPago33 As Integer, CveFormaPago33 As Integer, Optional CvePrecioLista As Integer = -1) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_ClientesNoFrecuenteUpdate")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CveCliente", SqlDbType.Int).Value = CveCliente
+ .Add("@Nombre", SqlDbType.VarChar).Value = Nombre
+ .Add("@Direccion", SqlDbType.VarChar).Value = Direccion
+ .Add("@NoExt", SqlDbType.VarChar).Value = NoExt
+ .Add("@NoInt", SqlDbType.VarChar).Value = NoInt
+ .Add("@Colonia", SqlDbType.VarChar).Value = Colonia
+ .Add("@Localidad", SqlDbType.VarChar).Value = Localidad
+ .Add("@Ciudad", SqlDbType.VarChar).Value = Ciudad
+ .Add("@CveEstado", SqlDbType.Int).Value = CveEstado
+ ' .Add("@Pais", SqlDbType.VarChar).Value = Pais
+ .Add("@RFC", SqlDbType.VarChar).Value = RFC
+ .Add("@CP", SqlDbType.VarChar).Value = CP
+ .Add("@Telefono", SqlDbType.VarChar).Value = Telefono
+ .Add("@Mail", SqlDbType.VarChar).Value = Mail
+ .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto
+ .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@CveMetodoPago33", SqlDbType.Int).Value = CveMetodoPago33
+ .Add("@CveFormaPago33", SqlDbType.Int).Value = CveFormaPago33
+ .Add("@NumCuentaPago", SqlDbType.VarChar).Value = NumCuentaPago
+ .Add("@CvePrecioLista", SqlDbType.Int).Value = CvePrecioLista
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch Ex1 As SqlException
+
+ If Ex1.Message.Contains("Número: 2627;") Then
+ Alert("El Nuevo Cliente no se guardo debido a que actualmente se encuentra registrado", TipoMensaje.MsgAdvertencia)
+
+ ElseIf Ex1.Message.Contains("Número: 2601;") Then
+ If Ex1.Message.Contains("UN_ClientesRFCEmpresa") Then
+ Alert("Ya existe un cliente registrado con el mismo RFC.", TipoMensaje.MsgAdvertencia)
+ End If
+
+ If Ex1.Message.Contains("IND_Clientes_Codigo") Then
+ Alert("Ya existe un cliente registrado con el mismo Código.", TipoMensaje.MsgAdvertencia)
+ End If
+ Else
+ Me.OnError("Ocurrió un error al Intentar guardar el Nuevo Cliente.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
+ End If
+ Catch ex As Exception
+ OnError("Ocurrió un error al guardar el cliente", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
+
#Region "UNIFICAR CLIENTES"
Public Function UnificarClientes(CveClienteAUnificar As Integer, CveClienteOriginal As Integer) As Boolean
Dim Retorno As Boolean = False
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 45b8f3792..8cc4b1e42 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -3571,6 +3571,26 @@ Public Class ClsInventarios
Return Retorno
End Function
+
+ Public Function ReconstruirCostos(CvePS As Integer, CveEmpresa As Integer) As Boolean
+ Dim Retorno As Boolean = False
+ DataAdapter("PA_Inv_ReconstruirCostos")
+
+ With SqlAdapter.SelectCommand.Parameters
+ .Add("@CvePS", SqlDbType.Int).Value = CvePS
+ .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+
+ End With
+
+ Try
+ SqlAdapter.Fill(Data)
+ Retorno = True
+ Catch ex As Exception
+ OnError("Ocurrió un error al obtener al reconstruir los costos del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
+ End Try
+
+ Return Retorno
+ End Function
#End Region
#Region " INVENTARIOS - OC "
diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb
index caef462e6..32d650303 100644
--- a/App_Code/ClsNominas.vb
+++ b/App_Code/ClsNominas.vb
@@ -979,7 +979,7 @@ Public Class ClsNominas
Public Function UpdateConcepto(Codigo As String, Concepto As String, Tipo As String, Formula As String, Sistema As Boolean, Estado As Boolean, CveConceptoPadre As Integer, CveConcepto As Integer,
EsRetencion As Boolean, CveClasificacion As Integer, IdCtaContable As Integer, CveTipoGasto As Integer, TipoCalculo As Boolean, CveConceptoContable As Integer,
- AplicaFiniquito As Integer, AutomaticoGlobal As Integer, Especie As Integer, Imprimir As Integer, CveSATConcepto As Integer) As Boolean
+ AplicaFiniquito As Integer, AutomaticoGlobal As Integer, Especie As Integer, Imprimir As Integer, CveSATConcepto As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Nom_ConceptosUpdate")
@@ -1004,6 +1004,7 @@ Public Class ClsNominas
.Add("Especie", SqlDbType.Bit).Value = Especie
.Add("Imprimir", SqlDbType.Bit).Value = Imprimir
.Add("CveSATConcepto", SqlDbType.Int).Value = CveSATConcepto
+ .Add("CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb
index 0a9d5aca9..bc165de82 100644
--- a/App_Code/ClsProductosServicios.vb
+++ b/App_Code/ClsProductosServicios.vb
@@ -208,7 +208,7 @@ Public Class ClsProductosServicios
Public Function GetPS(CvePS As Integer, CveClasificacion As Integer, CveEmpresa As Integer, Optional Codigo As String = "-1", Optional Codigo2 As String = "-1",
Optional CodigoBarras As String = "-1", Optional PS As String = "-1", Optional EsPaquete As Integer = -1, Optional CveSubProyecto As Integer = -1,
Optional pAplicaParaVenta As Integer = -1, Optional pEstado As Integer = -1, Optional CveClasificacionCosto As Integer = -1, Optional CveTipoPS As Integer = -1,
- Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000) As Boolean
+ Optional CveCompuesto As Integer = -1, Optional SATClavePS As String = "-1", Optional TopSelect As Integer = 10000, Optional CveMarca As Integer = -1) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_ProductosServiciosGet")
@@ -229,6 +229,7 @@ Public Class ClsProductosServicios
.Add("@CveTipoPS", SqlDbType.Int).Value = CveTipoPS
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
.Add("@SATClavePS", SqlDbType.VarChar).Value = SATClavePS
+ .Add("@CveMarca", SqlDbType.Int).Value = CveMarca
.Add("@TopSelect", SqlDbType.Int).Value = TopSelect
End With
@@ -252,7 +253,7 @@ Public Class ClsProductosServicios
Oferta = Data.Rows(0)("Oferta").ToString.ToDouble
IVA = Data.Rows(0)("IVA").ToString.ToDouble
RetIVA = Data.Rows(0)("RetIVA").ToString.ToDouble
- CveMarca = Data.Rows(0)("CveMarca").ToString.ToEntero
+ Me.CveMarca = Data.Rows(0)("CveMarca").ToString.ToEntero
AplicaParaConcepto = CBool(Data.Rows(0)("AplicaParaConcepto").ToString)
AplicaParaVenta = Data.Rows(0)("AplicaParaVenta").ToString = "True"
Estado = Data.Rows(0)("Estado").ToString = "Activo"
diff --git a/App_Code/ClsSisNotificaciones.vb b/App_Code/ClsSisNotificaciones.vb
index be0a9a61e..4aafd6454 100644
--- a/App_Code/ClsSisNotificaciones.vb
+++ b/App_Code/ClsSisNotificaciones.vb
@@ -357,7 +357,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -418,7 +418,7 @@ Public Class ClsSisNotificaciones
End If
If Archivos.Count > 0 Then
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", $"Se adjunta el {Formato} en el Reporte Programado.", "", Archivos) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", $"Se adjunta el {Formato} en el Reporte Programado.", "", Archivos) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -467,7 +467,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -509,7 +509,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -557,7 +557,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -596,7 +596,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
@@ -635,7 +635,7 @@ Public Class ClsSisNotificaciones
If LSRutasMail.Count > 0 Then
Dim ObjMail As New ClsSisMail()
Dim ResultadoMail As Integer = 0
- If ObjMail.SendMail(ClsPaginas.EmpresaNotificaciones, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
+ If ObjMail.SendMail(ClsPaginas.EmpresaNotificacionesGPS, Correos, $"Reporte Programado {Date.Today.ToShortDateString}", "Se adjunta en pdf el Reporte Programado.", "", LSRutasMail) Then
UpdateNotificacionesBitacoraNotifico(CveNotificacionBitacora, 1)
End If
End If
diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb
index 96d8c619a..adda24263 100644
--- a/App_Code/Modelos.vb
+++ b/App_Code/Modelos.vb
@@ -580,6 +580,14 @@ Namespace Modelos
Me.DtRemisionesDocumentosRelacionados = ObjVentas.DtResultados.Copy()
End If
+ 'CARGA LOS IMPUESTOS LOCALES
+ If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
+ If ObjVentas.DtResultados.Rows.Count > 0 Then
+ DtImpuestosLocales = ObjVentas.DtResultados.Copy()
+ End If
+ End If
+
+
ObjVentas.Dispose()
If Me.RealizarDevolucionAlmacen Then
@@ -1618,8 +1626,8 @@ Namespace Modelos
End If
'Impuestos Locales
- If DtImpuestosLocales IsNot Nothing Then
- For Each gvr As DataRow In DtImpuestosLocales.Rows
+ If factura.DtImpuestosLocales IsNot Nothing Then
+ For Each gvr As DataRow In factura.DtImpuestosLocales.Rows
If Not ObjVentas.AddVentaImpuestoLocales(factura.CveVenta, gvr("CveImpuestoLocal").ToString.ToEntero(), gvr("Importe").ToString().ToDouble()) Then
ErrorList.Add("Ocurrió un error al Guardar Impuestos Locales")
End If
@@ -1627,8 +1635,8 @@ Namespace Modelos
End If
- If DtFirmas IsNot Nothing AndAlso DtFirmas.Rows.Count > 0 Then
- For Each Row As DataRow In DtFirmas.Rows
+ If factura.DtFirmas IsNot Nothing AndAlso factura.DtFirmas.Rows.Count > 0 Then
+ For Each Row As DataRow In factura.DtFirmas.Rows
If Not ObjVentas.AddVentasFirmas(factura.CveVenta, Row("Titulo").ToString, Row("Nombre").ToString, Row("Puesto").ToString, Row("Lado").ToString.ToEntero) Then
ErrorList.Add("Ocurrio un error al Guardar Firmas")
End If
@@ -4828,8 +4836,10 @@ Namespace Modelos
If Not ErrorCancelar Then
Dim Filtro As String = ""
Select Case ObjFactura.TipoDocto
- Case "Ing", "Ped", "Dev"
+ Case "Ing", "Ped"
Filtro = "CveConcepto IN (3, 40)"
+ Case "Dev"
+ Filtro = "CveConcepto = 18"
Case Else
Filtro = "CveConcepto = 9"
End Select
@@ -4860,19 +4870,22 @@ Namespace Modelos
If Not ErrorCancelar AndAlso RealizarDevolucionAlmacen Then
'REALIZA DEVOLUCION A LAS SALIDAS PENDIENTES
For Each RowMovimiento As DataRow In DtSalidas.Rows
- Dim CveConceptoDevolucion As Integer = -1
- Dim CveAlmacenDevolucion As Integer = -1
+ Dim CveConceptoMovimiento As Integer = -1
+ Dim CveAlmacenMovimiento As Integer = -1
Dim CveMovimientoDevolucion As Integer = 0
Dim Folio As Integer = 0
Select Case RowMovimiento("CveConcepto").ToString().ToEntero()
Case 3
- CveConceptoDevolucion = 18 'DEVOLUCION DEL CLIENTE
- CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
+ CveConceptoMovimiento = 18 'DEVOLUCION DEL CLIENTE
+ CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
Case 40
- CveConceptoDevolucion = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
- CveAlmacenDevolucion = RowMovimiento("CveAlmacen").ToString().ToEntero()
+ CveConceptoMovimiento = 41 'DEVOLUCIÓN DEL CLIENTE DIRECTA
+ CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
+ Case 18
+ CveConceptoMovimiento = 3 'DEVOLUCIÓN DEL CLIENTE DIRECTA
+ CveAlmacenMovimiento = RowMovimiento("CveAlmacen").ToString().ToEntero()
''SI TIENE REMISIONES RELACIONADAS
'If DtRemisionesFacturadas.Rows.Count > 0 Then
' Dim RowRemision As DataRow = DtExistencias.FiltroPrimero($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}")
@@ -4896,12 +4909,20 @@ Namespace Modelos
'SI TIENE SALDO PENDIENTE POR DEVOLVER GENERA UN MOVIMIENTO DE DEVOLUCION
If ObjFactura.SaldoAlmacen <> 0 Then
'SALIDA DE ALMACEN - SALIDA POR TRASPASO CUANDO ES REMISION - DEVOLUCION (SI ES TRASPASO Y TIENE CONTRATO NO HACE DEVOLUCIóN)
- CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenDevolucion, CveConceptoDevolucion, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1")
+ CveMovimientoDevolucion = ObjInventario.AddMovimiento(CveAlmacenMovimiento, CveConceptoMovimiento, 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, CveVenta, -1, -1, Observaciones:="", Guia:="", CveContrato:=CveContrato, CveAlmacenDestino:=-1, Modulo:="Mod/CV1")
Folio = ObjInventario.Folio
If CveMovimientoDevolucion > 0 Then
For Each Dr As DataRow In DtExistencias.FiltraParametros($"CveMovimiento = {RowMovimiento("CveMovimiento").ToString()}").Rows
- If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero) Then
+
+ Dim FechaCaducidad As Date = MinFecha
+ If Not String.IsNullOrEmpty(Dr("FechaCaducidad").ToString()) Then
+ If IsDate(Dr("FechaCaducidad")) Then
+ FechaCaducidad = Dr("FechaCaducidad").ToString().ToDate()
+ End If
+ End If
+
+ If Not ObjInventario.AddMovimientoDetalle(CveMovimientoDevolucion, Dr("Cantidad").ToString.ToDecimal, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, -1, Serie:=Dr("Serie").ToString, Lote:=Dr("Lote").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, CveSeccionAlmacen:=Dr("CveSeccionAlmacen").ToString.ToEntero, FechaCaducidad:=FechaCaducidad) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
Exit For
@@ -4920,12 +4941,17 @@ Namespace Modelos
DtCostos = ObjInventario.DtResultados
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
- Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
+ Dim IdCtaContableAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {CveAlmacenMovimiento}").ToEntero
'Dim CveCuentaAlmacen As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContableSIG", $"CveAlmacen = {CveAlmacenDevolucion}").ToEntero
Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
If tmpCostos.Rows.Count > 0 Then
+ Dim Multiplicador As Decimal = -1D
+ If ObjFactura.TipoDocto = "Dev" Then
+ Multiplicador = 1D
+ End If
+
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
Dim Fecha As Date = Now
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString.ToEntero
@@ -4950,7 +4976,7 @@ Namespace Modelos
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostosSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
If Not ErrorCancelar Then
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, -1 * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, False, Multiplicador * ValorInventario, SerieFolio, 69, SerieFolio, Fecha, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * ValorInventario, CveCuenta:=CveCuenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero) Then
ErrorCancelar = True
End If
End If
@@ -4958,7 +4984,7 @@ Namespace Modelos
cont += 1
Next
- If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, -1 * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=-1 * TotalCosto) Then
+ If Not ObjConta.AddPrePolizasDetalle(CvePrePolizaDev, True, Multiplicador * TotalCosto, SerieFolio, 68, SerieFolio, Fecha, IdCtaContableAlmacen, -1, CveVenta:=CveVenta, CveCliente:=CveCliente, CveMovimientoAlmacen:=CveMovimientoDevolucion, CveSubProyecto:=ObjFactura.CveSubProyecto, ImporteMX:=Multiplicador * TotalCosto) Then
ErrorCancelar = True
End If
@@ -4995,7 +5021,7 @@ Namespace Modelos
'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION
'SI ES DEVOLUCION DEL CLIENTE DEBE REGRESAR A ENTREGA POR ADELANTADO
- If Not ErrorCancelar AndAlso CveConceptoDevolucion = 18 AndAlso RevivirRemisiones Then
+ If Not ErrorCancelar AndAlso CveConceptoMovimiento = 18 AndAlso RevivirRemisiones Then
If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimientoDevolucion, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then
ErrorCancelar = True
MensajeError = "Ocurrió un error al generar los movimientos de devolución a remisión"
diff --git a/Ashx/E141.ashx b/Ashx/E141.ashx
index 801f1ab28..fca4a8b19 100644
--- a/Ashx/E141.ashx
+++ b/Ashx/E141.ashx
@@ -115,6 +115,45 @@ Public Class E141 : Implements IHttpHandler
End Get
End Property
+ Public Property GlobalDTPSSimplificado(Optional CveClasificacion As Integer = -1, Optional Codigo As String = "-1", Optional Estatus As Integer = 1, Optional AplicaParaVenta As Integer = -1, Optional CvePS As Integer = -1) As DataTable
+ Get
+ Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
+ If CveEmpresa <> -1 Then
+ 'sino existe, recarga los datos
+ If HttpContext.Current.Application(AppNombre) Is Nothing Then
+ Dim ObjPS As New ClsProductosServicios
+ If ObjPS.GetPSSimplificado(CveEmpresa) Then HttpContext.Current.Application(AppNombre) = ObjPS.DtResultados.AsEnumerable()
+ ObjPS.Dispose()
+
+ End If
+
+
+ Dim Cons = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow))
+
+ Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEmpresa) = CveEmpresa))
+ If CveClasificacion >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveClasificacion) = CveClasificacion))
+ Codigo = Codigo.ToUpper()
+ If Codigo <> "-1" Then Cons = Cons.Where((Function(a) Convert.ToString(a!Codigo).ToUpper() = Codigo))
+ If Estatus >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CveEstado) = Estatus))
+ If AplicaParaVenta >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!AplicaParaVenta) = AplicaParaVenta))
+ If CvePS >= 0 Then Cons = Cons.Where((Function(a) Convert.ToInt32(a!CvePS) = CvePS))
+
+ Try
+ GlobalDTPSSimplificado = Cons.OrderBy(Function(a) a!PSCodigo).CopyToDataTable
+ Catch ex As Exception
+ GlobalDTPSSimplificado = New DataTable
+ End Try
+
+ Else
+ GlobalDTPSSimplificado = DirectCast(HttpContext.Current.Application(AppNombre), EnumerableRowCollection(Of DataRow)).CopyToDataTable
+ End If
+ End Get
+ Set(value As DataTable)
+ Dim AppNombre As String = String.Format("GlobalDTPSSimplificado-{0}", CveEmpresa)
+ HttpContext.Current.Application(AppNombre) = value
+ End Set
+ End Property
+
Property GlobalDTMonedas() As DataTable
Get
GlobalDTMonedas = DirectCast(HttpContext.Current.Application("GlobalDTMonedas"), DataTable)
@@ -632,11 +671,14 @@ Public Class E141 : Implements IHttpHandler
Dim ObjClientes As New ClsClientes()
Dim ObjInventario As New ClsInventarios(ObjClientes.IniciaTransacSQL())
- ObjClientes.IniciaTransacSQL()
Try
- If Not String.IsNullOrEmpty(JsonRequest("timbrar").ToString) Then
- DebeTimbrar = CBool(JsonRequest("timbrar"))
+ Dim timbrar_request As String = If(JsonRequest("timbrar") Is Nothing, "", JsonRequest("timbrar").ToString())
+
+ If Not String.IsNullOrEmpty(timbrar_request) Then
+ DebeTimbrar = CBool(timbrar_request)
+ Else
+ DebeTimbrar = False
End If
ObjFactura = CreaFactura(ObjInventario, ObjClientes, "Ing", Resp, JsonRequest, Usuario)
@@ -646,7 +688,7 @@ Public Class E141 : Implements IHttpHandler
If Resp.CveVenta > 0 Then
Respuesta.status = "success"
- Respuesta.data = Resp.CveVenta.ToString()
+ Respuesta.data = Resp.SerieFolio
Else
TieneError = True
End If
@@ -674,9 +716,11 @@ Public Class E141 : Implements IHttpHandler
If TieneError Then
ObjClientes.RollBack()
ObjClientes.Dispose()
+ ObjInventario.Dispose()
Else
ObjClientes.Commit()
ObjClientes.Dispose()
+ ObjInventario.Dispose()
If DebeTimbrar Then
Dim SeTimbro As Boolean = ObjFactura.TimbrarFactura()
@@ -690,6 +734,10 @@ Public Class E141 : Implements IHttpHandler
End If
End If
+ If ObjFactura IsNot Nothing Then
+ ObjFactura.Dispose()
+ End If
+
Else
TieneError = True
RespuestaError.message = "No hay un usuario disponible"
@@ -708,26 +756,83 @@ Public Class E141 : Implements IHttpHandler
#Region "D E F I N I R - O B J E T O S"
- Private Function CrearCliente(ObjClientes As ClsClientes, ByRef Resp As Modelos.Factura.MMensajeFactura, JsonRequest As JObject, UsuarioActual As Usuario) As Integer
+ Private Function CrearCliente(TipoDocto As String, ObjClientes As ClsClientes, ByRef Resp As Modelos.Factura.MMensajeFactura, JsonRequest As JObject, UsuarioActual As Usuario) As Integer
Dim CveCliente As Integer = -1
Dim CveSubProyecto As Integer = JsonRequest("branch_office_id").ToEntero()
- Dim Nombre As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
- Dim Direccion As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
- Dim NumExt As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
- Dim NumInt As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
- Dim Colonia As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
- Dim Localidad As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
- Dim Ciudad As String = Localidad
- Dim RFC As String = If(JsonRequest("invoice_rfc") Is Nothing, "XAXX010101000", JsonRequest("invoice_rfc").ToString())
- Dim CP As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
- Dim Telefono As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
- Dim Correo As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
+
+
+ Dim Nombre As String = ""
+ Dim Direccion As String = ""
+ Dim NumExt As String = ""
+ Dim NumInt As String = ""
+ Dim Colonia As String = ""
+ Dim Localidad As String = ""
+ Dim Ciudad As String = ""
+ Dim Estado As String = ""
+ Dim RFC As String = ""
+ Dim CP As String = ""
+ Dim Telefono As String = ""
+ Dim Correo As String = ""
+
+ 'DATOS DE CONTACTO
+ Dim contact_name As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
+ Dim contact_address As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
+ Dim contact_ext_number As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
+ Dim contact_int_number As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
+ Dim contact_neighborhood As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
+ Dim contact_city As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
+ Dim contact_zip_code As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
+ Dim contact_phone As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
+ Dim contact_email As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
+ Dim contact_state As String = If(JsonRequest("contact_state") Is Nothing, "", JsonRequest("contact_state").ToString())
+
+ 'DATOS DE FACTURACION
+ Dim invoice_rfc As String = If(JsonRequest("invoice_rfc") Is Nothing, "", JsonRequest("invoice_rfc").ToString())
+ Dim invoice_name As String = If(JsonRequest("invoice_name") Is Nothing, "", JsonRequest("invoice_name").ToString())
+ Dim invoice_address As String = If(JsonRequest("invoice_address") Is Nothing, "", JsonRequest("invoice_address").ToString())
+ Dim invoice_city As String = If(JsonRequest("invoice_city") Is Nothing, "", JsonRequest("invoice_city").ToString())
+ Dim invoice_state As String = If(JsonRequest("invoice_state") Is Nothing, "", JsonRequest("invoice_state").ToString())
+ Dim invoice_email As String = If(JsonRequest("invoice_email") Is Nothing, "", JsonRequest("invoice_email").ToString())
+ Dim invoice_phone As String = If(JsonRequest("invoice_phone") Is Nothing, "", JsonRequest("invoice_phone").ToString())
Dim CveEstado As Integer = -1
- If Not String.IsNullOrEmpty(JsonRequest("contact_state").ToString()) Then
- CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{JsonRequest("contact_state").ToString().Trim}'").ToEntero()
+ If TipoDocto = "Ing" Then
+ RFC = If(Not String.IsNullOrEmpty(invoice_rfc), invoice_rfc, "XAXX010101000")
+ Nombre = If(Not String.IsNullOrEmpty(invoice_name), invoice_name, contact_name)
+ Direccion = If(Not String.IsNullOrEmpty(invoice_address), invoice_address, contact_address)
+ 'SI LA DIRECCION ES LA MISMA QUE LA DE CONTACTO
+ If Direccion = contact_address Then
+ NumExt = If(Not String.IsNullOrEmpty(contact_ext_number), contact_ext_number, "")
+ NumInt = If(Not String.IsNullOrEmpty(contact_int_number), contact_int_number, "")
+ Colonia = If(Not String.IsNullOrEmpty(contact_neighborhood), contact_neighborhood, "")
+ End If
+ Ciudad = If(Not String.IsNullOrEmpty(invoice_city), invoice_city, contact_city)
+ Localidad = Ciudad
+ Estado = If(Not String.IsNullOrEmpty(invoice_state), invoice_state, contact_state)
+ CP = If(Not String.IsNullOrEmpty(contact_zip_code), contact_zip_code, "")
+ Correo = If(Not String.IsNullOrEmpty(invoice_email), invoice_email, contact_email)
+ Telefono = If(Not String.IsNullOrEmpty(invoice_phone), invoice_phone, contact_phone)
+
+ Else
+
+ Nombre = If(Not String.IsNullOrEmpty(contact_name), contact_name, "")
+ Direccion = If(Not String.IsNullOrEmpty(contact_address), contact_address, "")
+ NumExt = If(Not String.IsNullOrEmpty(contact_ext_number), contact_ext_number, "")
+ NumInt = If(Not String.IsNullOrEmpty(contact_int_number), contact_int_number, "")
+ Colonia = If(Not String.IsNullOrEmpty(contact_neighborhood), contact_neighborhood, "")
+ Ciudad = If(Not String.IsNullOrEmpty(contact_city), contact_city, "")
+ Localidad = Ciudad
+ Estado = If(Not String.IsNullOrEmpty(contact_state), contact_state, "")
+ CP = If(Not String.IsNullOrEmpty(contact_zip_code), contact_zip_code, "")
+ Correo = If(Not String.IsNullOrEmpty(contact_email), contact_email, "")
+ Telefono = If(Not String.IsNullOrEmpty(contact_phone), contact_phone, "")
+
+ End If
+
+ If Not String.IsNullOrEmpty(Estado) Then
+ CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{Estado.Trim}'").ToEntero()
'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
If CveEstado <= 0 Then
@@ -737,11 +842,18 @@ Public Class E141 : Implements IHttpHandler
CveEstado = 26
End If
+
'SI NO EXISTE EL RFC UTILIZA EL GENERICO
If String.IsNullOrEmpty(RFC) Then
RFC = "XAXX010101000"
End If
+ If String.IsNullOrEmpty(Nombre) Then
+ Resp.TieneError = False
+ Resp.Mensajes.Add("El cliente no tiene un nombre")
+ Return -1
+ End If
+
'VALIDAR QUE NO EXISTA EL RFC
If RFC <> "XAXX010101000" Then
If ObjClientes.GetClientes(-1, "-1", "-1", "-1", RFC, "-1", "-1", -1, UsuarioActual.CveEmpresa, 1, TipoCliente:=-1, TopSelect:=1) Then
@@ -774,11 +886,19 @@ Public Class E141 : Implements IHttpHandler
Resp.TieneError = False
Dim Serie As String = "-1"
Dim CveMoneda As Integer = 1
+
Dim CveSubProyecto As Integer = JsonRequest("branch_office_id").ToEntero()
+
+ If CveSubProyecto <= 0 Then
+ Resp.TieneError = False
+ Resp.Mensajes.Add("La sucursal es requerida")
+ Return Nothing
+ End If
+
Dim CveCliente As Integer = If(JsonRequest("user_id") Is Nothing, 0, JsonRequest("user_id").ToEntero())
If CveCliente <= 0 Then
- CveCliente = CrearCliente(ObjClientes, Resp, JsonRequest, UsuarioActual)
+ CveCliente = CrearCliente(TipoDocto, ObjClientes, Resp, JsonRequest, UsuarioActual)
End If
If CveCliente <= 0 Then
@@ -854,19 +974,6 @@ Public Class E141 : Implements IHttpHandler
ElseIf ObjFactura.TipoDocto = "Ing" Then
- If ObjFactura.Cliente IsNot Nothing AndAlso Not String.IsNullOrEmpty(JsonRequest("invoice_name").ToString()) Then
- ObjFactura.Cliente.Nombre = JsonRequest("invoice_name").ToString()
- ObjFactura.Cliente.NombreComercial = JsonRequest("invoice_name").ToString()
- ObjFactura.Cliente.Direccion = JsonRequest("invoice_address").ToString()
- ObjFactura.Cliente.Colonia = ""
- ObjFactura.Cliente.NoInt = ""
- ObjFactura.Cliente.NoExt = ""
- ObjFactura.Cliente.Localidad = JsonRequest("invoice_city").ToString()
- ObjFactura.Cliente.Estado = JsonRequest("invoice_state").ToString()
- ObjFactura.Cliente.Mail = JsonRequest("invoice_email").ToString()
- ObjFactura.Cliente.Telefono = JsonRequest("invoice_phone").ToString()
- End If
-
'FORMA DE PAGO
If JsonRequest("invoice_way_to_pay") Is Nothing Then
Resp.TieneError = False
@@ -941,10 +1048,73 @@ Public Class E141 : Implements IHttpHandler
End If
+ If ObjFactura.Cliente IsNot Nothing AndAlso TipoDocto = "Ing" Then
+
+ 'DATOS DE CONTACTO
+ Dim contact_name As String = If(JsonRequest("contact_name") Is Nothing, "", JsonRequest("contact_name").ToString())
+ Dim contact_address As String = If(JsonRequest("contact_address") Is Nothing, "", JsonRequest("contact_address").ToString())
+ Dim contact_ext_number As String = If(JsonRequest("contact_ext_number") Is Nothing, "", JsonRequest("contact_ext_number").ToString())
+ Dim contact_int_number As String = If(JsonRequest("contact_int_number") Is Nothing, "", JsonRequest("contact_int_number").ToString())
+ Dim contact_neighborhood As String = If(JsonRequest("contact_neighborhood") Is Nothing, "", JsonRequest("contact_neighborhood").ToString())
+ Dim contact_city As String = If(JsonRequest("contact_city") Is Nothing, "", JsonRequest("contact_city").ToString())
+ Dim contact_zip_code As String = If(JsonRequest("contact_zip_code") Is Nothing, "", JsonRequest("contact_zip_code").ToString())
+ Dim contact_phone As String = If(JsonRequest("contact_phone") Is Nothing, "", JsonRequest("contact_phone").ToString())
+ Dim contact_email As String = If(JsonRequest("contact_email") Is Nothing, "", JsonRequest("contact_email").ToString())
+ Dim contact_state As String = If(JsonRequest("contact_state") Is Nothing, "", JsonRequest("contact_state").ToString())
+
+ 'DATOS DE FACTURACION
+ Dim invoice_rfc As String = If(JsonRequest("invoice_rfc") Is Nothing, "", JsonRequest("invoice_rfc").ToString())
+ Dim invoice_name As String = If(JsonRequest("invoice_name") Is Nothing, "", JsonRequest("invoice_name").ToString())
+ Dim invoice_address As String = If(JsonRequest("invoice_address") Is Nothing, "", JsonRequest("invoice_address").ToString())
+ Dim invoice_city As String = If(JsonRequest("invoice_city") Is Nothing, "", JsonRequest("invoice_city").ToString())
+ Dim invoice_state As String = If(JsonRequest("invoice_state") Is Nothing, "", JsonRequest("invoice_state").ToString())
+ Dim invoice_email As String = If(JsonRequest("invoice_email") Is Nothing, "", JsonRequest("invoice_email").ToString())
+ Dim invoice_phone As String = If(JsonRequest("invoice_phone") Is Nothing, "", JsonRequest("invoice_phone").ToString())
+
+ Dim CveEstado As Integer = -1
+
+ ObjFactura.Cliente.RFC = If(Not String.IsNullOrEmpty(invoice_rfc), invoice_rfc, ObjFactura.Cliente.RFC)
+ ObjFactura.Cliente.Nombre = If(Not String.IsNullOrEmpty(invoice_name), invoice_name, contact_name)
+ ObjFactura.Cliente.NombreComercial = ObjFactura.Cliente.NombreComercial
+ ObjFactura.Cliente.Direccion = If(Not String.IsNullOrEmpty(invoice_address), invoice_address, contact_address)
+ ObjFactura.Cliente.Mail = If(Not String.IsNullOrEmpty(invoice_email), invoice_email, contact_email)
+ ObjFactura.Cliente.Telefono = If(Not String.IsNullOrEmpty(invoice_phone), invoice_phone, contact_phone)
+ ObjFactura.Cliente.Localidad = If(Not String.IsNullOrEmpty(invoice_city), invoice_city, contact_city)
+ ObjFactura.Cliente.Ciudad = ObjFactura.Cliente.Localidad
+ ObjFactura.Cliente.Estado = If(Not String.IsNullOrEmpty(invoice_state), invoice_state, contact_state)
+
+ If String.IsNullOrEmpty(ObjFactura.Cliente.RFC) Then
+ Resp.Mensajes.Add("No se ha ingresado un RFC")
+ Return Nothing
+ End If
+
+ If String.IsNullOrEmpty(ObjFactura.Cliente.Nombre) Then
+ Resp.Mensajes.Add("No se ha ingresado un nombre para el cliente")
+ Return Nothing
+ End If
+
+ If Not String.IsNullOrEmpty(ObjFactura.Cliente.Estado) Then
+ CveEstado = GlobalDTEstado("MEX").FiltroPrimeroValor("CveEstado", $"NombreEstado = '{ObjFactura.Cliente.Estado.Trim}'").ToEntero()
+
+ 'SI NO ENCUENTRA EL ESTADO INGRESA EL DE SONORA
+ If CveEstado <= 0 Then
+ CveEstado = 26
+ End If
+ Else
+ CveEstado = 26
+ End If
+
+ Dim Cliente = ObjFactura.Cliente
+ If Not ObjClientes.UpdateClienteNoFrencuente(CveCliente, Cliente.Nombre, Cliente.Direccion, Cliente.NoExt, Cliente.NoInt, Cliente.Colonia, Cliente.Localidad, Cliente.Ciudad, CveEstado, Cliente.RFC, Cliente.CP, Cliente.Telefono, Cliente.Mail, CveSubProyecto, UsuarioActual.CveUsuario, CveEmpresa, "-1", ObjFactura.CveMetodoPago33, ObjFactura.CveFormaPago33) Then
+ Resp.TieneError = False
+ Resp.Mensajes.Add("No se puedo actualizar un cliente")
+ Return Nothing
+ End If
+
+ End If
+
ObjFactura.CveAlmacen = GlobalDTAlmacen(CveEmpresa, CveTipoAlmacen:=1).FiltroPrimeroValor("CveAlmacen", $"CveSubProyecto={CveSubProyecto}").ToEntero()
-
-
'DETALLES
ObjFactura.DtDetalle = CreaDTDetalle(ObjInventario, ObjFactura, Resp, UsuarioActual, JsonRequest)
@@ -958,7 +1128,6 @@ Public Class E141 : Implements IHttpHandler
End If
End If
-
'INVENTARIO
If TipoDocto = "Ing" Then
ObjFactura.DtInventario = ObjFactura.DtDetalle.Copy.FiltraParametros("CveTipoPS = 2")
@@ -1235,7 +1404,9 @@ Public Class E141 : Implements IHttpHandler
TmpDT.Columns.Add("ClaveSATFraccionArancelariaDescripcion", GetType(String))
TmpDT.Columns.Add("ClaveSATUnidadAduanaDescripcion", GetType(String))
- TmpDT.Columns.Add("CveTamaño", GetType(Integer))
+ TmpDT.Columns.Add("CveTamaño", GetType(Integer))
+
+
Try
Dim ListaPS = JArray.Parse(JsonRequest("details").ToString())
Dim DescuentoTotal As Decimal = JsonRequest("discount").ToString().ToDecimal()
@@ -1245,7 +1416,9 @@ Public Class E141 : Implements IHttpHandler
For Each JsonPS As JObject In ListaPS
Dim Cantidad As Decimal = JsonPS("quantity").ToString.ToDecimal()
- Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, Codigo:=JsonPS("product_sku").ToString()).FiltroPrimero("")
+ Dim CvePS As Integer = GlobalDTPSSimplificado(Codigo:=JsonPS("product_sku").ToString()).FiltroPrimeroValor("CvePS").ToEntero()
+
+ Dim DrPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).FiltroPrimero("")
If DrPS Is Nothing Then
Retorno.TieneError = True
@@ -1487,7 +1660,7 @@ Public Class E141 : Implements IHttpHandler
If Resp.CveVenta > 0 Then
Respuesta.status = "success"
- Respuesta.data = Resp.CveVenta.ToString()
+ Respuesta.data = Resp.SerieFolio
Else
TieneError = True
End If
@@ -1499,6 +1672,8 @@ Public Class E141 : Implements IHttpHandler
Next
RespuestaError.message = sb.ToString()
End If
+
+ ObjFactura.Dispose()
Else
TieneError = True
Dim sb As New StringBuilder()
@@ -2077,7 +2252,8 @@ Public Class E141 : Implements IHttpHandler
New JProperty("age", 0),
New JProperty("gender", 0),
New JProperty("address", ""),
- New JProperty("code", "")
+ New JProperty("code", RowVendedor("CodigoVendedor")),
+ New JProperty("default_branchoffice", RowVendedor("CveSubProyecto"))
)
ArrayVendedores.Add(vendedor)
@@ -2097,6 +2273,10 @@ Public Class E141 : Implements IHttpHandler
End If
End If
+ If CountPeticionesExitosas > 0 Then
+ Retorno = True
+ End If
+
Return Retorno
End Function
#End Region
diff --git a/Bancos/Creditos.aspx.vb b/Bancos/Creditos.aspx.vb
index 437d9c1de..708bd7064 100644
--- a/Bancos/Creditos.aspx.vb
+++ b/Bancos/Creditos.aspx.vb
@@ -983,7 +983,7 @@ Partial Class Bancos_Creditos
For Each gvr As GridViewRow In GvTA.Rows
If Not ObjCredito.UpdateCreditosDetalle(gvr.DataKey("CveCreditoDetalle").ToString.ToEntero, gvr.FCTextBox("TxtFecha").Text.ToString.ToDate, gvr.FCTextBox("TxtCapital").Text.ToString.ToDouble, gvr.FCTextBox("TxtIntereses").Text.ToString.ToDouble,
gvr.FCTextBox("TxtSeguro").Text.ToString.ToDouble, gvr.FCTextBox("TxtIVACapital").Text.ToString.ToDouble,
- gvr.FCTextBox("TxtIVAIntereses").Text.ToString.ToDouble, gvr.FCTextBox("TxtIVASeguro").Text.ToString.ToDouble, 1) Then
+ gvr.FCTextBox("TxtIVAIntereses").Text.ToString.ToDouble, gvr.FCTextBox("TxtIVASeguro").Text.ToString.ToDouble, -1) Then
ErrorCredito = True
Exit For
End If
diff --git a/Bancos/DepositosCaja.aspx b/Bancos/DepositosCaja.aspx
index 05ca350a2..668920538 100644
--- a/Bancos/DepositosCaja.aspx
+++ b/Bancos/DepositosCaja.aspx
@@ -85,14 +85,7 @@
-
-
-
-
-
-
-
-
+
@@ -104,15 +97,16 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -124,16 +118,41 @@
-
-
-
- Importe seleccionado: $00.00
+
+
+
+
+
+
+ Seleccionado: $
+ 00.00
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -201,6 +220,9 @@
diff --git a/Bancos/DepositosCaja.aspx.vb b/Bancos/DepositosCaja.aspx.vb
index d20bfd0df..6d2911286 100644
--- a/Bancos/DepositosCaja.aspx.vb
+++ b/Bancos/DepositosCaja.aspx.vb
@@ -21,6 +21,8 @@ Partial Class Bancos_DepositosCaja
TxtFecha.Text = Now.ToShortDateString
txtFechaI.Text = Now.AddDays(-1).ToShortDateString
txtFechaF.Text = Now.ToShortDateString
+ TxtComision.Attributes.Add("onKeyUp", "txtSuma(event);")
+
CargaCuentas()
End If
End Sub
@@ -35,6 +37,10 @@ Partial Class Bancos_DepositosCaja
DdlSubProyectos.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa)
DdlSubProyectos.DataBind()
DdlSubProyectos.Items.Insert(0, New ListItem("Todos", "-1"))
+
+ DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa)
+ DdlClasificacion.DataBind()
+ DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1"))
End Sub
Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
@@ -56,11 +62,14 @@ Partial Class Bancos_DepositosCaja
GvFacturas.DataBind()
lblValorTotal.Text = "00.00"
divLabelTotal.Visible = True
+ DivComision.Visible = True
End Sub
Private Sub BtnDepositar_Click(sender As Object, e As EventArgs) Handles BtnDepositar.Click
Dim TotalImporte As Decimal = 0
+ Dim TotalImportePrePoliza As Decimal
+
For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then TotalImporte += Gvr.DataKey("Importe").ToDecimal
Next
@@ -70,6 +79,14 @@ Partial Class Bancos_DepositosCaja
Exit Sub
End If
+ TotalImportePrePoliza = TotalImporte
+ If TxtComision.Text.ToEntero > 0 Then
+ TotalImporte = TotalImporte - TxtComision.Text.ToEntero
+ If DdlSubProyectos.SelectedValue.ToEntero = -1 Or DdlClasificacion.SelectedValue.ToEntero = -1 Then
+ Alert("Debes Seleccionar un Subproyecto y una Clasificación", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+ End If
Dim OcurrioError As Boolean = False
Dim ObjContabilidad As New ClsContabilidad()
@@ -88,7 +105,10 @@ Partial Class Bancos_DepositosCaja
Dim CveCuentaBancariaDestino As Integer = 0
Dim drOrigen As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCajaChica.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
Dim drDestino As DataRow = GlobalDTBancosCuentas(UsuarioActual.CveUsuario, CveCuenta:=DdlCuentaDeposito.SelectedValue.ToEntero, CveEmpresa:=UsuarioActual.CveEmpresa).FiltroPrimero("")
-
+ Dim CveSubProyecto As Integer = 0
+ Dim CveClasificacion As Integer = 0
+ Dim documentos As String = "Los Depósitos se realizaron exitósamente
"
+ Dim imprimirFolios As String = ""
If drOrigen IsNot Nothing Then
CveMoneda = drOrigen("CveMoneda").ToString.ToEntero
IdCuentaBancariaOrigen = drOrigen("IdCtaContable").ToString.ToEntero
@@ -101,7 +121,9 @@ Partial Class Bancos_DepositosCaja
CveCuentaBancariaDestino = drDestino("IdCtaContableSIG").ToString.ToEntero
End If
- NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImporte, TotalImporte, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+ NuevaCvePrePoliza = ObjContabilidad.AddPrePolizas("Vta", 13, TotalImportePrePoliza, TotalImportePrePoliza, CveMoneda, Fecha, "Depósito Bancario", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+
'Salida de Caja Chica
FolioIE = ObjBancos.GetNextFolio(DdlCajaChica.SelectedValue.ToEntero, 2)
@@ -110,42 +132,59 @@ Partial Class Bancos_DepositosCaja
End If
CveIEOrigen = ObjBancos.AddBancos_IE(DdlCajaChica.SelectedValue.ToEntero, 2, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
- 'Entrada a Bancos
- FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8)
- If Not FolioIE > 0 Then
- OcurrioError = True
+ If TxtComision.Text.ToEntero > 0 Then
+ CveSubProyecto = DdlSubProyectos.SelectedValue.ToEntero
+ CveClasificacion = DdlClasificacion.SelectedValue.ToEntero
+ If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
+ If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TxtComision.Text.ToEntero, "Comisión", 78, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveClasificacion:=CveClasificacion, CveSubProyecto:=CveSubProyecto, ImporteMX:=TxtComision.Text.ToEntero * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
+ OcurrioError = True
+ End If
+ Else OcurrioError = True
+ End If
+ Else
+ If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
+ OcurrioError = True
+ End If
End If
- CveIEDestino = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", TotalImporte, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
-
For Each Gvr As GridViewRow In GvFacturas.Rows
If Gvr.FCCheckBox("ChkFactura").Checked Then
'Datos de las Nuevas PrePolizas
+ 'Entrada a Bancos
Dim Importe As Double = Gvr.DataKey("Importe").ToDouble
+ Dim SerieFolio As String = Gvr.DataKey("SerieFolio").ToString
'Datos de las Prepolizas A Cancelar
Dim CveIE As Integer = Gvr.DataKey("CveIE").ToEntero
Dim CveVenta As Integer = Gvr.DataKey("CveVenta").ToEntero
Dim CvePrePoliza As Integer = Gvr.DataKey("CvePrePoliza").ToEntero
+ FolioIE = ObjBancos.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToEntero, 8)
+ If Not FolioIE > 0 Then
+ OcurrioError = True
+ End If
+ CveIEDestino = ObjBancos.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToEntero, 8, Fecha, FolioIE.ToString, "Depósito Bancario", Importe, CveMoneda, 1, "Depósito Bancario", "", False, False, -1, NuevaCvePrePoliza, "-1", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
+
+
+ If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, Importe.ToDecimal, SerieFolio, 30, "Depósito Bancario", Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=Importe.ToDecimal * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
+ OcurrioError = True
+ End If
+
'Asignamos la cuenta Deposito
If Not ObjBancos.UpdateBancos_IECuentaDeposito(CveIEDestino, CveIE) Then
OcurrioError = True
End If
-
+ Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
+ documentos += String.Format("Documento {1}     ", CveIEDestino.ToString, SerieFolio)
+ documentos += String.Format("Imprimir {1}
", StrEncript, SerieFolio)
End If
+
Next
- If ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, True, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaOrigen, -1, CveIE:=CveIEOrigen, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaOrigen) Then
- If Not ObjContabilidad.AddPrePolizasDetalle(NuevaCvePrePoliza, False, TotalImporte, "Depósito Bancario", 30, "Depósito Bancario", Fecha, IdCuentaBancariaDestino, -1, CveIE:=CveIEDestino, ImporteMX:=TotalImporte * TipoCambio, CveCuenta:=CveCuentaBancariaDestino) Then
- OcurrioError = True
- End If
- Else OcurrioError = True
- End If
+
If OcurrioError Then
ObjContabilidad.RollBack()
@@ -153,12 +192,8 @@ Partial Class Bancos_DepositosCaja
Else
ObjContabilidad.Commit()
CargaDatos()
- Dim SbMensaje As New StringBuilder()
- Dim StrEncript As String = Encripta($"OP=DC&CveIE={CveIEDestino}&CuentaCaja={DdlCajaChica.SelectedItem.Text}&CuentaDepo={DdlCuentaDeposito.SelectedItem.Text}")
- SbMensaje.Append("Los Depósitos se realizaron exitósamente
")
- SbMensaje.AppendFormat("Documento     ", CveIEDestino)
- SbMensaje.AppendFormat("Imprimir ", StrEncript)
- Alert(SbMensaje.ToString)
+
+ Alert(documentos.ToString)
End If
diff --git a/Bancos/IE.aspx.vb b/Bancos/IE.aspx.vb
index 8cdfd3dcb..d2f2a0233 100644
--- a/Bancos/IE.aspx.vb
+++ b/Bancos/IE.aspx.vb
@@ -6676,5 +6676,6 @@ Partial Class Bancos_IE
End Sub
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
+ Calendario.EndDate = DateTime.Now
End Sub
End Class
\ No newline at end of file
diff --git a/Bancos/PopIECompras.aspx.vb b/Bancos/PopIECompras.aspx.vb
index 06c24cb3b..925566892 100644
--- a/Bancos/PopIECompras.aspx.vb
+++ b/Bancos/PopIECompras.aspx.vb
@@ -3647,6 +3647,8 @@ Partial Class Bancos_PopIECompras
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
+ Calendario.EndDate = DateTime.Now
+
End Sub
diff --git a/Bancos/PopIEVentas.aspx.vb b/Bancos/PopIEVentas.aspx.vb
index 178c34ab4..9b6ae3795 100644
--- a/Bancos/PopIEVentas.aspx.vb
+++ b/Bancos/PopIEVentas.aspx.vb
@@ -3665,6 +3665,8 @@ Partial Class Bancos_PopIEVentas
#End Region
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
+ Calendario.EndDate = DateTime.Now
+
End Sub
diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb
index 8997a0693..6f9274c1e 100644
--- a/Bancos/ProveedoresAbonar.aspx.vb
+++ b/Bancos/ProveedoresAbonar.aspx.vb
@@ -3390,6 +3390,8 @@ Partial Class Bancos_ProveedoresAbonar
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
+ Calendario.EndDate = DateTime.Now
+
End Sub
diff --git a/Bancos/RepComplementoPago.aspx.vb b/Bancos/RepComplementoPago.aspx.vb
index ba740b104..79693c956 100644
--- a/Bancos/RepComplementoPago.aspx.vb
+++ b/Bancos/RepComplementoPago.aspx.vb
@@ -72,23 +72,25 @@ Partial Class Bancos_RepComplementoPago
Dim Banco As New ClsBancos
Banco.IniciaTransacSQL()
-
- If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then
- If Banco.Mensaje = "" Then
- Banco.Commit()
- PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
- Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
- Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
- Str.AppendFormat("{1} {2} ", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
- MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
+ Try
+ If Banco.GeneraTimbrePago(gvr.DataKey("CveIE").ToEntero, -1, UsuarioActual, FechaTimbrado:=FechaTimbrado) Then
+ If Banco.Mensaje = "" Then
+ Banco.Commit()
+ PDFReciboDePagos(-1, -1, Banco.CveComplementoPago, False)
+ Str.AppendFormat("Folio: {0} ", Banco.ComplementoSerieFolio)
+ Str.AppendFormat("XML ", Encripta(String.Format("OP=CompP&EXT=xml&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
+ Str.AppendFormat("PDF ", Encripta(String.Format("OP=CompP&EXT=pdf&SerieFolio={0}&CveComplementoPago={1}", Banco.ComplementoSerieFolio, Banco.CveComplementoPago)))
+ Str.AppendFormat("{1} {2} ", gvr.DataKey("CveIE"), gvr.DataKey("Folio"), gvr.DataKey("NombreCliente"))
+ MandaCorreo(Banco.ComplementoSerieFolio, gvr.DataKey("CobranzaCorreo"))
+ End If
+ Else
+ Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
+ Banco.RollBack()
End If
-
- Else
- Str.AppendFormat("No se genero complemento del Folio {0} por el siguiente motivo: {1}", gvr.DataKey("Folio"), Banco.Mensaje)
+ Catch ex As Exception
+ OnError("Ocurrió un error al generar el complemento de pago", ex)
Banco.RollBack()
- End If
-
+ End Try
Banco.Dispose()
End If
Next
diff --git a/CRM/RepAcercamientosProcesosDetalle.aspx b/CRM/RepAcercamientosProcesosDetalle.aspx
index 61d484036..5559826fa 100644
--- a/CRM/RepAcercamientosProcesosDetalle.aspx
+++ b/CRM/RepAcercamientosProcesosDetalle.aspx
@@ -3,6 +3,7 @@
+
+ .chkChoice input
+ {
+ margin-right: 5px;
+ }
+
+ cc
Reporte Detalle de los Acercamientos Procesos
@@ -55,7 +61,15 @@
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Inventarios/ReconstruirCostos.aspx.vb b/Inventarios/ReconstruirCostos.aspx.vb
new file mode 100644
index 000000000..1f082cf1d
--- /dev/null
+++ b/Inventarios/ReconstruirCostos.aspx.vb
@@ -0,0 +1,88 @@
+Option Explicit On
+Option Strict On
+
+Imports Extensiones
+Imports System.Data
+Partial Class Inventario_ReconstruirCostos
+ Inherits ClsPaginas
+
+ Private Property FacturasCheckadas As Integer
+ Get
+ Return ViewState("FacturasCheckadas").ToString.ToEntero
+ End Get
+ Set(value As Integer)
+ ViewState("FacturasCheckadas") = value
+ End Set
+ End Property
+
+ Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
+ If Not IsPostBack Then
+ CargaClasificaciones()
+ CargaMarcas()
+ End If
+ End Sub
+ Private Sub CargaClasificaciones()
+
+ If UsuarioActual.Empresa.UsaAC Then
+ DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros(" Codigo = '' OR Codigo IS NULL ", Orderby:="Clasificacion")
+ Else
+ DdlClasificacion.DataSource = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltraParametros("", Orderby:="Clasificacion")
+ End If
+ DdlClasificacion.DataBind()
+ End Sub
+
+ Private Sub CargaMarcas()
+
+ Dim ObjPS As New ClsProductosServicios
+
+ If ObjPS.GetMarcas(UsuarioActual.CveEmpresa) Then
+ DdlMarca.DataSource = ObjPS.DtResultados
+ DdlMarca.DataBind()
+
+ End If
+ ObjPS.Dispose()
+ End Sub
+ Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click
+ CargaDatos()
+ End Sub
+
+ Private Sub CargaDatos()
+
+
+ Dim ObjPS As New ClsProductosServicios
+ ObjPS.GetPS(-1, DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveMarca:=DdlMarca.SelectedValue.ToEntero)
+ If ObjPS.DtResultados.Rows.Count > 0 Then
+ GvProdcutos.DataSource = ObjPS.DtResultados
+ GvProdcutos.DataBind()
+ UpGvProductos.Update()
+ End If
+ ObjPS.Dispose()
+ End Sub
+ Private Sub BtnReconstruir_Click(sender As Object, e As EventArgs) Handles BtnReconstruir.Click
+ Dim objInv As New ClsInventarios
+ Dim TieneError As Boolean = False
+ Dim Producto As String = ""
+
+ For Each Gvr As GridViewRow In GvProdcutos.Rows
+ If Gvr.FCCheckBox("ChkProducto").Checked Then
+ Dim CvePS As Integer = Gvr.DataKey("CvePS").ToEntero
+ If Not objInv.ReconstruirCostos(CvePS, UsuarioActual.CveEmpresa) Then
+ TieneError = True
+ Producto += String.Format("{0} ", Gvr.DataKey("PS").ToString)
+
+ End If
+ End If
+ Next
+
+ If TieneError Then
+ Alert(String.Format("Error al reconstruir los costos en los siguientes productos: {0}", Producto), TipoMensaje.MsgError)
+ Else
+ Alert("Se realizo el cambio correctamente", TipoMensaje.MsgConfirmacion)
+
+ End If
+
+ objInv.Dispose()
+ End Sub
+
+
+End Class
\ No newline at end of file
diff --git a/Nomina/Nomina2.aspx b/Nomina/Nomina2.aspx
index 333d3376b..27158a68e 100644
--- a/Nomina/Nomina2.aspx
+++ b/Nomina/Nomina2.aspx
@@ -153,6 +153,9 @@
Ver provisión
+
+ Ver provisión Asimilados
+
Timbrar todos
diff --git a/Sistemas/PopUpAddUsuario.aspx.vb b/Sistemas/PopUpAddUsuario.aspx.vb
index b48a4fd17..1ec6d9763 100644
--- a/Sistemas/PopUpAddUsuario.aspx.vb
+++ b/Sistemas/PopUpAddUsuario.aspx.vb
@@ -1,7 +1,7 @@
Imports Extensiones
Imports System.Data
Partial Class Sistemas_PopUpAddUsuario
- Inherits ClsPaginas
+ Inherits ClsPaginas
#Region "PROPIEDADES"
Public Property CveCliente As Integer
Get
@@ -51,7 +51,7 @@ Partial Class Sistemas_PopUpAddUsuario
Set(value As Integer)
ViewState("CvePlataforma") = value
End Set
- End Property
+ End Property
#End Region
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
@@ -164,8 +164,14 @@ Partial Class Sistemas_PopUpAddUsuario
If ObjUsuario.UpdateUsuario(LtlUsuario.Text, TxtNombre.Text, -1, TxtEmail.Text, -1, -1, True, True, -1, CveUsuario, -1, -1) Then
Alert("La contraseña se reestableció correctamente a la contraseña por default '-acceso-'.")
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
- EnviaCorreo(Liga, LigaActivar)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
+
+ If UsuarioActual.Empresa.CvePlataforma = 3 Then
+ EnviaCorreoGPS(Liga, LigaActivar)
+ Else
+ EnviaCorreo(Liga, LigaActivar)
+ End If
+
End If
End If
ObjUsuario.Dispose()
@@ -251,8 +257,14 @@ Partial Class Sistemas_PopUpAddUsuario
'ENVIA CORREO
If CveUsuario > 0 Then
Dim Liga As String = $"{Context.Request.Url.OriginalString.Substring(0, Context.Request.Url.OriginalString.Length - Context.Request.Url.PathAndQuery.Length)}/LogIn.aspx"
- Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
- Mensaje = EnviaCorreo(Liga, LigaActivar)
+ Dim LigaActivar As String = Liga & "?p=" & Encripta("CveU=" & CveUsuario & "&Clave=" & "-acceso-" & "&Opcion=Activar&Hora=" & DateTime.Now.Ticks& & "&CveE=" & UsuarioActual.CveEmpresa)
+
+ If UsuarioActual.Empresa.CvePlataforma = 3 Then
+ Mensaje = EnviaCorreoGPS(Liga, LigaActivar)
+ Else
+ Mensaje = EnviaCorreo(Liga, LigaActivar)
+ End If
+
Else
HuboError = True
End If
@@ -651,16 +663,139 @@ Partial Class Sistemas_PopUpAddUsuario
OnError("Ocurrió error al mandar MAIL", ex)
End Try
+ Return Retorno
+ End Function
+
+ Private Function EnviaCorreoGPS(Liga As String, LigaActivar As String) As String
+ Dim Retorno As String = ""
+ Try
+ 'Dim URL As String = "https://gps.signalsgps.com/" + LigaActivar
+
+ Dim Para = TxtEmail.Text.Trim
+ Dim Asunto = "ACCESO A SIGNALS GPS"
+
+ 'Dim SBBody As New StringBuilder
+ ''Linia de estilos
+ 'SBBody.Append("")
+ ''incio Cuerpo del correo
+ 'SBBody.Append("
")
+ 'SBBody.Append("
")
+ 'SBBody.Append("
")
+ 'SBBody.Append("ALTA DE CUENTA")
+ 'SBBody.Append("
")
+ 'SBBody.Append(" ")
+ 'SBBody.AppendFormat(" Estimado {0}: ", TxtNombre.Text.ToUpper)
+ 'SBBody.AppendFormat("El presente correo es para informarle que se le han asignado los siguientes datos para el acceso a la Plataforma de: {0}
")
+ 'Termino Cuerpo del correo
+
+ Dim Hilo As New System.Threading.Thread(Sub() MandaCorreo(Asunto, Para, SBBody.ToString))
+ Hilo.Start()
+
+ 'Dim JSBTN As String = ""
+ 'If UsuarioActual.CveCliente > 0 Then
+ ' JSBTN = $"document.location.href=""javascript: Ir2({CveCliente})"";"
+ 'ElseIf CveCliente > 0 Then
+ ' JSBTN = $"document.location.href=""javascript:Ir({CveCliente})"";"
+ 'End If
+ 'If UsuarioActual.Empresa.CvePlataforma = 3 Then
+ ' Alert("El correo se ha enviado correctamente a: " + TxtEmail.Text + ".", TipoMensaje.MsgInformacion, JSBTN)
+ 'End If
+
+ Retorno = $"El correo se ha enviado correctamente a: {TxtEmail.Text}."
+
+ Catch ex As Exception
+ OnError("Ocurrió error al mandar MAIL", ex)
+ End Try
+
Return Retorno
End Function
Private Sub MandaCorreo(Asunto As String, Para As String, Body As String)
Dim a As String = String.Format("{0} -- {1} ---- -->", Asunto, Para)
a.GuardaLog()
Dim Mail As New ClsSisMail()
- Mail.SendMail(ClsPaginas.EmpresaNotificaciones, Para, Asunto, Body)
- End Sub
-#End Region
+ Dim EmpresaEnvio As Empresa = ClsPaginas.EmpresaNotificaciones
+
+ If UsuarioActual.Empresa.CvePlataforma = 3 Then
+ EmpresaEnvio = ClsPaginas.EmpresaNotificacionesGPS
+ End If
+
+ Mail.SendMail(EmpresaEnvio, Para, Asunto, Body)
+ End Sub
+#End Region
+
#Region "M O D U L O S"
Public Sub CargaModulosAcceso()
Dim ObjPermisos As New ClsSisUsuarios
@@ -808,11 +943,11 @@ Partial Class Sistemas_PopUpAddUsuario
End If
End If
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
#Region "V E H I C U L O S"
Private Sub CargaDispositivos()
GvDispositivos.DataSource = GlobalDTDispositivos(CveCliente).FiltraParametros("Estatus = 1 ")
@@ -826,10 +961,10 @@ Partial Class Sistemas_PopUpAddUsuario
End If
End If
End If
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "N O T I F I C A C I O N E S"
Private Sub CargarNotificaciones()
Dim ObjNotificaciones As New ClsSisNotificaciones
@@ -851,11 +986,11 @@ Partial Class Sistemas_PopUpAddUsuario
e.Row.FCCheckBox("chkApp").Checked = If(DtNotificacionesUsuarios.FiltroPrimeroValor("Alerta_App", $"CveNotificacion = {e.Row.DBCampo("CveNotificacion")}").ToString = "True", True, False)
End If
End If
- End Sub
-
-
+ End Sub
+
+
#End Region
-
+
Protected Sub BtnCambiarUsuario_Click(sender As Object, e As EventArgs)
CveUsuario = -1
diff --git a/Site.master b/Site.master
index 0996ebb05..6c399c64c 100644
--- a/Site.master
+++ b/Site.master
@@ -6,7 +6,7 @@
- Sistema de Información Gerencial
+ Sistema de Información Gerencial
diff --git a/Site.master.vb b/Site.master.vb
index e35e3893b..899461f8d 100644
--- a/Site.master.vb
+++ b/Site.master.vb
@@ -76,6 +76,7 @@ Partial Class Site
If UsuarioActual.Empresa.CvePlataforma = 3 Then
lnkFavicon.Href = "/Imagenes/favicongps.ico"
+ tTitulo.Text = "SIGNALS GPS"
Else
lnkFavicon.Href = "/Imagenes/favicon.ico"
End If
diff --git a/Ventas/ClientesAbonar.aspx b/Ventas/ClientesAbonar.aspx
index 0c2dc1e61..61dbde5f6 100644
--- a/Ventas/ClientesAbonar.aspx
+++ b/Ventas/ClientesAbonar.aspx
@@ -365,7 +365,7 @@
Complemento Pago
-
+
diff --git a/Ventas/ClientesAbonar.aspx.vb b/Ventas/ClientesAbonar.aspx.vb
index 359ed6e11..fc2aa4147 100644
--- a/Ventas/ClientesAbonar.aspx.vb
+++ b/Ventas/ClientesAbonar.aspx.vb
@@ -639,11 +639,10 @@ Partial Class Ventas_ClientesAbonar
If e.Row.DBCampo("CveVenta").ToEntero > 0 Then
If e.Row.DataKey("ClaveMetodoPagoSAT") = "PUE" Then
- e.Row.FCLinkButton("LnkComplemento").Text = ""
- e.Row.FCLinkButton("LnkComplemento").CssClass = "text-danger"
+ e.Row.FCLiteral("LtlComplemento").Text = ""
End If
Else
- e.Row.FCLinkButton("LnkComplemento").Visible = False
+ e.Row.FCLiteral("LtlComplemento").Visible = False
End If
@@ -3179,5 +3178,7 @@ Partial Class Ventas_ClientesAbonar
Private Sub RVTxtFechaDocumento_Init(sender As Object, e As EventArgs) Handles RVTxtFechaDocumento.Init
RVTxtFechaDocumento.MaximumValue = DateTime.Now.ToShortDateString
+ Calendario.EndDate = DateTime.Now
+
End Sub
End Class
diff --git a/Ventas/PV.aspx b/Ventas/PV.aspx
index fdfef6fe7..0ac8d7586 100644
--- a/Ventas/PV.aspx
+++ b/Ventas/PV.aspx
@@ -2953,7 +2953,7 @@