This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-07-08 07:35:48 -07:00
48 changed files with 2797 additions and 2667 deletions

View File

@@ -190,8 +190,8 @@ Partial Class AC_RegDevengadoIngresos
'Detalles de PrePoliza 'Detalles de PrePoliza
If Not ErrorAC Then If Not ErrorAC Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 30, "", Now, 0, -1, CveIE) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 30, "", "", -1, CveIE) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 4, "", Now, 0, -1, CveIE) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 4, "", "", -1, CveIE) Then
ErrorAC = True ErrorAC = True
End If End If
Else Else

View File

@@ -165,8 +165,8 @@ Partial Class AC_RegRecaudado
'Detalles de PrePoliza 'Detalles de PrePoliza
If Not ErrorAC Then If Not ErrorAC Then
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 30, "", Fecha, 0, -1, CveIE, CveCliente:=CveCliente) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 30, "", "", 0, CveIE, CveCliente:=CveCliente) Then
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtImporte.Text.ToDouble, "", 4, "", Fecha, 0, -1, CveIE, CveCliente:=CveCliente) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtImporte.Text.ToDecimal, TxtImporte.Text.ToDecimal, 4, "", "", 0, CveIE, CveCliente:=CveCliente) Then
ErrorAC = True ErrorAC = True
End If End If
Else Else

View File

@@ -649,7 +649,7 @@ Public Class CFDIComplementoPago
.Base = t.Sum(Function(tt) tt.Base), .Base = t.Sum(Function(tt) tt.Base),
.Importe = t.Sum(Function(tt) tt.Importe), .Importe = t.Sum(Function(tt) tt.Importe),
.BaseMN = t.Sum(Function(tt) tt.BaseMN).TruncateDecimal, '' se trunca solo al final, NO EN EL DESGLOSE .BaseMN = t.Sum(Function(tt) tt.BaseMN).TruncateDecimal, '' se trunca solo al final, NO EN EL DESGLOSE
.ImporteMN = t.Sum(Function(tt) tt.ImporteMN)}) _ .ImporteMN = t.Sum(Function(tt) tt.ImporteMN).TruncateDecimal}) _
.OrderBy(Function(x) x.Impuesto).ToList .OrderBy(Function(x) x.Impuesto).ToList
End If End If

View File

@@ -1329,7 +1329,7 @@ Public Class ClsCompras
#Region "I M P O R T A C I O N E S" #Region "I M P O R T A C I O N E S"
Public Function GetImportaciones(CveImportacion As Integer, CveProveedor As Integer, CveActivoFijo As Integer, FechaInicio As String, FechaFin As String, CveEmpresa As Integer) As Boolean Public Function GetImportaciones(CveImportacion As Integer, CveProveedor As Integer, CveActivoFijo As Integer, FechaInicio As String, FechaFin As String, CveEmpresa As Integer, Optional CveEstatus As Integer = -1) As Boolean
Dim Retorno = False Dim Retorno = False
@@ -1342,6 +1342,7 @@ Public Class ClsCompras
.Add("@FechaI", SqlDbType.VarChar).Value = FechaInicio .Add("@FechaI", SqlDbType.VarChar).Value = FechaInicio
.Add("@FechaF", SqlDbType.VarChar).Value = FechaFin .Add("@FechaF", SqlDbType.VarChar).Value = FechaFin
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus
End With End With
Try Try

View File

@@ -1014,7 +1014,7 @@ Public Class ClsContabilidad
Return Retorno Return Retorno
End Function End Function
Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, Referencia As String, CveConceptoContable As Integer, Concepto As String, IdCtaContable As Integer, Public Function AddPrePolizasDetalle(CvePrePoliza As Integer, TipoMovimiento As Boolean, Importe As Decimal, ImporteMN As Decimal, CveConceptoContable As Integer, Referencia As String, Concepto As String, IdCtaContable As Integer,
Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveIE As Integer = -1, Optional CveVenta As Integer = -1, Optional CveCompra As Integer = -1, Optional CveSubProyecto As Integer = -1, Optional CveCliente As Integer = -1, Optional CveProveedor As Integer = -1,
Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveMovimientoAlmacen As Integer = -1, Optional CveActivoFijo As Integer = -1, Optional CveColectiva As Integer = -1, Optional CveCreditoDetalle As Integer = -1,
Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0, Optional CveOC As Integer = -1, Optional CveClasificacion As Integer = -1, Optional CveVentaAmortizacion As Integer = -1, Optional CveCompraAmortizacion As Integer = -1, Optional ImporteME As Decimal = 0,

View File

@@ -1665,7 +1665,7 @@ Public Class ClsInventarios
End Function End Function
Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer, Public Function GetProductosCaducidad(CveProveedor As Integer, FechaInicio As Date, FechaFin As Date, CveSubProyecto As Integer, CveClasificacion As Integer, CvePS As Integer,
CvesAlmacenes As String, CveUsuario As Integer, CveEmpresa As Integer, Optional Opcion As Integer = 1) As Boolean CvesAlmacenes As String, CveUsuario As Integer, CveEmpresa As Integer, Optional Opcion As Integer = 1, Optional CveCompuesto As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ProductosCaducidadGet") DataAdapter("PA_Inv_ProductosCaducidadGet")
@@ -1681,6 +1681,7 @@ Public Class ClsInventarios
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@Opcion", SqlDbType.Int).Value = Opcion .Add("@Opcion", SqlDbType.Int).Value = Opcion
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
End With End With
Try Try
@@ -5052,6 +5053,47 @@ Public Class ClsInventarios
Return Retorno Return Retorno
End Function End Function
Public Function UpdateFleteCierre(CveFlete As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_FletesCierreUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveFlete", SqlDbType.Int).Value = CveFlete
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar el flete.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
Public Function UpdateImportacionCierre(CveImportacion As Integer, CveEmpresa As Integer, CveUsuario As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_ImportacionCierreUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveImportacion", SqlDbType.Int).Value = CveImportacion
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch ex As Exception
OnError("Ocurrió un error al actualizar la importación.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End Try
Return Retorno
End Function
#End Region #End Region
#Region " FLETES COMPRAS " #Region " FLETES COMPRAS "
@@ -5915,128 +5957,6 @@ Public Class ClsInventarios
#Region "VIGENCIA COMPUESTOS" #Region "VIGENCIA COMPUESTOS"
Public Function AddCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, RegistroRSCO As String, FechaVigencia As Date, VigenciaIndeterminada As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CompuestosVigenciaAdd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO
.Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia
.Add("@VigenciaIndeterminada", SqlDbType.Bit).Value = VigenciaIndeterminada
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("IX_Inv_CveCompuestoCveProveedorFechaVigneciaCveEmpresa") Then
Alert($"Ya existe un RSCO con los datos especificados (proveedor, compuesto, Fecha de vigencia).", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("UNIX_Inv_RegistroRSCO") Then
Alert($"El RSCO {RegistroRSCO} ya se encuentra registrado.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al guardar la vigencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al guardar la vigencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function UpdateCompuestosVigencia(CveCompuestoVigencia As Integer, CveCompuesto As Integer, CveProveedor As Integer, RegistroRSCO As String, FechaVigencia As Date, VigenciaIndeterminada As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CompuestosVigenciaUpdate")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompuestoVigencia", SqlDbType.Int).Value = CveCompuestoVigencia
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO
.Add("@FechaVigencia", SqlDbType.Date).Value = FechaVigencia
.Add("@VigenciaIndeterminada", SqlDbType.Bit).Value = VigenciaIndeterminada
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
If Ex1.Message.Contains("IX_Inv_CveCompuestoCveProveedorFechaVigneciaCveEmpresa") Then
Alert($"Ya existe un RSCO con los datos especificados (proveedor, compuesto, Fecha de vigencia).", TipoMensaje.MsgAdvertencia)
ElseIf Ex1.Message.Contains("UNIX_Inv_RegistroRSCO") Then
Alert($"El RSCO {RegistroRSCO} ya se encuentra registrado.", TipoMensaje.MsgAdvertencia)
Else
Me.OnError("Ocurrió un error al actualizar la vigencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
End If
Catch ex As Exception
OnError("Ocurrió un error al actualizar el RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RemoveCompuestosVigencia(CveCompuestoVigencia As Integer, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CompuestosVigenciaRemove")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompuestoVigencia", SqlDbType.Int).Value = CveCompuestoVigencia
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al eliminar el RSCO.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al eliminar el RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function GetCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_CompuestosVigenciaGet")
With SqlAdapter.SelectCommand.Parameters
.Add("@CveCompuesto", SqlDbType.Int).Value = CveCompuesto
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedor
.Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@VigenciaIndeterminada", SqlDbType.Int).Value = VigenciaIndeterminada
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
End With
Try
SqlAdapter.Fill(Data)
Retorno = True
Catch Ex1 As SqlException
Me.OnError("Ocurrió un error al obtener los RSCO", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
Catch ex As Exception
OnError("Ocurrió un error al obtener los RSCO.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
End Try
Return Retorno
End Function
Public Function RepCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean Public Function RepCompuestosVigencia(CveCompuesto As Integer, CveProveedor As Integer, FechaI As Date, FechaF As Date, VigenciaIndeterminada As Boolean, CveEmpresa As Integer) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False

View File

@@ -35,7 +35,7 @@ Public Class ClsPaginas
Public ReadOnly Property EsProduccion As Boolean Public Shared ReadOnly Property EsProduccion As Boolean
Get Get
If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then If IsNothing(System.Configuration.ConfigurationManager.AppSettings("EsProduccion")) Then
Return False Return False
@@ -3899,7 +3899,7 @@ Public Class ClsPaginas
Application("GlobalDTPaqueteriaGuiaTipos") = value Application("GlobalDTPaqueteriaGuiaTipos") = value
End Set End Set
End Property End Property
Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1, Public Shared Property GlobalDTClasificacionPorcentaje(CveEmpresa As Integer, Optional CveClasicacionPorcentaje As Integer = -1, Optional CveClasicacion As Integer = -1,
Optional PorcentajeIVA As Double = -1) As DataTable Optional PorcentajeIVA As Double = -1) As DataTable
Get Get
@@ -3909,15 +3909,15 @@ Public Class ClsPaginas
If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje) If CveClasicacionPorcentaje <> -1 Then Str.AppendFormat(" {0} CveClasicacionPorcentaje = {1}", If(Str.Length > 0, "AND", ""), CveClasicacionPorcentaje)
If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion) If CveClasicacion <> -1 Then Str.AppendFormat(" {0} CveClasicacion = {1}", If(Str.Length > 0, "AND", ""), CveClasicacion)
If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA) If PorcentajeIVA <> -1 Then Str.AppendFormat(" {0} PorcentajeIVA = {1}", If(Str.Length > 0, "AND", ""), PorcentajeIVA)
Dim Dv As New DataView(DirectCast(Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows) Dim Dv As New DataView(DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
GlobalDTClasificacionPorcentaje = Dv.ToTable GlobalDTClasificacionPorcentaje = Dv.ToTable
Dv.Dispose() Dv.Dispose()
Else Else
GlobalDTClasificacionPorcentaje = DirectCast(Application("GlobalDTClasificacionPorcentaje"), DataTable) GlobalDTClasificacionPorcentaje = DirectCast(HttpContext.Current.Application("GlobalDTClasificacionPorcentaje"), DataTable)
End If End If
End Get End Get
Set(value As DataTable) Set(value As DataTable)
Application("GlobalDTClasificacionPorcentaje") = value HttpContext.Current.Application("GlobalDTClasificacionPorcentaje") = value
End Set End Set
End Property End Property
Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable Property GlobalDTPaqueterias(CveEmpresa As Integer, Optional TipoPaqueteria As Integer = -1) As DataTable
@@ -5603,7 +5603,7 @@ Public Class ClsPaginas
PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1) PaginaDict.Add("/Contabilidad/OCDetalleAlmacen.aspx".ToUpper(), -1)
PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326) PaginaDict.Add("/Agropecuaria/CierreCultivo.aspx".ToUpper(), 1326)
PaginaDict.Add("/Inventarios/RegRSCO.aspx".ToUpper(), 1327)
PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328) PaginaDict.Add("/Inventarios/RepRSCO.aspx".ToUpper(), 1328)

View File

@@ -416,12 +416,15 @@ Public Class ClsProductosServicios
Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False,
Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0) As Integer Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False) As Integer
Dim Retorno As Integer = -1 Dim Retorno As Integer = -1
DataAdapter("PA_ProductosServiciosAdd") DataAdapter("PA_ProductosServiciosAdd")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
.Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion .Add("@CveClasificacion", SqlDbType.Int).Value = CveClasificacion
.Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto .Add("@CveClasificacionCosto", SqlDbType.Int).Value = CveClasificacionCosto
.Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida .Add("@CveUnidadMedida", SqlDbType.Int).Value = CveUnidadMedida
@@ -506,6 +509,10 @@ Public Class ClsProductosServicios
.Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones
.Add("@CveObjetoImpuesto", SqlDbType.TinyInt).Value = CveObjetoImpuesto .Add("@CveObjetoImpuesto", SqlDbType.TinyInt).Value = CveObjetoImpuesto
.Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO
.Add("@FechaVigenciaRSCO", SqlDbType.Date).Value = FechaVigenciaRSCO
.Add("@VigenciaIndeterminadaRSCO", SqlDbType.Bit).Value = VigenciaIndeterminadaRSCO
End With End With
Try Try
@@ -653,7 +660,8 @@ Public Class ClsProductosServicios
Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "", Optional CveClasificacionDetalle As Integer = -1, Optional CveTamaño As Integer = -1, Optional CveModelo As Integer = -1, Optional CveMedida As Integer = -1, Optional CveRinTamaño As Integer = -1, Optional ClaveImpuestoEmpaque As String = "", Optional ClaveImpuestoUM As String = "",
Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False, Optional ClaveCategoriaToxicidad As String = "", Optional ClaveImpuestoTipoProducto As String = "", Optional Litraje As Double = -1, Optional EsOutSourcing As Boolean = False,
Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False, Optional AplicaSerie As Boolean = False, Optional AplicaLote As Boolean = False, Optional AplicaCaducidad As Boolean = False, Optional AplicaSeccion As Boolean = False, Optional TiempoCaducidad As Integer = -1, Optional CvePSAdicionalVigencia As Integer = -1, Optional PrecioLibre As Boolean = False,
Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0) As Boolean Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0,
Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
@@ -745,6 +753,10 @@ Public Class ClsProductosServicios
.Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones .Add("@Dimensiones", SqlDbType.VarChar).Value = Dimensiones
.Add("@CveObjetoImpuesto", SqlDbType.TinyInt).Value = CveObjetoImpuesto .Add("@CveObjetoImpuesto", SqlDbType.TinyInt).Value = CveObjetoImpuesto
.Add("@RegistroRSCO", SqlDbType.VarChar).Value = RegistroRSCO
.Add("@FechaVigenciaRSCO", SqlDbType.Date).Value = FechaVigenciaRSCO
.Add("@VigenciaIndeterminadaRSCO", SqlDbType.Bit).Value = VigenciaIndeterminadaRSCO
End With End With
Try Try

View File

@@ -5397,7 +5397,7 @@ Public Class ClsVentas
Return Retorno Return Retorno
End Function End Function
Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha) As Boolean Public Function GetAutorizacionLimite(CveEmpresa As Integer, CveCliente As Integer, CveVendedor As Integer, TipoDocumento As String, Optional CveEstatus As Integer = -1, Optional FechaI As DateTime = MinFecha, Optional FechaF As DateTime = MaxFecha, Optional CveUsuarioConsulta As Integer = -1) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
DataAdapter("PA_Vta_AutorizacionLimitesGet") DataAdapter("PA_Vta_AutorizacionLimitesGet")
With SqlAdapter.SelectCommand.Parameters With SqlAdapter.SelectCommand.Parameters
@@ -5408,6 +5408,7 @@ Public Class ClsVentas
.Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento .Add("@TipoDocumento", SqlDbType.VarChar).Value = TipoDocumento
.Add("@FechaI", SqlDbType.Date).Value = FechaI .Add("@FechaI", SqlDbType.Date).Value = FechaI
.Add("@FechaF", SqlDbType.Date).Value = FechaF .Add("@FechaF", SqlDbType.Date).Value = FechaF
.Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta
End With End With
Try Try
SqlAdapter.Fill(Data) SqlAdapter.Fill(Data)

View File

@@ -102,7 +102,7 @@ Public Class Empresa
Public Property RutaArchivos As String Public Property RutaArchivos As String
Public ReadOnly Property Ruta As String Public ReadOnly Property Ruta As String
Get Get
If Not String.IsNullOrEmpty(RutaArchivos) Then If Not String.IsNullOrEmpty(RutaArchivos) AndAlso ClsPaginas.EsProduccion Then
Return RutaArchivos Return RutaArchivos
Else Else
Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa) Return String.Format("{0}\{1}\", Extensiones.ModExtensiones.DirectorioEmpresas, Me.CveEmpresa)

View File

@@ -2251,13 +2251,13 @@ Namespace Modelos
For Each RowInv As DataRow In DtMovimientosEntrada.Rows For Each RowInv As DataRow In DtMovimientosEntrada.Rows
ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL ValorInventario = DtMovimientosEntrada.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, Concepto, tCveConcepto, Concepto, tFecha, -1, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-ValorInventario, CveSubProyecto:=tCveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, -ValorInventario, -ValorInventario, tCveConcepto, Concepto, Concepto, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, CveSubProyecto:=tCveSubProyecto) Then
CveMovimiento = -1 CveMovimiento = -1
Exit For Exit For
End If End If
Next Next
If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, Concepto, 68, Concepto, tFecha, -1, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=-DtMovimientosEntrada.SUMD("Total").RoundSQL) Then If CveMovimiento > 0 AndAlso Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, -DtMovimientosEntrada.SUMD("Total").RoundSQL, -DtMovimientosEntrada.SUMD("Total").RoundSQL, 68, Concepto, Concepto, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento) Then
CveMovimiento = -1 CveMovimiento = -1
End If End If
End If End If

View File

@@ -1647,7 +1647,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
End If End If
End While End While
xtr.Close() xtr.Close()
xtr.
End Using End Using
If (System.IO.File.Exists(urfile)) Then If (System.IO.File.Exists(urfile)) Then
Dim fechita As DateTime = fecha.ToDateTime() Dim fechita As DateTime = fecha.ToDateTime()

View File

@@ -686,7 +686,7 @@ Partial Class Bancos_Creditos
If TipoCreditoTemp = 2 AndAlso DdlCuentaDeposito.SelectedValue.ToEntero > 0 Then If TipoCreditoTemp = 2 AndAlso DdlCuentaDeposito.SelectedValue.ToEntero > 0 Then
Folio = ObjCredito.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToString.ToEntero, 8).ToString Folio = ObjCredito.GetNextFolio(DdlCuentaDeposito.SelectedValue.ToString.ToEntero, 8).ToString
If Folio <> "" Then If Folio <> "" Then
CvePrePoliza = ObjMov.AddPrePolizas("Creditos", 2, 0, 0, 1, TxtFechaDeposito.Text.ToDate, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CvePrePoliza = ObjMov.AddPrePolizas("Creditos", 2, 0, 0, 1, TxtFechaDeposito.Text.ToDate, TxtCSReferencia.Text, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
CveIE = ObjCredito.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToString.ToEntero, 8, TxtFechaDeposito.Text.ToDate, Folio, LtBancoDeposito.Text, TxtCSTotalCredito.Text.ToString.ToDouble, 1, 1, "Credito Revolvente", "", True, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) CveIE = ObjCredito.AddBancos_IE(DdlCuentaDeposito.SelectedValue.ToString.ToEntero, 8, TxtFechaDeposito.Text.ToDate, Folio, LtBancoDeposito.Text, TxtCSTotalCredito.Text.ToString.ToDouble, 1, 1, "Credito Revolvente", "", True, False, 0, CvePrePoliza, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If CveIE < 0 Then If CveIE < 0 Then
@@ -695,7 +695,7 @@ Partial Class Bancos_Creditos
'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToString.ToDouble, "Crédito", 50, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToString.ToDouble) Then 'If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToString.ToDouble, "Crédito", 50, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToString.ToDouble) Then
' ErrorCredito = True ' ErrorCredito = True
'End If 'End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtCSTotalCredito.Text.ToDecimal, "Crédito", 30, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToDecimal) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToDecimal, "Crédito", 30, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToDecimal) Then
ErrorCredito = True ErrorCredito = True
End If End If
Else Else
@@ -715,7 +715,7 @@ Partial Class Bancos_Creditos
If CveIE < 0 Then If CveIE < 0 Then
ErrorCredito = True ErrorCredito = True
End If End If
If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, TxtCSTotalCredito.Text.ToDecimal, "Crédito", 30, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToDecimal) Then If Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, True, TxtCSTotalCredito.Text.ToDecimal, "Crédito", 30, "", Now, 0, -1, CveIE, ImporteMX:=TxtCSTotalCredito.Text.ToDecimal) Then
ErrorCredito = True ErrorCredito = True
End If End If

View File

@@ -183,7 +183,7 @@ Partial Class Bancos_CreditosPagoMultiple
Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click Protected Sub BtnIEGuardar_Click(sender As Object, e As EventArgs) Handles BtnIEGuardar.Click
Dim Total As Double = 0 Dim Total As Decimal = 0
For Each gvr As GridViewRow In GvV.Rows For Each gvr As GridViewRow In GvV.Rows
If gvr.FCCheckBox("Chk").Checked Then If gvr.FCCheckBox("Chk").Checked Then
Total += gvr.DataKey("Total").ToDouble Total += gvr.DataKey("Total").ToDouble
@@ -205,7 +205,7 @@ Partial Class Bancos_CreditosPagoMultiple
Dim CveConceptoContable As Integer = 30 Dim CveConceptoContable As Integer = 30
Dim CveConceptoCompra As Integer = 48 Dim CveConceptoCompra As Integer = 48
' Dim CveCreditoDetalle As Integer = -1 ' Dim CveCreditoDetalle As Integer = -1
Dim CIF As Double = 0 Dim CIF As Decimal = 0
Dim CvePlantillaPoliza As Integer = 5 Dim CvePlantillaPoliza As Integer = 5
Dim TC As Double = 1.0 Dim TC As Double = 1.0
Dim Estatus As Integer = 2 Dim Estatus As Integer = 2
@@ -260,8 +260,8 @@ Partial Class Bancos_CreditosPagoMultiple
ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle) ObjIE.UpdateCreditosDetalle(Estatus, CveCreditoDetalle)
Dim IVA As Double = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble Dim IVA As Decimal = 0 ' TxtImporte.Text.ToDouble * HdnProvPorIVA.Value.ToDouble
If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, gvr.DataKey("Total").ToDouble - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then If ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, gvr.DataKey("Total").ToDecimal - IVA - CIF, TxtObservaciones.Text, CveConceptoCompra, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then
If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then If IVA > 0 AndAlso Not ObjMov.AddPrePolizasDetalle(CvePrePoliza, False, IVA, TxtObservaciones.Text, 19, TxtObservaciones.Text, Now, 0, -1, CveIE, CveProveedor:=CveProveedor, CveCreditoDetalle:=CveCreditoDetalle) Then
MsgError = "Detalle" MsgError = "Detalle"
End If End If

View File

@@ -354,7 +354,7 @@ Partial Class Bancos_OtrosIE
If CvePrePoliza > 0 Then If CvePrePoliza > 0 Then
Dim Importe As Double = 0 Dim Importe As Decimal = 0
Dim TipoMovto As Boolean = False Dim TipoMovto As Boolean = False
'INSERTO LAS COMPRAS QUE VOY A PAGAR 'INSERTO LAS COMPRAS QUE VOY A PAGAR

View File

@@ -1108,7 +1108,7 @@ Partial Class Bancos_ProveedoresAbonar
ConceptoContable = 243 ConceptoContable = 243
ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 3 Then ElseIf gvr.DataKey("CveRetISRConcepto").ToEntero = 3 Then
funcionalidad = 348 funcionalidad = 348
ConceptoContable = 328 ConceptoContable = 327
End If End If
ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL ImporteMovimiento = (gvr.DataKey("RetISR").ToDecimal * PorcentajePago).RoundSQL

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,16 @@
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server"> <asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
</asp:Content> </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content3" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones">
<ContentTemplate>
<li>
<asp:LinkButton ID="LnkCerrarImportacion" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Cerrar Importación" OnClick="LnkCerrarImportacion_Click"
data-toggle="confirmation" data-popout="true" data-original-title="¿Cerrar Importación?" data-btn-ok-label="si" Visible="false" />
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="E" runat="Server">
Importaciones Importaciones

View File

@@ -95,6 +95,11 @@ Partial Class Compras_Importaciones
'HLCompraSerieFolio.NavigateUrl = $"/Compras/Compras.aspx?CveCompra={HdnCveCompra.Value}" 'HLCompraSerieFolio.NavigateUrl = $"/Compras/Compras.aspx?CveCompra={HdnCveCompra.Value}"
'LbCompraImporte.Text = ObjImportaciones.DtResultados.Rows(0)("Total").ToString 'LbCompraImporte.Text = ObjImportaciones.DtResultados.Rows(0)("Total").ToString
If ObjImportaciones.DtResultados.Rows(0)("CveEstatus").ToString.ToEntero = 0 Then
LnkCerrarImportacion.Visible = True
End If
HdnCveAF.Value = ObjImportaciones.DtResultados.Rows(0)("CveActivoFijo").ToString HdnCveAF.Value = ObjImportaciones.DtResultados.Rows(0)("CveActivoFijo").ToString
VincularAF() VincularAF()
@@ -491,4 +496,17 @@ Partial Class Compras_Importaciones
Protected Sub LnkCerrarImportacion_Click(sender As Object, e As EventArgs)
Dim ObjInv As New ClsInventarios
If ObjInv.UpdateImportacionCierre(CveImportacion, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Alert("Importación cerrada correctamente.", TipoMensaje.MsgInformacion, $" location.href = ""./Importaciones.aspx?CveImportacion={CveImportacion}"" ")
End If
ObjInv.Dispose()
End Sub
End Class End Class

View File

@@ -114,6 +114,17 @@
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaF" Width="350px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaF" Width="350px"></ajax:ValidatorCalloutExtender>
</div> </div>
</div> </div>
<div class="col-md-1" style="max-width: 70px">Esatus:</div>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlEstatus" Width="100%" CssClass="select2me">
<asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Value="0" Selected="True">Activo</asp:ListItem>
<asp:ListItem Value="1">Cerrado</asp:ListItem>
</asp:DropDownList>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -40,9 +40,11 @@ Partial Class Compras_RepImportaciones
#Region " CARGA DAATOS " #Region " CARGA DAATOS "
Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs) Protected Sub BtnConsultarFiltros_Click(sender As Object, e As EventArgs)
CargaDatos() CargaDatos()
End Sub End Sub
Private Sub CargaDatos() Private Sub CargaDatos()
Dim ObjImportaciones As New ClsCompras Dim ObjImportaciones As New ClsCompras
Dim FechaI, FechaF As String Dim FechaI, FechaF As String
@@ -50,7 +52,7 @@ Partial Class Compras_RepImportaciones
If TxtFechaI.Text <> "" Then FechaI = TxtFechaI.Text Else FechaI = "-1" If TxtFechaI.Text <> "" Then FechaI = TxtFechaI.Text Else FechaI = "-1"
If TxtFechaF.Text <> "" Then FechaF = TxtFechaF.Text Else FechaF = "-1" If TxtFechaF.Text <> "" Then FechaF = TxtFechaF.Text Else FechaF = "-1"
If ObjImportaciones.GetImportaciones(-1, DdlProveedor.SelectedValue.ToString.ToEntero, -1, FechaI, FechaF, UsuarioActual.CveEmpresa) Then If ObjImportaciones.GetImportaciones(-1, DdlProveedor.SelectedValue.ToString.ToEntero, -1, FechaI, FechaF, UsuarioActual.CveEmpresa, DdlEstatus.SelectedValue.ToEntero) Then
DtImportaciones = ObjImportaciones.DtResultados DtImportaciones = ObjImportaciones.DtResultados
Else Else
Alert("Ocurrió un error al cargar las importaciones", TipoMensaje.MsgError) Alert("Ocurrió un error al cargar las importaciones", TipoMensaje.MsgError)
@@ -59,6 +61,7 @@ Partial Class Compras_RepImportaciones
CargaGrid() CargaGrid()
End Sub End Sub
Private Sub CargaGrid() Private Sub CargaGrid()
GvDatos.DataSource = DtImportaciones GvDatos.DataSource = DtImportaciones
GvDatos.DataBind() GvDatos.DataBind()

View File

@@ -75,7 +75,7 @@ public partial class Compras_RepPagadoPeriodo : ClsPaginas
txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}"; txtFechaI.Text = $"01/{DateTime.Now.Month}/{DateTime.Now.Year}";
txtFechaF.Text = DateTime.Now.ToShortDateString(); txtFechaF.Text = DateTime.Now.ToShortDateString();
TxtFechaICompra.Text = $"01/01/{DateTime.Now.Year}"; TxtFechaICompra.Text = MinFecha.ToShortDateString(); //'$"01/01/{DateTime.Now.Year}";
TxtFechaFCompra.Text = DateTime.Now.ToShortDateString(); TxtFechaFCompra.Text = DateTime.Now.ToShortDateString();
//Carga Proyectos //Carga Proyectos

View File

@@ -2918,6 +2918,9 @@ Partial Class Compras_eFacturas
Dim FechaPago As Date Dim FechaPago As Date
Dim PagosCantidad As Integer = 0 Dim PagosCantidad As Integer = 0
Dim UUIDDuplicados As String = ""
Dim ListaUUIDDuplicados As New List(Of String)
DTGVPagosVinculacion = New DataTable DTGVPagosVinculacion = New DataTable
MontoPago = 0D MontoPago = 0D
ComprasEnComplemento = 0 ComprasEnComplemento = 0
@@ -3067,6 +3070,25 @@ Partial Class Compras_eFacturas
Next Next
Next Next
Dim UUIDDuplicadosEnu = From row In DTDocumentosRelacionados.AsEnumerable()
Let IdDocumento = row.Field(Of String)("IdDocumento")
Group row By IdDocumento Into IdDocumentos = Group
Where IdDocumentos.Count() > 1
Select IdDocumentos
For Each UUIDDuplicadosRows In UUIDDuplicadosEnu
For Each row In UUIDDuplicadosRows
If Not ListaUUIDDuplicados.Contains(row.Field(Of String)("IdDocumento")) Then
UUIDDuplicados = $"{UUIDDuplicados} {If(ListaUUIDDuplicados.Count > 0, "<br>", "") } {row.Field(Of String)("IdDocumento")}"
ListaUUIDDuplicados.Add(row.Field(Of String)("IdDocumento"))
End If
Next
Next
MontoPago = Monto MontoPago = Monto
Dim ObjCompraFolios As New ClsCompras Dim ObjCompraFolios As New ClsCompras
@@ -3253,7 +3275,7 @@ Partial Class Compras_eFacturas
If Math.Abs(DiferenciaImportes) > 5 Then If Math.Abs(DiferenciaImportes) > 5 Then
TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>" TextoDiferenciaImporte = $"<b>&nbsp;&nbsp;-&nbsp;&nbsp; IE ${ImporteIES.FormatoNumero}</b> <div style='color:red'><strong>Diferencia { DiferenciaImportes.FormatoNumero() }</strong></div>"
BtnVincularPago.Visible = False BtnVincularPago.Visible = False
MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes)})" MSGComplemento = MSGComplemento & $" Existe una diferencia mayor a $5.00 ({Math.Abs(DiferenciaImportes).ToString("###,###,###.00")})"
If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then If TieneRegistros AndAlso UsuarioActual.TienePermisoProceso(286) Then
DivVincularPagoManualmente.Visible = True DivVincularPagoManualmente.Visible = True
@@ -3285,9 +3307,20 @@ Partial Class Compras_eFacturas
LblDiferencia.Text = If(DiferenciaImportes <> 0 And ImporteIES > 0, DiferenciaImportes.FormatoNumero, "") LblDiferencia.Text = If(DiferenciaImportes <> 0 And ImporteIES > 0, DiferenciaImportes.FormatoNumero, "")
If MSGComplemento.Trim.Length > 0 And CveComplementoPagoCompra <= 0 Then If MSGComplemento.Trim.Length > 0 And CveComplementoPagoCompra <= 0 Or ListaUUIDDuplicados.Count > 0 And CveComplementoPagoCompra <= 0 Then
If ListaUUIDDuplicados.Count > 0 Then
LblMensajeComlementoError.Text = $"Las siguientes UUID se encuentran duplicadas:<br>{UUIDDuplicados}<br>{MSGComplemento}"
'<hr style='border: 0; height: 1px; background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));' />
DVMensajecomplementoError.Visible = True
Else
LblMensajeComlementoError.Text = MSGComplemento LblMensajeComlementoError.Text = MSGComplemento
DVMensajecomplementoError.Visible = True DVMensajecomplementoError.Visible = True
End If
Else Else
LblMensajeComlementoError.Text = "" LblMensajeComlementoError.Text = ""

View File

@@ -1633,7 +1633,7 @@ Partial Class ContabilidadC_RegPrePolizaS
If AplicaComplementaria Then If AplicaComplementaria Then
Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal) Dim Importe As Decimal = IIf(TxtCargoE.Text.ToDecimal <> 0, TxtCargoE.Text.ToDecimal, TxtAbonoE.Text.ToDecimal)
'valida Mon Extranjera por el TC - Mon Extranjera 'valida Mon Extranjera por el TC - Mon Extranjera
Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal) - TxtME.Text.ToDecimal).RoundSQL - Importe Dim dif As Decimal = ((TxtME.Text.ToDecimal * TxtTipoCambio.Text.ToDecimal).RoundSQL - TxtME.Text.ToDecimal).RoundSQL - Importe
If dif <> 0 Then If dif <> 0 Then
Alert("El importe moneda extranjera no coinciden con el TC ") Alert("El importe moneda extranjera no coinciden con el TC ")

View File

@@ -744,9 +744,33 @@ Partial Class Inventarios_Consignaciones
If Not ErrorMovInv Then If Not ErrorMovInv Then
If DdlConcepto.SelectedValue = "11" Then
Dim ImportePrePoliza As Decimal = DtMovimientos.SUMD("Total")
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Concepto As String = "Consig"
Dim CvePrePoliza = ObjConta.AddPrePolizas("Entrada/Consignacion", 53, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, False, ImportePrePoliza, "Entrada por Consignacion", 68, "Entrada por Consignacion", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImportePrePoliza, CveSubProyecto:=-1, Contabilizable:=False) Then
ErrorMovInv = True
End If End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, True, ImportePrePoliza, "Entrada por Consignacion", 337, "Entrada por Consignacion", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImportePrePoliza, Contabilizable:=False) Then
ErrorMovInv = True
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Consig | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorMovInv = True
End If
End If
End If End If
@@ -879,10 +903,49 @@ Partial Class Inventarios_Consignaciones
TextoError = "Ocurrió un Error al guardar los movimientos" TextoError = "Ocurrió un Error al guardar los movimientos"
Exit For Exit For
Else Else
Dim ImportePrePoliza As Decimal = Gvr.DataKey("PU").ToString.ToDecimal * Gvr.FCTextBox("TxtCantidadDevolucion").Text.ToString.ToDecimal
Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & ConceptoDevolucion).ToEntero
If OrigenMov = 1 Then
MovAlmacen = True
Else
MovAlmacen = False
End If
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Concepto As String = "Consig"
Dim CvePrePoliza = ObjConta.AddPrePolizas("Consig", 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, "Consig", 68, "Consig", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImportePrePoliza, CveSubProyecto:=-1, Contabilizable:=False) Then
ErrorMovInv = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, "Consig", 337, "Consig", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ImportePrePoliza, Contabilizable:=False) Then
ErrorMovInv = True
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Consig | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
ErrorMovInv = True
End If
End If
If Not ErrorMovInv Then
MovimientosRealizados += 1 MovimientosRealizados += 1
End If End If
End If End If
End If
Next Next

View File

@@ -5,8 +5,6 @@ Imports System.Data
Imports System.IO Imports System.IO
Imports Extensiones Imports Extensiones
'Imports DocumentFormat.OpenXml.Wordprocessing
Partial Class Inventarios_EntradasSalidas Partial Class Inventarios_EntradasSalidas
Inherits ClsPaginas Inherits ClsPaginas
@@ -345,9 +343,6 @@ Partial Class Inventarios_EntradasSalidas
End Select End Select
If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then If Request("CveMovimiento") IsNot Nothing AndAlso Request("CveMovimiento").ToString.ToEntero > 0 Then
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 140 Then
LnkGenerarVirtual.Visible = True
End If
CargaDatos(Request("CveMovimiento").ToString.ToEntero) CargaDatos(Request("CveMovimiento").ToString.ToEntero)
'CargaGvPaqueteria() 'CargaGvPaqueteria()
@@ -708,6 +703,10 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
If UsuarioActual.CveRol = 1 AndAlso UsuarioActual.CveEmpresa = 140 AndAlso Mov.CveMovimientoVirtual <= 0 Then
LnkGenerarVirtual.Visible = True
End If
'DATOS DE CONSIGNACION 'DATOS DE CONSIGNACION
If DtMov.Rows(0)("SerieFolio").ToString.Length > 0 Then If DtMov.Rows(0)("SerieFolio").ToString.Length > 0 Then
RowConsignacion.Visible = True RowConsignacion.Visible = True
@@ -1830,9 +1829,9 @@ Partial Class Inventarios_EntradasSalidas
Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy Dim Dt As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}).Copy
'Dim IdCuentaGasto As Integer = 0 'Dim IdCuentaGasto As Integer = 0
For Each Dr As DataRow In Dt.Rows For Each Dr As DataRow In Dt.Rows
Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion").ToString}").SUM("Total").ToDecimal.RoundSQL() Dim Total As Decimal = ObjInventario.DtResultados.FiltraParametros($"CveClasificacion = {Dr("CveClasificacion")}").SUM("Total").ToDecimal.RoundSQL()
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, TxtObservaciones.Text.Trim, CveConceptoContable, TxtObservaciones.Text.Trim, TxtFecha.Text.ToDate, -1, -1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=Total, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not TipoMovtoAlmacen, Total, Total, CveConceptoContable, TxtFolio.Text, TxtObservaciones.Text.Trim, IdCtaContableOtro, CveMovimientoAlmacen:=CveMovimiento, CveClasificacion:=Dr("CveClasificacion").ToString.ToEntero, CveSubProyecto:=tCveSubProyecto) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
Next Next
@@ -3773,6 +3772,12 @@ Partial Class Inventarios_EntradasSalidas
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 205, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True ErrorMovInv = True
End If End If
Else
If ObjInventario.Modulo.Contiene("M/CU") Then
Contabilizable = True
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 278, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveCompra:=CveCompra, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
ErrorMovInv = True
End If
Else Else
If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then If ObjInventario.Modulo.Contiene("TA/G1", "Recons") Then
Contabilizable = False Contabilizable = False
@@ -3830,6 +3835,7 @@ Partial Class Inventarios_EntradasSalidas
End If End If
End If End If
End If End If
End If
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then
@@ -4548,11 +4554,11 @@ Partial Class Inventarios_EntradasSalidas
'MOVIMIENTOS 'MOVIMIENTOS
If DtMovimientosCambioVigencias.Rows.Count > 0 Then If DtMovimientosCambioVigencias.Rows.Count > 0 Then
FolioSalida = ObjInventario.GetFolioSiguiente(8, UsuarioActual.CveEmpresa) FolioSalida = ObjInventario.GetFolioSiguiente(47, UsuarioActual.CveEmpresa)
CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 8, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, Modulo:="ES/CV1") CveMovimientoSalida = ObjInventario.AddMovimiento(CveAlmacen, 47, 1, Fecha, FolioSalida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, Modulo:="ES/CV1")
FolioEntrada = ObjInventario.GetFolioSiguiente(9, UsuarioActual.CveEmpresa) FolioEntrada = ObjInventario.GetFolioSiguiente(48, UsuarioActual.CveEmpresa)
CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 9, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ES/CV2") CveMovimientoEntrada = ObjInventario.AddMovimiento(CveAlmacen, 48, 1, Fecha, FolioEntrada, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, Observaciones:=TxtObsCambioVigencia.Text.Trim, CveMovimientoRelacionado:=CveMovimientoSalida, Modulo:="ES/CV2")
End If End If
@@ -5298,7 +5304,7 @@ Partial Class Inventarios_EntradasSalidas
If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then If DtPSVirtual IsNot Nothing AndAlso DtPSVirtual.Rows.Count > 0 Then
CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, Now, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV") CveMovimientoVirtual = ObjInventario.AddMovimiento(CveAlmacenVirtual, If(tOrigen > 0, 36, 37), 1, TxtFecha.text.todate, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1, -1, -1, -1, CveMovimientoRelacionado:=CveMovimiento, Observaciones:=TxtObservaciones.Text.Trim, Modulo:="ES/GV")
FolioVirtual = ObjInventario.Folio FolioVirtual = ObjInventario.Folio
For Each RowUsado As DataRow In DtPSVirtual.Rows For Each RowUsado As DataRow In DtPSVirtual.Rows

View File

@@ -2992,7 +2992,7 @@ Partial Class Inventarios_EntregaAlmacen
If tmpCostos.Rows.Count > 0 Then If tmpCostos.Rows.Count > 0 Then
If ObjVentas.GetVenta(CveVentaSurtir, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVenta(CveVentaSurtir, UsuarioActual.CveEmpresa, False) Then
Dim Fecha As Date = TxtFecha.Text.ToDate ' If(TipoMovimiento <> 1, TxtFecha.Text.ToDate, ObjVentas.DtResultados(0)("Fecha").ToString().ToDate) Dim Fecha As Date = TxtFecha.Text.ToDate ' If(TipoMovimiento <> 1, TxtFecha.Text.ToDate, ObjVentas.DtResultados(0)("Fecha").ToString().ToDate)
Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero() Dim CveCliente As Integer = ObjVentas.DtResultados(0)("CveCliente").ToString().ToEntero()
Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString() Dim ClienteNombre As String = ObjVentas.DtResultados(0)("ClienteNombre").ToString()

View File

@@ -8,9 +8,24 @@
Costo Indirecto Costo Indirecto
</asp:Content> </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server"> <asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAcciones">
<ContentTemplate>
<li> <li>
<asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton> <asp:LinkButton ID="LnkPdf" OnClick="LnkPdf_Click" runat="server"> <i class="fa fa-file-pdf-o" style="font-weight:bold;"></i> PDF</asp:LinkButton>
</li> </li>
<li>
<asp:LinkButton ID="LnkCerrarFlete" runat="server" CausesValidation="False" Text="<i class='fa fa-pencil'></i> Cerrar Costo Indirecto" OnClick="LnkCerrarFlete_Click"
data-toggle="confirmation" data-popout="true" data-original-title="¿Cerrar Costo Indirecto?" data-btn-ok-label="si" Visible="false" />
</li>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="LnkPdf" />
</Triggers>
</asp:UpdatePanel>
</asp:Content> </asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server"> <asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
</asp:Content> </asp:Content>

View File

@@ -94,6 +94,11 @@ Partial Class Compras_Fletes
'HLOCFolio.NavigateUrl = If(HdnCveOC.Value.ToEntero > 0, $"/OC/OC.aspx?OC={HdnCveOC.Value}", $"/Compras/Compras.aspx?CveCompra={HdnCveCompra.Value}") 'HLOCFolio.NavigateUrl = If(HdnCveOC.Value.ToEntero > 0, $"/OC/OC.aspx?OC={HdnCveOC.Value}", $"/Compras/Compras.aspx?CveCompra={HdnCveCompra.Value}")
'LbOCImporte.Text = $"{ObjInv.DtResultados.Rows(0)("TotalDocumento").ToString.FormatoNumero} {ObjInv.DtResultados.Rows(0)("Moneda").ToString}" 'LbOCImporte.Text = $"{ObjInv.DtResultados.Rows(0)("TotalDocumento").ToString.FormatoNumero} {ObjInv.DtResultados.Rows(0)("Moneda").ToString}"
If ObjInv.DtResultados.Rows(0)("CveEstatus").ToString.ToEntero = 0 Then
LnkCerrarFlete.Visible = True
End If
If ObjInv.GetFleteDetalle(CveFlete) Then If ObjInv.GetFleteDetalle(CveFlete) Then
DtCompras = ObjInv.DtResultados DtCompras = ObjInv.DtResultados
Else Else
@@ -104,6 +109,9 @@ Partial Class Compras_Fletes
GvComprasVinculadas.DataSource = ObjInv.DtResultados GvComprasVinculadas.DataSource = ObjInv.DtResultados
End If End If
Else Else
Alert("No se encontró el flete", TipoMensaje.MsgAdvertencia) Alert("No se encontró el flete", TipoMensaje.MsgAdvertencia)
End If End If
@@ -434,4 +442,17 @@ Partial Class Compras_Fletes
End Sub End Sub
Protected Sub LnkCerrarFlete_Click(sender As Object, e As EventArgs)
Dim ObjInv As New ClsInventarios
If ObjInv.UpdateFleteCierre(CveFlete, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
Alert("Costo Indirecto cerrado correctamente.", TipoMensaje.MsgInformacion, $" location.href = ""./Fletes.aspx?CveFlete={CveFlete}"" ")
End If
ObjInv.Dispose()
End Sub
End Class End Class

View File

@@ -587,25 +587,45 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
End If End If
'Dim Concepto As String = ConceptoPoliza
'Dim CvePrePoliza = ObjConta.AddPrePolizas("RA-01", 74, DtCostos.SUM("Total"), DtCostos.SUM("Total"), 1, TxtFecha.Text.ToDate, ConceptoPoliza, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Dim ImportePrePoliza As Decimal = 0D
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
ImportePrePoliza = ObjInventario.DtResultados.SUMD("Total")
End If
Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & 19).ToEntero
If OrigenMov = 1 Then
MovAlmacen = True
Else
MovAlmacen = False
End If
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Concepto As String = "ARMPAQ2"
Dim CvePrePoliza = ObjConta.AddPrePolizas("ARMPAQ1/ARMPAQ2", 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero 'Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto, Contabilizable:=EsContabilizable) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, "ARMPAQ2", 68, "ARMPAQ2", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImportePrePoliza, CveSubProyecto:=-1, Contabilizable:=True) Then
' Retorno = False TieneError = True
'End If End If
'If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ValorInventario, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ValorInventario, Contabilizable:=If(CveTipoCompra = 10, False, EsContabilizable)) Then If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, "ARMPAQ1", 68, "ARMPAQ1", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImportePrePoliza, Contabilizable:=True) Then
' Retorno = False TieneError = True
'End If End If
'If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
' If ObjConta.ValorPolizaDescuadre > 0 Then If ObjConta.ValorPolizaDescuadre > 0 Then
' GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas") GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
' Retorno = False TieneError = True
' End If End If
'End If End If
Case 2 'DESARMADO Case 2 'DESARMADO
@@ -688,6 +708,49 @@ Partial Class Inventarios_PaquetesArmadoDesarmado
End If End If
End If End If
Dim ImportePrePoliza As Decimal = 0D
If ObjInventario.GetMovimientosDetalle(CveMovimientoEntrada, UsuarioActual.CveEmpresa) Then
ImportePrePoliza = ObjInventario.DtResultados.SUMD("Total")
End If
Dim MovAlmacen As Boolean = True
Dim OrigenMov As Integer = GlobalDTInvConceptos.FiltroPrimeroValor("Origen", "CveConcepto = " & 4).ToEntero
If OrigenMov = 1 Then
MovAlmacen = True
Else
MovAlmacen = False
End If
Dim ObjConta As New ClsContabilidad(ObjInventario.IniciaTransacSQL)
Dim Concepto As String = "ARMPAQ2"
Dim CvePrePoliza = ObjConta.AddPrePolizas("ARMPAQ1/ARMPAQ2", 74, ImportePrePoliza, ImportePrePoliza, 1, Fecha, Concepto, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
'Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={CveAlmacen}").ToEntero
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ImportePrePoliza, "ARMPAQ4", 68, "ARMPAQ4", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimientoEntrada, ImporteMX:=ImportePrePoliza, CveSubProyecto:=-1, Contabilizable:=True) Then
TieneError = True
End If
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, ImportePrePoliza, "ARMPAQ3", 68, "ARMPAQ3", Fecha, -1, -1, CveVenta:=-1, CveMovimientoAlmacen:=CveMovimientoSalida, ImporteMX:=ImportePrePoliza, Contabilizable:=True) Then
TieneError = True
End If
If ObjConta.ValidacionPrePolizaCuadre(CvePrePoliza, 6) Then
If ObjConta.ValorPolizaDescuadre > 0 Then
GuardaLogAD($"Inventarios/RecepcionAlmacen-PPCompOC | Error:{ObjConta.MensajePolizaDescuadre} Diferencia:{ObjConta.ValorDiferencia} | CvePrePoliza:{CvePrePoliza}", "LogPrePolizas")
TieneError = True
End If
End If
End Select End Select

View File

@@ -285,8 +285,8 @@
<div class="portlet-body"> <div class="portlet-body">
<asp:GridView ID="GVPendientes" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" DataKeyNames="CveCompra" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="200" data-freezerows="1" GridLines="None"> <asp:GridView ID="GVPendientes" runat="server" EmptyDataText="Aun no hay registros." AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" DataKeyNames="CveCompra" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="200" data-freezerows="1" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" /> <asp:BoundField HeaderText="Tipo" DataField="TipoDocto" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="50px" />
<asp:BoundField HeaderText="Proveedor" DataField="RazonSocial" ItemStyle-Width="45%" /> <asp:BoundField HeaderText="Proveedor" DataField="RazonSocial" />
<asp:TemplateField HeaderText="Serie-Folio"> <asp:TemplateField HeaderText="Serie-Folio">
<ItemTemplate> <ItemTemplate>
<asp:Label ID="LblSerieFolio" runat="server" Text='<%# Eval("SerieFolio")%>' /> <asp:Label ID="LblSerieFolio" runat="server" Text='<%# Eval("SerieFolio")%>' />
@@ -297,7 +297,7 @@
<ItemTemplate> <ItemTemplate>
<asp:LinkButton Text="Surtir" ID="BtnSurtir" CommandArgument="-1" OnClick="BtnSurtir_Click" CssClass="btn btn-primary input-sm" runat="server" /> <asp:LinkButton Text="Surtir" ID="BtnSurtir" CommandArgument="-1" OnClick="BtnSurtir_Click" CssClass="btn btn-primary input-sm" runat="server" />
</ItemTemplate> </ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="20%" /> <ItemStyle HorizontalAlign="Center" Width="100px" />
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
@@ -809,7 +809,7 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title"> <h4 class="modal-title">
<asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Ingresar producto con Serie/Lote y Fecha de Vencimiento"></asp:Label> <asp:Label ID="Label7" runat="server" ClientIDMode="Static" Text="Ingresar producto con Serie"></asp:Label>
</h4> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@@ -825,11 +825,6 @@
<asp:Label Text="" ID="LbCantidad" runat="server" /> <asp:Label Text="" ID="LbCantidad" runat="server" />
</td> </td>
</tr> </tr>
<tr>
<td colspan="4">
<hr />
</td>
</tr>
<tr> <tr>
<td width="80px">Serie:</td> <td width="80px">Serie:</td>
<td> <td>
@@ -841,18 +836,17 @@
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> debe tener un minimo de 6 caracteres." ValidationGroup="GrpAgregaSerie" /> ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Serie''</b> debe tener un minimo de 6 caracteres." ValidationGroup="GrpAgregaSerie" />
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="ReVTxtSerie" Width="300px"></ajax:ValidatorCalloutExtender> <ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender3" runat="server" HighlightCssClass="vco" TargetControlID="ReVTxtSerie" Width="300px"></ajax:ValidatorCalloutExtender>
</td> </td>
<td><asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarPS" OnClick="BtnAgregarPS_Click" ValidationGroup="GrpAgregaSerie" runat="server" /></td> <td><asp:Button Text="Agregar" CssClass="btn btn-primary" ID="BtnAgregarPS" OnClick="BtnAgregarPS_Click" ValidationGroup="GrpAgregaSerie" runat="server" /></td>
</tr> </tr>
<tr> <tr>
<td colspan="4"> <td colspan="4">
<asp:GridView ID="GvSerie" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="Serie" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover Widthall ScrollAD" data-height="250" data-freezerows="1" GridLines="None"> <asp:GridView ID="GvSerie" runat="server" EmptyDataText="Aun no hay registros." DataKeyNames="Serie" AutoGenerateColumns="False" ShowHeader="true" ShowHeaderWhenEmpty="True" HeaderStyle-CssClass="Titulos" RowStyle-Height="25px" CssClass="table table-striped table-hover table-advance mysmallbtn Widthall ScrollAD " data-height="250" data-freezerows="1" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Serie-Folio" DataField="Serie" ItemStyle-Width="40%" /> <asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="40%" />
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-xs red" Text="<i class='icon-trash'></i>" CommandName="Delete" OnClientClick="return confirm('¿Desea borrar el registro?')"></asp:LinkButton> <asp:LinkButton ID="lnkRemove" runat="server" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" CommandName="Delete" OnClientClick="return confirm('¿Desea borrar el registro?')"></asp:LinkButton>
</ItemTemplate> </ItemTemplate>
<ItemStyle Width="20%"></ItemStyle> <ItemStyle Width="20%"></ItemStyle>
</asp:TemplateField> </asp:TemplateField>

View File

@@ -434,6 +434,42 @@ Partial Class Inventarios_RecepcionAlmacen
End Set End Set
End Property End Property
Private Property CveImportacionSeleccionada As Integer
Get
If ViewState("CveImportacionSeleccionada") Is Nothing Then
ViewState("CveImportacionSeleccionada") = -1
End If
Return ViewState("CveImportacionSeleccionada").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveImportacionSeleccionada") = value
End Set
End Property
Private Property CveFleteSeleccionado As Integer
Get
If ViewState("CveFleteSeleccionado") Is Nothing Then
ViewState("CveFleteSeleccionado") = -1
End If
Return ViewState("CveFleteSeleccionado").ToString.ToEntero
End Get
Set(value As Integer)
ViewState("CveFleteSeleccionado") = value
End Set
End Property
#End Region #End Region
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
@@ -561,7 +597,7 @@ Partial Class Inventarios_RecepcionAlmacen
End Sub End Sub
Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs) Protected Sub DdlAlmacen_SelectedIndexChanged(sender As Object, e As EventArgs)
Recargaporalmacenes() RecargaporAlmacenes()
End Sub End Sub
Private Sub RecargaporAlmacenes() Private Sub RecargaporAlmacenes()
@@ -858,7 +894,7 @@ Partial Class Inventarios_RecepcionAlmacen
If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.FCLinkButton("BtnSurtir").CommandArgument = e.Row.DBCampo("CveCompra") e.Row.FCLinkButton("BtnSurtir").CommandArgument = e.Row.DBCampo("CveCompra")
If e.Row.DBCampo("TipoDocto").ToString.Contiene({"Fac"}) And e.Row.DBCampo("EstatusAlmacen").ToString.ToEntero = 0 Then If e.Row.DBCampo("TipoDocto").ToString.Contiene({"Fac"}) And e.Row.DBCampo("EstatusAlmacen").ToString = "0" Then
e.Row.FCLinkButton("BtnSurtir").CssClass = "btn btn-primary input-sm" e.Row.FCLinkButton("BtnSurtir").CssClass = "btn btn-primary input-sm"
e.Row.FCLinkButton("BtnSurtir").Text = "<i class='fa fa-arrow-left'></i> Recibir" e.Row.FCLinkButton("BtnSurtir").Text = "<i class='fa fa-arrow-left'></i> Recibir"
Else Else
@@ -867,9 +903,7 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
If UsuarioActual.TienePermisoProceso(201) Then If UsuarioActual.TienePermisoProceso(201) Then
Dim Css = "Texto" e.Row.FCLabel("LblSerieFolio").Text = String.Format("<a class='Texto' href='/Compras/Compras.aspx?CveCompra={0}'>{1} </a>", e.Row.DataKey("CveCompra"), e.Row.FCLabel("LblSerieFolio").Text)
Dim Liga = $"/Compras/Compras.aspx?&CveCompra={e.Row.DataKey("CveCompra")}"
e.Row.FCLabel("LblSerieFolio").Text = "<a class=" + "" + Css + "" + " href=" + "" + Liga + "" + ">" + e.Row.FCLabel("LblSerieFolio").Text + "</a>"
End If End If
End If End If
@@ -921,6 +955,9 @@ Partial Class Inventarios_RecepcionAlmacen
UpDatosCompra.Update() UpDatosCompra.Update()
CveImportacionSeleccionada = -1
CveFleteSeleccionado = -1
If TxtOC.Text <> "" Then If TxtOC.Text <> "" Then
LtDocumento.Text = "ORDEN DE COMPRA" LtDocumento.Text = "ORDEN DE COMPRA"
CargaOC() CargaOC()
@@ -1242,6 +1279,11 @@ Partial Class Inventarios_RecepcionAlmacen
CreaDtLoteDetalle() CreaDtLoteDetalle()
CreaDTInv(ObjInventario.DtResultados) CreaDTInv(ObjInventario.DtResultados)
BtnGuardar.Visible = True BtnGuardar.Visible = True
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
CveImportacionSeleccionada = DdlFolioImportacion.SelectedValue.ToEntero
End If
End If End If
If DtInv Is Nothing OrElse DtInv.Rows.Count = 0 Then If DtInv Is Nothing OrElse DtInv.Rows.Count = 0 Then
@@ -1298,6 +1340,10 @@ Partial Class Inventarios_RecepcionAlmacen
CreaDtLoteDetalle() CreaDtLoteDetalle()
CreaDTInv(ObjInventario.DtResultados) CreaDTInv(ObjInventario.DtResultados)
BtnGuardar.Visible = True BtnGuardar.Visible = True
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
CveFleteSeleccionado = DdlFletes.SelectedValue.ToEntero
End If
End If End If
If DtInv Is Nothing OrElse DtInv.Rows.Count = 0 Then If DtInv Is Nothing OrElse DtInv.Rows.Count = 0 Then
@@ -1712,13 +1758,12 @@ Partial Class Inventarios_RecepcionAlmacen
'RegistraScript("document.getElementById(""TxtSerie"").focus();") 'RegistraScript("document.getElementById(""TxtSerie"").focus();")
RegistraScript("$('#DivSerie').modal();", "ModalLote") RegistraScript("$('#DivSerie').modal();", "ModalLote")
GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC") GvSerie.DataSource = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie), "Consec DESC")
GvSerie.DataBind() GvSerie.DataBind()
'VALIDA QUE SIGA AGREGANDO 'VALIDA QUE SIGA AGREGANDO
If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then If Not DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", CveConsecSerie)).Rows.Count < LbCantidad.Text.ToEntero Then
BtnAgregarPS.Enabled = False BtnAgregarPS.Enabled = True
If CerrarCompletado Then If CerrarCompletado Then
RegistraScript("$('#DivSerie').modal('hide');") RegistraScript("$('#DivSerie').modal('hide');")
End If End If
@@ -1761,9 +1806,7 @@ Partial Class Inventarios_RecepcionAlmacen
Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs) Protected Sub BtnAgregarPS_Click(sender As Object, e As EventArgs)
AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty), 1) AgregaSerie(TxtSerie.Text.Replace(" ", String.Empty), 1)
End Sub End Sub
Private Sub AgregaSerie(Serie As String, Tipo As Integer) Private Sub AgregaSerie(Serie As String, Tipo As Integer, Optional AlertaSonido As Boolean = True, Optional CargaMasivaSeries As Boolean = False)
'SerieLote = SerieLote.Trim.Replace(" ", " ")
If Serie.Trim = "" Then If Serie.Trim = "" Then
Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia) Alert("El campo Serie es obligatorio. Por favor rectifique y vuelva a intentar.", TipoMensaje.MsgAdvertencia)
Exit Sub Exit Sub
@@ -1774,10 +1817,6 @@ Partial Class Inventarios_RecepcionAlmacen
'VALIDACION DE SERIES DUPLICADAS 'VALIDACION DE SERIES DUPLICADAS
Dim MensajeAlert As New StringBuilder Dim MensajeAlert As New StringBuilder
Dim DtDuplicado As New DataTable Dim DtDuplicado As New DataTable
Dim DtSeriesNuevas As New DataTable
DtSeriesNuevas.Columns.Add("Serie", GetType(String))
'If CvePSS > 0 And CvePSSerie = 0 Then CvePSSerie = CvePSS
'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS 'PARA VALIDAR SI LA SERIE ES IGUAL AL CODIGO O CODIGOBARRAS
Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltroPrimero("", "PS") Dim dr As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltroPrimero("", "PS")
@@ -1786,12 +1825,8 @@ Partial Class Inventarios_RecepcionAlmacen
DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{Serie}'") DtDuplicado = DtDatosDetalle.FiltraParametros($"ConsecId = {CveConsecSerie} AND Serie = '{Serie}'")
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado ya se encuentra ingresado.") MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado ya se encuentra ingresado.")
Continue For TxtSerie.Text = ""
End If TxtSerie.Focus()
DtDuplicado = DtSeriesNuevas.FiltraParametros($"Serie = '{Serie}'")
If DtDuplicado IsNot Nothing AndAlso DtDuplicado.Rows.Count > 0 Then
MensajeAlert.Append($"<br/> El numero de Serie <b>""{Serie}""</b> proporcionado se encuentra duplicado.")
Continue For Continue For
End If End If
@@ -1800,19 +1835,14 @@ Partial Class Inventarios_RecepcionAlmacen
MensajeAlert.Append($"<br/> El numero de Serie <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.") MensajeAlert.Append($"<br/> El numero de Serie <b>{Serie}</b> coincide con el codigo o codigo de barras del producto. Por favor rectifique y vuelva a intentar.")
Continue For Continue For
End If End If
Dim Row = DtSeriesNuevas.NewRow
Row("Serie") = Serie
DtSeriesNuevas.Rows.Add(Row)
Next Next
If MensajeAlert.ToString <> "" Then If MensajeAlert.ToString <> "" Then
Alert(MensajeAlert.ToString, TipoMensaje.MsgAdvertencia) Alert(MensajeAlert.ToString, TipoMensaje.ToastError)
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Exit Sub Exit Sub
End If End If
Dim MensajeSinExistencias As New StringBuilder Dim MensajeSinExistencias As New StringBuilder
Dim ObjInventarios As New ClsInventarios Dim ObjInventarios As New ClsInventarios
Dim Index = 0 Dim Index = 0
@@ -1820,7 +1850,6 @@ Partial Class Inventarios_RecepcionAlmacen
For Each Serie In SeriesArreglo For Each Serie In SeriesArreglo
If Serie <> "" Then If Serie <> "" Then
Dim Row = DtDatosDetalle.NewRow Dim Row = DtDatosDetalle.NewRow
Index = Index + 1 Index = Index + 1
@@ -1849,11 +1878,6 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
End If End If
'Dim AplicaCaducidad = False
'If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0) IsNot Nothing Then
' AplicaCaducidad = If(GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePSSerie).FiltraParametros("").Rows(0)("AplicaCaducidad").ToString = "True", True, False)
'End If
Row("ConsecId") = CveConsecSerie Row("ConsecId") = CveConsecSerie
Row("Consec") = DtDatosDetalle.Rows.Count + 1 Row("Consec") = DtDatosDetalle.Rows.Count + 1
Row("CvePS") = CvePSSerie Row("CvePS") = CvePSSerie
@@ -1872,15 +1896,15 @@ Partial Class Inventarios_RecepcionAlmacen
TxtSerie.Text = "" TxtSerie.Text = ""
End If End If
CargaSerie(Tipo, True) If Not CargaMasivaSeries Then CargaSerie(Tipo, True)
If MensajeAlert.ToString <> "" Then If MensajeAlert.ToString <> "" Then
RegistraScript("playsonidito('142608__autistic-lucario__error.wav')") If AlertaSonido Then RegistraScript("playsonidito('142608__autistic-lucario__error.wav')")
Else Else
If MensajeSinExistencias.ToString <> "" Then If MensajeSinExistencias.ToString <> "" Then
Alert($"Las siguientes Series no cuentan con la existencia suficiente por lo cual se omitieron. <br?><br/> {MensajeSinExistencias.ToString}", TipoMensaje.MsgAdvertencia) Alert($"Las siguientes Series no cuentan con la existencia suficiente por lo cual se omitieron. <br?><br/> {MensajeSinExistencias.ToString}", TipoMensaje.MsgAdvertencia)
End If End If
RegistraScript("playsonidito('beep-07.wav')", "SoniditoSerie") If AlertaSonido Then RegistraScript("playsonidito('beep-07.wav')", "SoniditoSerie")
End If End If
@@ -3753,6 +3777,8 @@ Partial Class Inventarios_RecepcionAlmacen
ErrorMovInv = True ErrorMovInv = True
End Try End Try
'FINAL 'FINAL
If Not ErrorMovInv Then If Not ErrorMovInv Then
ObjInventario.Commit() ' aplica los movimientos insertados ObjInventario.Commit() ' aplica los movimientos insertados
@@ -4099,6 +4125,22 @@ Partial Class Inventarios_RecepcionAlmacen
End If End If
If Not ErrorMovInv AndAlso CveImportacionSeleccionada > 0 Then
If Not ObjInventario.UpdateImportacionCierre(CveImportacionSeleccionada, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
ErrorMovInv = True
End If
End If
If Not ErrorMovInv AndAlso CveFleteSeleccionado > 0 Then
If Not ObjInventario.UpdateFleteCierre(CveFleteSeleccionado, UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario) Then
ErrorMovInv = True
End If
End If
'FINAL 'FINAL
If Not ErrorMovInv Then If Not ErrorMovInv Then
ObjInventario.Commit() ' aplica los movimientos insertados ObjInventario.Commit() ' aplica los movimientos insertados
@@ -4954,12 +4996,13 @@ Partial Class Inventarios_RecepcionAlmacen
If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then If RowPS("AplicaSerie").ToString() = "True" AndAlso Not String.IsNullOrEmpty(Serie.Trim()) Then
NoPSConSerie = NoPSConSerie + 1 NoPSConSerie = NoPSConSerie + 1
LbCantidad.Text = DtInv.FiltroPrimeroValor("Cantidad", "CvePS=" & CvePSSerie)
End If End If
If Valido Then If Valido Then
CveConsecSerie = RowPS("Consec").ToString.ToEntero CveConsecSerie = RowPS("Consec").ToString.ToEntero
AgregaSerie(RowExcel("Serie").ToString, 1) AgregaSerie(RowExcel("Serie").ToString, 1, False)
'AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False) 'AgregarPS(Cantidad, CveProducto, CveUnidadMedida, Observaciones, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(Not String.IsNullOrEmpty(Serie), Serie, ""), Lote:=Lote, FechaCaducidad:=FechaCaducidad, Limpia:=False)
RowsCargados = RowsCargados + 1 RowsCargados = RowsCargados + 1

View File

@@ -1,187 +0,0 @@
<%@ Page Title="Reg RSCO" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RegRSCO.aspx.vb" Inherits="Inventarios_RegRSCO" EnableEventValidation="false" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
<style>
#DivAgregarUnidad > div.modal-dialog > div label input {
padding: 0px !important;
}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
Reg RSCO
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
<asp:UpdatePanel runat="server" ID="UpAgregar">
<ContentTemplate>
<li>
<asp:LinkButton runat="server" ID="LnkAgregarRSCO" OnClick="LnkAgregarRSCO_Click" data-toggle="tooltip" data-placement="left" title="Agregar RSCO" Text="<i class='fa fa-plus'></i>Agregar RSCO"></asp:LinkButton>
</li>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompuestoVigencia,CveCompuesto,CveProveedor,RegistroRSCO,FechaVigencia,VigenciaIndeterminada,CveUsuario, NombreComercial"
EmptyDataText="No se Encontraron Registros" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
<Columns>
<asp:BoundField HeaderText="Proveedor" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Compuesto" DataField="Compuesto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Registro RSCO" DataField="RegistroRSCO" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha. Vigencia" ItemStyle-HorizontalAlign="Center" DataField="FechaVigencia" ItemStyle-Width="5%" DataFormatString="{0:d}" />
<asp:BoundField HeaderText="Fecha Indeterminada" DataField="VigenciaIndeterminadaStr" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:BoundField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" DataField="FechaIng" ItemStyle-Width="5%" DataFormatString="{0:d}" />
<asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Eitar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Eliminar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Eliminar" data-btn-ok-label="Si" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<div id="DivAgregarRSCO" class="modal ADS fade" role="dialog">
<div class="modal-dialog ">
<asp:UpdatePanel runat="server" class="modal-content rowpadding" tabindex="-1" ID="UpModalRSCO" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-header ">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">
<asp:Literal runat="server" ID="LtlTituloModal" Text="Agregar Unidad"></asp:Literal></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12" runat="server" id="DVTiposRemolque" >
<div class="form-group form-md-line-input input-iconright" >
<ADS:Dropdownlost ID="DdlProveedores" runat="server" CssClass="form-control" CssStyle="width: 100%;" Width="100%" DataTextField="RazonSocial" DataValueField="CveProveedor"></ADS:Dropdownlost>
<label for="<%= DdlProveedores.ClientID.ToString()%>" style="margin-top:-6px" >Proveedor:</label>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" runat="server">
<div class="form-group form-md-line-input input-iconright">
<asp:DropDownList ID="DdlCompuesto" CssClass="form-control input-sm select2me " Width="100%" runat="server" AppendDataBoundItems="true" AutoPostBack="false" CausesValidation="true" DataValueField="CveCompuesto" DataTextField="Compuesto" Style="padding: 0px">
</asp:DropDownList>
<label for="<%= DdlCompuesto.ClientID.ToString()%>">Compuesto:</label>
<asp:RequiredFieldValidator runat="server" ID="RfvDdlCompuesto" ControlToValidate="DdlCompuesto" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Compuesto''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRSCO"></asp:RequiredFieldValidator>
<i></i>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group form-md-line-input input-iconright">
<asp:TextBox ID="TxtRegistroRSCO" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<label for="<%= TxtRegistroRSCO.ClientID.ToString()%>">Registro RSCO:</label>
<asp:RequiredFieldValidator runat="server" ID="RfvTxtRegistroRSCO" ControlToValidate="TxtRegistroRSCO" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Registro RSCO''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRSCO"></asp:RequiredFieldValidator>
<i></i>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright" style="width: 160px!important" runat="server" id="DvFechaVijencia">
<asp:TextBox ID="TxtFechaVigencia" CssClass="form-control" MaxLength="50" runat="server" Width="130px"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
<asp:LinkButton ID="LnkTxtFechaVigencia" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:CalendarExtender runat="server" ID="CETxtFechaVigencia" TargetControlID="TxtFechaVigencia" PopupButtonID="LnkTxtFechaVigencia" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvTxtFechaVigencia" runat="server" ControlToValidate="TxtFechaVigencia" Display="None"
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRSCO"></asp:CompareValidator>
<asp:RequiredFieldValidator ID="RfvTxtFechaVigencia" runat="server" ControlToValidate="TxtFechaVigencia" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Cierre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRSCO"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaVigencia" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaVigencia" Width="300px"></ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="VCETxtFechaVigencia" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaVigencia" Width="300px"></ajax:ValidatorCalloutExtender>
<label for="<%= TxtFechaVigencia.ClientID.ToString() %>">Fecha de Vigencia:</label>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group form-md-line-input input-iconright" runat="server">
<asp:CheckBox ID="ChkFechaIndeterminada" runat="server" CssClass="form-control" OnCheckedChanged="ChkFechaIndeterminada_CheckedChanged" AutoPostBack="true" />
<label for="<%= ChkFechaIndeterminada.ClientID.ToString()%>">Fecha Indeterminada:</label>
</div>
</div>
</div>
<div class="row" runat="server" id="DivModalContinuarAgregando">
<div class="col-md-12" style="text-align:right!important">
<asp:CheckBox ID="ChkModalContinuarAgregando" runat="server" Text="Continuar Agregando" TextAlign="Left" />
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnAgregarRSCO" Text="Agregar" runat="server" ClientIDMode="Static" CssClass="btn btn-primary" OnClick="BtnAgregarRSCO_Click" ValidationGroup="GrpRSCO" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
</asp:Content>

View File

@@ -1,232 +0,0 @@
Imports Extensiones
Partial Class Inventarios_RegRSCO
Inherits ClsPaginas
Private Property CveCompuestoVigencia As Integer
Get
If ViewState("CveCompuestoVigencia") Is Nothing Then
Return -1
Else
Return ViewState("CveCompuestoVigencia").ToString().ToEntero()
End If
End Get
Set(ByVal value As Integer)
ViewState("CveCompuestoVigencia") = value
End Set
End Property
Private Sub Inventarios_RegRSCO_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
CargaCombos()
CargaDatos()
End If
End Sub
Public Sub CargaDatos()
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetCompuestosVigencia(-1, -1, MinFecha, MaxFecha, 1, UsuarioActual.CveEmpresa) Then
GvDatos.DataSource = ObjInventarios.DtResultados
Else
GvDatos.DataSource = Nothing
End If
ObjInventarios.Dispose()
GvDatos.DataBind()
UpDatos.Update()
End Sub
Private Sub CargaCombos()
DdlProveedores.setEsWebService(True)
DdlProveedores.Attributes.Add("data-metodo", "getproveedores")
DdlProveedores.SelectedText = "Seleccione Uno"
DdlProveedores.SelectedValue = "-1"
Dim ObjPS As New ClsProductosServicios
If ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa) Then
DdlCompuesto.DataSource = ObjPS.DtResultados
Else
DdlCompuesto.DataSource = Nothing
End If
ObjPS.Dispose()
DdlCompuesto.DataBind()
DdlCompuesto.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
UpModalRSCO.Update()
End Sub
Private Sub LimpiarModalDivAgregarRSCO()
CveCompuestoVigencia = -1
BtnAgregarRSCO.Text = "Agregar"
DdlProveedores.txtValue.Value = "-1"
DdlProveedores.txtText.Value = ""
DdlCompuesto.SelectedValueExist(-1)
TxtFechaVigencia.Text = ""
TxtRegistroRSCO.Text = ""
ChkFechaIndeterminada.Checked = False
LtlTituloModal.Text = "Agregar RSCO"
DivModalContinuarAgregando.Visible = True
ChkModalContinuarAgregando.Checked = True
UpModalRSCO.Update()
End Sub
Protected Sub LnkAgregarRSCO_Click(sender As Object, e As EventArgs)
LimpiarModalDivAgregarRSCO()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO"))
End Sub
Protected Sub LnkEditar_Click(sender As Object, e As EventArgs)
BtnAgregarRSCO.Text = "Actualizar"
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
CveCompuestoVigencia = GvRow.DataKey("CveCompuestoVigencia").ToEntero()
DdlProveedores.txtValue.Value = GvRow.DataKey("CveProveedor")
DdlProveedores.txtText.Value = GvRow.DataKey("NombreComercial")
DdlCompuesto.SelectedValueExist(GvRow.DataKey("CveCompuesto"))
TxtFechaVigencia.Text = GvRow.DataKey("FechaVigencia").ToDate.ToString("dd/MM/yyyy")
TxtRegistroRSCO.Text = GvRow.DataKey("RegistroRSCO")
ChkFechaIndeterminada.Checked = Boolean.Parse(GvRow.DataKey("VigenciaIndeterminada"))
LtlTituloModal.Text = "Actualizar RSCO"
DivModalContinuarAgregando.Visible = False
ChkModalContinuarAgregando.Checked = False
If ChkFechaIndeterminada.Checked Then
DvFechaVijencia.Visible = False
TxtFechaVigencia.Text = "01/01/1900"
Else
DvFechaVijencia.Visible = True
End If
UpModalRSCO.Update()
RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarRSCO"))
End Sub
Protected Sub LnkEliminar_Click(sender As Object, e As EventArgs)
Dim ErrorAlElimiar As Boolean = False
Dim GvRow As GridViewRow = CType(((CType(sender, LinkButton)).NamingContainer), GridViewRow)
Dim CveCompuestoVigenciaEliminar = GvRow.DataKey("CveCompuestoVigencia").ToEntero()
Using ObjInventarios As New ClsInventarios
If (ObjInventarios.RemoveCompuestosVigencia(CveCompuestoVigenciaEliminar, UsuarioActual.CveEmpresa)) Then
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO"))
Alert("RSCO Eliminado Correctamente.")
Else
ErrorAlElimiar = True
End If
End Using
If Not ErrorAlElimiar Then
GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
End If
End Sub
Protected Sub BtnAgregarRSCO_Click(sender As Object, e As EventArgs)
Dim ErrorPrceso As Boolean = False
If DdlProveedores.SelectedValue.ToEntero <= 0 Then
Alert("Debe de seleccionar un proveedor.")
Exit Sub
End If
Using ObjInventarios As New ClsInventarios
If CveCompuestoVigencia <= 0 Then
If ObjInventarios.AddCompuestosVigencia(DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("RSCO agregado correctamente")
Else
ErrorPrceso = True
End If
Else
If ObjInventarios.UpdateCompuestosVigencia(CveCompuestoVigencia, DdlCompuesto.SelectedValue.ToEntero, DdlProveedores.SelectedValue.ToEntero, TxtRegistroRSCO.Text, TxtFechaVigencia.Text.ToDate, ChkFechaIndeterminada.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
Alert("RSCO actualizado correctamente")
Else
ErrorPrceso = True
End If
End If
End Using
If Not ErrorPrceso Then
GlobalDTInvCamiones(UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If Not ChkModalContinuarAgregando.Checked Then
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarRSCO"))
Else
LimpiarModalDivAgregarRSCO()
End If
UpDatos.Update()
End If
End Sub
Protected Sub ChkFechaIndeterminada_CheckedChanged(sender As Object, e As EventArgs)
If ChkFechaIndeterminada.Checked Then
DvFechaVijencia.Visible = False
TxtFechaVigencia.Text = "01/01/1900"
Else
DvFechaVijencia.Visible = True
TxtFechaVigencia.Text = ""
End If
UpModalRSCO.Update()
End Sub
End Class

View File

@@ -40,6 +40,7 @@
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server"> <asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
<asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server"> <asp:UpdatePanel ID="UpFiltros" UpdateMode="Conditional" runat="server">
<ContentTemplate> <ContentTemplate>
<div class="portlet solid grey-cascade portlet-filter"> <div class="portlet solid grey-cascade portlet-filter">
<div class="portlet-title portlet-filterT smalltitle"> <div class="portlet-title portlet-filterT smalltitle">
<div class="tools"> <div class="tools">
@@ -91,9 +92,31 @@
</asp:DropDownList> </asp:DropDownList>
</div> </div>
</div> </div>
</div>
</div>
<div class="portlet-body" style="display: block">
<div class="row">
<div class="col-md-1" style="max-width: 70px">Esatus:</div>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlEstatus" Width="100%" CssClass="select2me">
<asp:ListItem Value="-1">Todos</asp:ListItem>
<asp:ListItem Value="0" Selected="True">Activo</asp:ListItem>
<asp:ListItem Value="1">Cerrado</asp:ListItem>
</asp:DropDownList>
</div> </div>
</div> </div>
</div> </div>
</div>
</ContentTemplate> </ContentTemplate>
</asp:UpdatePanel> </asp:UpdatePanel>
<br /> <br />

View File

@@ -49,7 +49,7 @@ Partial Class Compras_RepFletes
Dim ObjInv As New ClsInventarios Dim ObjInv As New ClsInventarios
If TxtFolio.Text <> "" Then TxtFechaI.Text = MinFecha.ToShortDateString : TxtFechaF.Text = MaxFecha.ToShortDateString If TxtFolio.Text <> "" Then TxtFechaI.Text = MinFecha.ToShortDateString : TxtFechaF.Text = MaxFecha.ToShortDateString
If ObjInv.GetFletesRep(UsuarioActual.CveEmpresa, -1, If(TxtFolio.Text = "", "-1", TxtFolio.Text), DdlProveedores.SelectedValue.ToString.ToEntero, -1, -1, If ObjInv.GetFletesRep(UsuarioActual.CveEmpresa, -1, If(TxtFolio.Text = "", "-1", TxtFolio.Text), DdlProveedores.SelectedValue.ToString.ToEntero, -1, -1,
TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, TipoGasto:=DdlTipoGasto.SelectedValue.ToEntero()) Then TxtFechaI.Text.ToDate, TxtFechaF.Text.ToDate, TipoGasto:=DdlTipoGasto.SelectedValue.ToEntero(), CveEstatus:=DdlEstatus.SelectedValue.ToEntero()) Then
DtFletes = ObjInv.DtResultados DtFletes = ObjInv.DtResultados
End If End If
ObjInv.Dispose() ObjInv.Dispose()

View File

@@ -118,7 +118,7 @@
<ajax:CalendarExtender ID="CalFechaIEjec" runat="server" TargetControlID="TxtFechaInicio" PopupButtonID="ImgCalFechaIEjec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender> <ajax:CalendarExtender ID="CalFechaIEjec" runat="server" TargetControlID="TxtFechaInicio" PopupButtonID="ImgCalFechaIEjec" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
</div> </div>
<div class="col-md-1" style="text-align:right"> <div class="col-md-1" style="text-align:right">
<label>. Fin:</label> <label>F. Fin:</label>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;display:flex"> <div class="input-group input-sm input-small date date-picker" data-date-format="dd/mm/yyyy" style="width: 100% !important; padding: 0px;display:flex">
@@ -139,10 +139,10 @@
<div class="col-sm-1" style="text-align:right"> <div class="col-sm-1" style="text-align:right">
<label>Sucursal:</label> <label>Sucursal:</label>
</div> </div>
<div class="col-sm-1"> <div class="col-sm-2">
<asp:DropDownList runat="server" ID="DdlSucursal" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlSucursal_SelectedIndexChanged" Width="100%"></asp:DropDownList> <asp:DropDownList runat="server" ID="DdlSucursal" CssClass="select2me" DataTextField="SubProyecto" DataValueField="CveSubProyecto" AutoPostBack="true" OnSelectedIndexChanged="DdlSucursal_SelectedIndexChanged" Width="100%"></asp:DropDownList>
</div> </div>
<label class="col-md-1 truncate" >Almacén:</label> <label class="col-md-1 truncate" style="text-align:right">Almacén:</label>
<div class="col-md-1"> <div class="col-md-1">
<asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox> <asp:ListBox ID="ddlAlmacen" SelectionMode="Multiple" data-text="Todos" AppendDataBoundItems="true" CssClass="ddlFiltros input-sm select2me Widthall" Style="width: 100%;" runat="server" DataTextField="Almacen" DataValueField="CveAlmacen"></asp:ListBox>
@@ -153,11 +153,19 @@
<div class="col-md-1"> <div class="col-md-1">
<asp:DropDownList runat="server" ID="DdlClasificacion" CssClass="select2me" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" CssStyle="width: 100%;"/> <asp:DropDownList runat="server" ID="DdlClasificacion" CssClass="select2me" DataTextField="Clasificacion" DataValueField="CveClasificacion" Width="100%" CssStyle="width: 100%;"/>
</div> </div>
<label class="col-md-1 truncate">Producto:</label>
<label class="col-md-1 truncate" style="text-align:right" >Compuesto:</label>
<div class="col-md-2">
<asp:DropDownList runat="server" ID="DdlCompuesto" CssClass="select2me" DataTextField="Compuesto" DataValueField="CveCompuesto" Width="100%" ></asp:DropDownList>
</div>
</div>
<div class="row">
<label class="col-md-1 truncate" style="text-align:right">Producto:</label>
<div class="col-md-2"> <div class="col-md-2">
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" Width="100%" /> <ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:100%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" Width="100%" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -29,10 +29,13 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
CargaFiltros(); CargaFiltros();
CargarDatos(); CargarDatos();
CargaAlamacenes(); CargaAlamacenes();
CargaCompuestos();
} }
} }
private void CargarDatos() private void CargarDatos()
{ {
@@ -47,7 +50,8 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
// aqui siempre se visualiza la caducidad, sin importar la condición, porque siempre se valida la caducidad // aqui siempre se visualiza la caducidad, sin importar la condición, porque siempre se valida la caducidad
ClsInventarios ObjInventarios = new ClsInventarios(); ClsInventarios ObjInventarios = new ClsInventarios();
if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(), if (ObjInventarios.GetProductosCaducidad(DdlProveedor.SelectedValue.ToEntero(), FI, TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
DdlClasificacion.SelectedValue.ToEntero(), CvePS, Cves_Alamcenes, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Opcion: DdlOpcion.SelectedValue.ToEntero())) DdlClasificacion.SelectedValue.ToEntero(), CvePS, Cves_Alamcenes, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, Opcion: DdlOpcion.SelectedValue.ToEntero(),
CveCompuesto: DdlCompuesto.SelectedValue.ToEntero() ))
{ {
GvDatos.DataSource = ObjInventarios.DtResultados; GvDatos.DataSource = ObjInventarios.DtResultados;
DTDatos = ObjInventarios.DtResultados; DTDatos = ObjInventarios.DtResultados;
@@ -75,6 +79,16 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
} }
private void CargaCompuestos()
{
ClsProductosServicios ObjPS = new ClsProductosServicios();
ObjPS.GetCompuestosActivos(UsuarioActual.CveEmpresa);
DdlCompuesto.DataSource = ObjPS.DtResultados;
ObjPS.Dispose();
DdlCompuesto.DataBind();
DdlCompuesto.Items.Insert(0, new ListItem("Todos", "-1"));
}
private void CargarFechaText() private void CargarFechaText()
{ {
DateTime date = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); DateTime date = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);

View File

@@ -115,26 +115,20 @@
<ContentTemplate> <ContentTemplate>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" <asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False"
DataKeyNames="CveCompuestoVigencia,CveCompuesto,CveProveedor,RegistroRSCO,FechaVigencia,VigenciaIndeterminada,CveUsuario" DataKeyNames="CvePS,CveCompuesto,CveProveedorCompra,RegistroRSCO,FechaVigenciaRSCOStr,VigenciaIndeterminadaRSCO,CveUsuario"
EmptyDataText="No se Encontraron Registros" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None"> EmptyDataText="No se Encontraron Registros" ToolTip="Listado de Unidades" CssClass="table table-striped table-advance table-hover mysmallbtn " data-sort="true" Style="width: 100%" GridLines="None">
<Columns> <Columns>
<asp:BoundField HeaderText="Proveedor" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Proveedor" DataField="NombreComercial" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Compuesto" DataField="Compuesto" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Compuesto" DataField="Compuesto" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Registro RSCO" DataField="RegistroRSCO" ItemStyle-HorizontalAlign="Left" /> <asp:BoundField HeaderText="Registro RSCO" DataField="RegistroRSCO" ItemStyle-HorizontalAlign="Left" />
<asp:BoundField HeaderText="Fecha. Vigencia" ItemStyle-HorizontalAlign="Center" DataField="FechaVigencia" ItemStyle-Width="5%" DataFormatString="{0:d}" /> <asp:BoundField HeaderText="Fecha. Vigencia" ItemStyle-HorizontalAlign="Center" DataField="FechaVigenciaRSCOStr" ItemStyle-Width="5%" />
<asp:BoundField HeaderText="Fecha Indeterminada" DataField="VigenciaIndeterminadaStr" ItemStyle-HorizontalAlign="Center" />
<asp:BoundField HeaderText="Usuario" DataField="Usuario" /> <asp:BoundField HeaderText="Usuario" DataField="Usuario" />
<asp:BoundField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" DataField="FechaIng" ItemStyle-Width="5%" DataFormatString="{0:d}" /> <asp:BoundField HeaderText="Fecha Ing." ItemStyle-HorizontalAlign="Center" DataField="Fecha" ItemStyle-Width="5%" DataFormatString="{0:d}" />
<%-- <asp:TemplateField ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Left" HeaderText="Editar">
<ItemTemplate>
<asp:LinkButton ID="LnkEditar" OnClick="LnkEditar_Click" runat="server" Visible="true" AlternateText="Eitar" CausesValidation="False" CssClass="btn btn-circle btn-sm green" Text="<i title='Editar' class='fa fa-pencil' title='Editar' ></i>" />
<asp:LinkButton ID="LnkEliminar" OnClick="LnkEliminar_Click" runat="server" Visible="true" AlternateText="Eliminar" CausesValidation="False" CssClass="btn btn-circle btn-sm red" Text="<i title='Eliminar' class='icon-trash' title='Eliminar' ></i>" data-toggle="confirmation" data-popout="true" data-original-title="Eliminar" data-btn-ok-label="Si" />
</ItemTemplate>
</asp:TemplateField>--%>
</Columns> </Columns>
</asp:GridView> </asp:GridView>
</ContentTemplate> </ContentTemplate>

View File

@@ -2987,8 +2987,8 @@ Partial Class Sistemas_UsuarioDetalle
#Region "TAB - ACCESO MODULOS" #Region "TAB - ACCESO MODULOS"
Public Sub CargaModulosAcceso() Public Sub CargaModulosAcceso()
Dim ObjPermisos As New ClsSisUsuarios Dim ObjPermisos As New ClsSisUsuarios
If ObjPermisos.GetUsuariosModulos(CveUsuario, UsuarioActual.CveEmpresa, If(UsuarioControlado, UsuarioActual.CveUsuario, -1), CvePlataforma:=1) Then If ObjPermisos.GetUsuariosModulos(CveUsuario, UsuarioActual.CveEmpresa, If(UsuarioControlado, UsuarioActual.CveUsuario, -1)) Then
DTModulos = ObjPermisos.DtResultados.FiltraParametros("Liga <> '' ") DTModulos = ObjPermisos.DtResultados.FiltraParametros("Liga <> '' AND CvePlataforma IN (1,4) ")
Else Else
DTModulos = Nothing DTModulos = Nothing
End If End If

View File

@@ -77,7 +77,7 @@ Partial Class Ventas_CatAutorizacionLimites
FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha) FechaF = If(IsDate(txtFechaF.Text.Trim()), txtFechaF.Text.Trim.ToDate, MaxFecha)
Dim ObjGral As New ClsVentas Dim ObjGral As New ClsVentas
If ObjGral.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedorFiltro.SelectedValue.ToEntero(), "-1", CveEstatus:=DdlEstatus.SelectedValue.ToEntero(), FechaI:=FechaI, FechaF:=FechaF) Then If ObjGral.GetAutorizacionLimite(UsuarioActual.CveEmpresa, CveCliente, DdlVendedorFiltro.SelectedValue.ToEntero(), "-1", CveEstatus:=DdlEstatus.SelectedValue.ToEntero(), FechaI:=FechaI, FechaF:=FechaF, CveUsuarioConsulta:=UsuarioActual.CveUsuario) Then
GvDatos.DataSource = ObjGral.DtResultados GvDatos.DataSource = ObjGral.DtResultados
End If End If
ObjGral.Dispose() ObjGral.Dispose()

View File

@@ -4502,7 +4502,7 @@
<asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Cargo" ItemStyle-HorizontalAlign="Center">
<ItemTemplate> <ItemTemplate>
<asp:CheckBox ID="ChkCargo" runat="server"></asp:CheckBox> <asp:CheckBox ID="ChkCargo" runat="server" Visible="false" Checked="false"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="Bonificación" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="Bonificación" ItemStyle-HorizontalAlign="Center">

View File

@@ -9219,13 +9219,13 @@ Partial Class Clientes
Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo")) Dim FacturadoCargo As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoCargo"))
Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion")) Dim FacturadoBonificacion As Boolean = Boolean.Parse(e.Row.DataKey("FacturadoBonificacion"))
If FacturadoCargo Then 'If FacturadoCargo Then
e.Row.FCCheckBox("ChkCargo").Checked = False ' e.Row.FCCheckBox("ChkCargo").Checked = False
e.Row.FCCheckBox("ChkCargo").Visible = False ' e.Row.FCCheckBox("ChkCargo").Visible = False
Else 'Else
e.Row.FCCheckBox("ChkCargo").Checked = False ' e.Row.FCCheckBox("ChkCargo").Checked = False
e.Row.FCCheckBox("ChkCargo").Visible = False 'True ' e.Row.FCCheckBox("ChkCargo").Visible = False 'True
End If 'End If
If FacturadoBonificacion Then If FacturadoBonificacion Then
e.Row.FCCheckBox("ChkBonificacion").Checked = False e.Row.FCCheckBox("ChkBonificacion").Checked = False
@@ -9240,6 +9240,10 @@ Partial Class Clientes
ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then ElseIf e.Row.DBCampo("EsUsadoAjuste") = "1" Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If End If
If e.Row.DBCampo("ImporteBonificacion").ToDecimal() = 0 Then
e.Row.FCCheckBox("ChkBonificacion").Visible = False
End If
End If End If
Else Else
@@ -10231,9 +10235,19 @@ Partial Class Clientes
TxtNombreComercial.Enabled = True TxtNombreComercial.Enabled = True
End If End If
' DdlRegimenFiscal.SelectedIndex = -1 ' DdlRegimenFiscal.SelectedIndex = -1
Dim dt As DataTable = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal")
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
'verifico que sino existe el valor. lo limpie
Dim Val As String = dt.FiltroPrimeroValor("CveRegimenFiscal", "CveRegimenFiscal = " & DdlRegimenFiscal.SelectedValue)
If Val = "" Then 'sino encuentra valor, lo limpia
DdlRegimenFiscal.Items.Clear() DdlRegimenFiscal.Items.Clear()
DdlRegimenFiscal.SelectedValue = Nothing DdlRegimenFiscal.SelectedValue = Nothing
DdlRegimenFiscal.DataSource = GlobalDTRegimenesFiscales(RdTipoPersona.SelectedValue.ToEntero).FiltraParametros("", "CodigoRegimenFiscal") End If
End If
DdlRegimenFiscal.DataSource = dt
DdlRegimenFiscal.DataBind() DdlRegimenFiscal.DataBind()
UpDatos.Update() UpDatos.Update()

View File

@@ -210,7 +210,7 @@
Real<br/>Acum. Real<br/>Acum.
</HeaderTemplate> </HeaderTemplate>
<ItemTemplate> <ItemTemplate>
<asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado", "{0:#,###}").ToString() %>'> </asp:Label> <asp:Label ID="lblRealAcumulado" runat="server" Target="_blank" Text='<%# Eval("RealAcumulado", "{0:#,###.##}").ToString() %>'> </asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center"> <asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">

View File

@@ -250,6 +250,17 @@
<i></i> <i></i>
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-3">
<asp:TextBox ID="TxtVentaMinima" CssClass="form-control " runat="server"></asp:TextBox>
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>
<label class="truncate" style="padding-left: 16px;" for="<%= TxtVentaMinima.ClientID.ToString()%>">Venta Mínima:</label>
<i></i>
</div>
<div class="row">
<div class=" col-md-12">
<div runat="server" id="DivCompuesto" class="form-group form-md-line-input input-iconright" visible="false"> <div runat="server" id="DivCompuesto" class="form-group form-md-line-input input-iconright" visible="false">
<asp:DropDownList ID="DdlCompuesto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" runat="server" DataTextField="Compuesto" DataValueField="CveCompuesto" Width="206px" Height="22px"> <asp:DropDownList ID="DdlCompuesto" AppendDataBoundItems="true" CssClass="form-control input-sm select2me" runat="server" DataTextField="Compuesto" DataValueField="CveCompuesto" Width="206px" Height="22px">
<asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem> <asp:ListItem Text="Seleccione" Value="-1"></asp:ListItem>
@@ -257,12 +268,80 @@
<label for="<%= DdlCompuesto.ClientID.ToString()%>">Compuesto:</label> <label for="<%= DdlCompuesto.ClientID.ToString()%>">Compuesto:</label>
<i></i> <i></i>
</div> </div>
<div class="form-group form-md-line-input input-iconright col-xs-3">
<asp:TextBox ID="TxtVentaMinima" CssClass="form-control " runat="server"></asp:TextBox> </div>
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%> </div>
<label class="truncate" style="padding-left: 16px;" for="<%= TxtVentaMinima.ClientID.ToString()%>">Venta Mínima:</label> <br />
<div class="row">
<div class=" col-md-4">
<div runat="server" id="DivRegistroRSCO1" class="form-group form-md-line-input input-iconright" visible="false" style="width:100%!important">
<asp:TextBox ID="TxtRegistroRSCO" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
<label for="<%= TxtRegistroRSCO.ClientID.ToString()%>">Registro RSCO:</label>
<%--<asp:RequiredFieldValidator runat="server" ID="RfvTxtRegistroRSCO" ControlToValidate="TxtRegistroRSCO" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Registro RSCO''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
<i></i> <i></i>
</div> </div>
</div>
<div class=" col-md-4" runat="server" id="DivRegistroRSCO2" visible="false">
<div class="form-group form-md-line-input input-iconright" runat="server" style="width: 200px">
<asp:CheckBox ID="ChkFechaIndeterminadaRSCO" runat="server" CssClass="form-control" OnCheckedChanged="ChkFechaIndeterminadaRSCO_CheckedChanged" AutoPostBack="true" />
<label for="<%= ChkFechaIndeterminadaRSCO.ClientID.ToString()%>">Fecha Indeterminada:</label>
</div>
</div>
<div class=" col-md-4">
<div class="form-group form-md-line-input input-iconright" style="width: 160px!important" runat="server" id="DivRegistroRSCO3" visible="false">
<asp:TextBox ID="TxtFechaVigenciaRSCO" CssClass="form-control" MaxLength="50" runat="server" Width="130px"></asp:TextBox>
<span class="input-group-btn " style="position: absolute; right: 41px; top: -5px;">
<asp:LinkButton ID="LnkTxtFechaVigenciaRSCO" class="btn default" Style="margin-top: 15px; margin-left: 6px" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
</span>
<ajax:CalendarExtender runat="server" ID="CETxtFechaVigenciaRSCO" TargetControlID="TxtFechaVigenciaRSCO" PopupButtonID="LnkTxtFechaVigenciaRSCO" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
<asp:CompareValidator ID="CvTxtFechaVigenciaRSCO" runat="server" ControlToValidate="TxtFechaVigenciaRSCO" Display="None"
ErrorMessage="El campo <b>''Fecha de Cierre''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)."
Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardar"></asp:CompareValidator>
<%--<asp:RequiredFieldValidator ID="RfvTxtFechaVigenciaRSCO" runat="server" ControlToValidate="TxtFechaVigenciaRSCO" Display="None"
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha de Cierre''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaVigenciaRSCO" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaVigenciaRSCO" Width="300px"></ajax:ValidatorCalloutExtender>
<%--<ajax:ValidatorCalloutExtender ID="VCETxtFechaVigenciaRSCO" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaVigenciaRSCO" Width="300px"></ajax:ValidatorCalloutExtender>--%>
<label for="<%= TxtFechaVigenciaRSCO.ClientID.ToString() %>">Fecha de Vigencia:</label>
</div>
</div>
</div>
<div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server"> <div class="form-group form-md-line-input input-iconright col-xs-3" id="divLitraje" visible="false" runat="server">
<asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ></asp:TextBox> <asp:TextBox ID="TxtLitraje" CssClass="form-control " runat="server" ></asp:TextBox>
<%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%> <%--<ajax:FilteredTextBoxExtender ID="FTBETVentaMinima" TargetControlID="TxtVentaMinima" FilterType="Numbers" runat="server" ValidChars=".," />--%>

View File

@@ -220,6 +220,18 @@ Partial Class ProductosyServicios
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(143) = "1" Then
DivRegistroRSCO1.Visible = True
DivRegistroRSCO2.Visible = True
DivRegistroRSCO3.Visible = True
TxtRegistroRSCO.Text = ""
TxtFechaVigenciaRSCO.Text = ""
ChkFechaIndeterminadaRSCO.Checked = False
End If
End If End If
If Request("Ret") IsNot Nothing AndAlso Request("Ret").ToString <> "" Then If Request("Ret") IsNot Nothing AndAlso Request("Ret").ToString <> "" Then
@@ -352,7 +364,7 @@ Partial Class ProductosyServicios
DivObjetoImpuesto.Visible = True DivObjetoImpuesto.Visible = True
DdlObjetoImpuesto.DataSource = GlobalDTSATObjetosImpuestos DdlObjetoImpuesto.DataSource = GlobalDTSATObjetosImpuestos
DdlObjetoImpuesto.DataBind() DdlObjetoImpuesto.DataBind()
DdlObjetoImpuesto.SelectedValue = "02" 'se sugiere este valor, que sería el más utilizado DdlObjetoImpuesto.SelectedValue = "2" 'se sugiere este valor, que sería el más utilizado
End If End If
CreaDtSeccionAlmacen() CreaDtSeccionAlmacen()
@@ -1000,6 +1012,35 @@ Partial Class ProductosyServicios
ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre ChkPrecioLibre.Checked = ObjProductosServicios.PrecioLibre
If UsuarioActual.Empresa.Funcionalidad(143) = "1" Then
TxtRegistroRSCO.Text = ObjProductosServicios.DtResultados.Rows(0)("RegistroRSCO").ToString
ChkFechaIndeterminadaRSCO.Checked = Boolean.Parse(ObjProductosServicios.DtResultados.Rows(0)("VigenciaIndeterminadaRSCO").ToString)
DivRegistroRSCO1.Visible = True
DivRegistroRSCO2.Visible = True
If ChkFechaIndeterminadaRSCO.Checked Then
TxtFechaVigenciaRSCO.Text = "01/01/1900"
Else
TxtFechaVigenciaRSCO.Text = ObjProductosServicios.DtResultados.Rows(0)("FechaVigenciaRSCO").ToString.ToDate.ToString("dd/MM/yyyy")
DivRegistroRSCO3.Visible = True
End If
Else
TxtRegistroRSCO.Text = ""
TxtFechaVigenciaRSCO.Text = ""
ChkFechaIndeterminadaRSCO.Checked = False
End If
Else Else
Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia)
RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')")
@@ -1365,6 +1406,11 @@ Partial Class ProductosyServicios
End If End If
End If End If
If TxtFechaVigenciaRSCO.Text = "" Then
TxtFechaVigenciaRSCO.Text = "01/01/1900"
End If
If CvePS = -1 Then If CvePS = -1 Then
Dim PSS As String = TxtPS.Text.Trim.Replace("|", "") Dim PSS As String = TxtPS.Text.Trim.Replace("|", "")
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper If UsuarioActual.CveEmpresa.Contiene(1, 72, 80) Then PSS = PSS.ToUpper
@@ -1381,7 +1427,7 @@ Partial Class ProductosyServicios
ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoEmpaque:=DdlImpEmpaque.SelectedValue.ToString, ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString,
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) > 0 Then CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked) > 0 Then
ViewState("CvePS") = ObjProductosServicios.CvePS ViewState("CvePS") = ObjProductosServicios.CvePS
For Each GVR As GridViewRow In GvImpuestosLocales.Rows For Each GVR As GridViewRow In GvImpuestosLocales.Rows
If GVR.FCCheckBox("ChkDeduccion").Checked Then If GVR.FCCheckBox("ChkDeduccion").Checked Then
@@ -1432,7 +1478,8 @@ Partial Class ProductosyServicios
ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, EsOutSourcing:=ChkEsOutSourcing.Checked,
AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TiempoCaducidad, CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked,
CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim,
CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal) Then CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal,
RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked) Then
If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then
TieneError = True TieneError = True
@@ -1900,6 +1947,10 @@ Partial Class ProductosyServicios
DdlCompuesto.DataSource = PS.DtResultados DdlCompuesto.DataSource = PS.DtResultados
PS.Dispose() PS.Dispose()
DdlCompuesto.DataBind() DdlCompuesto.DataBind()
End If End If
End Sub End Sub
@@ -3183,5 +3234,16 @@ Partial Class ProductosyServicios
End Sub End Sub
Protected Sub ChkFechaIndeterminadaRSCO_CheckedChanged(sender As Object, e As EventArgs)
DivRegistroRSCO3.Visible = If(ChkFechaIndeterminadaRSCO.Checked, False, True)
If TxtFechaVigenciaRSCO.Text = "01/01/1900" Then
TxtFechaVigenciaRSCO.Text = ""
End If
UpDatos.Update()
End Sub
End Class End Class

View File

@@ -398,9 +398,9 @@ public partial class Ventas_RepProductosServiciosPeriodo : ClsPaginas
{ {
string Info = ""; string Info = "";
StringBuilder SBJSScript = new StringBuilder(); StringBuilder SBJSScript = new StringBuilder();
if (DTDatos.Rows.Count > 0) if (DTDatos.Rows.Count > 0)
{ {
foreach (DataRow DbRow in DTDatos.Rows) foreach (DataRow DbRow in DTDatos.Rows)
{ {
string moneda = DbRow["Moneda"].ToString(); string moneda = DbRow["Moneda"].ToString();

View File

@@ -343,6 +343,14 @@ Partial Class Ventas
ViewState("DTRemisiones") = value ViewState("DTRemisiones") = value
End Set End Set
End Property End Property
Private Property ListaDescuentos As List(Of Descuentos)
Get
Return If(IsNothing(ViewState("ListaDescuentos")), Nothing, CType(ViewState("ListaDescuentos"), List(Of Descuentos)))
End Get
Set(value As List(Of Descuentos))
ViewState("ListaDescuentos") = value
End Set
End Property
Private Property RemisionesLista As List(Of Integer) Private Property RemisionesLista As List(Of Integer)
Get Get
Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer))) Return If(IsNothing(ViewState("RemisionesLista")), Nothing, CType(ViewState("RemisionesLista"), List(Of Integer)))
@@ -2318,6 +2326,8 @@ Partial Class Ventas
RemisionesLista = New List(Of Integer) RemisionesLista = New List(Of Integer)
Pedidos2Lista = New List(Of Integer) Pedidos2Lista = New List(Of Integer)
CotizacionesLista = New List(Of Integer) CotizacionesLista = New List(Of Integer)
ListaDescuentos = New List(Of Descuentos)
CuentasContablesInvalidas = New StringBuilder CuentasContablesInvalidas = New StringBuilder
CvePrePoliza = 0 CvePrePoliza = 0
TotalOtrosConceptos = 0 TotalOtrosConceptos = 0
@@ -4400,19 +4410,143 @@ Partial Class Ventas
CveVenta = If(CvePedido > 0, CvePedido, CveVenta) CveVenta = If(CvePedido > 0, CvePedido, CveVenta)
Dim DtAntRelacionados As DataTable = Nothing Dim DtAntRelacionados As DataTable = Nothing
Dim SerieFolioPadre As String
Dim DbRowVenta As DataRow = Nothing
Dim ObjVentas As New ClsVentas() 'CARGA DTs DE VENTAS
If CveVenta > 0 Then
Using ObjVentas As New ClsVentas()
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
DbRowVenta = ObjVentas.DtResultados.Copy().Rows(0)
Else
ViewState("CveVenta") = -1
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
End If
End If
If DbRowVenta IsNot Nothing Then
If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then If ObjVentas.GetVentasRelacionadas(CveVenta, UsuarioActual.CveEmpresa) Then
DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')") DtAntRelacionados = ObjVentas.DtResultados.FiltraParametros("TipoDocto IN ('Ing','Ant','Egs','Dev')")
End If End If
Dim SerieFolioPadre As String 'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados.Copy()
If ObjVentas.GetVenta(CveVenta, UsuarioActual.CveEmpresa) Then TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
End If
'CargaFirmas
If ObjVentas.GetVentasFirmas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DTmpF = ObjVentas.DtResultados.Copy()
End If
End If
'CARGA IMPUESTOS LOCALES
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TmpDTImpuestos = ObjVentas.DtResultados.Copy()
End If
End If
'CARGA ANTICIPOS
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") Then
'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
TmpDTDocumentosRelacionados = ObjVentas.DtResultados.Copy()
GvAntNC.DataSource = TmpDTDocumentosRelacionados
GvAntNC.Caption = " <table width='100%'><tr><td style='text-align:center'>(Anticipos/NC/IxC) Vinculados</td></tr></table>"
GvAntNC.DataBind()
End If
End If
If DbRowVenta("TipoDocto").ToString().Contiene("Egs", "Dev", "Ant") Then
Dim AplicaAmortizacion As Boolean = False
If DbRowVenta("TipoDocto").ToString().Contiene("Ant") Then AplicaAmortizacion = True
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
TmpDTNCVinculadas = ObjVentas.DtResultados.Copy()
GvNC.DataSource = TmpDTNCVinculadas
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
GvNC.DataBind()
InicializaDTVentasNC()
For Each Dr As DataRow In TmpDTNCVinculadas.Rows
If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then
CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If
Next
If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False
End If
End If
End If
End If
'CARGA REMISIONES
If ObjVentas.GetRemisionesRelacionadas(CveVenta, DbRowVenta("TipoDocto").ToString()) Then
GvRemisiones.Caption = " <table width='100%'><tr><td style='text-align:center'>Remisiones/Facturas</td></tr></table>"
GvRemisiones.DataSource = ObjVentas.DtResultados.Copy()
GvCancelarRemisiones.DataSource = ObjVentas.DtResultados.Copy()
GvRemisiones.DataBind()
GvCancelarRemisiones.DataBind()
'[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018
If DbRowVenta("TipoDocto").ToString().Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then
LbCancelarDocumento.Visible = False
End If
'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION
If DbRowVenta("TipoDocto").ToString().Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
'LiDevolucionAlmacen.Visible = False
End If
End If
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DbRowVenta("TipoDocto").ToString() = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
'CARGA GV DE OC RELACIONADAS
If ObjVentas.GetOCRelacionadas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DivOCRelacionadas.Visible = True
GvOCRelacionadas.DataSource = ObjVentas.DtResultados
GvOCRelacionadas.DataBind()
End If
End If
End If
End Using
End If
If DbRowVenta IsNot Nothing Then
'CARGAR PS
GvPS.DataSource = TmpDT
GvPS.DataBind()
If ObjVentas.DtResultados IsNot Nothing AndAlso ObjVentas.DtResultados.Rows.Count > 0 Then
Dim DbRowVenta As DataRow = ObjVentas.DtResultados.Rows(0)
Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero() Dim CveCliente As Integer = DbRowVenta("CveCliente").ToString().ToEntero()
HdnCveVenta.Value = CveVenta.ToString() HdnCveVenta.Value = CveVenta.ToString()
@@ -4432,13 +4566,10 @@ Partial Class Ventas
Else Else
DivAdjuntar.Visible = False DivAdjuntar.Visible = False
End If End If
ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero() ViewState("CveSubProyectoVenta") = DbRowVenta("CveSubProyecto").ToString().ToEntero()
Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero() Me.CveEstatusFacturaPadre = DbRowVenta("CveEstatusFacturaPadre").ToString().ToEntero()
'CargaEncabezado 'CargaEncabezado
If Not (CveRemision > 0 Or CveCotizacion > 0) Then If Not (CveRemision > 0 Or CveCotizacion > 0) Then
@@ -4518,21 +4649,6 @@ Partial Class Ventas
TrServicioDomicilio.Visible = True TrServicioDomicilio.Visible = True
End If End If
'CargaDetalle
If ObjVentas.GetVentaDetalle(CveVenta) Then
TmpDT = ObjVentas.DtResultados
TmpDT.Columns.Add("EntregaDirecta", GetType(Integer))
TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer))
TmpDT.Columns.Add("CveVentaDetalleRNC", GetType(Integer))
TmpDT.Columns.Add("TieneProntoPago", GetType(String))
TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal))
GvPS.DataSource = ObjVentas.DtResultados
GvPS.DataBind()
'IEPS A NIVEL DETALLE
'TxtIEPS.Text = If(TmpDT.SUM("IEPS") > 0, TmpDT.SUM("IEPS").FormatoNumero, TxtIEPS.Text)
End If
If UsuarioActual.TienePermisoProceso(318) Then If UsuarioActual.TienePermisoProceso(318) Then
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Ing", "Ant", "Dev") AndAlso String.IsNullOrEmpty(DbRowVenta("FolioFiscal").ToString.Trim) Then HplFolioFiscalModal.Visible = True
End If End If
@@ -4957,9 +5073,6 @@ Partial Class Ventas
TrTipoRelacion2.Visible = True TrTipoRelacion2.Visible = True
LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString() LblTipoRelacion.Text = DbRowVenta("TipoRelacion").ToString()
HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString() HdnFolioFiscalNC.Value = DbRowVenta("FolioFiscalPadre").ToString()
End If End If
@@ -5149,29 +5262,17 @@ Partial Class Ventas
GvPS.Columns(19).Visible = False GvPS.Columns(19).Visible = False
GvPS.Columns(20).Visible = False GvPS.Columns(20).Visible = False
'CargaFirmas GvFirmas.DataSource = DTmpF
If ObjVentas.GetVentasFirmas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DTmpF = ObjVentas.DtResultados
GvFirmas.DataSource = ObjVentas.DtResultados
GvFirmas.DataBind() GvFirmas.DataBind()
Else
GvFirmas.DataSource = Nothing
End If
End If
'CARGA IMPUESTOS LOCALES If TmpDTImpuestos IsNot Nothing AndAlso TmpDTImpuestos.Rows.Count > 0 Then
If ObjVentas.GetVentaImpuestosLocales(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
TrOtros.Visible = True TrOtros.Visible = True
TmpDTImpuestos = ObjVentas.DtResultados GvImpuestosLocales2.DataSource = TmpDTImpuestos
GvImpuestosLocales2.DataSource = ObjVentas.DtResultados
GvImpuestosLocales2.DataBind() GvImpuestosLocales2.DataBind()
GvImpuestosLocales2.Enabled = False GvImpuestosLocales2.Enabled = False
GvImpuestosLocales2.Visible = True GvImpuestosLocales2.Visible = True
End If End If
End If
DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero. DdlVendedor.SelectedValue = If(DbRowVenta("CveVendedor").ToString = "", "0", DbRowVenta("CveVendedor").ToString) 'si viene dbnull, que ponga cero.
DdlTipoComprobante.Enabled = False DdlTipoComprobante.Enabled = False
@@ -5273,64 +5374,6 @@ Partial Class Ventas
'JJMQ 20160506: Se agrego para la validacion de pago de contado. 'JJMQ 20160506: Se agrego para la validacion de pago de contado.
'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "") 'CVImporteContado.ValueToCompare = TxtTotal.Text.Replace(",", "")
'CARGA ANTICIPOS
If Not (CveRemision > 0 Or CveCotizacion > 0) Then
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant", "Rem") Then
'carga as notas de credito vinculadas
If ObjVentas.GetVentasAntNC(CveVenta, -1) Then
GvAntNC.DataSource = ObjVentas.DtResultados
TmpDTDocumentosRelacionados = ObjVentas.DtResultados
GvAntNC.Caption = " <table width='100%'><tr><td style='text-align:center'>(Anticipos/NC/IxC) Vinculados</td></tr></table>"
GvAntNC.DataBind()
End If
End If
If DdlTipoComprobante.SelectedValue.Contiene("Egs", "Dev", "Ant") Then
Dim AplicaAmortizacion As Boolean = False
If DdlTipoComprobante.SelectedValue.Contiene("Ant") Then AplicaAmortizacion = True
If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion) Then
GvNC.DataSource = ObjVentas.DtResultados
TmpDTNCVinculadas = ObjVentas.DtResultados
GvNC.Caption = " <table width='100%'><tr><td style='text-align:center'>Ventas Aplicadas</td></tr></table>"
GvNC.DataBind()
InicializaDTVentasNC()
For Each Dr As DataRow In ObjVentas.DtResultados.Rows
If Dr("CveConceptoContable").ToString().ToEntero() = 91 Then
CargaNCDT(Dr("CveVenta").ToString().ToEntero(), Dr("Importe").ToString().ToDecimal, Dr("FolioFiscal").ToString(), TC:=Dr("TipoCambio").ToString().ToDecimal)
End If
Next
End If
End If
End If
If GvNC.Rows.Count > 0 Then
ImgAntiPend.Visible = False
End If
'CARGA REMISIONES
If ObjVentas.GetRemisionesRelacionadas(CveVenta, DdlTipoComprobante.SelectedValue) Then
GvRemisiones.Caption = " <table width='100%'><tr><td style='text-align:center'>Remisiones/Facturas</td></tr></table>"
GvRemisiones.DataSource = ObjVentas.DtResultados
GvCancelarRemisiones.DataSource = ObjVentas.DtResultados
GvRemisiones.DataBind()
GvCancelarRemisiones.DataBind()
'[IPP] SI ES REMISION PARA CANCELARLA NO DEBE TENER NINGUNA FACTURADA RELACIONADA - 24Abril2018
If DdlTipoComprobante.SelectedValue.Contiene("Rem") And GvRemisiones.Rows.Count > 0 Then
LbCancelarDocumento.Visible = False
End If
'SI TIENE REMISIONES Y VA A CANCELAR ES NECESARIO EL MOVIMIENTO DE DEVOLUCION
If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso GvRemisiones.Rows.Count > 0 Then
ChkDevAlm.Checked = True
ChkDevAlm.Enabled = False
'LiDevolucionAlmacen.Visible = False
End If
End If
tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot") tdFechaVigencia.Visible = DdlTipoComprobante.SelectedValue.Contiene("Cot")
@@ -5391,10 +5434,22 @@ Partial Class Ventas
'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then 'If ObjUsados.GetVentasGarantiaPendiente(CveVenta, -1, Now, UsuarioActual.CveEmpresa) Then
' DtGarantiasPendientes = ObjUsados.DtResultados.Copy() ' DtGarantiasPendientes = ObjUsados.DtResultados.Copy()
'End If 'End If
ObjUsados.Dispose() ObjUsados.Dispose()
Dim SaldoAlmacenExA As Decimal = 0
'Dim SaldoAlmacenUsados As Decimal = 0
Using ObjInventarios As New ClsInventarios
'VERIFICA SI HACE FALTA DEVOLVER PRODUCTOS Y USADOS EN ESPECIFICO
If ObjInventarios.GetSaldoVentaDetalleAlmacen(CveVenta, UsuarioActual.CveEmpresa) Then
SaldoAlmacenExA = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 10")
'SaldoAlmacenUsados = ObjInventarios.DtResultados.SUMD("SaldoAlmacen", $"CveTipoAlmacen = 22")
End If
End Using
'Si ya se surtió y recibió 'Si ya se surtió y recibió
If DbRowVenta("SaldoAlmacen").ToString().ToDecimal > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then If SaldoAlmacenExA > 0 OrElse TmpDT.MAX("CveTipoPS") = "1" Then
BtnsFacturar.Visible = True BtnsFacturar.Visible = True
End If End If
@@ -5460,19 +5515,6 @@ Partial Class Ventas
CargaCodigoUnico() CargaCodigoUnico()
'SI ES COTIZACION PUEDE GENERAR UNA OC PARA MODIFICAR LOS IMPORTES
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(583) = "1" Then
Dim DtOCGeneradas As DataTable = Nothing
If ObjVentas.GetVentasCotizacionesOC(Me.CveVenta, -1, UsuarioActual.CveEmpresa) Then
DtOCGeneradas = ObjVentas.DtResultados.Copy()
End If
If DtOCGeneradas IsNot Nothing AndAlso DtOCGeneradas.Rows.Count > 0 Then
LtGenerarOC.Visible = False
Else
LtGenerarOC.Visible = True
End If
End If
DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString()) DdlTipoRetencion.SelectedValueExist(DbRowVenta("CveTipoRetencion").ToString())
Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString()) Me.FacturarSucursal = CBool(DbRowVenta("FacturarSucursal").ToString())
@@ -5483,17 +5525,6 @@ Partial Class Ventas
CargaPS(-1, DdlPS) CargaPS(-1, DdlPS)
'CARGA GV DE OC RELACIONADAS
If CveVenta > 0 AndAlso ObjVentas.GetOCRelacionadas(CveVenta) Then
If ObjVentas.DtResultados.Rows.Count > 0 Then
DivOCRelacionadas.Visible = True
GvOCRelacionadas.DataSource = ObjVentas.DtResultados
End If
End If
GvOCRelacionadas.DataBind()
'Verifico si tiene la funcionalidad (135) 'Verifico si tiene la funcionalidad (135)
If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then If DdlTipoComprobante.SelectedValue = "Cot" AndAlso UsuarioActual.Empresa.Funcionalidad(135).Contiene("1", "2") Then
@@ -5560,12 +5591,7 @@ Partial Class Ventas
UpEstatus.Update() UpEstatus.Update()
Retorno = True Retorno = True
Else
ViewState("CveVenta") = -1
Alert("El documento solicitado no existe, favor de revisar su búsqueda.", TipoMensaje.MsgAdvertencia)
End If End If
End If
ObjVentas.Dispose()
Return Retorno Return Retorno
End Function End Function
@@ -7952,13 +7978,25 @@ Partial Class Ventas
End If End If
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
End If
End If
If TmpDT.Rows(e.RowIndex)("CvePS").ToString() <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then If TmpDT.Rows(e.RowIndex)("CvePS").ToString() <> GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue Then
'eliminar y cargar el ps *** 'eliminar y cargar el ps ***
Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida") Dim DdlUM As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlUnidadMedida")
Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion") Dim DdlCla As DropDownList = GvPS.Rows(e.RowIndex).FCDropDownList("DdlClasificacion")
If DtPromociones IsNot Nothing AndAlso DtPromociones.Rows.Count > 0 Then
ObjDescuento = CalcularDescuentos(GvPS.Rows(e.RowIndex).FCDropDownLost("DdlPS").SelectedValue.ToEntero(), Cantidad, PU)
End If
TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex)) TmpDT.Rows.Remove(TmpDT.Rows(e.RowIndex))
CalculaUsados() CalculaUsados()
AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text, AgregarProductoServicio(Cantidad, DdlUM.SelectedValue.ToEntero(), DdlUM.SelectedItem.Text, DdlCla.SelectedValue.ToEntero(), DdlCla.SelectedItem.Text,
@@ -7966,18 +8004,17 @@ Partial Class Ventas
GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento, GvPS.Rows(e.RowIndex).FCTextBox("TxtObsPS").Text.Trim, PU, ObjDescuento.ImporteDescuento,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text, GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlProyecto").SelectedItem.Text,
GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text, GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue.ToEntero(), GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedItem.Text,
CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle) CuentaPredial:=CuentaPredial, CveVentaDetalle:=GvPS.Rows(e.RowIndex).DataKey("CveVentaDetalle").ToString().ToEntero(), SeActualiza:=True, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, ObjDescuento:=ObjDescuento)
' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue ' TmpDT.Rows(e.RowIndex)("CveUM") = Ddl.SelectedValue
' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text ' TmpDT.Rows(e.RowIndex)("UM") = Ddl.SelectedItem.Text
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
GvPS.EditIndex = -1 GvPS.EditIndex = -1
GvPS.DataSource = TmpDT GvPS.DataSource = TmpDT
DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
GvPS.DataBind() GvPS.DataBind()
CargaGVInv(DtInv) CargaGVInv(DtInv)
If UsuarioActual.Empresa.Funcionalidad(533).ToEntero() > 0 Then
CalculaUsados() CalculaUsados()
End If End If
@@ -8055,6 +8092,12 @@ Partial Class Ventas
TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue TmpDT.Rows(e.RowIndex)("CveSubProyecto") = GvPS.Rows(e.RowIndex).FCDropDownList("DdlSubProyecto").SelectedValue
End If End If
'RELACIONAL PS CON EL DESCUENTO
If ObjDescuento IsNot Nothing Then
ObjDescuento.Consec = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
End If
DrPS = Nothing DrPS = Nothing
GvPS.EditIndex = -1 GvPS.EditIndex = -1
@@ -8065,6 +8108,10 @@ Partial Class Ventas
CalculaUsados() CalculaUsados()
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
ListaDescuentos.Add(ObjDescuento)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
'SI EL PORLET DE COMERCIO EXTERIOR EXTERIOR ESTA VISIBLE SE ACTUALIZAN LOS PRODUCTOS DEL GRIDVIEW 'SI EL PORLET DE COMERCIO EXTERIOR EXTERIOR ESTA VISIBLE SE ACTUALIZAN LOS PRODUCTOS DEL GRIDVIEW
@@ -8083,6 +8130,16 @@ Partial Class Ventas
End Sub End Sub
Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting Protected Sub GvPS_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GvPS.RowDeleting
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing Then
Dim ConsecEliminar = TmpDT.Rows(e.RowIndex)("Consec").ToString().ToEntero()
If ConsecEliminar > 0 Then
Dim descEliminar = ListaDescuentos.FirstOrDefault(Function(x) x.Consec = ConsecEliminar)
If descEliminar IsNot Nothing Then
ListaDescuentos.Remove(descEliminar)
End If
End If
End If
Dim DbRow As DataRow = Nothing Dim DbRow As DataRow = Nothing
DbRow = TmpDT.Rows(e.RowIndex) DbRow = TmpDT.Rows(e.RowIndex)
TmpDT.Rows.Remove(DbRow) TmpDT.Rows.Remove(DbRow)
@@ -17835,8 +17892,11 @@ Partial Class Ventas
End If End If
End If End If
Dim Cant As Integer = 1 Dim Cant As Integer = 1
Dim CveMarcaPromocion As Integer = -1
If dr IsNot Nothing Then If dr IsNot Nothing Then
CveMarcaPromocion = dr("CveMarca").ToString().ToEntero()
TipoPromo = dr("TipoPromocion").ToString().ToEntero() TipoPromo = dr("TipoPromocion").ToString().ToEntero()
CantMinima = dr("CantidadMinima").ToString().ToEntero() CantMinima = dr("CantidadMinima").ToString().ToEntero()
IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True" IncluyeImpuestos = dr("IncluyeImpuestos").ToString() = "True"
@@ -17954,6 +18014,26 @@ Partial Class Ventas
End If End If
'YOKOHAMA
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso CveRinTamañoPS > 0 AndAlso CveMarcaPromocion.Contiene(800, 912, 1238, 1381, 1456, 1528, 1600, 1672, 1807) Then
Dim DtRines As DataTable = Nothing
Dim ObjGral As New ClsGenerales
If ObjGral.GetRimTamanios(UsuarioActual.CveEmpresa) Then
DtRines = ObjGral.DtResultados.Copy()
End If
ObjGral.Dispose()
If CveMarcaPromocion > 0 Then
ObjDescuento.NombrePromo = "YOKOHAMA VERANO" 'dr("NombrePromocion").ToString()
ObjDescuento.CveMarca = CveMarcaPromocion
Dim Rin As String = DtRines.FiltroPrimeroValor("RinTamaño", $"CveRinTamaño = {CveRinTamañoPS}")
Dim PromoDescuento = (Descuento * (1 + If(IncluyeImpuestos, PorcentajeIVA, 0))).RoundSQL(2)
ObjDescuento.ObsDescuento = String.Format("RIN {0} BONO ${1:N2}", Rin, PromoDescuento)
End If
End If
ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2) ObjDescuento.ImporteDescuento = Descuento.RoundSQL(2)
ObjDescuento.CvePromocionDetalle = CvePromocionDetalle ObjDescuento.CvePromocionDetalle = CvePromocionDetalle
If SeAjustoPU Then If SeAjustoPU Then
@@ -17993,10 +18073,14 @@ Partial Class Ventas
CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento, CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento,
DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text,
Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle,
ImporteProntoPago:=ObjDescuento.ImporteProntoPago) ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento)
CalculaUsados() CalculaUsados()
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ObjDescuento IsNot Nothing Then
ListaDescuentos.Add(ObjDescuento)
End If
CalculaTotalesVenta() CalculaTotalesVenta()
LimpiaAgregar() LimpiaAgregar()
@@ -18128,7 +18212,7 @@ Partial Class Ventas
Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0, Optional EntregaDirecta As Integer = 0, Optional CveContratoDetalle As Integer = 0, Optional CveVentaDetalle As Integer = 0, Optional CveMovimientoDetallePedido As Integer = 0,
Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "",
Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False,
Optional ImporteProntoPago As Decimal = 0) As Boolean Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Descuentos = Nothing) As Boolean
Dim Retorno As Boolean = False Dim Retorno As Boolean = False
Try Try
@@ -18393,6 +18477,11 @@ Partial Class Ventas
End If End If
End If End If
'RELACIONAL PS CON EL DESCUENTO
If ObjDescuento IsNot Nothing Then
ObjDescuento.Consec = Row("Consec").ToString().ToEntero()
End If
'RECARGAR GV 'RECARGAR GV
TmpDT.Rows.Add(Row) TmpDT.Rows.Add(Row)
@@ -19152,6 +19241,26 @@ Partial Class Ventas
CargaGVInv(DtInv) CargaGVInv(DtInv)
End If End If
If UsuarioActual.Empresa.Funcionalidad(558) = "1" AndAlso ListaDescuentos IsNot Nothing AndAlso ListaDescuentos.Count > 0 Then
TxtObsFact.Text = ""
Dim Titulo As String = ListaDescuentos.FirstOrDefault().NombrePromo
Dim strPromos As New StringBuilder
If Not String.IsNullOrEmpty(Titulo) Then
For Each Promo As Descuentos In ListaDescuentos
strPromos.AppendFormat("{0}, ", Promo.ObsDescuento)
Next
If strPromos.Length > 2 Then
strPromos.Remove(strPromos.Length - 2, 2)
End If
End If
TxtObsFact.Text = String.Format("{0} {1}", Titulo, strPromos.ToString())
End If
UPObservaciones.Update()
UpContado.Update() UpContado.Update()
UpPS.Update() UpPS.Update()
RegistraScript("BorraDescuentos();", "BorraDescuentos") RegistraScript("BorraDescuentos();", "BorraDescuentos")
@@ -19849,7 +19958,42 @@ Partial Class Ventas
Return MovDTCuadrados Return MovDTCuadrados
End Function End Function
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = False, Private Function SalidaEntradaAlmacen(ByRef ObjInventario As ClsInventarios, CveRemision As Integer, ByRef ObjConta As ClsContabilidad) As Boolean
Dim OcurrioError As Boolean = False
Dim DtMovimientos As DataTable
Dim DtMovimientosDetalles As DataTable
'Obtenemos los movimientos detalle
If ObjInventario.GetInv_Mov(CveRemision, UsuarioActual.CveEmpresa) Then
If ObjInventario.DtResultados.Rows.Count > 0 Then
DtMovimientos = ObjInventario.DtResultados.FiltraParametros("", DistinctColumns:={"CveMovimiento"})
DtMovimientosDetalles = ObjInventario.DtResultados.FiltraParametros("CvePS > 0")
For Each dr As DataRow In DtMovimientos.Rows
'Obtenemos los Movimientos de salida
If ObjInventario.GetMovimientos(dr("CveMovimiento").ToString().ToEntero(), 3, -1, UsuarioActual.CveEmpresa) Then
Dim CveAlmacenSalida As Integer = ObjInventario.DtResultados(0)("CveAlmacen").ToString().ToEntero()
Dim CveMoneda As Integer = ObjInventario.DtResultados(0)("CveMoneda").ToString().ToEntero()
'Le damos entrada
If Not GenerarMovimientoAlmacen(ObjInventario, DtMovimientosDetalles.FiltraParametros($"CveMovimiento = {dr("CveMovimiento")}"), CveAlmacenSalida, 2, CveMoneda, CveRemision) > 0 Then
OcurrioError = True
End If
End If
Next
End If
End If
Return Not OcurrioError
End Function
Private Function GenerarMovimientoAlmacen(ByRef ObjInventario As ClsInventarios, DtMovDetalle As DataTable, CveAlmacen As Integer, ConceptoEntrada As Integer, CveMoneda As Integer, CveVenta As Integer, Optional MovimientoPrePoliza As Boolean = True,
Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1, Optional AplicaMovimientoDetalleEntrada As Boolean = False, Optional ObjContPaq As ClsContPAQi = Nothing) As Integer
Dim OcurrioError As Boolean = False Dim OcurrioError As Boolean = False
Dim ContadorMovtosDetalles = 0 Dim ContadorMovtosDetalles = 0
@@ -19948,7 +20092,6 @@ Partial Class Ventas
Dim DtCostos = ObjInventario.DtResultados.Copy Dim DtCostos = ObjInventario.DtResultados.Copy
Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"}) Dim DtCostosDistinct As DataTable = ObjInventario.DtResultados.FiltraParametros("", "", {"CveClasificacion"})
Dim IdCtaContable As Integer = 0 Dim IdCtaContable As Integer = 0
Dim CveCuenta As Integer = 0
Dim ValorInventario As Decimal Dim ValorInventario As Decimal
Dim TotalCostoAcumulado As Decimal = 0D Dim TotalCostoAcumulado As Decimal = 0D
Dim Cont As Integer = 1 Dim Cont As Integer = 1
@@ -19966,7 +20109,7 @@ Partial Class Ventas
Try Try
'If ValorInventario <> 0 Then 'If ValorInventario <> 0 Then
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ObjFactura.SerieFolio, 69, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, False, ValorInventario, ValorInventario, 69, ObjFactura.SerieFolio, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
Exit For Exit For
End If End If
@@ -19980,7 +20123,7 @@ Partial Class Ventas
If Not OcurrioError Then If Not OcurrioError Then
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero() IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero()
If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, ObjFactura.SerieFolio, 68, ObjFactura.SerieFolio, Now, IdCtaContable, -1, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=ObjFactura.CveSubProyecto) Then If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, True, TotalCosto, TotalCosto, 68, ObjFactura.SerieFolio, ObjFactura.SerieFolio, IdCtaContable, CveVenta:=CveVenta, CveCliente:=ObjFactura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, CveSubProyecto:=ObjFactura.CveSubProyecto) Then
OcurrioError = True OcurrioError = True
End If End If
End If End If
@@ -26690,6 +26833,33 @@ Partial Class Ventas
'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas 'GvRemisionesNCBon.DataSource = Me.TmpDTRNCBonificacionesSeleccionadas
'GvRemisionesNCBon.DataBind() 'GvRemisionesNCBon.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
If CveVentaUsado > 0 Then If CveVentaUsado > 0 Then
DivSMU.Visible = True DivSMU.Visible = True
@@ -26702,44 +26872,21 @@ Partial Class Ventas
End Using End Using
If DtDetalleUsado IsNot Nothing Then If DtDetalleUsado IsNot Nothing Then
Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsadosFactura As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
End If LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else Else
If CargarSoloGarantias Then HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True") LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
Else Else
Dim ObjAcum As New ClsAcumuladores HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2) End If
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = "0" LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2)
End If
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
End If End If
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
@@ -26778,9 +26925,44 @@ Partial Class Ventas
End If End If
GvDescNCCargos.DataBind() GvDescNCCargos.DataBind()
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUtilizable As Decimal = 0
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = DtNC.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
Dim SaldoMaximoUsadosFactura As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoUtilizable < SaldoMaximoUsadosFactura Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsadosFactura.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsadosFactura)
End If
Else Else
HdnSaldoMaximoUsados.Value = "0" HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = "0" LblSaldoMaximoUsados.Text = "0"
@@ -26820,6 +27002,27 @@ Partial Class Ventas
GvRemisionesNCDetalle.DataBind() GvRemisionesNCDetalle.DataBind()
'GvRemisionesNCBon.DataBind() 'GvRemisionesNCBon.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargaSoloGarantias Then
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
'DivSMU.Visible = False
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
If CveVentaUsado > 0 Then If CveVentaUsado > 0 Then
DivSMU.Visible = True DivSMU.Visible = True
@@ -26833,49 +27036,26 @@ Partial Class Ventas
If DtDetalleUsado IsNot Nothing Then If DtDetalleUsado IsNot Nothing Then
Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsados As Decimal = DtDetalleUsado.SUM("Total", "EsCargo = True").ToDecimal() + DtDetalleUsado.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
If SaldoMaximoUsados > 0 Then If SaldoMaximoUtilizable < SaldoMaximoUsados Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados) LtlSMU.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If End If
End If End If
Else Else
If CargaSoloGarantias Then HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Total", "TipoRNC = 1") LtlSMU.Text = SaldoMaximoUtilizable.FormatoNumero(2)
If SaldoMaximo > 0 Then
HdnSaldoMaximoUsados.Value = SaldoMaximo.ToString()
LtlSMU.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
HdnSaldoMaximoUsados.Value = RowUsadosNC("ValorConImpuestos").ToString()
LtlSMU.Text = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal().FormatoNumero(2)
Else
'DivSMU.Visible = False
HdnSaldoMaximoUsados.Value = "0"
LtlSMU.Text = "0"
End If
ObjAcum.Dispose()
End If
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
UpDescNC.Update() UpDescNC.Update()
End Sub End Sub
Private Sub CargaRNCDetalleDesc(Optional CargarSoloGarantias As Boolean = False) Private Sub CargaRNCDetalleDesc(Optional CargarSoloGarantias As Boolean = False)
Dim DtNC As DataTable = Nothing
Dim ObjMovtos As New ClsMovimientos() Dim ObjMovtos As New ClsMovimientos()
If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1) Then If ObjMovtos.GetRemisionesNCCliente(CveCliente, True, CveMoneda:=-1) Then
@@ -26896,14 +27076,42 @@ Partial Class Ventas
End If End If
GvDescNCCargosDetalle.DataBind() GvDescNCCargosDetalle.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If CargarSoloGarantias Then
Dim SaldoMaximo As Decimal = TmpDTRNCDetalle.SUMD("Saldo", "TipoRNC = 1 AND EsGarantia = True")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
Else
Dim ObjAcum As New ClsAcumuladores
If ObjAcum.GetMovimientosDistribuidorResumen(CveCliente, UsuarioActual.CveEmpresa) Then
Dim RowUsadosNC As DataRow = ObjAcum.DtResultados.Rows(2)
DivSMU.Visible = True
Dim SaldoMaximo As Decimal = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = RowUsadosNC("ValorConImpuestos").ToString().ToDecimal()
Else
SaldoMaximoUtilizable = 0
End If
Else
SaldoMaximoUtilizable = 0
End If
ObjAcum.Dispose()
End If
Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal() Dim SaldoMaximoUsados As Decimal = Me.TmpDT.SUM("Total", "EsCargo = True").ToDecimal() + Me.TmpDT.SUM("ImporteIVA", "EsCargo = True").ToDecimal()
If SaldoMaximoUsados > 0 Then If SaldoMaximoUtilizable < SaldoMaximoUsados Then
HdnSaldoMaximoUsados.Value = SaldoMaximoUtilizable.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
Else
HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString() HdnSaldoMaximoUsados.Value = SaldoMaximoUsados.ToString()
LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados) LblSaldoMaximoUsados.Text = String.Format("{0:N2}", SaldoMaximoUsados)
Else
HdnSaldoMaximoUsados.Value = "0"
LblSaldoMaximoUsados.Text = "0"
End If End If
UpDescNC.Update() UpDescNC.Update()
@@ -26940,6 +27148,16 @@ Partial Class Ventas
GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2") GvRemisionesNCBonDetalle.DataSource = TmpDTRNCDetalle.FiltraParametros("TipoRNC = 2")
GvRemisionesNCBonDetalle.DataBind() GvRemisionesNCBonDetalle.DataBind()
Dim SaldoMaximoUtilizable As Decimal = 0
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If SaldoMaximo > 0 Then
SaldoMaximoUtilizable = SaldoMaximo
Else
SaldoMaximoUtilizable = 0
End If
End If
If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then
Dim DtDetalleFactura As DataTable = Nothing Dim DtDetalleFactura As DataTable = Nothing
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
@@ -26949,21 +27167,18 @@ Partial Class Ventas
End Using End Using
Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal())
If SaldoMaximoUtilizable < ImporteBon Then
LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Else
LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon)
HdnSMUBon.Value = ImporteBon.ToString() HdnSMUBon.Value = ImporteBon.ToString()
End If
DtDetalleFactura.Dispose() DtDetalleFactura.Dispose()
Else Else
If TmpDTRNCBonificacionesSeleccionadas IsNot Nothing Then HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2)
If SaldoMaximo > 0 Then
HdnSMUBon.Value = SaldoMaximo.ToString()
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else
HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0"
End If
End If
End If End If
UpModalRemisionesNC.Update() UpModalRemisionesNC.Update()
@@ -27077,6 +27292,9 @@ Partial Class Ventas
'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon) 'LtlSMUBon.Text = String.Format("{0:N2}", SMUBon)
'HdnSMUBon.Value = SMUBon.ToString() 'HdnSMUBon.Value = SMUBon.ToString()
Dim SaldoMaximoUtilizable As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo")
If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then If DdlVentaUsado.SelectedValue.ToEntero() > 0 Then
Dim DtDetalleFactura As DataTable = Nothing Dim DtDetalleFactura As DataTable = Nothing
Using ObjVentas As New ClsVentas Using ObjVentas As New ClsVentas
@@ -27086,15 +27304,20 @@ Partial Class Ventas
End Using End Using
Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal()) Dim ImporteBon As Decimal = DtDetalleFactura.SUMD("PUBonificacion") * (1 + DtDetalleFactura.MAX("PorcentajeIVA").ToDecimal())
If SaldoMaximoUtilizable < ImporteBon Then
LtlSMUBon.Text = String.Format("{0:N2}", SaldoMaximoUtilizable)
HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
Else
LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon) LtlSMUBon.Text = String.Format("{0:N2}", ImporteBon)
HdnSMUBon.Value = ImporteBon.ToString() HdnSMUBon.Value = ImporteBon.ToString()
End If
DtDetalleFactura.Dispose() DtDetalleFactura.Dispose()
Else Else
Dim SaldoMaximo As Decimal = TmpDTRNCBonificacionesSeleccionadas.SUMD("Saldo") If SaldoMaximoUtilizable > 0 Then
If SaldoMaximo > 0 Then HdnSMUBon.Value = SaldoMaximoUtilizable.ToString()
HdnSMUBon.Value = SaldoMaximo.ToString() LtlSMUBon.Text = SaldoMaximoUtilizable.FormatoNumero(2)
LtlSMUBon.Text = SaldoMaximo.FormatoNumero(2)
Else Else
HdnSMUBon.Value = "0" HdnSMUBon.Value = "0"
LtlSMUBon.Text = "0" LtlSMUBon.Text = "0"
@@ -32904,11 +33127,15 @@ Partial Class Ventas
' If ObjAC IsNot Nothing Then ObjAC.Dispose() ' If ObjAC IsNot Nothing Then ObjAC.Dispose()
'End Sub 'End Sub
Partial Class Descuentos Partial Class Descuentos
Public Consec As Integer
Public ImporteDescuento As Decimal = 0 Public ImporteDescuento As Decimal = 0
Public CvePromocionDetalle As Integer = -1 Public CvePromocionDetalle As Integer = -1
Public PU As Decimal = 0 Public PU As Decimal = 0
Public EsPUModificado As Boolean = False Public EsPUModificado As Boolean = False
Public ImporteProntoPago As Decimal = 0 Public ImporteProntoPago As Decimal = 0
Public NombrePromo As String = ""
Public CveMarca As Integer = -1
Public ObsDescuento As String = ""
End Class End Class
Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs) Protected Sub btnupEventoBitacora_Click(sender As Object, e As EventArgs)