Merge branch 'master' of http://oirigoyen@192.168.10.111:8383/SIG.git
This commit is contained in:
@@ -23,11 +23,12 @@ Partial Class AF_CatSubTipos
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaGlobal()
|
Private Sub CargaGlobal()
|
||||||
Dim ObjSubTipos As New ClsAF
|
'Dim ObjSubTipos As New ClsAF
|
||||||
If ObjSubTipos.GetSubTiposActivosFijos(-1) Then
|
'If ObjSubTipos.GetSubTiposActivosFijos(-1) Then
|
||||||
GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados
|
' GlobalDTSubTipoActivoFijo(-1) = ObjSubTipos.DtResultados
|
||||||
End If
|
'End If
|
||||||
ObjSubTipos.Dispose()
|
'ObjSubTipos.Dispose()
|
||||||
|
GlobalDTSubTipoActivoFijo(UsuarioActual.CveEmpresa, -1) = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub CargaDatos()
|
Public Sub CargaDatos()
|
||||||
|
|||||||
@@ -2048,7 +2048,7 @@ Public Class ClsInventarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer) As Boolean
|
Public Function GetExistenciasProductosLike(PS As String, CveClasificacion As Integer, CveSubProyecto As Integer, Estatus As Integer, AplicaParaVenta As Integer, CveEmpresa As Integer, Optional CveMarca As Integer = -1) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_ProductosServiciosInventario")
|
DataAdapter("PA_ProductosServiciosInventario")
|
||||||
@@ -2059,6 +2059,7 @@ Public Class ClsInventarios
|
|||||||
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
.Add("@Estatus", SqlDbType.Int).Value = Estatus
|
||||||
.Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta
|
.Add("@AplicaParaVenta", SqlDbType.Int).Value = AplicaParaVenta
|
||||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
.Add("@CveMarca", SqlDbType.Int).Value = CveMarca
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@@ -4047,7 +4048,7 @@ Public Class ClsInventarios
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String,
|
Public Function AddTrasladoSolicitudDetalle(CveTrasladoSolicitud As Integer, Cantidad As Integer, CveUM As Integer, CvePS As Integer, Precio As Double, Observaciones As String,
|
||||||
CveContratoDetalle As Integer, Optional Serie As String = "-1") As Boolean
|
CveContratoDetalle As Integer, Optional Serie As String = "-1", Optional Lote As String = "-1", Optional FechaCaducidad As Date = MinFecha) As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
Dim CveTraspasoSolicitud As Integer = 0
|
Dim CveTraspasoSolicitud As Integer = 0
|
||||||
DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd")
|
DataAdapter("PA_Inv_TraspasoSolicitudDetalleAdd")
|
||||||
@@ -4061,6 +4062,9 @@ Public Class ClsInventarios
|
|||||||
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
.Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones
|
||||||
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
.Add("@CveContratoDetalle", SqlDbType.Int).Value = CveContratoDetalle
|
||||||
.Add("@Serie", SqlDbType.NVarChar).Value = Serie
|
.Add("@Serie", SqlDbType.NVarChar).Value = Serie
|
||||||
|
.Add("@Lote", SqlDbType.NVarChar).Value = Lote
|
||||||
|
.Add("@FechaCaducidad", SqlDbType.Date).Value = FechaCaducidad
|
||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -2184,19 +2184,43 @@ Public Class ClsPaginas
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer) As DataTable
|
Property GlobalDTSubTipoActivoFijo(CveEmpresa As Integer, Optional CveTipoActivoFijo As Integer = -1) As DataTable
|
||||||
|
|
||||||
Get
|
Get
|
||||||
If CveEmpresa <> -1 Then
|
Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa)
|
||||||
Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
'sino existe, recarga los datos
|
||||||
GlobalDTSubTipoActivoFijo = Dv.ToTable
|
If Application(AppNombre) Is Nothing Then
|
||||||
Dv.Dispose()
|
Dim ObjSubTipos As New ClsAF
|
||||||
Else
|
If ObjSubTipos.GetSubTiposActivosFijos(CveEmpresa) Then Application(AppNombre) = ObjSubTipos.DtResultados
|
||||||
GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable)
|
ObjSubTipos.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim Str As New StringBuilder
|
||||||
|
|
||||||
|
If CveEmpresa <> -1 Then Str.AppendFormat(" CveEmpresa = {0} ", CveEmpresa)
|
||||||
|
If CveTipoActivoFijo > 0 Then Str.AppendFormat("AND CveTipoActivoFijo = {0}", CveTipoActivoFijo)
|
||||||
|
Dim Dv As New DataView(DirectCast(Application(AppNombre), DataTable), Str.ToString, "", DataViewRowState.CurrentRows)
|
||||||
|
GlobalDTSubTipoActivoFijo = Dv.ToTable
|
||||||
|
Dv.Dispose()
|
||||||
|
|
||||||
End Get
|
End Get
|
||||||
Set(value As DataTable)
|
Set(value As DataTable)
|
||||||
Application("GlobalDTSubTipoActivoFijo") = value
|
Dim AppNombre As String = String.Format("GlobalDTSubTipoActivoFijo-{0}", CveEmpresa)
|
||||||
|
Application(AppNombre) = value
|
||||||
End Set
|
End Set
|
||||||
|
|
||||||
|
'Get
|
||||||
|
' If CveEmpresa <> -1 Then
|
||||||
|
' Dim Dv As New DataView(DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable), String.Format("CveEmpresa = {0}", CveEmpresa), "", DataViewRowState.CurrentRows)
|
||||||
|
' GlobalDTSubTipoActivoFijo = Dv.ToTable
|
||||||
|
' Dv.Dispose()
|
||||||
|
' Else
|
||||||
|
' GlobalDTSubTipoActivoFijo = DirectCast(Application("GlobalDTSubTipoActivoFijo"), DataTable)
|
||||||
|
' End If
|
||||||
|
'End Get
|
||||||
|
'Set(value As DataTable)
|
||||||
|
' Application("GlobalDTSubTipoActivoFijo") = value
|
||||||
|
'End Set
|
||||||
End Property
|
End Property
|
||||||
Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable
|
Property GlobalDTTipoActivoFijo(CveEmpresa As Integer) As DataTable
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -416,7 +416,29 @@ Public Class ClsSisUsuarios
|
|||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function ValidaUsuarioCodigoAcceso(CodigoAcceso As String, CveEmpresa As Integer) As Integer
|
||||||
|
Dim Retorno As Integer = Nothing
|
||||||
|
|
||||||
|
DataAdapter("PA_Sis_UsuariosCodigoAccesoGet")
|
||||||
|
|
||||||
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
|
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||||
|
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||||
|
End With
|
||||||
|
|
||||||
|
Try
|
||||||
|
SqlAdapter.Fill(Data)
|
||||||
|
If Data.Rows.Count > 0 Then
|
||||||
|
Retorno = Data.Rows(0)("CveUsuario").ToString.ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
Catch ex As SqlException
|
||||||
|
OnError("Ocurrió un error al obtener el usuario.", ex)
|
||||||
|
Retorno = Nothing
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Return Retorno
|
||||||
|
End Function
|
||||||
Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario
|
Public Function ValidaUsuarioPortalCliente(CveCliente As Integer, Usuario As String, Password As String) As Usuario
|
||||||
Dim Retorno As Usuario = Nothing
|
Dim Retorno As Usuario = Nothing
|
||||||
|
|
||||||
@@ -799,7 +821,7 @@ Public Class ClsSisUsuarios
|
|||||||
Public Function AddUsuario(Usuario As String, Contraseña As String, Nombre As String, CveRol As Integer, Correo As String,
|
Public Function AddUsuario(Usuario As String, Contraseña As String, Nombre As String, CveRol As Integer, Correo As String,
|
||||||
CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean,
|
CvePersonal As Integer, CveVendedor As Integer, CambiarContraseña As Boolean,
|
||||||
CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
CveUsuarioIng As Integer, CveEmpresa As Integer, CveSubProyecto As Integer, Optional Rol As String = "-1", Optional CveAlmacenAsignado As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
||||||
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0) As Integer
|
Optional CvePlataforma As Integer = -1, Optional CveClientePlataforma As Integer = -1, Optional CveProveedorPlataforma As Integer = -1, Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Integer
|
||||||
Dim Retorno = -1
|
Dim Retorno = -1
|
||||||
DataAdapter("PA_Sis_UsuarioAdd")
|
DataAdapter("PA_Sis_UsuarioAdd")
|
||||||
With SqlAdapter.SelectCommand.Parameters
|
With SqlAdapter.SelectCommand.Parameters
|
||||||
@@ -819,6 +841,7 @@ Public Class ClsSisUsuarios
|
|||||||
.Add("@CveCliente", SqlDbType.Int).Value = CveClientePlataforma
|
.Add("@CveCliente", SqlDbType.Int).Value = CveClientePlataforma
|
||||||
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedorPlataforma
|
.Add("@CveProveedor", SqlDbType.Int).Value = CveProveedorPlataforma
|
||||||
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
||||||
|
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||||
|
|
||||||
.Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output
|
.Add("@CveUsuario", SqlDbType.Int).Direction = ParameterDirection.Output
|
||||||
End With
|
End With
|
||||||
@@ -917,7 +940,7 @@ Public Class ClsSisUsuarios
|
|||||||
End Function
|
End Function
|
||||||
Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer,
|
Public Function UpdateUsuario(Usuario As String, Nombre As String, CveRol As Integer, Correo As String, CvePersonal As Integer,
|
||||||
CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
CveVendedor As Integer, CambiarContraseña As Boolean, Activo As Boolean, CveEmpresa As Integer, CveUsuario As Integer, CveAlmacenAsignado As Integer, CveSubProyecto As Integer, Optional CveUsuarioModifico As Integer = -1, Optional AsignarSubProyecto As Boolean = False, Optional AsignarOC As Boolean = False,
|
||||||
Optional DescuentoAutorizado As Double = 0) As Boolean
|
Optional DescuentoAutorizado As Double = 0, Optional CodigoAcceso As String = "-1") As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
|
|
||||||
DataAdapter("PA_Sis_UsuarioUpdate")
|
DataAdapter("PA_Sis_UsuarioUpdate")
|
||||||
@@ -938,6 +961,7 @@ Public Class ClsSisUsuarios
|
|||||||
.Add("@AsignarSubProyecto", SqlDbType.Bit).Value = AsignarSubProyecto
|
.Add("@AsignarSubProyecto", SqlDbType.Bit).Value = AsignarSubProyecto
|
||||||
.Add("@AsignarOC", SqlDbType.Bit).Value = AsignarOC
|
.Add("@AsignarOC", SqlDbType.Bit).Value = AsignarOC
|
||||||
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
.Add("@DescuentoAutorizado", SqlDbType.Float).Value = DescuentoAutorizado
|
||||||
|
.Add("@CodigoAcceso", SqlDbType.VarChar).Value = CodigoAcceso
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
|||||||
@@ -2203,8 +2203,8 @@ Namespace Modelos
|
|||||||
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString.ToEntero
|
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=DtDetalle.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString.ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim UsaComplementariaClientes As Boolean = False
|
Dim UsaComplementariaClientes As Boolean = True
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
||||||
|
|
||||||
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
||||||
Dim dtt As DataTable = ObjConta.DtResultados
|
Dim dtt As DataTable = ObjConta.DtResultados
|
||||||
@@ -3798,6 +3798,18 @@ Namespace Modelos
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If factura.TipoDocto = "Rem" AndAlso factura.ServicioDomicilio Then
|
||||||
|
Dim CveMovimientoSalida As Integer = GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenServicioDomicilio, 8, factura.CveMoneda, factura.CveVenta, "Modelos/SD1")
|
||||||
|
If CveMovimientoSalida > 0 Then
|
||||||
|
|
||||||
|
If Not (GenerarMovimientoAlmacenServicioDomicilio(ObjInventario, factura, DtInventario, factura.CveAlmacenTraspasoDestino, 9, factura.CveMoneda, factura.CveVenta, "Modelos/SD1", CveMovimientoRelacionado:=CveMovimientoSalida) > 0) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return OcurrioError
|
Return OcurrioError
|
||||||
@@ -4059,6 +4071,129 @@ Namespace Modelos
|
|||||||
'Return Not OcurrioError
|
'Return Not OcurrioError
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function GenerarMovimientoAlmacenServicioDomicilio(ByRef ObjInventario As ClsInventarios, factura As Modelos.Factura, DtInventario As DataTable, CveAlmacen As Integer, CveConcepto As Integer, CveMoneda As Integer, CveVenta As Integer, Modulo As String, Optional MovimientoPrePoliza As Boolean = False, Optional ByRef ObjConta As ClsContabilidad = Nothing, Optional CveMovimientoRelacionado As Integer = -1) As Integer
|
||||||
|
Dim OcurrioError As Boolean = False
|
||||||
|
|
||||||
|
Dim CveMovimientoInventario As Integer = ObjInventario.AddMovimiento(CveAlmacen, CveConcepto, factura.CveMoneda, factura.Fecha, -1, factura.CveUsuario, factura.CveEmpresa, -1, factura.CveVenta, -1, -1, Modulo:=Modulo, CveMovimientoRelacionado:=CveMovimientoRelacionado)
|
||||||
|
|
||||||
|
If CveMovimientoInventario <= 0 Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />Revise su factura y cualquier detalle comuníquese a Soporte Técnico")
|
||||||
|
Else
|
||||||
|
Dim Mensaje As String = ""
|
||||||
|
Dim i As Integer = 0
|
||||||
|
Dim Cantidad As Double
|
||||||
|
Dim CveUnidad As Integer
|
||||||
|
Dim CveProducto As Integer
|
||||||
|
Dim Existencia As Double
|
||||||
|
'Dim Pu As Double
|
||||||
|
'DtInv.Clone()
|
||||||
|
|
||||||
|
Dim DtEquivalencias As DataTable
|
||||||
|
For Each Dr As DataRow In DtInventario.Rows
|
||||||
|
CveProducto = Dr("CvePS").ToString.ToEntero
|
||||||
|
CveUnidad = Dr("CveUM").ToString.ToEntero
|
||||||
|
Cantidad = Dr("Cantidad").ToString.ToDouble
|
||||||
|
|
||||||
|
If Dr("CveTipoInvPS").ToString.ToEntero = 5 And Dr("Serie").ToString = "" Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Se deben especificar las Series de los productos de almacén")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa.Contiene({72, 80, 119}) AndAlso factura.TipoDocto.Contiene("Rem", "Ing") Then
|
||||||
|
Existencia = ObjInventario.GetExistenciasPS(CveProducto, CveUnidad, UsuarioActual.CveEmpresa, CveAlmacen, FechaMovto:=DateTime.Today.AddDays(1).ToString("yyyy/MM/dd HH:mm"), CveSubProyecto:=factura.CveSubProyecto, CveVendedor:=factura.CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente), ExcluyeAdelantado:=1, RestringirAlmacenes:=1, ExcluyeApartados:=1)
|
||||||
|
If Existencia < Cantidad Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add($"No cuenta con la cantidad suficiente en inventario del producto {Dr("CodigoPS")} .Cuenta con {Existencia.FormatoNumero(2)}.")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.CveEmpresa = 1 Then
|
||||||
|
DtEquivalencias = New DataTable
|
||||||
|
DtEquivalencias = GlobalDTProductosServiciosEquivalencias(CveProducto, -1, UsuarioActual.CveEmpresa)
|
||||||
|
Dim CveUnidadBase As Integer = DtEquivalencias.FiltroPrimeroValor("CveUM", "UnidadBase = 'True'").ToEntero
|
||||||
|
Dim drUMBase As DataRow = DtEquivalencias.FiltroPrimero("UnidadBase = 'True'")
|
||||||
|
|
||||||
|
'SI LA UNIDAD ACTUAL NO ES LA BASE SACA PROPORCION (EQUIVALENTE)
|
||||||
|
If CveUnidadBase <> CveUnidad Then
|
||||||
|
' LO QUE PUSE LO QUE VALE UNIDAD BASE LO QUE VALE UNIDAD SELECCIONADA
|
||||||
|
Cantidad = Dr("Cantidad").ToString.ToDouble * drUMBase("Cantidad").ToString.ToDouble / DtEquivalencias.FiltraParametros(String.Format("CveUM = {0}", CveUnidad)).Rows(0)("Cantidad").ToString.ToDouble
|
||||||
|
CveUnidad = CveUnidadBase
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If CveProducto > 0 Then
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoInventario, Cantidad, CveUnidad, CveProducto, 0, CveSeccionAlmacen:=-3, Serie:=Dr("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero) Then
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
OcurrioError = True
|
||||||
|
ErrorList.Add("Ocurrió un error al agregar los Movimientos de salida al Inventario.<br />")
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
i = i + 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
'REGISTRO LA PREPOLIZA DE COSTO VS ALMACEN
|
||||||
|
If MovimientoPrePoliza AndAlso Not OcurrioError Then
|
||||||
|
Dim DtCostos As DataTable = Nothing
|
||||||
|
Dim ValorInventario As Decimal = 0
|
||||||
|
Dim TotalCosto As Decimal = 0
|
||||||
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoInventario, UsuarioActual.CveEmpresa) Then
|
||||||
|
DtCostos = ObjInventario.DtResultados
|
||||||
|
TotalCosto = DtCostos.SUMD("Total").RoundSQL()
|
||||||
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
|
Dim IdCtaContable As Integer = 0
|
||||||
|
Dim CveCuenta As Integer = 0
|
||||||
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
|
Dim cont As Integer = 1
|
||||||
|
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||||
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
|
ValorInventario = DtCostos.SUMD("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").RoundSQL()
|
||||||
|
TotalCostoAcumulado += ValorInventario
|
||||||
|
|
||||||
|
'cuando es el último movimiento y hay diferencias en los importes
|
||||||
|
If cont = DtCostos.Rows.Count AndAlso TotalCosto <> TotalCostoAcumulado Then
|
||||||
|
ValorInventario = ValorInventario + (TotalCosto - TotalCostoAcumulado)
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Concepto = String.Format("{0} - {1}", Row2("Clasificacion").ToString, Row2("SubProyecto").ToString)
|
||||||
|
IdCtaContable = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
CveCuenta = GlobalDTClasificaciones(factura.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero
|
||||||
|
If ValorInventario <> 0 Then
|
||||||
|
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, False, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
cont += 1
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", String.Format("CveAlmacen = {0}", CveAlmacen)).ToEntero
|
||||||
|
|
||||||
|
If TotalCosto <> 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, True, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
|
||||||
|
OcurrioError = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
factura.Inv_CveMovimiento = CveMovimientoInventario
|
||||||
|
factura.Inv_ValorInventario = ValorInventario
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return CveMovimientoInventario
|
||||||
|
End Function
|
||||||
Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos)
|
Private Sub GuardarVentaEstimaciones(ByRef factura As Modelos.Factura, ObjContr As ClsContratos)
|
||||||
'debe de ser por contrato el movimiento
|
'debe de ser por contrato el movimiento
|
||||||
If factura.CveContratoSecciones.Length > 0 Then
|
If factura.CveContratoSecciones.Length > 0 Then
|
||||||
@@ -5786,6 +5921,7 @@ Namespace Modelos
|
|||||||
Public Property CvePedido2 As Integer = -1
|
Public Property CvePedido2 As Integer = -1
|
||||||
Public Property CveAlmacenTraspasoOrigen As Integer = -1
|
Public Property CveAlmacenTraspasoOrigen As Integer = -1
|
||||||
Public Property CveAlmacenTraspasoDestino As Integer = -1
|
Public Property CveAlmacenTraspasoDestino As Integer = -1
|
||||||
|
Public Property CveAlmacenServicioDomicilio As Integer = -1
|
||||||
Public Property EsDevolucionVenta As Integer = -1
|
Public Property EsDevolucionVenta As Integer = -1
|
||||||
Public Property EsInterno As Integer = -1
|
Public Property EsInterno As Integer = -1
|
||||||
Public Property CveEmpresaCRM As Integer = -1
|
Public Property CveEmpresaCRM As Integer = -1
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ Public Class Usuario
|
|||||||
|
|
||||||
Public Property isLoginseted As Boolean = False
|
Public Property isLoginseted As Boolean = False
|
||||||
|
|
||||||
|
Public Property SesionBloqueada As Boolean = False
|
||||||
|
|
||||||
Public ReadOnly Property FechaActualCliente As DateTime
|
Public ReadOnly Property FechaActualCliente As DateTime
|
||||||
Get
|
Get
|
||||||
If UTCOffset <> 0 Then
|
If UTCOffset <> 0 Then
|
||||||
|
|||||||
@@ -693,21 +693,17 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
|||||||
Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
|
Dim CveSucursal = IfNull(context.Request("cvesucursal"), "-1").ToString.ToEntero
|
||||||
Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
|
Dim CveSubProyecto = IfNull(context.Request("cvesubproyecto"), "-1").ToString.ToEntero
|
||||||
Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
|
Dim UsoClasificacion = IfNull(context.Request("usoclasificacion"), "-1").ToString.ToEntero
|
||||||
Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "-1").ToString.ToEntero
|
Dim AplicaParaVenta = IfNull(context.Request("aplicaparaventa"), "1").ToString.ToEntero
|
||||||
|
Dim CveMarca = IfNull(context.Request("cvemarca"), "-1").ToString.ToEntero
|
||||||
|
|
||||||
Dim UsaGlobal As Boolean = True
|
Dim UsaGlobal As Boolean = True
|
||||||
|
|
||||||
|
|
||||||
'verifica existencias
|
'verifica existencias
|
||||||
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then
|
If Pagina.Contiene("ventas/ventas", "oc/oc", "inv/traspaso") AndAlso CveEmpresa.Contiene(72, 80, 119, 140, 141, 152, 153, 159, 160, 161, 162, 163) Then
|
||||||
UsaGlobal = False
|
UsaGlobal = False
|
||||||
|
|
||||||
If CveEmpresa.Contiene(140, 141) And Pagina.Contiene("ventas/ventas") Then
|
|
||||||
AplicaParaVenta = 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim objInv As New ClsInventarios
|
Dim objInv As New ClsInventarios
|
||||||
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa) Then
|
If objInv.GetExistenciasProductosLike(Name, CveClasificacion, CveSubProyecto, Estatus.ToEntero, AplicaParaVenta, CveEmpresa, CveMarca) Then
|
||||||
|
|
||||||
' limpio los almacenes donde no tiene ningun producto existencia
|
' limpio los almacenes donde no tiene ningun producto existencia
|
||||||
|
|
||||||
|
|||||||
@@ -767,12 +767,12 @@ Partial Class Bancos_IE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If TabCancelacion.Visible Then
|
'If TabCancelacion.Visible Then
|
||||||
LnkCancelar.Visible = False
|
' LnkCancelar.Visible = False
|
||||||
LnkCancelarComplemento.Visible = False
|
' LnkCancelarComplemento.Visible = False
|
||||||
LnkEliminar.Visible = False
|
' 'LnkEliminar.Visible = False
|
||||||
LnkCancelarComplementoImporte.Visible = False
|
' LnkCancelarComplementoImporte.Visible = False
|
||||||
End If
|
'End If
|
||||||
|
|
||||||
UppEliminarIE.Update()
|
UppEliminarIE.Update()
|
||||||
|
|
||||||
@@ -4382,183 +4382,185 @@ Partial Class Bancos_IE
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim Banc As New ClsBancos
|
|
||||||
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
|
|
||||||
|
|
||||||
Dim ObjAC As ClsContPAQi = Nothing
|
|
||||||
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
|
||||||
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
|
||||||
ObjAC.IniciaTransacSQL()
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Dim ErrorCancelar = False
|
Dim ErrorCancelar = False
|
||||||
Dim MensajeError = ""
|
Dim MensajeError = ""
|
||||||
Dim IdPolizaNueva = -1
|
Dim IdPolizaNueva = -1
|
||||||
Dim FolioPolizaNueva = -1
|
Dim FolioPolizaNueva = -1
|
||||||
|
|
||||||
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then
|
Dim Banc As New ClsBancos
|
||||||
|
Dim ObjConta As New ClsContabilidad(Banc.IniciaTransacSQL())
|
||||||
|
|
||||||
If ObjAC Is Nothing Then
|
Dim ObjAC As ClsContPAQi = Nothing
|
||||||
|
If UsuarioActual.Empresa.UsaAC Or UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||||
|
Try
|
||||||
|
ObjAC = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
ObjAC.IniciaTransacSQL()
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrió un error al iniciar la contabilización", ex)
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
End Try
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
End If
|
||||||
Dim dt As DataTable
|
|
||||||
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
|
|
||||||
dt = ObjAC.DtResultados
|
|
||||||
|
|
||||||
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
Try
|
||||||
If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
If (IDPoliza > 0 AndAlso (UsuarioActual.Empresa.UsaAC)) Then
|
||||||
IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate)
|
|
||||||
If IdPolizaNueva > 0 Then
|
|
||||||
FolioPolizaNueva = ObjAC.Folio
|
|
||||||
|
|
||||||
'CREA POLIZA NEGATIVA
|
If ObjAC Is Nothing Then
|
||||||
For Each dr As DataRow In dt.Rows
|
ErrorCancelar = True
|
||||||
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then
|
End If
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al crear poliza negativa"
|
If Not ErrorCancelar Then
|
||||||
Exit For
|
Dim dt As DataTable
|
||||||
|
If ObjAC.GetPoliza(IDPoliza, -1, -1, -1, -1) AndAlso ObjAC.DtResultados.Rows.Count > 0 Then
|
||||||
|
dt = ObjAC.DtResultados
|
||||||
|
|
||||||
|
' MES ANTERIOR, MOVIMIENTOS CONTRARIOS (NEGATIVOS)
|
||||||
|
If dt.Rows(0)("FechaPol").ToString.ToDate < TxtFechaCancelacion.Text.ToDate.FirstDayOfMonth Then 'dt.Rows(0)("FechaPol").ToString.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or dt.Rows(0)("FechaPol").ToString.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||||
|
IdPolizaNueva = ObjAC.AddPoliza(dt.Rows(0)("CodigoTipoPoliza").ToString.ToEntero, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), 0, 0, UsuarioActual.CveUsuario, TxtFechaCancelacion.Text.ToDate)
|
||||||
|
If IdPolizaNueva > 0 Then
|
||||||
|
FolioPolizaNueva = ObjAC.Folio
|
||||||
|
|
||||||
|
'CREA POLIZA NEGATIVA
|
||||||
|
For Each dr As DataRow In dt.Rows
|
||||||
|
If Not ObjAC.AddMovimiento(IdPolizaNueva, dr("IdCuenta").ToString.ToEntero, dr("TipoMovto").ToString = "True", dr("Importe").ToString.ToDecimal * -1, dr("Referencia").ToString, String.Format("Cancelacion: {0}", dt.Rows(0)("Concepto").ToString), dr("IdSegNeg").ToString.ToEntero, TxtFechaCancelacion.Text.ToDate, "") Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al crear poliza negativa"
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
'AJUSTA POLIZA
|
||||||
|
If Not ErrorCancelar Then
|
||||||
|
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al ajustar poliza negativa"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
|
||||||
|
|
||||||
'AJUSTA POLIZA
|
'CANCELA IE
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Not ObjAC.AjustaPoliza(IdPolizaNueva) Then
|
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
If ObjAC.RemovePoliza(IDPoliza) Then
|
||||||
|
If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al ajustar poliza negativa"
|
MensajeError = "Error al desvincular poliza."
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al eliminar poliza."
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorCancelar Then
|
||||||
|
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al desbloquear prepoliza."
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'CANCELA IE
|
'CANCELA IE
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al cancelar IE"
|
MensajeError = "Error al cancelar IE"
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
End If
|
MensajeError = "Error al contabilizar poliza"
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al obtener la poliza"
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
If ObjAC.RemovePoliza(IDPoliza) Then
|
Else
|
||||||
If Not ObjConta.DesvincularPrePolizaContabilizada(IDPoliza, UsuarioActual.CveEmpresa) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al desvincular poliza."
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al eliminar poliza."
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
||||||
If Not ObjConta.UpdatePrePolizasDetalleBloquear(CvePrePoliza, False) Then
|
Dim GeneraCancelacionEnCero As Boolean = False
|
||||||
ErrorCancelar = True
|
If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero
|
||||||
MensajeError = "Error al desbloquear prepoliza."
|
GeneraCancelacionEnCero = True
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
'CANCELA IE
|
Dim TipoMovimiento As Integer = 1
|
||||||
If Not ErrorCancelar Then
|
|
||||||
If Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero) <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePoliza, UsuarioActual.CveUsuario, UsuarioActual.Empresa, ObjConta:=ObjAC) Then
|
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
|
||||||
ErrorCancelar = True
|
GeneraCancelacionEnCero = False
|
||||||
MensajeError = "Error al contabilizar poliza"
|
TipoMovimiento = 2
|
||||||
End If
|
End If
|
||||||
|
Dim CvePrePolizaCancelacion As Integer = 0
|
||||||
|
|
||||||
|
If Not GeneraCancelacionEnCero Then
|
||||||
|
'CANCELA IE MES ANTERIOR
|
||||||
|
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, TipoMovimiento:=TipoMovimiento, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
||||||
|
If CvePrePolizaCancelacion <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
||||||
|
Else
|
||||||
|
'DEBE GENERAR UNA NUEVA POLIZA
|
||||||
|
IDPoliza = -1
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
ErrorCancelar = True
|
'CANCELA IE MES ACTUAL
|
||||||
MensajeError = "Error al obtener la poliza"
|
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
||||||
|
If CvePrePolizaCancelacion <= 0 Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al cancelar IE MES ACTUAL"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
||||||
|
|
||||||
' If TxtFechaDocumento.Text.ToDate.Month < TxtFechaCancelacion.Text.ToDate.Month Or TxtFechaDocumento.Text.ToDate.Year < TxtFechaCancelacion.Text.ToDate.Year Then
|
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then
|
||||||
Dim GeneraCancelacionEnCero As Boolean = False
|
ErrorCancelar = True
|
||||||
If TxtFechaCancelacion.Text.ToDate <= TxtFechaDocumento.Text.ToDate.LastDayOfMonth Then 'si es del mismo mes, se genra cancelacion en cero
|
MensajeError = "Error al contabilizar poliza"
|
||||||
GeneraCancelacionEnCero = True
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If ChkGeneraCancelacion.Checked AndAlso GeneraCancelacionEnCero Then
|
|
||||||
GeneraCancelacionEnCero = False
|
|
||||||
End If
|
|
||||||
Dim CvePrePolizaCancelacion As Integer = 0
|
|
||||||
|
|
||||||
If Not GeneraCancelacionEnCero Then
|
|
||||||
'CANCELA IE MES ANTERIOR
|
|
||||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, True, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
|
||||||
If CvePrePolizaCancelacion <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE MES ANTERIOR"
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
'CANCELA IE MES ACTUAL
|
|
||||||
CvePrePolizaCancelacion = Banc.CancelarBancos_IE(UsuarioActual.CveUsuario, CveIE, False, IdPolizaNueva, FolioPolizaNueva, TxtFechaCancelacion.Text.ToDate, CveTipoTransaccionCancelacion:=DdlTipoTransaccionCancelacion.SelectedValue.ToEntero)
|
|
||||||
If CvePrePolizaCancelacion <= 0 Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar IE MES ACTUAL"
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(200).ToString = "1" Then
|
|
||||||
|
|
||||||
If Not ObjConta.ContabilizarPrePoliza(CvePrePolizaCancelacion, UsuarioActual.CveUsuario, UsuarioActual.Empresa, pIDPoliza:=If(IDPoliza > 0, IDPoliza, -1), ObjConta:=ObjAC) Then
|
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al contabilizar poliza"
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
If Banc.GetComplementoPagos(-1, CveIE, -1, UsuarioActual.CveEmpresa) Then
|
||||||
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
If Banc.DtResultados.FiltraParametros("", DistinctColumns:={"CveComplementoPago", "SerieFolio", "Fecha", "CveIE"}).Rows.Count > 0 Then
|
||||||
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
If Not Banc.GetFoliosCancelados(UsuarioActual.CveEmpresa) Then
|
||||||
ErrorCancelar = True
|
|
||||||
MensajeError = "Error al cancelar complemento de pago"
|
|
||||||
Else
|
|
||||||
Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
|
|
||||||
If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
|
|
||||||
ErrorCancelar = True
|
ErrorCancelar = True
|
||||||
MensajeError = "Error al actualizar complemento de pago"
|
MensajeError = "Error al cancelar complemento de pago"
|
||||||
|
Else
|
||||||
|
Dim FolioCancelado = $"{TxtFolio.Text}_C_{Banc.DtResultados(0)("Cantidad").ToString().ToEntero + 1}"
|
||||||
|
If Not Banc.UpdateFolioCancelado(CveIE.ToEntero, Folio:=FolioCancelado) Then
|
||||||
|
ErrorCancelar = True
|
||||||
|
MensajeError = "Error al actualizar complemento de pago"
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
If Not ErrorCancelar Then
|
If Not ErrorCancelar Then
|
||||||
|
|
||||||
Dim ErrorCancelarComplemento As Boolean = True
|
Dim ErrorCancelarComplemento As Boolean = True
|
||||||
|
|
||||||
If CancelarComplemento Then
|
If CancelarComplemento Then
|
||||||
Dim ObjCancelacion As New Timbrado
|
Dim ObjCancelacion As New Timbrado
|
||||||
'Dim ObjBanco As New ClsBancos
|
'Dim ObjBanco As New ClsBancos
|
||||||
|
|
||||||
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
If EstatusSATCancelado(FolioFiscalCancelar, UsuarioActual.Empresa.RFC, RFCReceptorCancelar) Then
|
||||||
|
|
||||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=Date.Now, SelloCancelacion:="") Then
|
||||||
CargaComplementosPago()
|
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
|
||||||
ErrorCancelarComplemento = False
|
|
||||||
Alert("El complemento se cancelo correctamente.")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Else
|
|
||||||
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
|
||||||
|
|
||||||
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
|
||||||
CargaComplementosPago()
|
CargaComplementosPago()
|
||||||
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
ErrorCancelarComplemento = False
|
ErrorCancelarComplemento = False
|
||||||
@@ -4566,49 +4568,62 @@ Partial Class Bancos_IE
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
If ObjCancelacion.CFDICancelar(UsuarioActual.Empresa, FolioFiscalCancelar, 0, RFCReceptorCancelar, UsuarioActual.Empresa.RFC, CvePACCancelacion) Then
|
||||||
|
|
||||||
|
If Banc.UpdateComplementoPago(CveComplementoPagoCancelar, "-1", -1, UsuarioActual.CveEmpresa, 2, CvePACCancelacion, FechaCancelacion:=ObjCancelacion.CancelacionFecha, SelloCancelacion:=ObjCancelacion.CancelacionAcuse) Then
|
||||||
|
CargaComplementosPago()
|
||||||
|
RegistraScript("$('#ModalCancelarComplemetno').modal('hide');")
|
||||||
|
ErrorCancelarComplemento = False
|
||||||
|
Alert("El complemento se cancelo correctamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert("Se presento un error al cancelar el complemento.", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
Else
|
|
||||||
ErrorCancelarComplemento = False
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
If Not ErrorCancelarComplemento Then
|
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
|
||||||
Banc.Commit()
|
|
||||||
Dim Msg As New StringBuilder
|
|
||||||
|
|
||||||
If CancelarComplemento Then
|
|
||||||
Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.")
|
|
||||||
Else
|
Else
|
||||||
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
ErrorCancelarComplemento = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
|
If Not ErrorCancelarComplemento Then
|
||||||
Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
|
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.Commit()
|
||||||
|
Banc.Commit()
|
||||||
|
Dim Msg As New StringBuilder
|
||||||
|
|
||||||
|
If CancelarComplemento Then
|
||||||
|
Msg.Append("El movimiento bancario y su complemento quedaron cancelados exitosamente.")
|
||||||
|
Else
|
||||||
|
Msg.Append("El movimiento bancario quedó cancelado exitosamente.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
If IdPolizaNueva > 0 Then Msg.AppendFormat("<br/><br/><a class=""Texto"" target='_blank' href=""/Contabilidad/RegPoliza.aspx?IdPoliza={0}"">Ver Póliza de cancelación</a>", IdPolizaNueva)
|
||||||
|
Alert(Msg.ToString, TipoMensaje.MsgInformacion, "document.location.href=""/Bancos/RepIE.aspx""")
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||||
|
Banc.RollBack()
|
||||||
|
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
|
GuardaLog(MensajeError + " | CANCELAR IE")
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
||||||
Banc.RollBack()
|
Banc.RollBack()
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
||||||
GuardaLog(MensajeError + " | CANCELAR IE")
|
GuardaLog(MensajeError + " | CANCELAR IE")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
OnError("Ocurrio un error al cancelar", ex)
|
||||||
Else
|
End Try
|
||||||
If ObjAC IsNot Nothing Then ObjAC.RollBack()
|
|
||||||
Banc.RollBack()
|
|
||||||
Alert("El movimiento bancario no se pudo cancelar. Por favor vuelva a intentar.", TipoMensaje.MsgError)
|
|
||||||
GuardaLog(MensajeError + " | CANCELAR IE")
|
|
||||||
End If
|
|
||||||
|
|
||||||
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
If ObjAC IsNot Nothing Then ObjAC.Dispose()
|
||||||
Banc.Dispose()
|
Banc.Dispose()
|
||||||
@@ -6646,7 +6661,7 @@ Partial Class Bancos_IE
|
|||||||
GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
|
GlobalDTTipoTransacciones.FiltraParametros("Tipo='Egs'")
|
||||||
|
|
||||||
DdlTipoTransaccionCancelacion.Items.Clear()
|
DdlTipoTransaccionCancelacion.Items.Clear()
|
||||||
DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}'")
|
DdlTipoTransaccionCancelacion.DataSource = GlobalDTTipoTransacciones.FiltraParametros($"Tipo ='{TipoMovto}' AND Estatus = 1")
|
||||||
DdlTipoTransaccionCancelacion.DataBind()
|
DdlTipoTransaccionCancelacion.DataBind()
|
||||||
DdlTipoTransaccionCancelacion.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
DdlTipoTransaccionCancelacion.Items.Insert(0, New ListItem("Seleccione una", "-1"))
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,8 @@
|
|||||||
|
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtRFC" CssClass="form-control " runat="server" MaxLength="13"></asp:TextBox>
|
<asp:TextBox ID="TxtRFC" CssClass="form-control " runat="server" MaxLength="13"></asp:TextBox>
|
||||||
<%-- <asp:RegularExpressionValidator ID="REVRFC" runat="server" CssClass="help-block errorimput" ValidationExpression="^([A-Z\d]){12,13}$" ControlToValidate="TxtRFC" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
|
<asp:RegularExpressionValidator ID="REVRFC" runat="server" CssClass="help-block errorimput" ValidationExpression="^([A-Z\d]){12,13}$" ControlToValidate="TxtRFC" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> no es válido, por favor ingrése uno correcto." ValidationGroup="GrpGuardar"></asp:RegularExpressionValidator>
|
||||||
<asp:RequiredFieldValidator ID="RFVRFC" runat="server" ControlToValidate="TxtRFC" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
|
<%--<asp:RequiredFieldValidator ID="RFVRFC" runat="server" ControlToValidate="TxtRFC" CssClass="help-block errorimput" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''RFC''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>--%>
|
||||||
<label for="<%= TxtRFC.ClientID.ToString()%>">RFC:</label>
|
<label for="<%= TxtRFC.ClientID.ToString()%>">RFC:</label>
|
||||||
<i></i>
|
<i></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6711,7 +6711,7 @@ Partial Class Compras_Compras
|
|||||||
Dim TCO As Decimal = 1
|
Dim TCO As Decimal = 1
|
||||||
For Each Dr As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").Rows
|
For Each Dr As DataRow In TmpDT.FiltraParametros("ISNULL(TipoAF,0) <> 2 And ISNULL(CveAlmacen,0) = 0 And ISNULL(AplicaCostoIndirecto,0) <> 1 And ISNULL(CveTipoPS,0) = 2").Rows
|
||||||
If ObjOC.OrdenesCompraDetalleCostoPP(Dr("CveOrdenCompraDetalle").ToString.ToEntero) AndAlso ObjOC.DtResultados.Rows.Count >= 1 Then
|
If ObjOC.OrdenesCompraDetalleCostoPP(Dr("CveOrdenCompraDetalle").ToString.ToEntero) AndAlso ObjOC.DtResultados.Rows.Count >= 1 Then
|
||||||
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}"
|
Concepto = $"{NombreProveedor} {TxtSerie.Text} - {TxtFolio.Text} OC {ObjOC.DtResultados.FiltroPrimeroValor("Folio").ToString} Inv:{ObjOC.DtResultados.FiltroPrimeroValor("FolioAlmacen").ToString}"
|
||||||
Importe176 = ObjOC.DtResultados.FiltroPrimeroValor("Importe176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN176").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
Importe176 = ObjOC.DtResultados.FiltroPrimeroValor("Importe176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME176").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN176 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN176").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
||||||
Importe228 = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN228").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
Importe228 = ObjOC.DtResultados.FiltroPrimeroValor("Importe228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME228").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN228 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN228").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
||||||
Importe229 = ObjOC.DtResultados.FiltroPrimeroValor("Importe229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN229").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
Importe229 = ObjOC.DtResultados.FiltroPrimeroValor("Importe229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteME229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteME229").ToDecimal * Dr("Cantidad").ToString.ToDecimal : ImporteMN229 = ObjOC.DtResultados.FiltroPrimeroValor("ImporteMN229").ToDecimal * Dr("Cantidad").ToString.ToDecimal
|
||||||
@@ -20287,7 +20287,7 @@ Partial Class Compras_Compras
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
If DiferenciaInvOC.RoundSQL() <> 0 Then
|
If DiferenciaInvOC.RoundAD() <> 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -20301,8 +20301,8 @@ Partial Class Compras_Compras
|
|||||||
If CvePrePoliza > 0 Then
|
If CvePrePoliza > 0 Then
|
||||||
|
|
||||||
If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then
|
If CveMoneda = 2 And UsuarioActual.CveEmpresa.Contiene(119) Then
|
||||||
ImporteME = (DiferenciaInvOC / TCInvOC).RoundSQL()
|
ImporteME = (DiferenciaInvOC / TCInvOC).RoundAD()
|
||||||
ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundSQL()
|
ImporteMEComp = ((ImporteME * TCInvOC) - ImporteME).RoundAD()
|
||||||
|
|
||||||
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
|
Dim DifImporte As Decimal = DiferenciaInvOC - (ImporteME + ImporteMEComp)
|
||||||
|
|
||||||
|
|||||||
@@ -2254,7 +2254,7 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>
|
||||||
|
|
||||||
<ajax:TabPanel ID="TabProductosXEntregar" runat="server" HeaderText="Productos por entregar">
|
<%-- <ajax:TabPanel ID="TabProductosXEntregar" runat="server" HeaderText="Productos por entregar">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="portlet light xspadding bordered ">
|
<div class="portlet light xspadding bordered ">
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
@@ -2296,7 +2296,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</ajax:TabPanel>
|
</ajax:TabPanel>--%>
|
||||||
|
|
||||||
<ajax:TabPanel ID="TabDocs" runat="server" HeaderText="Documentación" CssClass="table table-hover table-advance Widthall" Visible="False">
|
<ajax:TabPanel ID="TabDocs" runat="server" HeaderText="Documentación" CssClass="table table-hover table-advance Widthall" Visible="False">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1">SubTipo Activo Fijo:</div>
|
<div class="col-md-1">SubTipo Fijo:</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:DropDownList ID="DdlSubTipoActivoFijo" CssClass="form-control input-sm select2me input-small" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataTextField="SubTipoActivoFijo" DataValueField="CveSubTipoActivoFijo" Width="95%">
|
<asp:DropDownList ID="DdlSubTipoActivoFijo" CssClass="form-control input-sm select2me input-small" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataTextField="SubTipoActivoFijo" DataValueField="CveSubTipoActivoFijo" Width="95%">
|
||||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
<asp:ListItem Selected="True" Text="Todas" Value="-1"></asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1">Producto Servicio:</div>
|
<div class="col-md-1" style="display:none;">Producto Servicio:</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" Width="95%" />
|
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width: 100%;" CssClassDdl="select2me" DataTextField="PSCodigo" DataValueField="CvePS" Width="95%" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Enero</th>
|
<th>Enero</th>
|
||||||
<th>Febero</th>
|
<th>Febrero</th>
|
||||||
<th>Marzo</th>
|
<th>Marzo</th>
|
||||||
<th>Abril</th>
|
<th>Abril</th>
|
||||||
<th>Mayo</th>
|
<th>Mayo</th>
|
||||||
|
|||||||
@@ -67,9 +67,16 @@
|
|||||||
<asp:Label ID="LblEncabezado" runat="server" Text=" Registro de Póliza"></asp:Label>
|
<asp:Label ID="LblEncabezado" runat="server" Text=" Registro de Póliza"></asp:Label>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||||
<li>
|
<asp:UpdatePanel runat="server">
|
||||||
<asp:LinkButton ID="LnkComplementoPago" runat="server" Visible="false" OnClick="LnkComplementoPago_Click" Style="color: #686868;"><i class="fa fa-money" style="color:#686868;"></i> Crear Complemento de Pago</asp:LinkButton>
|
<ContentTemplate>
|
||||||
</li>
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkExcel" runat="server" Visible="true" data-target="#DivCargaExcel"><i class="far fa-file-excel" style="font-weight:bold;"></i> Cargar Excel</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<asp:LinkButton ID="LnkComplementoPago" runat="server" Visible="false" OnClick="LnkComplementoPago_Click" Style="color: #686868;"><i class="fa fa-money" style="color:#686868;"></i> Crear Complemento de Pago</asp:LinkButton>
|
||||||
|
</li>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
<asp:Content ID="Content6" ContentPlaceHolderID="C" runat="Server">
|
||||||
|
|
||||||
@@ -304,7 +311,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;">
|
<div style="width: 100%; min-height: 200px; overflow-scrolling: auto;">
|
||||||
<asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" ShowHeader="False" DataKeyNames="IdMov,IDCuenta,Cargo,Abono,TipoMovto,CveConcepto,CveProveedor,CvePersonal, CveCompra,CveClasificacion,CveCliente,CveVenta,TC,CveOC,PorcentajeImpuesto,CveCuenta" Width="100%" CssClass=" GvMov GvSize table table-striped table-advance table-hover mysmallbtn" GridLines="None">
|
<asp:GridView ID="GvMov" runat="server" AutoGenerateColumns="False" ShowHeader="False" DataKeyNames="IdMov,IDCuenta,Cargo,Abono,TipoMovto,CveConcepto,CveProveedor,CvePersonal, CveCompra,CveClasificacion,CveCliente,CveVenta,TC,CveOC,PorcentajeImpuesto,CveCuenta, Cuenta, CveSubProyecto" Width="100%" CssClass=" GvMov GvSize table table-striped table-advance table-hover mysmallbtn" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<HeaderTemplate>Cuenta</HeaderTemplate>
|
<HeaderTemplate>Cuenta</HeaderTemplate>
|
||||||
@@ -728,7 +735,54 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="DivCargaExcel" class="modal ADS fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header ">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<h4 class="modal-title">Agregar Excel</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
<label class="col-md-2 truncate" style="text-align: right;">Almacen:</label>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<asp:DropDownList ID="DdlPlantilla2" runat="server" DataValueField="CvePlantillaPoliza" DataTextField="PlantillaPoliza" class="select2me" Width="100%"></asp:DropDownList>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h3>Arraste o haga click para subir el archivo Excel</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-11" style="margin-left: 30px; margin-right: 30px; margin-bottom: 10px;">
|
||||||
|
<asp:TextBox ID="TxtExcel" CssClass="ADSdropzone hidden" Text="" data-maxFile="1" runat="server"></asp:TextBox>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3" style="text-align: left">
|
||||||
|
<asp:UpdatePanel ID="UpDescargar" runat="server" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<asp:Button ID="BtnDescargar" runat="server" CssClass="btn btn-warning" Text="Descargar Formato" />
|
||||||
|
</ContentTemplate>
|
||||||
|
<Triggers>
|
||||||
|
<asp:PostBackTrigger ControlID="BtnDescargar" />
|
||||||
|
</Triggers>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9" style="text-align: right">
|
||||||
|
<asp:Button ID="BtnCargaExcel" runat="server" CssClass="btn btn-success" Text="Aceptar"></asp:Button>
|
||||||
|
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancelar</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
<script src="/Metronic/assets/global/plugins/dropzone/dropzone.js"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ Imports System.Data
|
|||||||
Imports Extensiones
|
Imports Extensiones
|
||||||
Imports System.Linq
|
Imports System.Linq
|
||||||
Imports System.Web.Services
|
Imports System.Web.Services
|
||||||
|
Imports GemBox.Spreadsheet
|
||||||
|
|
||||||
Partial Class ContabilidadC_RegPrePoliza
|
Partial Class ContabilidadC_RegPrePoliza
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -171,6 +172,8 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
|
|
||||||
If Not Page.IsPostBack Then
|
If Not Page.IsPostBack Then
|
||||||
|
|
||||||
|
|
||||||
If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
If UsuarioActual.Empresa.TipoContabilizacion = 1 OrElse UsuarioActual.Empresa.TipoContabilidad = 1 Then
|
||||||
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
|
Response.Redirect(Request.Url.PathAndQuery.Replace("RegPrePoliza", "RegPrePolizaS"))
|
||||||
End If
|
End If
|
||||||
@@ -223,8 +226,9 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
Contabilizar()
|
Contabilizar()
|
||||||
End If
|
End If
|
||||||
Exit Sub
|
Exit Sub
|
||||||
|
LnkExcel.Visible = False
|
||||||
Else
|
Else
|
||||||
|
LnkExcel.Visible = True
|
||||||
CreaDT()
|
CreaDT()
|
||||||
BtnEliminar.Visible = False
|
BtnEliminar.Visible = False
|
||||||
|
|
||||||
@@ -527,13 +531,20 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
|
|
||||||
If UsuarioActual.CveEmpresa.Contiene(120) Then
|
If UsuarioActual.CveEmpresa.Contiene(120) Then
|
||||||
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1)
|
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1)
|
||||||
|
DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, -1)
|
||||||
|
|
||||||
Else
|
Else
|
||||||
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
|
DdlPlantilla.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
|
||||||
|
DdlPlantilla2.DataSource = GlobalDTContaPlantillasPolizas(UsuarioActual.CveEmpresa, TipoPlantilla)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
DdlPlantilla.DataBind()
|
DdlPlantilla.DataBind()
|
||||||
DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
|
DdlPlantilla.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
|
||||||
|
|
||||||
|
DdlPlantilla2.DataBind()
|
||||||
|
DdlPlantilla2.Items.Insert(0, New ListItem("Plantilla Personalizada", "53"))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaConceptos()
|
Private Sub CargaConceptos()
|
||||||
@@ -801,6 +812,8 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto")
|
dr("PorcentajeImpuesto") = drt("PorcentajeImpuesto")
|
||||||
dr("CveCuenta") = drt("CveCuenta")
|
dr("CveCuenta") = drt("CveCuenta")
|
||||||
DtMovimientos.Rows.Add(dr)
|
DtMovimientos.Rows.Add(dr)
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|
||||||
@@ -1754,5 +1767,252 @@ Partial Class ContabilidadC_RegPrePoliza
|
|||||||
End If
|
End If
|
||||||
ObjGral.Dispose()
|
ObjGral.Dispose()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub LnkExcel_Click(sender As Object, e As EventArgs) Handles LnkExcel.Click
|
||||||
|
RegistraScript(String.Format("$('#{0}').modal();", "DivCargaExcel"))
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnDescargar_Click(sender As Object, e As EventArgs) Handles BtnDescargar.Click
|
||||||
|
Dim NombreArchivo As String
|
||||||
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
Dim workbook As New ExcelFile()
|
||||||
|
Dim worksheet = workbook.Worksheets.Add(DdlPlantilla2.SelectedItem.Text.ToString)
|
||||||
|
|
||||||
|
Dim CvePlantilla As Integer = DdlPlantilla2.SelectedValue.ToEntero
|
||||||
|
Dim Dt As DataTable = GlobalDTContaPlantillasPolizasDetalle(CvePlantilla).FiltraParametros(String.Format("CveEmpresa={0}", UsuarioActual.CveEmpresa), "Orden")
|
||||||
|
|
||||||
|
Dim DtExcel As DataTable = (From row As DataRow In Dt.Rows
|
||||||
|
Select New With
|
||||||
|
{
|
||||||
|
.ConceptoAdministrativo = row.Item("ConceptoContable"),
|
||||||
|
.Cuenta = "",
|
||||||
|
.NombreCuenta = "",
|
||||||
|
.Cargo = "",
|
||||||
|
.Abono = "",
|
||||||
|
.Referencia = "",
|
||||||
|
.Concepto = "",
|
||||||
|
.SubProyecto = row.Item("SubProyecto"),
|
||||||
|
.CveConceptoContable = row.Item("CveConcepto"),
|
||||||
|
.CveSubProyecto = IIf(row.Item("CveSubProyecto").ToString.ToEntero > 0, row.Item("CveSubProyecto"), -1),
|
||||||
|
.IdCtaContable = IIf(row.Item("IdCtaContable").ToString.ToEntero > 0, row.Item("IdCtaContable"), -1)
|
||||||
|
}).QueryToDataTable(True)
|
||||||
|
|
||||||
|
worksheet.InsertDataTable(DtExcel, New InsertDataTableOptions() With
|
||||||
|
{
|
||||||
|
.ColumnHeaders = True,
|
||||||
|
.StartRow = 0,
|
||||||
|
.StartColumn = 0
|
||||||
|
})
|
||||||
|
|
||||||
|
Dim columnCount = worksheet.CalculateMaxUsedColumns()
|
||||||
|
For i = 0 To columnCount
|
||||||
|
worksheet.Columns(i).AutoFit(1, worksheet.Rows(0), worksheet.Rows(worksheet.Rows.Count - 1))
|
||||||
|
Next
|
||||||
|
worksheet.Columns("I").Hidden = True
|
||||||
|
worksheet.Columns("J").Hidden = True
|
||||||
|
worksheet.Columns("K").Hidden = True
|
||||||
|
|
||||||
|
|
||||||
|
NombreArchivo = DdlPlantilla2.SelectedItem.Text.ToString
|
||||||
|
workbook.Save(Response, $"{NombreArchivo}.xlsx", SaveOptions.XlsxDefault)
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) Handles BtnCargaExcel.Click
|
||||||
|
If TxtExcel.getfiles().Archivos.Count > 0 Then
|
||||||
|
Dim file As Archivo = TxtExcel.getfiles().Archivos(0)
|
||||||
|
|
||||||
|
Dim Directorio As String = Server.MapPath("~") & file.patch
|
||||||
|
|
||||||
|
Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV")
|
||||||
|
CargarArchivo(Directorio, file.filename, Tipo)
|
||||||
|
Else
|
||||||
|
Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub CargarArchivo(Ruta As String, FileName As String, Tipo As String)
|
||||||
|
Dim dt As New DataTable
|
||||||
|
' Conexion As Odbc.OdbcConnection = Nothing
|
||||||
|
Dim ErrorArchivo = False
|
||||||
|
Dim ErrorExcel = False
|
||||||
|
|
||||||
|
dt = ReadExcelFile(Ruta + FileName, True)
|
||||||
|
|
||||||
|
|
||||||
|
If Not ErrorArchivo Then
|
||||||
|
|
||||||
|
If Not dt.Columns(0).ColumnName = "ConceptoAdministrativo" Then
|
||||||
|
Alert("El nombre de la primera columna debe ser 'ConceptoAdmin'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(1).ColumnName = "Cuenta" Then
|
||||||
|
Alert("El nombre de la segunda columna debe ser 'Cuenta'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(2).ColumnName = "NombreCuenta" Then
|
||||||
|
Alert("El nombre de la tercera columna debe ser 'NombreCuenta'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(3).ColumnName = "Cargo" Then
|
||||||
|
Alert("El nombre de la cuarta columna debe ser 'Cargo'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(4).ColumnName = "Abono" Then
|
||||||
|
Alert("El nombre de la quinta columna debe ser 'Abono' .Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(5).ColumnName = "Referencia" Then
|
||||||
|
Alert("El nombre de la sexta columna debe ser 'Referencia'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(6).ColumnName = "Concepto" Then
|
||||||
|
Alert("El nombre de la séptima columna debe ser 'Concepto'.Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
If Not dt.Columns(7).ColumnName = "SubProyecto" Then
|
||||||
|
Alert("El nombre de la octava columna debe ser 'SubProyecto'. Favor de corregirlo", TipoMensaje.MsgError)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ErrorArchivo Then
|
||||||
|
|
||||||
|
|
||||||
|
Dim ObjConta As New ClsContabilidad()
|
||||||
|
ObjConta.IniciaTransacSQL()
|
||||||
|
Try
|
||||||
|
Dim TieneError As Boolean = False
|
||||||
|
Dim ContadorUpdate As Integer = 0
|
||||||
|
Dim ContadorError As Integer = 0
|
||||||
|
Dim NombreCuenta As String = ""
|
||||||
|
Dim CvePrePoliza As Integer = 0
|
||||||
|
Dim Cuenta As String = ""
|
||||||
|
Dim Reporte As New StringBuilder
|
||||||
|
Dim TotalCargos As Integer = 0
|
||||||
|
Dim TotalAbonos As Integer = 0
|
||||||
|
|
||||||
|
|
||||||
|
CvePrePoliza = ObjConta.AddPrePolizas("Contabilidad/RegPrePolizaExcel", DdlPlantilla2.SelectedValue.ToEntero, TotalCargos, TotalAbonos, 1, TxtFecha.Text.ToDate, DdlPlantilla2.SelectedItem.Text.ToString, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoPoliza:=DdlTipoPolizaAdd.SelectedValue.ToEntero)
|
||||||
|
|
||||||
|
|
||||||
|
For Each Row As DataRow In dt.Rows
|
||||||
|
NombreCuenta = Row("NombreCuenta").ToString
|
||||||
|
Cuenta = Row("Cuenta").ToString
|
||||||
|
|
||||||
|
Dim Importe As Decimal = If(Row("Cargo").ToString.ToDecimal <> 0, Row("Cargo").ToString.ToDecimal, Row("Abono").ToString.ToDecimal)
|
||||||
|
Dim Concepto As String = Row("Concepto").ToString
|
||||||
|
Dim Referencia As String = Row("Referencia").ToString
|
||||||
|
Dim IdCuenta As Integer = -1
|
||||||
|
Dim CveSubProyecto As Integer = Row("CveSubProyecto").ToString.ToEntero
|
||||||
|
Dim TipoMovto As Boolean = If(Row("Cargo").ToString.ToDecimal <> 0, False, True)
|
||||||
|
Dim YaExiste As Boolean = False
|
||||||
|
Dim CveConceptoContable As Integer = Row("CveConceptoContable").ToString.ToEntero
|
||||||
|
Dim IdCtaContable As Integer = Row("IdCtaContable").ToString.ToEntero
|
||||||
|
|
||||||
|
If ObjConta.GetCuentas(-1, Cuenta.Replace("-", ""), 1, UsuarioActual.CveEmpresa) Then
|
||||||
|
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||||
|
IdCuenta = ObjConta.DtResultados().FiltroPrimeroValor("CveCuenta").ToEntero
|
||||||
|
'TipoCuenta = ObjConta.DtResultados().FiltroPrimeroValor("Tipo")
|
||||||
|
Else
|
||||||
|
Reporte.AppendLine($"{Cuenta} - {NombreCuenta} - {Importe} </br>")
|
||||||
|
TieneError = True
|
||||||
|
YaExiste = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
TieneError = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
'If TipoCuenta.Contiene("A", "C", "E") Then
|
||||||
|
' CargoAbono = False
|
||||||
|
'End If
|
||||||
|
|
||||||
|
If YaExiste = False Then
|
||||||
|
If IdCuenta > 0 Then
|
||||||
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", CveConceptoContable, Concepto, Now.ToDate, IdCtaContable, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then
|
||||||
|
TieneError = True
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
IdCuenta = -2
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Next
|
||||||
|
If Not TieneError Then
|
||||||
|
ObjConta.Commit()
|
||||||
|
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjConta.ContaFolio))
|
||||||
|
|
||||||
|
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")
|
||||||
|
|
||||||
|
Else
|
||||||
|
Alert($"No encontraron las siguientes cuentas: {Reporte.ToString} ", TipoMensaje.MsgError)
|
||||||
|
ObjConta.RollBack()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
ObjConta.RollBack()
|
||||||
|
End Try
|
||||||
|
|
||||||
|
ObjConta.Dispose()
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable
|
||||||
|
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
|
||||||
|
Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath)
|
||||||
|
|
||||||
|
Dim unnamed As Integer = 0
|
||||||
|
Dim cols As Integer
|
||||||
|
Dim columns As String()
|
||||||
|
Dim curRow As Integer = 0
|
||||||
|
Dim curCol As Integer = 0
|
||||||
|
Dim dataTable As DataTable = New DataTable()
|
||||||
|
Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0)
|
||||||
|
|
||||||
|
For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1
|
||||||
|
|
||||||
|
If firstRowHasHeaders Then
|
||||||
|
|
||||||
|
If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then
|
||||||
|
dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim)
|
||||||
|
Else
|
||||||
|
dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed)))
|
||||||
|
End If
|
||||||
|
|
||||||
|
curRow = 1
|
||||||
|
Else
|
||||||
|
dataTable.Columns.Add("Column " & (cols + 1))
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
While curRow < worksheet.Rows.Count
|
||||||
|
|
||||||
|
columns = New String(cols - 1) {}
|
||||||
|
|
||||||
|
For curCol = 0 To cols - 1
|
||||||
|
|
||||||
|
If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then
|
||||||
|
columns(curCol) = ""
|
||||||
|
Else
|
||||||
|
columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString()
|
||||||
|
End If
|
||||||
|
|
||||||
|
Next
|
||||||
|
|
||||||
|
dataTable.Rows.Add(columns)
|
||||||
|
curRow += 1
|
||||||
|
|
||||||
|
End While
|
||||||
|
|
||||||
|
Return dataTable
|
||||||
|
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
|
|
||||||
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
||||||
|
|
||||||
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
|
|
||||||
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
Using ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
|
||||||
@@ -372,6 +372,10 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
|
|
||||||
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
'Dim ObjConta As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
Dim ObjConta As New ClsContabilidad
|
Dim ObjConta As New ClsContabilidad
|
||||||
|
<<<<<<< HEAD
|
||||||
|
Dim ObjConta2 As ClsContPAQi
|
||||||
|
=======
|
||||||
|
>>>>>>> ee1135d888f76469fa6e3e68f0b6393f8450045a
|
||||||
|
|
||||||
Dim CuentaEfectivo As Integer = 0
|
Dim CuentaEfectivo As Integer = 0
|
||||||
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
|
Dim Afectable As Integer = 1 'If(DcuentaMayor.SelectedValue <> 2, 0, 1) ' cuando sea tipo 2, va a ser afectable
|
||||||
@@ -386,7 +390,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If idnew > 0 Then
|
If idnew > 0 Then
|
||||||
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
|
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
|
||||||
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
||||||
@@ -397,58 +401,71 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
|
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If IdPadre > 0 Then
|
|
||||||
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
|
|
||||||
|
|
||||||
If idnew2 > 0 Then
|
Dim codigoPadre As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}") 'Tsubcuenta.Text
|
||||||
If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
|
ObjConta2 = New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
|
|
||||||
|
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
||||||
|
Dim IdPadre As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigoPadre}'").ToEntero
|
||||||
|
Dim IdAgrupador As Integer
|
||||||
|
|
||||||
|
If ObjConta2.GetAgrupadoresSAT() Then
|
||||||
|
IdAgrupador = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"CodigoNombre='{DdlAgrupadorSAT.SelectedItem.Text}'").ToEntero
|
||||||
|
End If
|
||||||
|
|
||||||
|
If IdPadre > 0 Then
|
||||||
|
Dim idnew2 As Integer = ObjConta2.AddCuenta(TxtCuenta.Text.Replace("-", ""), Tnombre.Text, DTcuenta.SelectedValue.ToString, DcuentaMayor.SelectedValue.ToString.ToEntero, CuentaEfectivo, DdlMoneda.SelectedValue.ToEntero, TxtDigAgrup.Text.ToEntero, TxtNomIngles.Text.Trim, Afectable, IdPadre, IdAgrupador)
|
||||||
|
|
||||||
|
If idnew2 > 0 Then
|
||||||
|
If ObjConta.UpdateCuentaCompaq(idnew, idnew2, UsuarioActual.CveEmpresa) Then
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
ObjConta2.Dispose()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim dr As DataRow = DtDatos.NewRow
|
||||||
|
dr("CveCuenta") = idnew
|
||||||
|
dr("CuentaFormato") = TxtCuenta.Text
|
||||||
|
'dr("CuentaFormato") = Tcuenta.Text
|
||||||
|
dr("Nombre") = Tnombre.Text
|
||||||
|
dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)
|
||||||
|
'dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)
|
||||||
|
dr("Tipo") = DTcuenta.SelectedValue.ToString
|
||||||
|
dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString
|
||||||
|
dr("CvePadre") = IDSelected
|
||||||
|
dr("Codigo") = Tnombre.Text
|
||||||
|
dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero
|
||||||
|
dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero
|
||||||
|
dr("NomIdioma") = TxtNomIngles.Text.Trim
|
||||||
|
DtDatos.Rows.Add(dr)
|
||||||
|
ArbolCuentas.DataSource = DtDatos
|
||||||
|
'.Attributes.Add("data-hijos","0");
|
||||||
|
Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
|
||||||
|
item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1
|
||||||
|
Dim objul As ADServerControl.DragableUL = DirectCast(ArbolCuentas.FindControl(String.Format("ul{0}", IDSelected)), ADServerControl.DragableUL)
|
||||||
|
If (IsNothing(objul)) Then
|
||||||
|
objul = New ADServerControl.DragableUL
|
||||||
|
objul.ID = String.Format("ul{0}", item.Cve)
|
||||||
|
item.Controls.Add(objul)
|
||||||
|
End If
|
||||||
|
ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text))
|
||||||
|
|
||||||
|
LimpiarCampos()
|
||||||
|
updatos.Update()
|
||||||
|
CargaDatos()
|
||||||
|
|
||||||
|
Alert("La cuenta se guardo correctamente")
|
||||||
End If
|
End If
|
||||||
ObjConta2.Dispose()
|
|
||||||
End If
|
ObjConta.Dispose()
|
||||||
|
|
||||||
|
If ObjConta2 IsNot Nothing Then ObjConta2.Dispose()
|
||||||
|
|
||||||
|
|
||||||
'Dim dr As DataRow = DtDatos.NewRow
|
|
||||||
'dr("CveCuenta") = idnew
|
|
||||||
'dr("CuentaFormato") = TxtCuenta.Text
|
|
||||||
''dr("CuentaFormato") = Tcuenta.Text
|
|
||||||
'dr("Nombre") = Tnombre.Text
|
|
||||||
'dr("CtaCodigo") = String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text)
|
|
||||||
''dr("CtaCodigo") = String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text)
|
|
||||||
'dr("Tipo") = DTcuenta.SelectedValue.ToString
|
|
||||||
'dr("CtaMayor") = DcuentaMayor.SelectedValue.ToString
|
|
||||||
'dr("CvePadre") = IDSelected
|
|
||||||
'dr("Codigo") = Tnombre.Text
|
|
||||||
'dr("CveMoneda") = DdlMoneda.SelectedValue.ToEntero
|
|
||||||
'dr("DigAgrup") = TxtDigAgrup.Text.Trim.ToEntero
|
|
||||||
'dr("NomIdioma") = TxtNomIngles.Text.Trim
|
|
||||||
'DtDatos.Rows.Add(dr)
|
|
||||||
'ArbolCuentas.DataSource = DtDatos
|
|
||||||
''.Attributes.Add("data-hijos","0");
|
|
||||||
'Dim item As ADServerControl.DragableItem = DirectCast(ArbolCuentas.FindControl(String.Format("{0}", IDSelected)), ADServerControl.DragableItem)
|
|
||||||
'item.Attributes.Item("data-hijos") = item.Attributes.Item("data-hijos").ToEntero + 1
|
|
||||||
'Dim objul As ADServerControl.DragableUL = DirectCast(ArbolCuentas.FindControl(String.Format("ul{0}", IDSelected)), ADServerControl.DragableUL)
|
|
||||||
'If (IsNothing(objul)) Then
|
|
||||||
' objul = New ADServerControl.DragableUL
|
|
||||||
' objul.ID = String.Format("ul{0}", item.Cve)
|
|
||||||
' item.Controls.Add(objul)
|
|
||||||
'End If
|
|
||||||
'ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", TxtCuenta.Text, Tnombre.Text))
|
|
||||||
''ArbolCuentas.additem(objul, idnew, IDSelected, String.Format("{0} - {1}", Tcuenta.Text, Tnombre.Text))
|
|
||||||
|
|
||||||
''updatos.Visible = False
|
|
||||||
''nuevacuenta.Visible = False
|
|
||||||
LimpiarCampos()
|
|
||||||
updatos.Update()
|
|
||||||
CargaDatos()
|
|
||||||
|
|
||||||
Alert("La cuenta se guardo correctamente")
|
|
||||||
End If
|
|
||||||
|
|
||||||
ObjConta.Dispose()
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub LimpiarCampos()
|
Private Sub LimpiarCampos()
|
||||||
TxtCuenta.Text = ""
|
TxtCuenta.Text = ""
|
||||||
@@ -496,7 +513,7 @@ Partial Class Contabilidad2_CatCuentas
|
|||||||
|
|
||||||
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
Dim codigo As String = DtDatos.FiltroPrimeroValor("Codigo", $"CveCuenta={IDSelected}")
|
||||||
|
|
||||||
If UsuarioActual.Empresa.TipoContabilidad <> 1 Then
|
If UsuarioActual.Empresa.TipoContabilidad = 2 Then
|
||||||
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
Dim ObjConta2 As New ClsContPAQi(UsuarioActual.Empresa)
|
||||||
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
If ObjConta2.GetCuentas(-1, "-1", -1) Then
|
||||||
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
|
Dim Id As Integer = ObjConta2.DtResultados.FiltroPrimeroValor("Id", $"Codigo='{codigo}'").ToEntero
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -513,7 +513,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -266,6 +266,6 @@
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -632,6 +632,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -769,7 +769,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=geometry&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=geometry&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -754,7 +754,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
|
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -3130,7 +3130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
||||||
<script src="Rastreo/JS/GeoRutas.js"></script>
|
<script src="Rastreo/JS/GeoRutas.js"></script>
|
||||||
|
|||||||
@@ -1586,7 +1586,7 @@ Partial Class GPS_Rastreo
|
|||||||
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
|
RptParametro.Add(New ReportParameter("FechaInicio", FechaI.ToString))
|
||||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
||||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
|
||||||
|
|
||||||
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
|
retorno = StreamPDF(RutaReporte, DtDatos, RptParametro, $"{NombreReporte}{Date.Now.ToShortDateString}", Format, MR:=Nothing, RDSName:="DsOC")
|
||||||
|
|
||||||
@@ -1614,6 +1614,8 @@ Partial Class GPS_Rastreo
|
|||||||
ElseIf Opcion = "Speed" Then
|
ElseIf Opcion = "Speed" Then
|
||||||
RutaReporte = "Empresas/Grales/ReportesProgramados/RPVelocidad.rdlc"
|
RutaReporte = "Empresas/Grales/ReportesProgramados/RPVelocidad.rdlc"
|
||||||
NombreReporte = "ReporteExcesosVelocidad"
|
NombreReporte = "ReporteExcesosVelocidad"
|
||||||
|
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
|
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
Dim RptParametro As New List(Of ReportParameter)
|
Dim RptParametro As New List(Of ReportParameter)
|
||||||
Dim DtDatos As New DataTable()
|
Dim DtDatos As New DataTable()
|
||||||
@@ -1628,9 +1630,14 @@ Partial Class GPS_Rastreo
|
|||||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
||||||
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
||||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
|
||||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
|
RptParametro.Add(New ReportParameter("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||||
|
If Imagen.Exists Then
|
||||||
|
RptParametro.Add(New ReportParameter("LogoPath", logouri))
|
||||||
|
Else
|
||||||
|
RptParametro.Add(New ReportParameter("LogoPath", ""))
|
||||||
|
End If
|
||||||
For Each row As GridViewRow In GvBarra.Rows
|
For Each row As GridViewRow In GvBarra.Rows
|
||||||
Dim DrNew = DtDatos.NewRow()
|
Dim DrNew = DtDatos.NewRow()
|
||||||
|
|
||||||
@@ -1676,7 +1683,7 @@ Partial Class GPS_Rastreo
|
|||||||
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
RptParametro.Add(New ReportParameter("FechaFin", FechaF.ToString))
|
||||||
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
RptParametro.Add(New ReportParameter("MapaURL", ""))
|
||||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToShortDateString))
|
RptParametro.Add(New ReportParameter("FechaImpresion", DateTime.Now.ToString))
|
||||||
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
|
|
||||||
If Opcion = "Idle" Then
|
If Opcion = "Idle" Then
|
||||||
@@ -1825,12 +1832,20 @@ Partial Class GPS_Rastreo
|
|||||||
|
|
||||||
Private Sub ImprimirCrystal(NombreReporte As String, Format As String)
|
Private Sub ImprimirCrystal(NombreReporte As String, Format As String)
|
||||||
Dim RptParametro As New List(Of CrystalParametro)
|
Dim RptParametro As New List(Of CrystalParametro)
|
||||||
|
Dim Imagen As New System.IO.FileInfo(String.Format("{0}/Logo.png", UsuarioActual.Empresa.Ruta))
|
||||||
|
Dim logouri = String.Format("{0}://{1}:{2}/Empresas/{3}/Logo.png", Request.Url.Scheme, Request.Url.Host, Request.Url.Port, UsuarioActual.CveEmpresa)
|
||||||
|
|
||||||
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
RptParametro.Add(New CrystalParametro("FechaInicio", FechaI.ToString))
|
||||||
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
|
RptParametro.Add(New CrystalParametro("FechaFin", FechaF.ToString))
|
||||||
RptParametro.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Usuario))
|
RptParametro.Add(New CrystalParametro("UsuarioImprimio", UsuarioActual.Usuario))
|
||||||
RptParametro.Add(New CrystalParametro("FechaImpresion", DateTime.Now.ToShortDateString))
|
RptParametro.Add(New CrystalParametro("FechaImpresion", DateTime.Now.ToString))
|
||||||
RptParametro.Add(New CrystalParametro("KMRecorridos", $"{DtPosiciones.SUM("KMRecorridos").ToString} KM"))
|
RptParametro.Add(New CrystalParametro("KMRecorridos", $"{DtPosiciones.SUM("KMRecorridos").ToString} KM"))
|
||||||
|
RptParametro.Add(New CrystalParametro("NombreEmpresa", UsuarioActual.Empresa.Empresa))
|
||||||
|
If Imagen.Exists Then
|
||||||
|
RptParametro.Add(New CrystalParametro("LogoPath", logouri))
|
||||||
|
Else
|
||||||
|
RptParametro.Add(New CrystalParametro("LogoPath", ""))
|
||||||
|
End If
|
||||||
Dim DtDatos As New DataTable()
|
Dim DtDatos As New DataTable()
|
||||||
|
|
||||||
DtDatos.Columns.Add("Vehiculo", GetType(String))
|
DtDatos.Columns.Add("Vehiculo", GetType(String))
|
||||||
|
|||||||
@@ -623,6 +623,6 @@
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -722,7 +722,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", "AIzaSyDsZ4ATb_hVSEpRbBSlS46ZHEOn-0bNIFI") %>"></script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places&callback=initMap", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -731,6 +731,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.ModExtensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.ModExtensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -784,6 +784,6 @@
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -1333,6 +1333,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|
||||||
|
|||||||
@@ -3340,9 +3340,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&callback=IniciaMapas", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAF7s8wwhzCVXDUYopc9mXxqaWB33cDro4&libraries=drawing&callback=IniciaMapas">
|
|
||||||
</script>
|
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/jquery.minicolors.min.js"></script>
|
||||||
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
<script src="../Metronic/assets/global/plugins/jquery-minicolors/components-color-pickers.min.js"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -2021,7 +2021,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If YaExiste = False Then
|
If YaExiste = False Then
|
||||||
If IdCuenta > 0 Then
|
If IdCuenta > 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.toDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, TipoMovto, Importe, "", 95, Concepto, Now.toDate, -1, -1, ImporteMX:=Importe, CveSubProyecto:=CveSubProyecto, CveCuenta:=IdCuenta) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -2035,7 +2035,7 @@ Partial Class General_SaldosIniciales
|
|||||||
|
|
||||||
If Not TieneError Then
|
If Not TieneError Then
|
||||||
ObjConta.Commit()
|
ObjConta.Commit()
|
||||||
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >{1}</a></b>", CvePrePoliza, ObjConta.ContaFolio))
|
Alert(String.Format("<br/><br/>Prepóliza: <b><a href = ""/Contabilidad/RegPrePoliza.aspx?CvePrePoliza={0}"" class=""texto"" target=""_blank"" >Prepóliza</a></b>", CvePrePoliza, ObjConta.ContaFolio))
|
||||||
|
|
||||||
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")
|
Alert($"Se agregó la póliza {ObjConta.ContaFolio}")
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@
|
|||||||
Using ObjActivosFijos As New ClsAF
|
Using ObjActivosFijos As New ClsAF
|
||||||
If ObjActivosFijos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTAFCaracteristicasClasificaciones") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicasClasificaciones") = Nothing
|
If ObjActivosFijos.GetCaracteristicasClasificaciones(-1) Then Application("GlobalDTAFCaracteristicasClasificaciones") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicasClasificaciones") = Nothing
|
||||||
If ObjActivosFijos.GetCaracteristicas(-1) Then Application("GlobalDTAFCaracteristicas") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicas") = Nothing
|
If ObjActivosFijos.GetCaracteristicas(-1) Then Application("GlobalDTAFCaracteristicas") = ObjActivosFijos.DtResultados Else Application("GlobalDTAFCaracteristicas") = Nothing
|
||||||
If ObjActivosFijos.GetSubTiposActivosFijos(-1) Then Application("GlobalDTSubTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTSubTipoActivoFijo") = Nothing
|
'If ObjActivosFijos.GetSubTiposActivosFijos(-1) Then Application("GlobalDTSubTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTSubTipoActivoFijo") = Nothing
|
||||||
If ObjActivosFijos.GetTiposActivosFijos(-1) Then Application("GlobalDTTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTTipoActivoFijo") = Nothing
|
If ObjActivosFijos.GetTiposActivosFijos(-1) Then Application("GlobalDTTipoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTTipoActivoFijo") = Nothing
|
||||||
If ObjActivosFijos.GetEstatusActivoFijo() Then Application("GlobalDTEstadoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTEstadoActivoFijo") = Nothing
|
If ObjActivosFijos.GetEstatusActivoFijo() Then Application("GlobalDTEstadoActivoFijo") = ObjActivosFijos.DtResultados Else Application("GlobalDTEstadoActivoFijo") = Nothing
|
||||||
If ObjActivosFijos.GetMarcasActivosFijos(-1) Then Application(" GlobalDTMarcaActivoFijo") = ObjActivosFijos.DtResultados Else Application(" GlobalDTMarcaActivoFijo") = Nothing
|
If ObjActivosFijos.GetMarcasActivosFijos(-1) Then Application(" GlobalDTMarcaActivoFijo") = ObjActivosFijos.DtResultados Else Application(" GlobalDTMarcaActivoFijo") = Nothing
|
||||||
|
|||||||
@@ -535,7 +535,7 @@
|
|||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 col-sm-2">
|
<%-- <div class="col-md-2 col-sm-2">
|
||||||
<div class="portlet light ">
|
<div class="portlet light ">
|
||||||
<div class="portlet-title">
|
<div class="portlet-title">
|
||||||
<div class="caption">
|
<div class="caption">
|
||||||
@@ -558,7 +558,7 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|
||||||
</asp:GridView>--%>
|
</asp:GridView> --
|
||||||
<div class="inbox-sidebar">
|
<div class="inbox-sidebar">
|
||||||
<a href="javascript:;" data-title="Compose" class="btn red compose-btn btn-block">
|
<a href="javascript:;" data-title="Compose" class="btn red compose-btn btn-block">
|
||||||
<i class="fa fa-edit"></i>Eventos </a>
|
<i class="fa fa-edit"></i>Eventos </a>
|
||||||
@@ -603,7 +603,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>--%>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%-- DIRECTORIO TELEFONICO --%>
|
<%-- DIRECTORIO TELEFONICO --%>
|
||||||
|
|||||||
@@ -125,11 +125,22 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
If gvr.FCCheckBox("ChkEditCaducidad").Checked And FechaCaducidadNueva.Length > 0 And FechaCaducidadNueva <> FechaCaducidadOriginal Then
|
If gvr.FCCheckBox("ChkEditCaducidad").Checked And FechaCaducidadNueva.Length > 0 And FechaCaducidadNueva <> FechaCaducidadOriginal Then
|
||||||
If Not ListaCaducidad.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaCaducidad.Add(gvr.DataKey("CvePS").ToEntero, FechaCaducidadNueva) 'guardo que dato le corresponde
|
If Not ListaCaducidad.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaCaducidad.Add(gvr.DataKey("CvePS").ToEntero, FechaCaducidadNueva) 'guardo que dato le corresponde
|
||||||
Modificar = True
|
Modificar = True
|
||||||
|
If FechaCaducidadOriginal = "" Then
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False, False)
|
||||||
|
Else
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True, True)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If gvr.FCCheckBox("ChkLote").Checked And LoteNuevo.Length > 0 And LoteNuevo <> LoteOriginal Then
|
If gvr.FCCheckBox("ChkLote").Checked And LoteNuevo.Length > 0 And LoteNuevo <> LoteOriginal Then
|
||||||
If Not ListaLote.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaLote.Add(gvr.DataKey("CvePS").ToEntero, LoteNuevo) 'guardo que dato le corresponde
|
If Not ListaLote.ContainsKey(gvr.DataKey("CvePS").ToEntero) Then ListaLote.Add(gvr.DataKey("CvePS").ToEntero, LoteNuevo) 'guardo que dato le corresponde
|
||||||
Modificar = True
|
Modificar = True
|
||||||
|
If LoteOriginal = "" Then
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, False, False)
|
||||||
|
Else
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(gvr.DataKey("CvePS").ToEntero, UsuarioActual.CveEmpresa, True, True)
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Modificar Then
|
If Modificar Then
|
||||||
@@ -187,6 +198,12 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Lote = "" Then
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, False, False)
|
||||||
|
Else
|
||||||
|
ErrorMovInv = Not ObjPS.UpdateAplicaLoteCaducidadAlmacen(Row("CvePS").ToString().ToEntero(), UsuarioActual.CveEmpresa, True, True)
|
||||||
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Cantidad, CveUM, CvePS, PU, -1, CostoIndirecto:=CostoIndirecto, CveSeccionAlmacen:=CveSeccionAlmacen, Lote:=Lote, Serie:=Serie, FechaCaducidad:=FechaCaducidad, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
Exit For
|
Exit For
|
||||||
@@ -420,7 +437,7 @@ Partial Class Inventarios_AjustesSeccionAlmacen
|
|||||||
Dim Lote As String = RowExcel("Lote").ToString()
|
Dim Lote As String = RowExcel("Lote").ToString()
|
||||||
Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate
|
Dim FechaCaducidad As Date = IfNull(RowExcel("FechaCaducidad"), MinFecha).ToString.ToDate
|
||||||
|
|
||||||
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'")
|
Dim RowExistencia As DataRow = DtExistenciasSecciones.FiltroPrimero($"CvePS={CvePS} and ISNULL(Serie,'') = '{Serie}'", Orderby:="Serie,Lote,FechaCaducidad")
|
||||||
|
|
||||||
If RowExistencia IsNot Nothing Then
|
If RowExistencia IsNot Nothing Then
|
||||||
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
|
Dim CveSeccionAlmacenSalida As Integer = RowExistencia("CveSeccionAlmacen").ToString().ToEntero()
|
||||||
|
|||||||
@@ -263,6 +263,15 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property ValidaLoteCaducidad As Boolean
|
||||||
|
Get
|
||||||
|
Return CType(ViewState("ValidaLoteCaducidad"), Boolean)
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("ValidaLoteCaducidad") = 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
|
||||||
@@ -270,7 +279,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
InicializaValores()
|
InicializaValores()
|
||||||
CargaParametrosAD()
|
CargaParametrosAD()
|
||||||
If UsuarioActual.CveEmpresa.Contiene(72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True
|
If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 146, 119) Then DdlAlmacen.AutoPostBack = True
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero() = 1 Then
|
If UsuarioActual.Empresa.Funcionalidad(281).ToEntero() = 1 Then
|
||||||
|
|
||||||
@@ -527,7 +536,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CveVentaAD = -2
|
CveVentaAD = -2
|
||||||
CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero())
|
CargaVentaPorSurtir(DdlFolio.SelectedValue.ToEntero())
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaVentaPorSurtir(CveVenta As Integer)
|
Private Sub CargaVentaPorSurtir(CveVenta As Integer, Optional CveAlmacen As Integer = -1)
|
||||||
LbSurtida.Visible = False
|
LbSurtida.Visible = False
|
||||||
CveContrato = -1
|
CveContrato = -1
|
||||||
CveSubProyecto = -1
|
CveSubProyecto = -1
|
||||||
@@ -544,14 +553,14 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Dim ObjInventario As New ClsInventarios
|
Dim ObjInventario As New ClsInventarios
|
||||||
|
|
||||||
If ObjInventario.EntregaAlmacenGet(CveVenta) Then
|
If ObjInventario.EntregaAlmacenGet(CveVenta, CveAlmacen) Then
|
||||||
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
If ObjInventario.DtResultados IsNot Nothing AndAlso ObjInventario.DtResultados.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
|
||||||
DtDatos = ObjInventario.DtResultados
|
DtDatos = ObjInventario.DtResultados
|
||||||
DtDatos.Columns.Add("Consec", GetType(Integer))
|
If Not DtDatos.Columns.Contains("Consec") Then DtDatos.Columns.Add("Consec", GetType(Integer))
|
||||||
DtDatos.Columns.Add("CantidadGV", GetType(Double))
|
If Not DtDatos.Columns.Contains("CantidadGV") Then DtDatos.Columns.Add("CantidadGV", GetType(Double))
|
||||||
DtDatos.Columns.Add("CantidadTraspaso", GetType(Double))
|
If Not DtDatos.Columns.Contains("CantidadTraspaso") Then DtDatos.Columns.Add("CantidadTraspaso", GetType(Double))
|
||||||
Dim Index = 1
|
Dim Index = 1
|
||||||
For Each Dr As DataRow In DtDatos.Rows
|
For Each Dr As DataRow In DtDatos.Rows
|
||||||
Dr("Consec") = Index
|
Dr("Consec") = Index
|
||||||
@@ -576,6 +585,13 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
|
HLFolio.NavigateUrl = $"/Ventas/Ventas.aspx?CveVenta={CveVenta}"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'filtra los Almacenes de domicilio
|
||||||
|
If DtDatos.Rows(0)("ServicioDomicilio").ToString() = "True" Then
|
||||||
|
StrAlmacenes = String.Format("{0} AND Almacen like '%Domicilio%' ", StrAlmacenes)
|
||||||
|
Else
|
||||||
|
StrAlmacenes = String.Format("{0} AND NOT (Almacen like '%Domicilio%') ", StrAlmacenes)
|
||||||
|
End If
|
||||||
|
|
||||||
LbObservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString()
|
LbObservaciones.Text = DtDatos.Rows(0)("Observaciones").ToString()
|
||||||
LbObservacionesAlmacen.Text = DtDatos.Rows(0)("ObservacionesAlmacen").ToString()
|
LbObservacionesAlmacen.Text = DtDatos.Rows(0)("ObservacionesAlmacen").ToString()
|
||||||
CveVentaSurtir = CveVenta
|
CveVentaSurtir = CveVenta
|
||||||
@@ -607,41 +623,43 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
BtnGuardar.Visible = False
|
BtnGuardar.Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
DdlAlmacen.Items.Clear()
|
|
||||||
If CveAlmacenTraspasoOrigen > 0 Then 'Not (EsDevolucionVenta = 1 And DtDatos.Rows(0)("TipoDocto").ToString() = "Rem" And UsuarioActual.Empresa.Funcionalidad(145) = "1") - ESTO ES PARA CUANDO SEA REMISION DE ENTREGA POR ADELANTADO FUNCIONA LA DEVOLUCION
|
If CveAlmacen <= 0 Then
|
||||||
DdlAlmacen.Items.Insert(0, New ListItem(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoOrigen}"), CveAlmacenTraspasoOrigen.ToString()))
|
DdlAlmacen.Items.Clear()
|
||||||
Else
|
If CveAlmacenTraspasoOrigen > 0 Then 'Not (EsDevolucionVenta = 1 And DtDatos.Rows(0)("TipoDocto").ToString() = "Rem" And UsuarioActual.Empresa.Funcionalidad(145) = "1") - ESTO ES PARA CUANDO SEA REMISION DE ENTREGA POR ADELANTADO FUNCIONA LA DEVOLUCION
|
||||||
'[IPP] PARCHE - Debe hacerse permiso proceso - 17Enero2018
|
DdlAlmacen.Items.Clear()
|
||||||
Dim RestriccionAlmacenSubProyecto = If(UsuarioActual.CveEmpresa.Contiene(72, 80), $" AND CveSubProyecto = {CveSubProyecto}", "")
|
DdlAlmacen.Items.Insert(0, New ListItem(GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("Almacen", $"CveAlmacen = {CveAlmacenTraspasoOrigen}"), CveAlmacenTraspasoOrigen.ToString()))
|
||||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"{StrAlmacenes} {RestriccionAlmacenSubProyecto}")
|
Else
|
||||||
End If
|
'[IPP] PARCHE - Debe hacerse permiso proceso - 17Enero2018
|
||||||
DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
Dim RestriccionAlmacenSubProyecto = If(UsuarioActual.CveEmpresa.Contiene(72, 80), $" AND CveSubProyecto = {CveSubProyecto}", "")
|
||||||
DdlAlmacen.SelectedValue = "-1"
|
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"{StrAlmacenes} {RestriccionAlmacenSubProyecto}")
|
||||||
DdlAlmacen.DataBind()
|
End If
|
||||||
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
|
||||||
If CveAlmacenTraspasoOrigen > 0 Then
|
DdlAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||||
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
|
DdlAlmacen.SelectedValue = "-1"
|
||||||
|
DdlAlmacen.DataBind()
|
||||||
|
DdlAlmacen.SelectedValueExist(UsuarioActual.CveAlmacen)
|
||||||
|
If CveAlmacenTraspasoOrigen > 0 Then
|
||||||
|
DdlAlmacen.SelectedValueExist(CveAlmacenTraspasoOrigen)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not DtDatos.Columns.Contains("Serie") Then
|
If UsuarioActual.CveEmpresa = 119 AndAlso CveSubProyecto = 10276 Then
|
||||||
DtDatos.Columns.Add("Serie", GetType(String))
|
ValidaLoteCaducidad = True
|
||||||
End If
|
|
||||||
If Not DtDatos.Columns.Contains("Lote") Then
|
|
||||||
DtDatos.Columns.Add("Lote", GetType(String))
|
|
||||||
End If
|
|
||||||
If Not DtDatos.Columns.Contains("CveSeccion") Then
|
|
||||||
DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
|
||||||
End If
|
|
||||||
If Not DtDatos.Columns.Contains("FechaCaducidad") Then
|
|
||||||
DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
|
|
||||||
End If
|
|
||||||
If Not DtDatos.Columns.Contains("Seleccionado") Then
|
|
||||||
DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
|
||||||
End If
|
|
||||||
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then
|
|
||||||
DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("Serie") Then DtDatos.Columns.Add("Serie", GetType(String))
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("Lote") Then DtDatos.Columns.Add("Lote", GetType(String))
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("CveSeccion") Then DtDatos.Columns.Add("CveSeccion", GetType(Integer))
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("FechaCaducidad") Then DtDatos.Columns.Add("FechaCaducidad", GetType(Date))
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("Seleccionado") Then DtDatos.Columns.Add("Seleccionado", GetType(Boolean))
|
||||||
|
|
||||||
|
If Not DtDatos.Columns.Contains("CantidadSeleccionada") Then DtDatos.Columns.Add("CantidadSeleccionada", GetType(Double))
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(280) = "1" Then
|
||||||
FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString().ToEntero()
|
FormaPaqueteria = DtDatos.Rows(0)("FormaPaqueteria").ToString().ToEntero()
|
||||||
Dim FormaPaq As Integer = FormaPaqueteria
|
Dim FormaPaq As Integer = FormaPaqueteria
|
||||||
@@ -692,7 +710,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
If TipoDocto.Contiene("Ing") AndAlso TipoMovimiento = 2 Then
|
If TipoDocto.Contiene("Ing") AndAlso TipoMovimiento = 2 Then
|
||||||
Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"})
|
Dim DtMov As DataTable = DtExistencias.FiltraParametros("CveConcepto = 40", "", {"CveAlmacen"})
|
||||||
If DtMov.Rows.Count > 0 Then
|
If DtMov.Rows.Count > 0 AndAlso CveAlmacen <= 0 Then
|
||||||
Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero()
|
Dim CveAlmacenDev As Integer = DtMov.Rows(0)("CveAlmacen").ToString().ToEntero()
|
||||||
DdlAlmacen.Items.Clear()
|
DdlAlmacen.Items.Clear()
|
||||||
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}")
|
DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1).FiltraParametros($"CveAlmacen = {CveAlmacenDev}")
|
||||||
@@ -719,7 +737,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
ObjInventario.Dispose()
|
ObjInventario.Dispose()
|
||||||
UpGenerales.Update()
|
UpGenerales.Update()
|
||||||
CargaGvDatos()
|
If CveAlmacen <= 0 Then CargaGvDatos()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
|
Private Sub CargaTraspasoPorSurtir(CveTraspaso As Integer)
|
||||||
@@ -853,8 +871,9 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
|
'GvDatos.Columns(9).HeaderText = If(UsuarioActual.Empresa.Funcionalidad(147) <> "", UsuarioActual.Empresa.Funcionalidad(147), "")
|
||||||
|
|
||||||
'SugerirFecha()
|
'SugerirFecha()
|
||||||
If DdlAlmacen.SelectedValue.ToEntero > 0 Then
|
If DdlAlmacen.SelectedValue.ToEntero > 0 And CveVentaSurtir > 0 Then
|
||||||
SugiereLoteCaducidad(DdlAlmacen.SelectedValue.ToEntero)
|
CargaVentaPorSurtir(CveVentaSurtir, CveAlmacen:=DdlAlmacen.SelectedValue.ToEntero)
|
||||||
|
' SugiereLoteCaducidad(DdlAlmacen.SelectedValue.ToEntero)
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
GvDatos.DataSource = DtDatos
|
GvDatos.DataSource = DtDatos
|
||||||
@@ -943,19 +962,23 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
e.Row.FCDropDownList("DdlSeccionAlmacen").Visible = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
If (ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
|
||||||
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
If CBool(e.Row.DBCampo("AplicaCaducidad")) Then
|
||||||
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
e.Row.FCTextBox("TxtCaducidad").Visible = True
|
||||||
|
e.Row.FCLinkButton("LnkCaducidad").Visible = True
|
||||||
|
e.Row.FCTextBox("TxtCaducidad").readonly = True
|
||||||
|
Else
|
||||||
|
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
||||||
|
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
||||||
e.Row.FCTextBox("TxtCaducidad").Visible = False
|
e.Row.FCTextBox("TxtLote").Visible = True
|
||||||
e.Row.FCLinkButton("LnkCaducidad").Visible = False
|
e.Row.FCTextBox("TxtLote").readonly = True
|
||||||
End If
|
Else
|
||||||
|
e.Row.FCTextBox("TxtLote").Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
If CBool(e.Row.DBCampo("AplicaLote")) Then
|
|
||||||
e.Row.FCTextBox("TxtLote").Visible = True
|
|
||||||
Else
|
|
||||||
e.Row.FCTextBox("TxtLote").Visible = False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
e.Row.FCButton("BtnDividir").Attributes.Add("onclick", String.Format("Dividir('{0}');", e.Row.FCTextBox("TxtDividir").ClientID))
|
||||||
@@ -1629,6 +1652,12 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
If (Not ValidaLoteCaducidad) OrElse (UsuarioActual.CveEmpresa <> 119) Then
|
||||||
|
ValidaSeccion = False
|
||||||
|
ValidaCaducidad = False
|
||||||
|
ValidaLote = False
|
||||||
|
End If
|
||||||
|
|
||||||
If ValidaSeccion Then
|
If ValidaSeccion Then
|
||||||
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
Alert("La sección de almacen no ha sido especificada en todos los productos.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -1769,6 +1798,11 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
|
FechaCaducidad = If(CBool(Dr("AplicaCaducidad")) AndAlso Dr("FechaCaducidad").ToString() <> "", Dr("FechaCaducidad").ToString().ToDate, MinFecha)
|
||||||
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1")
|
Lote = If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1")
|
||||||
|
|
||||||
|
If Not ValidaLoteCaducidad Then
|
||||||
|
FechaCaducidad = MinFecha
|
||||||
|
Lote = "-1"
|
||||||
|
End If
|
||||||
|
|
||||||
If Dr("CantidadGV").ToString().ToDecimal > 0 Then
|
If Dr("CantidadGV").ToString().ToDecimal > 0 Then
|
||||||
If CBool(Dr("AplicaSerie")) Then
|
If CBool(Dr("AplicaSerie")) Then
|
||||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", Dr("Consec")))
|
||||||
@@ -2428,18 +2462,17 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CantidadPendiente = Dr("CantidadGV").ToString().ToDecimal - Dr("CantidadTraspaso").ToString().ToDecimal - CantidadEntradaSinCosto
|
CantidadPendiente = Dr("CantidadGV").ToString().ToDecimal - Dr("CantidadTraspaso").ToString().ToDecimal - CantidadEntradaSinCosto
|
||||||
If CantidadPendiente > 0 Then
|
If CantidadPendiente > 0 Then
|
||||||
Dim PU As Decimal = 0
|
Dim PU As Decimal = 0
|
||||||
Dim CveSeccionAlmacen As Integer = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
|
|
||||||
'SI FUE POR SERIE
|
'SI FUE POR SERIE
|
||||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
If DtDetalle.Rows.Count > 0 Then
|
If DtDetalle.Rows.Count > 0 Then
|
||||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||||
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
|
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
|
||||||
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
|
PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
|
||||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"ISNULL(CveTipoAlmacenDevolucion,0) <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, Serie:=Dr1("Serie").ToString(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
||||||
Exit For
|
Exit For
|
||||||
@@ -2448,11 +2481,10 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
ElseIf DtDetalleLote.Rows.Count > 0 Then
|
ElseIf DtDetalleLote.Rows.Count > 0 Then
|
||||||
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
||||||
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
|
If TipoMovimiento = 2 AndAlso DtExistencias IsNot Nothing Then
|
||||||
CveSeccionAlmacen = DtExistencias.FiltroPrimeroValor("CveSeccionAlmacen", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToEntero
|
|
||||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
|
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()} AND Serie = '{Dr1("Serie").ToString()}'").ToString().ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=CveSeccionAlmacen) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString().ToDouble, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.")
|
||||||
Exit For
|
Exit For
|
||||||
@@ -2463,7 +2495,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
|
PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString().ToEntero()}").ToString().ToDecimal
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=-3) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero(), FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString().ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString(), "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
|
TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.")
|
||||||
Exit For
|
Exit For
|
||||||
@@ -3040,7 +3072,6 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Dim FolioEntrada As Integer
|
Dim FolioEntrada As Integer
|
||||||
Dim ErrorMovInv As Boolean
|
Dim ErrorMovInv As Boolean
|
||||||
Dim DtDetalle As New DataTable
|
Dim DtDetalle As New DataTable
|
||||||
Dim DtDetalleLote As New DataTable
|
|
||||||
Dim TextoError = ""
|
Dim TextoError = ""
|
||||||
|
|
||||||
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
'PASA DATOS DEL GV A DATATABLE PARA MANEJOR CON FOR EACH
|
||||||
@@ -3150,7 +3181,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
|
CveSeccionAlmacen = If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString().ToEntero(), -1)
|
||||||
|
|
||||||
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
DtDetalle = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
'DtDetalleLote = DtDatosDetalleLote.FiltraParametros(String.Format("ConsecId = {0} AND FueTraspaso IS NULL", Dr("Consec")))
|
||||||
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
If DtDetalle.Rows.Count > 0 Then 'SI FUE POR SERIE
|
||||||
For Each Dr1 As DataRow In DtDetalle.Rows
|
For Each Dr1 As DataRow In DtDetalle.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, 1, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:=Dr1("Serie").ToString(), Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
@@ -3159,16 +3190,16 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
'ElseIf DtDetalleLote.Rows.Count > 0 Then 'SI FUE POR LOTE BATCH
|
||||||
For Each Dr1 As DataRow In DtDetalleLote.Rows
|
' For Each Dr1 As DataRow In DtDetalleLote.Rows
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
' If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr1("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, Serie:="", Lote:=Dr1("Lote").ToString(), FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveVentaDetalle:=-1, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
ErrorMovInv = True
|
' ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
' TextoError = "Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar."
|
||||||
Exit For
|
' Exit For
|
||||||
End If
|
' End If
|
||||||
Next
|
' Next
|
||||||
Else 'NORMAL
|
Else 'NORMAL
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, Dr("CantidadGV").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), 0, -1, Lote:=Lote, FechaCaducidad:=FechaCaducidad, CveSeccionAlmacen:=CveSeccionAlmacen, CveContratoDetalle:=Dr("CveContratoDetalle").ToString().ToEntero()) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
TextoError = "Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar."
|
||||||
Exit For
|
Exit For
|
||||||
@@ -3195,11 +3226,7 @@ Partial Class Inventarios_EntregaAlmacen
|
|||||||
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
If ObjInventario.GetMovimientosDetalle(CveMovimientoSalida, UsuarioActual.CveEmpresa) Then
|
||||||
Dim CveSeccionAlmacen As Integer = -1
|
Dim CveSeccionAlmacen As Integer = -1
|
||||||
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
For Each Dr As DataRow In ObjInventario.DtResultados.Rows
|
||||||
'If CBool(Dr("AplicaSeccion")) Then
|
|
||||||
' CveSeccionAlmacen = GlobalDTInvPSSeccionesAlmacen(UsuarioActual.CveEmpresa, Almacen2, Dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveSeccionAlmacen").ToEntero()
|
|
||||||
'Else
|
|
||||||
' CveSeccionAlmacen = -1
|
|
||||||
'End If
|
|
||||||
CveSeccionAlmacen = -3
|
CveSeccionAlmacen = -3
|
||||||
|
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, Dr("Cantidad").ToString().ToDecimal, Dr("CveUM").ToString().ToEntero(), Dr("CvePS").ToString().ToEntero(), Dr("PU").ToString().ToDecimal, CveAF:=Dr("CveAF").ToString().ToEntero(), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Dr("Serie").ToString(), Lote:=Dr("Lote").ToString(), FechaCaducidad:=Dr("FechaCaducidad").ToString().ToDate, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString().ToEntero(), CveVentaDetalle:=Dr("CveVentaDetalle").ToString().ToEntero()) Then
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
|
|
||||||
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
|
<asp:UpdatePanel runat="server" ID="UppEntrega" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
|
<asp:GridView ID="GvD" DataKeyNames="CveUM,CvePS,CveSeccionAlmacen,Serie,Lote,FechaCaducidad,CveMovimientoDetalle,CveMovimiento, AplicaLote, AplicaCaducidad,PS" runat="server" AutoGenerateColumns="False" EmptyDataText="No hay movimientos pendientes" CssClass="table table-hover Widthall" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center">
|
||||||
<%--<HeaderTemplate>
|
<%--<HeaderTemplate>
|
||||||
@@ -138,17 +138,35 @@
|
|||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
<asp:TemplateField HeaderText="Cantidad" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false"></asp:TextBox>
|
<asp:TextBox ID="TxtCantidad" Visible="false" Width="60px" runat="server" Text="0" Enabled="false" Style="text-align:right;"></asp:TextBox>
|
||||||
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="SoloNumeros2" runat="server" TargetControlID="TxtCantidad" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Disponible" DataField="Cantidad" DataFormatString="{0:#,##0.######}" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Unidad" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="35%" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="10%" Visible="false"/>
|
||||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
|
<asp:TemplateField HeaderText="Lote" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center" Visible="false">
|
||||||
<asp:BoundField HeaderText="F. Caducidad" DataField="FechaCaducidad" ItemStyle-Width="15%" />
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlLote" runat="server" Text='<%# Eval("Lote", "{0}") %>'></asp:Literal>
|
||||||
|
<asp:Textbox ID="TxtLote" runat="server" Visible="false" Width="70px" Text='<%# Eval("Lote", "{0}") %>'></asp:Textbox>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="Fecha" ItemStyle-Width="25%" HeaderStyle-HorizontalAlign="Center" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFechaCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}") %>'></asp:Literal>
|
||||||
|
<asp:Textbox ID="TxtFechaCaducidad" runat="server" Visible="false" Width="75px" Text='<%# Eval("FechaCaducidad", "{0:d}") %>'></asp:Textbox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVFechaCad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="GrpRecibir"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
<ajax:MaskedEditExtender ID="MEEFechaCad" runat="server" TargetControlID="TxtFechaCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
|
<asp:CompareValidator ID="CVFechaCad" runat="server" ControlToValidate="TxtFechaCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpRecibir"></asp:CompareValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCEFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
</ItemTemplate>
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,11 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
GvD.Columns(6).Visible = ObjInv.DtResultados.MAX("Serie") <> ""
|
||||||
|
GvD.Columns(7).Visible = ObjInv.DtResultados.MAX("AplicaLote") = "True" 'MAX("Lote") <> ""
|
||||||
|
GvD.Columns(8).Visible = ObjInv.DtResultados.MAX("AplicaCaducidad") = "True" 'MAX("FechaCaducidad").ToDate > MinFecha
|
||||||
|
GvD.Columns(8).HeaderText = UsuarioActual.Empresa.Funcionalidad(147)
|
||||||
|
|
||||||
ObjInv.Dispose()
|
ObjInv.Dispose()
|
||||||
GvD.DataBind()
|
GvD.DataBind()
|
||||||
UppEntrega.Update()
|
UppEntrega.Update()
|
||||||
@@ -91,17 +96,34 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
If TxtFolioEntrega.Text <> "" Then
|
If TxtFolioEntrega.Text <> "" Then
|
||||||
e.Row.FCCheckBox("Chk").Visible = True
|
e.Row.FCCheckBox("Chk").Visible = True
|
||||||
e.Row.FCTextBox("TxtCantidad").Enabled = True
|
e.Row.FCTextBox("TxtCantidad").Enabled = True
|
||||||
|
|
||||||
|
If e.Row.DataKey("AplicaLote").ToString = "True" Then
|
||||||
|
e.Row.FCLiteral("LtlLote").Visible = False
|
||||||
|
e.Row.FCTextBox("TxtLote").Visible = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DataKey("AplicaCaducidad").ToString = "True" Then
|
||||||
|
e.Row.FCLiteral("LtlFechaCaducidad").Visible = False
|
||||||
|
e.Row.FCTextBox("TxtFechaCaducidad").Visible = True
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
e.Row.FCTextBox("TxtCantidad").Visible = True
|
e.Row.FCTextBox("TxtCantidad").Visible = True
|
||||||
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad")))
|
e.Row.FCTextBox("TxtCantidad").Attributes.Add("onkeyup", String.Format("ValidaCantidad(this,{0});", e.Row.DBCampo("Cantidad")))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
''FUNCIONALIDAD PISTOLA DE CODIGOS
|
''FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||||
'If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
'If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
||||||
' e.Row.FCTextBox("TxtCantidad").Enabled = False
|
' e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnRecibir_Click(sender As Object, e As EventArgs)
|
||||||
@@ -119,10 +141,11 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
Dim Lote As String = "-1"
|
Dim Lote As String = "-1"
|
||||||
Dim FechaCaducidad As Date = MinFecha
|
Dim FechaCaducidad As Date = MinFecha
|
||||||
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
|
If gvr.DataKey("Serie") <> "" Then Serie = gvr.DataKey("Serie")
|
||||||
If gvr.DataKey("Lote") <> "" Then Lote = gvr.DataKey("Lote")
|
If gvr.DataKey("AplicaLote") = "True" Then Lote = gvr.FCTextBox("TxtLote").Text ' gvr.DataKey("Lote")
|
||||||
If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
|
If gvr.DataKey("AplicaCaducidad") = "True" Then FechaCaducidad = gvr.FCTextBox("TxtFechaCaducidad").Text.todate ' gvr.DataKey("Lote")
|
||||||
|
'If gvr.DataKey("FechaCaducidad").ToDate > MinFecha Then FechaCaducidad = gvr.DataKey("FechaCaducidad")
|
||||||
|
|
||||||
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad)
|
Dim Valido = ValidaExistencia(gvr.FCTextBox("TxtCantidad").Text.ToDecimal, gvr.DataKey("CvePS").ToEntero, gvr.DataKey("CveUM").ToEntero, gvr.DataKey("CveSeccionAlmacen").ToEntero, Serie, Lote, FechaCaducidad, gvr.DataKey("PS"))
|
||||||
If Not Valido Then
|
If Not Valido Then
|
||||||
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
|
Alert("No hay existencia del producto a devolver.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -169,7 +192,7 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal > 0 Then
|
If gvr.FCCheckBox("Chk").Checked AndAlso gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal > 0 Then
|
||||||
CveMovimientoDetalleEntrada = gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero
|
CveMovimientoDetalleEntrada = gvr.DataKey("CveMovimientoDetalle").ToString.ToEntero
|
||||||
CvePS = gvr.DataKey("CvePS").ToString.ToEntero
|
CvePS = gvr.DataKey("CvePS").ToString.ToEntero
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToString.ToDate) Then
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoSalida, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, 0, -1, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.FCTextBox("TxtLote").ToString, FechaCaducidad:=gvr.FCTextBox("TxtFechaCaducidad").ToString.ToDate) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||||
Exit For
|
Exit For
|
||||||
@@ -251,7 +274,7 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date) As Boolean
|
Private Function ValidaExistencia(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, CveSeccionAlmacen As Integer, Serie As String, Lote As String, FechaCaducidad As Date, PS As String) As Boolean
|
||||||
Dim Retorno = True
|
Dim Retorno = True
|
||||||
|
|
||||||
Dim Inv As New ClsInventarios
|
Dim Inv As New ClsInventarios
|
||||||
@@ -261,9 +284,9 @@ Partial Class Inventarios_PrestamosdeProveedor
|
|||||||
|
|
||||||
If Existencia - Cantidad < 0 Then
|
If Existencia - Cantidad < 0 Then
|
||||||
If Existencia < 0 Then
|
If Existencia < 0 Then
|
||||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("No hay existencia del producto: ", PS), TipoMensaje.MsgAdvertencia)
|
||||||
Else
|
Else
|
||||||
Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("Solo hay en existencia: {0} en el producto: {1}", Existencia, PS), TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
Retorno = False
|
Retorno = False
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -326,6 +326,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CargaInicial()
|
Private Sub CargaInicial()
|
||||||
|
ConsecutivoVenta = 0
|
||||||
CveMovimiento = -1
|
CveMovimiento = -1
|
||||||
CveMovimientoRelacionado = -1
|
CveMovimientoRelacionado = -1
|
||||||
TieneRelacionado = -1
|
TieneRelacionado = -1
|
||||||
@@ -2255,7 +2256,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesPS(-1, Now, CveSubProyecto, Me.ObjRemisionNC.CveCliente, Me.ObjRemisionNC.CveVendedor, 1, UsuarioActual.CveEmpresa) Then
|
||||||
Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
Me.ObjRemisionNC.DtPromociones = ObjVentas.DtResultados.Copy()
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -2573,8 +2574,11 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
|
|
||||||
Dim Obs As String = SbBCI.ToString()
|
Dim Obs As String = SbBCI.ToString()
|
||||||
|
|
||||||
AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
|
If AddPSRNC(ObjRemisionNC.DtDetalle, 1, CveUnidadMedida, "", CveClasificacion, "", CvePS, "", Obs, PU, 0, -1, "",
|
||||||
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA)
|
ObjRemisionNC.CveSubProyecto, ObjRemisionNC.SubProyecto.SubProyecto, PorcentajeIVA:=PorcentajeIVA) Then
|
||||||
|
ConsecutivoVenta += 1
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -2966,6 +2970,9 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Dim CargoActual As Double = 0
|
Dim CargoActual As Double = 0
|
||||||
|
|
||||||
Dim Row As DataRow = Nothing
|
Dim Row As DataRow = Nothing
|
||||||
|
|
||||||
|
ConsecutivoVenta += 1
|
||||||
|
|
||||||
Row = TmpDTAjustes.NewRow
|
Row = TmpDTAjustes.NewRow
|
||||||
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
Row("CveFolioGarantia") = DdlFolioGarantia.SelectedValue.ToEntero
|
||||||
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
Row("CveTipoUso") = DdlTipoUso.SelectedValue.ToEntero
|
||||||
@@ -2981,7 +2988,7 @@ Partial Class Inventarios_RecepcionUsados
|
|||||||
Row("TipoComprobante") = 1
|
Row("TipoComprobante") = 1
|
||||||
Row("Comprobante") = TxtPoliza.Text
|
Row("Comprobante") = TxtPoliza.Text
|
||||||
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
Row("Importe") = TxtImporteAjuste.Text.ToDouble
|
||||||
Row("ConsecutivoVenta") = TxtConsecutivoAjuste.Text.ToEntero()
|
Row("ConsecutivoVenta") = ConsecutivoVenta
|
||||||
Row("CvePS") = DdlPSAjuste.SelectedValue
|
Row("CvePS") = DdlPSAjuste.SelectedValue
|
||||||
Row("PS") = DdlPSAjuste.SelectedText
|
Row("PS") = DdlPSAjuste.SelectedText
|
||||||
Row("CveVenta") = -1
|
Row("CveVenta") = -1
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<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">Productos:</label>
|
<label class="col-md-1 truncate">Producto:</label>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:55%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
|
<ADS:Dropdownlost runat="server" ID="DdlPS" CssStyle="width:55%;" CssClass="DdlPS" CssClassDdl="select2me " DataTextField="PSCodigo" DataValueField="CvePS" />
|
||||||
</div>
|
</div>
|
||||||
@@ -102,13 +102,13 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="Cantidad,PS,Lote,FechaCaducidad" EmptyDataText="No se encontraron Registros" ToolTip="Reporte de productos caducidad " CssClass="table table-striped table-advance table-hover" Style="margin-top: -10px; width: 100%" GridLines="None">
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" EmptyDataText="No se encontraron Registros" ToolTip="Reporte de productos caducidad " CssClass="table table-advance table-hover Widthall ScrollAD" data-sort="true" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Almacén" DataField="Almacen" />
|
<asp:BoundField HeaderText="Almacén" DataField="Almacen" ItemStyle-Width="150px" />
|
||||||
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-HorizontalAlign="Right" />
|
<asp:BoundField HeaderText="Cantidad" DataField="Cantidad" DataFormatString="{0:#,###.##}" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" />
|
||||||
<asp:BoundField HeaderText="Producto" DataField="PS" />
|
<asp:BoundField HeaderText="Producto" DataField="CodigoPS" />
|
||||||
<asp:BoundField HeaderText="Lote" DataField="Lote" />
|
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="150px" />
|
||||||
<asp:BoundField HeaderText="Fecha de Caducidad" DataField="FechaCaducidad" DataFormatString = "{0:dd/MM/yyyy}" />
|
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" DataFormatString = "{0:dd/MM/yyyy}" ItemStyle-Width="100px" />
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -35,11 +35,16 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
|
|||||||
|
|
||||||
private void CargarDatos()
|
private void CargarDatos()
|
||||||
{
|
{
|
||||||
|
DateTime FI = ModExtensiones.MinFecha;
|
||||||
|
if (TxtFechaInicio.Text != "") FI = TxtFechaInicio.Text.ToDate();
|
||||||
|
|
||||||
|
|
||||||
|
int CvePS = -1;
|
||||||
|
if (DdlPS.SelectedValue.ToEntero() > 0) CvePS = DdlPS.SelectedValue.ToEntero();
|
||||||
// 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
|
||||||
//if (!String.IsNullOrWhiteSpace(UsuarioActual.Empresa.Funcionalidad(147))) { GvDatos.Columns[4].HeaderText = UsuarioActual.Empresa.Funcionalidad(147); }
|
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(),TxtFechaInicio.Text.ToDate(),TxtFechaFin.Text.ToDate(), DdlSucursal.SelectedValue.ToEntero(),
|
DdlClasificacion.SelectedValue.ToEntero(), CvePS, UsuarioActual.CveEmpresa))
|
||||||
DdlClasificacion.SelectedValue.ToEntero(), -1, UsuarioActual.CveEmpresa))
|
|
||||||
{
|
{
|
||||||
GvDatos.DataSource = ObjInventarios.DtResultados;
|
GvDatos.DataSource = ObjInventarios.DtResultados;
|
||||||
DTDatos = ObjInventarios.DtResultados;
|
DTDatos = ObjInventarios.DtResultados;
|
||||||
@@ -60,8 +65,8 @@ public partial class Inventarios_RepProductosPorCaducar : ClsPaginas
|
|||||||
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);
|
||||||
TxtFechaInicio.Text = date.ToString("dd/MM/yyyy");
|
//TxtFechaInicio.Text = date.AddYears(-5).ToString("dd/MM/yyyy");
|
||||||
TxtFechaFin.Text = date.AddMonths(3).AddDays(-1).ToString("dd/MM/yyyy");
|
TxtFechaFin.Text = date.AddMonths(6).AddDays(-1).ToString("dd/MM/yyyy");
|
||||||
DdlPS.setEsWebService(true);
|
DdlPS.setEsWebService(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="portlet-body rowpadding">
|
<div class="portlet-body rowpadding">
|
||||||
|
|
||||||
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie" EmptyDataText="No se encontraron Productos registrados" ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None">
|
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePS, CodigoPS, CveUM, Cantidad, Precio, Observaciones, CveContratoDetalle,UnidadMedida,Serie, Lote, FechaCaducidad" EmptyDataText="No se encontraron Productos registrados" ToolTip="Listado de Productos" CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="Cantidad" ItemStyle-Width="5%" />
|
<asp:BoundField HeaderText="Cantidad" HeaderStyle-HorizontalAlign="Left" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="Cantidad" ItemStyle-Width="5%" />
|
||||||
<asp:BoundField HeaderText="U.M" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="U.M" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:N}" ItemStyle-HorizontalAlign="Center" DataField="UnidadMedida" ItemStyle-Width="10%" />
|
||||||
@@ -311,9 +311,21 @@
|
|||||||
<%--<asp:BoundField HeaderText="Direccion Envio" HeaderStyle-HorizontalAlign="Left" DataField="DireccionEnvio" ItemStyle-Width="20%" />--%>
|
<%--<asp:BoundField HeaderText="Direccion Envio" HeaderStyle-HorizontalAlign="Left" DataField="DireccionEnvio" ItemStyle-Width="20%" />--%>
|
||||||
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="20%" />
|
<asp:BoundField HeaderText="Observaciones" DataField="Observaciones" ItemStyle-Width="20%" />
|
||||||
<asp:BoundField HeaderText="Precio" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:c}" ItemStyle-HorizontalAlign="Right" DataField="Precio" Visible="false" ItemStyle-Width="5%" />
|
<asp:BoundField HeaderText="Precio" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:c}" ItemStyle-HorizontalAlign="Right" DataField="Precio" Visible="false" ItemStyle-Width="5%" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" Visible="false" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Center"/>
|
<asp:TemplateField HeaderText="Serie" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||||
<asp:BoundField HeaderText="Lote" DataField="Lote" Visible="false" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center"/>
|
<ItemTemplate>
|
||||||
<asp:BoundField HeaderText="Fecha Caducidad" DataField="FechaCaducidad" Visible="false" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:d}"/>
|
<asp:Literal ID="LtlSerie" runat="server" Text='<%# Eval("Serie")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Lote" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlLote" runat="server" Text='<%# Eval("Lote")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Fecha Caducidad" ItemStyle-HorizontalAlign="Center" Visible="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="LtlFechaCaducidad" runat="server" Text='<%# Eval("FechaCaducidad", "{0:d}")%>'></asp:Literal>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
<asp:TemplateField HeaderText="Eliminar" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="5%">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgD" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="Si" />
|
<asp:LinkButton ID="imgD" runat="server" CausesValidation="False" CommandName="Delete" CssClass="btn btn-circle btn-sm red" Text="<i class='icon-trash'></i>" data-toggle="confirmation" data-popout="true" data-original-title="Confirmar" data-btn-ok-label="Si" />
|
||||||
@@ -492,6 +504,9 @@
|
|||||||
<div class="col-md-4 form-group form-md-line-input input-iconright" id="divLote" runat="server" visible="false">
|
<div class="col-md-4 form-group form-md-line-input input-iconright" id="divLote" runat="server" visible="false">
|
||||||
<asp:TextBox ID="TxtLote" runat="server" CssClass="form-control"></asp:TextBox>
|
<asp:TextBox ID="TxtLote" runat="server" CssClass="form-control"></asp:TextBox>
|
||||||
<label for="<%= TxtLote.ClientID.ToString()%>">Lote:</label>
|
<label for="<%= TxtLote.ClientID.ToString()%>">Lote:</label>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVLote" runat="server" ControlToValidate="TxtLote" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Lote''</b> es necesario, por favor ingréselo." ValidationGroup="AgregarPS"></asp:RequiredFieldValidator>
|
||||||
|
<ajax:ValidatorCalloutExtender ID="VCLote" runat="server" HighlightCssClass="vco" TargetControlID="RFVLote" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 form-group form-md-line-input input-iconright" id="divCaducidad" runat="server" visible="false">
|
<div class="col-md-3 form-group form-md-line-input input-iconright" id="divCaducidad" runat="server" visible="false">
|
||||||
@@ -501,11 +516,11 @@
|
|||||||
|
|
||||||
<div class="col-md-1 form-group form-md-line-input input-iconright" id="divCaducidad2" runat="server" visible="false">
|
<div class="col-md-1 form-group form-md-line-input input-iconright" id="divCaducidad2" runat="server" visible="false">
|
||||||
<asp:LinkButton ID="ImgFechaCad" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
<asp:LinkButton ID="ImgFechaCad" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||||
<asp:RequiredFieldValidator ID="RFVFechaCad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="AddPSInvFisico"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVFechaCad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> es necesario, por favor ingréselo." ValidationGroup="AgregarPS"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="RFVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:MaskedEditExtender ID="MEEFechaCad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
<ajax:MaskedEditExtender ID="MEEFechaCad" runat="server" TargetControlID="TxtCaducidad" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||||
<ajax:CalendarExtender runat="server" ID="CEFechaCad" TargetControlID="TxtCaducidad" PopupButtonID="ImgFechaCad" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
<ajax:CalendarExtender runat="server" ID="CEFechaCad" TargetControlID="TxtCaducidad" PopupButtonID="ImgFechaCad" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||||
<asp:CompareValidator ID="CVFechaCad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="AddPSInvFisico"></asp:CompareValidator>
|
<asp:CompareValidator ID="CVFechaCad" runat="server" ControlToValidate="TxtCaducidad" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="AgregarPS"></asp:CompareValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEFechaCad" runat="server" HighlightCssClass="vco" TargetControlID="CVFechaCad" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -50,6 +50,48 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
Private Property AplicaSerie As Boolean
|
||||||
|
Get
|
||||||
|
If ViewState("AplicaSerie") Is Nothing Then
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
Return CType(ViewState("AplicaSerie"), Boolean)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("AplicaSerie") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property AplicaLote As Boolean
|
||||||
|
Get
|
||||||
|
If ViewState("AplicaLote") Is Nothing Then
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
Return CType(ViewState("AplicaLote"), Boolean)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("AplicaLote") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
Private Property AplicaCaducidad As Boolean
|
||||||
|
Get
|
||||||
|
If ViewState("AplicaCaducidad") Is Nothing Then
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
Return CType(ViewState("AplicaCaducidad"), Boolean)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Get
|
||||||
|
Set(value As Boolean)
|
||||||
|
ViewState("AplicaCaducidad") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||||
@@ -153,9 +195,26 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
|
|
||||||
If ObjInventarios.AddTrasladoSolicitudGet(CveTraspasoSolicitud, UsuarioActual.CveEmpresa) Then
|
If ObjInventarios.AddTrasladoSolicitudGet(CveTraspasoSolicitud, UsuarioActual.CveEmpresa) Then
|
||||||
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
If ObjInventarios.DtResultados.Rows.Count > 0 Then
|
||||||
|
For Each rowtp As DataRow In ObjInventarios.DtResultados.Rows
|
||||||
|
If Not AplicaSerie Then
|
||||||
|
AplicaSerie = rowtp("Serie").ToString <> ""
|
||||||
|
End If
|
||||||
|
If Not AplicaLote Then
|
||||||
|
AplicaLote = rowtp("Lote").ToString <> ""
|
||||||
|
End If
|
||||||
|
If Not AplicaCaducidad Then
|
||||||
|
AplicaCaducidad = rowtp("FechaCaducidad").ToString <> ""
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
|
||||||
|
Dim drPS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlProductoServicio.SelectedValue.ToEntero).FiltroPrimero("")
|
||||||
|
|
||||||
|
|
||||||
GvDatos.Columns(4).Visible = False
|
GvDatos.Columns(4).Visible = False
|
||||||
GvDatos.Columns(5).Visible = True
|
GvDatos.Columns(5).Visible = AplicaSerie
|
||||||
|
GvDatos.Columns(6).Visible = AplicaLote
|
||||||
|
GvDatos.Columns(7).Visible = AplicaCaducidad
|
||||||
|
|
||||||
DivFolio.Visible = True
|
DivFolio.Visible = True
|
||||||
LbFolio.Text = ObjInventarios.DtResultados.Rows(0)("FolioTraspaso").ToString
|
LbFolio.Text = ObjInventarios.DtResultados.Rows(0)("FolioTraspaso").ToString
|
||||||
TxtObservaciones.Text = ObjInventarios.DtResultados.Rows(0)("ObservacionesTraspaso").ToString
|
TxtObservaciones.Text = ObjInventarios.DtResultados.Rows(0)("ObservacionesTraspaso").ToString
|
||||||
@@ -369,14 +428,14 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
Row("CveUM") = DdlUM.SelectedValue.ToEntero
|
Row("CveUM") = DdlUM.SelectedValue.ToEntero
|
||||||
Row("UnidadMedida") = DdlUM.SelectedItem.Text
|
Row("UnidadMedida") = DdlUM.SelectedItem.Text
|
||||||
Row("Observaciones") = ""
|
Row("Observaciones") = ""
|
||||||
|
Row("Lote") = "-1"
|
||||||
|
Row("Serie") = "-1"
|
||||||
|
Row("FechaCaducidad") = MinFecha
|
||||||
|
|
||||||
If divLote.Visible Then
|
If divLote.Visible Then
|
||||||
Row("Lote") = TxtLote.Text
|
Row("Lote") = TxtLote.Text
|
||||||
GvDatos.Columns(6).Visible = True
|
GvDatos.Columns(6).Visible = True
|
||||||
Lote = TxtLote.Text.ToString
|
Lote = TxtLote.Text.ToString
|
||||||
Else
|
|
||||||
Row("Lote") = "-1"
|
|
||||||
Lote = "-1"
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -384,8 +443,9 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
Row("FechaCaducidad") = TxtCaducidad.Text
|
Row("FechaCaducidad") = TxtCaducidad.Text
|
||||||
GvDatos.Columns(7).Visible = True
|
GvDatos.Columns(7).Visible = True
|
||||||
FechaCaducidad = TxtCaducidad.Text.ToDate
|
FechaCaducidad = TxtCaducidad.Text.ToDate
|
||||||
|
RFVFechaCad.Enabled = True
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Row("FechaCaducidad") = MinFecha
|
|
||||||
FechaCaducidad = MinFecha
|
FechaCaducidad = MinFecha
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -393,8 +453,6 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
If Div4.Visible Then
|
If Div4.Visible Then
|
||||||
Row("Serie") = TxtSerie.Text
|
Row("Serie") = TxtSerie.Text
|
||||||
GvDatos.Columns(5).Visible = True
|
GvDatos.Columns(5).Visible = True
|
||||||
Else
|
|
||||||
Row("Serie") = "-1"
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
@@ -621,7 +679,7 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
|
|
||||||
For Each row As GridViewRow In GvDatos.Rows
|
For Each row As GridViewRow In GvDatos.Rows
|
||||||
CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "")
|
CodigoPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=row.DataKey("CvePS").ToEntero).FiltroPrimeroValor("PSCodigo", "")
|
||||||
Existencia = ObjInventarios.GetExistenciasPS(row.DataKey("CvePS").ToEntero, row.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"))
|
Existencia = ObjInventarios.GetExistenciasPS(row.DataKey("CvePS").ToEntero, row.DataKey("CveUM").ToEntero, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), Lote:=row.DataKey("Lote").ToString, FechaCaducidad:=row.DataKey("FechaCaducidad").ToString.ToDate)
|
||||||
If Existencia - TempDT.SUM("Cantidad", $"CvePS = {row.DataKey("CvePS").ToEntero} AND CveUM = {row.DataKey("CveUM").ToEntero}") < 0 Then
|
If Existencia - TempDT.SUM("Cantidad", $"CvePS = {row.DataKey("CvePS").ToEntero} AND CveUM = {row.DataKey("CveUM").ToEntero}") < 0 Then
|
||||||
MensajeExistencia.AppendFormat("<br/> - <b>{0}.</b> Existencia: {1}", CodigoPS, Existencia)
|
MensajeExistencia.AppendFormat("<br/> - <b>{0}.</b> Existencia: {1}", CodigoPS, Existencia)
|
||||||
TieneErrorExistencia = True
|
TieneErrorExistencia = True
|
||||||
@@ -667,8 +725,10 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
Dim Observaciones As String = Row.DataKey("Observaciones")
|
Dim Observaciones As String = Row.DataKey("Observaciones")
|
||||||
Dim CveContratoDetalle As Integer = Row.DataKey("CveContratoDetalle").ToEntero
|
Dim CveContratoDetalle As Integer = Row.DataKey("CveContratoDetalle").ToEntero
|
||||||
Dim Serie As String = Row.DataKey("Serie")
|
Dim Serie As String = Row.DataKey("Serie")
|
||||||
|
Dim Lote As String = Row.DataKey("Lote")
|
||||||
|
Dim FechaCaducidad As Date = Row.DataKey("FechaCaducidad").ToDate
|
||||||
|
|
||||||
If Not ObjInventarios.AddTrasladoSolicitudDetalle(CveTraspasoSolicitud, Cantidad, CveUM, CvePS, Precio, Observaciones, CveContratoDetalle, Serie) Then
|
If Not ObjInventarios.AddTrasladoSolicitudDetalle(CveTraspasoSolicitud, Cantidad, CveUM, CvePS, Precio, Observaciones, CveContratoDetalle, Serie, Lote, FechaCaducidad) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@@ -1019,15 +1079,17 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
DdlUM.SelectedValue = "-1"
|
DdlUM.SelectedValue = "-1"
|
||||||
DdlUM.DataBind()
|
DdlUM.DataBind()
|
||||||
DdlUM.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
DdlUM.SelectedValueExist(drPS("CveUnidadMedida").ToString)
|
||||||
Dim AplicaSerie As Boolean = drPS("AplicaSerie").ToString = "True"
|
AplicaSerie = drPS("AplicaSerie").ToString = "True"
|
||||||
Div4.Visible = AplicaSerie
|
Div4.Visible = AplicaSerie
|
||||||
|
|
||||||
Dim AplicaLote As Boolean = drPS("AplicaLote").ToString = "True"
|
AplicaLote = drPS("AplicaLote").ToString = "True"
|
||||||
divLote.Visible = AplicaLote
|
divLote.Visible = AplicaLote
|
||||||
|
RFVLote.Enabled = AplicaLote
|
||||||
|
|
||||||
Dim AplicaCaducidad As Boolean = drPS("AplicaCaducidad").ToString = "True"
|
AplicaCaducidad = drPS("AplicaCaducidad").ToString = "True"
|
||||||
divCaducidad.Visible = AplicaCaducidad
|
divCaducidad.Visible = AplicaCaducidad
|
||||||
divCaducidad2.Visible = AplicaCaducidad
|
divCaducidad2.Visible = AplicaCaducidad
|
||||||
|
RFVFechaCad.Enabled = AplicaCaducidad
|
||||||
|
|
||||||
End If
|
End If
|
||||||
UpPS.Update()
|
UpPS.Update()
|
||||||
@@ -1180,5 +1242,23 @@ Partial Class Inventarios_TrasladoSolicitud
|
|||||||
GvDatos.Columns(5).Visible = Mostrar
|
GvDatos.Columns(5).Visible = Mostrar
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||||
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
If e.Row.FCLiteral("LtlSerie").ToString = "-1" Then
|
||||||
|
e.Row.FCLiteral("LtlSerie").Text = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.FCLiteral("LtlLote").ToString = "-1" Then
|
||||||
|
e.Row.FCLiteral("LtlLote").Text = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.FCLiteral("LtlFechaCaducidad").ToString.ToDate = MinFecha Then
|
||||||
|
e.Row.FCLiteral("LtlFechaCaducidad").Text = ""
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@@ -443,6 +443,7 @@
|
|||||||
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
<asp:TextBox ID="TxtnLote" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
<td runat="server" id="TdFechaCaducidad" visible="false">
|
<td runat="server" id="TdFechaCaducidad" visible="false">
|
||||||
|
<asp:CheckBox ID="ChkSugiereFechaCaducidad" runat="server" Text="Auto Sugiere" ToolTip="Auto Sugiere Fecha de caducidad" AutoPostBack="true" OnCheckedChanged="ChkSugiereFechaCaducidad_CheckedChanged" />
|
||||||
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
<asp:TextBox ID="TxtnFechaCaducidad" CssClass="form-control input-sm" runat="server" Width="80px" Visible="false"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
@@ -456,7 +457,7 @@
|
|||||||
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
<asp:GridView ID="GvDatos" DataKeyNames="No,PS,CvePS,CveUM,Serie,Cantidad" runat="server" ShowHeader="false" AutoGenerateColumns="False" EmptyDataText="" ToolTip="Listado de Movimientos" CssClass="Widthall table table-striped table-hover" GridLines="None">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
|
<asp:BoundField HeaderText="#" DataField="No" ItemStyle-Width="23px" />
|
||||||
<asp:TemplateField ItemStyle-Width="93px">
|
<asp:TemplateField ItemStyle-Width="93px" ItemStyle-HorizontalAlign ="Right">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal runat="server" Text='<%# Eval("Cantidad") %>' ID="ltlCantidad"></asp:Literal>
|
<asp:Literal runat="server" Text='<%# Eval("Cantidad") %>' ID="ltlCantidad"></asp:Literal>
|
||||||
<asp:TextBox runat="server" ID="TxtCantidad2" Text='<%# Eval("Cantidad", "{0:###,###,###,##0.##}") %>' Width="50px" Visible="false"></asp:TextBox>
|
<asp:TextBox runat="server" ID="TxtCantidad2" Text='<%# Eval("Cantidad", "{0:###,###,###,##0.##}") %>' Width="50px" Visible="false"></asp:TextBox>
|
||||||
@@ -671,8 +672,16 @@
|
|||||||
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
<asp:BoundField HeaderText="Código" DataField="Codigo" ItemStyle-Width="10%" />
|
||||||
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
<asp:BoundField HeaderText="Producto" DataField="PS" ItemStyle-Width="40%" />
|
||||||
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
<asp:BoundField HeaderText="Serie" DataField="Serie" ItemStyle-Width="15%" />
|
||||||
<asp:BoundField HeaderText="Lote" DataField="Lote" ItemStyle-Width="15%" />
|
<asp:TemplateField HeaderText="Lote" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" Visible="false" >
|
||||||
<asp:BoundField HeaderText="Caducidad" DataField="FechaCaducidad" DataFormatString="{0:d}" ItemStyle-Width="15%" />
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtLote" Width="60px" runat="server" Text='<%# Eval("Lote") %>' Visible="false"></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="Caducidad" ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center" Visible="false" >
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:TextBox ID="TxtCaducidad" Width="75px" runat="server" Text='<%# Eval("FechaCaducidad") %>' Visible="false" ></asp:TextBox>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
<asp:TemplateField HeaderText="Sección Almacén" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" Visible="false">
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
<asp:DropDownList ID="DdlSeccionAlmacen" DataTextField="SeccionAlmacen" AppendDataBoundItems="true" DataValueField="CveSeccionAlmacen" Class="form-control input-sm select2me" Style="width: 95% !important" runat="server" CausesValidation="true">
|
||||||
|
|||||||
@@ -526,19 +526,73 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
|
DrPS = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CveProducto).FiltroPrimero("") ' Estado = -1
|
||||||
|
|
||||||
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
|
If DrPS IsNot Nothing Then
|
||||||
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
|
|
||||||
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
|
If Cantidad > 0 AndAlso DrPS("VentaMinima").ToString.ToDecimal > 0 Then
|
||||||
Alert(String.Format("El producto se vende solo en cantidades de {0:#,###.####}", DrPS("VentaMinima")))
|
'verifico que la cantidad sea multiplo de venta minima, es decir ventaminima =5, solo puede vender 5,10,15...
|
||||||
Exit Sub
|
If Cantidad Mod DrPS("VentaMinima").ToString.ToDecimal <> 0 Then
|
||||||
|
Alert(String.Format("El producto se vende solo en cantidades de {0:#,###.####}", DrPS("VentaMinima")))
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), If(TxtnLote.Visible, TxtnLote.Text, "-1"), If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha))
|
'codigo provisional.
|
||||||
|
Dim CveSubP As Integer = GlobalDTAlmacen(UsuarioActual.CveEmpresa, CveAlmacen:=DdlAlmacenOrigen.selectedvalue.toentero).FiltroPrimeroValor("CveSubProyecto", "").ToEntero
|
||||||
|
|
||||||
|
|
||||||
|
If DrPS("AplicaCaducidad").ToString = "True" AndAlso ChkSugiereFechaCaducidad.checked And CveSubP.Contiene(10276) Then
|
||||||
|
|
||||||
|
Dim ObjInventarios As New ClsInventarios
|
||||||
|
If ObjInventarios.GetExistenciasCaducidad(CveProducto, -1, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.selectedvalue) Then
|
||||||
|
Dim dtt As DataTable = ObjInventarios.DtResultados
|
||||||
|
|
||||||
|
If Cantidad > dtt.SUMD("Cantidad") Then
|
||||||
|
Alert("No se cuenta con la cantidad requerida")
|
||||||
|
Else
|
||||||
|
'recorro las existencias para tomar la cantidad
|
||||||
|
Dim i As Decimal = 0
|
||||||
|
Dim CantidadRestante As Decimal = Cantidad
|
||||||
|
For Each drr As DataRow In dtt.Rows
|
||||||
|
If drr("Cantidad").ToString.ToDecimal < CantidadRestante Then
|
||||||
|
i = drr("Cantidad").ToString.ToDecimal
|
||||||
|
Else
|
||||||
|
i = CantidadRestante
|
||||||
|
End If
|
||||||
|
AgregarPS(i, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Lote:=drr("Lote").ToString, FechaCaducidad:=drr("FechaCaducidad").ToString.ToDate, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
||||||
|
CantidadRestante -= i
|
||||||
|
If CantidadRestante <= 0 Then Exit For
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
ObjInventarios.Dispose()
|
||||||
|
|
||||||
|
Else
|
||||||
|
|
||||||
|
'codigo temporal
|
||||||
|
Dim tLote As String
|
||||||
|
Dim tCaducidad As Date
|
||||||
|
|
||||||
|
tLote = If(TxtnLote.Visible, TxtnLote.Text, "-1")
|
||||||
|
tCaducidad = If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha)
|
||||||
|
|
||||||
|
If CveSubP <> 10276 Then
|
||||||
|
tLote = "-1"
|
||||||
|
tCaducidad = MinFecha
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
Dim Valido = ValidaExistencia(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, DdlSeccionAlmacen.SelectedValue.ToEntero, If(TxtnSerie.Visible, TxtnSerie.Text, "-1"), tLote, tCaducidad)
|
||||||
|
|
||||||
|
If Valido Then
|
||||||
|
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(tLote = "-1", "", tLote), FechaCaducidad:=tCaducidad, CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
If Valido Then
|
|
||||||
AgregarPS(Cantidad, CveProducto, DdlUnidad.SelectedValue.ToEntero, TxtnObservaciones.Text, CveSeccionAlmacen:=DdlSeccionAlmacen.SelectedValue.ToEntero, SeccionAlmacen:=DdlSeccionAlmacen.SelectedItem.Text, Serie:=If(TxtnSerie.Visible, TxtnSerie.Text, ""), Lote:=If(TxtnLote.Visible, TxtnLote.Text, ""), FechaCaducidad:=If(TxtnFechaCaducidad.Visible, TxtnFechaCaducidad.Text.ToDate, MinFecha), CveSeccionAlmacenDestino:=DdlSeccionAlmacenDestino.SelectedValue.ToEntero, Limpia:=FuncionalidadSinSerie)
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -550,26 +604,39 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim Inv As New ClsInventarios
|
Dim Inv As New ClsInventarios
|
||||||
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
|
Dim Existencia As Decimal = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), PendientePorSurtir:=1)
|
||||||
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
|
||||||
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
|
||||||
If FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "" Then
|
|
||||||
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
|
||||||
Else
|
|
||||||
ExistenciaEspecificada = Existencia
|
|
||||||
End If
|
|
||||||
Inv.Dispose()
|
|
||||||
|
|
||||||
If Existencia - Cantidad - CantidadEnGrid < 0 OrElse ExistenciaEspecificada - Cantidad - CantidadEnGrid < 0 Then
|
If Existencia > 0 Then
|
||||||
If Existencia < 0 OrElse ExistenciaEspecificada < 0 Then
|
'la primera vez valida, que la existencia global, cumpla, considerando lo pendiente por surtir
|
||||||
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
'las segunda consulta, que tenga existencia, ya con los parametros especificos
|
||||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
If (FechaCaducidad > MinFecha OrElse Serie <> "" OrElse Lote <> "") Then
|
||||||
|
ExistenciaEspecificada = Inv.GetExistenciasPS(CvePS, CveUnidadMedida, UsuarioActual.CveEmpresa, DdlAlmacenOrigen.SelectedValue.ToEntero, FechaMovto:=TxtFecha.Text.ToDate.ToString("yyyy/MM/dd 23:59"), CveSeccionAlmacen:=CveSeccionAlmacen, Serie:=Serie, Lote:=Lote, FechaCaducidad:=FechaCaducidad, PendientePorSurtir:=-1)
|
||||||
|
Dim StrB As New stringbuilder
|
||||||
|
StrB.appendformat("CvePS = {0} AND CveUM = {1} ", CvePS, CveUnidadMedida)
|
||||||
|
If Serie <> "" Then StrB.appendformat(" AND Serie = '{0}' ", Serie)
|
||||||
|
If Lote <> "" Then StrB.appendformat(" AND Lote = '{0}' ", Lote)
|
||||||
|
If FechaCaducidad.ToDate > MinFecha Then StrB.appendformat(" AND FechaCaducidad = '{0}' ", FechaCaducidad.ToShortDateString)
|
||||||
|
Dim CantidadEspecificaEnGrid As Decimal = DtMovimientos.SUMD("Cantidad", StrB.tostring)
|
||||||
|
|
||||||
|
If ExistenciaEspecificada - Cantidad - CantidadEspecificaEnGrid < 0 Then
|
||||||
|
Alert(String.Format("Solo hay en existencia: {0:#,###.##}", ExistenciaEspecificada), TipoMensaje.MsgAdvertencia)
|
||||||
|
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||||
|
Retorno = False
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
Alert(String.Format("Solo hay en existencia: {0}", Existencia), TipoMensaje.MsgAdvertencia)
|
ExistenciaEspecificada = Existencia
|
||||||
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
If Existencia - Cantidad - CantidadEnGrid < 0 Then
|
||||||
|
Alert(String.Format("Solo hay en existencia: {0:#,###.##}", ExistenciaEspecificada), TipoMensaje.MsgAdvertencia)
|
||||||
|
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||||
|
Retorno = False
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Retorno = False
|
Else
|
||||||
|
Alert("No hay existencia del producto", TipoMensaje.MsgAdvertencia)
|
||||||
|
RegistraScript("playsonidito(''142608__autistic-lucario__error.wav'')")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Inv.Dispose()
|
||||||
|
|
||||||
Return Retorno
|
Return Retorno
|
||||||
End Function
|
End Function
|
||||||
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1)
|
Private Sub AgregarPS(Cantidad As Double, CvePS As Integer, CveUnidadMedida As Integer, Optional Observaciones As String = "", Optional CveSeccionAlmacen As Integer = -1, Optional SeccionAlmacen As String = "", Optional Serie As String = "", Optional Lote As String = "", Optional FechaCaducidad As Date = MinFecha, Optional Limpia As Boolean = True, Optional CveSeccionAlmacenDestino As Integer = -1)
|
||||||
@@ -1482,6 +1549,13 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
' CargaGvDatos()
|
' CargaGvDatos()
|
||||||
'End Sub
|
'End Sub
|
||||||
|
|
||||||
|
Protected Sub ChkSugiereFechaCaducidad_CheckedChanged(sender As Object, e As EventArgs)
|
||||||
|
|
||||||
|
TxtnFechaCaducidad.visible = Not ChkSugiereFechaCaducidad.checked
|
||||||
|
TxtnLote.visible = Not ChkSugiereFechaCaducidad.checked
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
@@ -1544,8 +1618,8 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
GvDatosRecepcion.DataBind()
|
GvDatosRecepcion.DataBind()
|
||||||
|
|
||||||
GvDatosRecepcion.Columns(6).Visible = Dtt.MAX("Serie") <> ""
|
GvDatosRecepcion.Columns(6).Visible = Dtt.MAX("Serie") <> ""
|
||||||
GvDatosRecepcion.Columns(7).Visible = Dtt.MAX("Lote") <> ""
|
GvDatosRecepcion.Columns(7).Visible = Dtt.MAX("AplicaLote").ToEntero > 0 'Dtt.MAX("Lote") <> ""
|
||||||
GvDatosRecepcion.Columns(8).Visible = Dtt.MAX("FechaCaducidad").ToDate > MinFecha
|
GvDatosRecepcion.Columns(8).Visible = Dtt.MAX("AplicaCaducidad").ToEntero > 0 'Dtt.MAX("FechaCaducidad").ToDate > MinFecha
|
||||||
GvDatosRecepcion.Columns(9).Visible = Dtt.MAX("CveSeccionAlmacen").ToEntero > 0
|
GvDatosRecepcion.Columns(9).Visible = Dtt.MAX("CveSeccionAlmacen").ToEntero > 0
|
||||||
'Dt.Dispose()
|
'Dt.Dispose()
|
||||||
End If
|
End If
|
||||||
@@ -1607,14 +1681,29 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
'dtt.Dispose()
|
'dtt.Dispose()
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("AplicaLote").ToString.Trim = "1" Then
|
||||||
|
e.Row.FCTextBox("TxtLote").visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If e.Row.DBCampo("AplicaCaducidad").ToString.Trim = "1" Then
|
||||||
|
e.Row.FCTextBox("TxtCaducidad").visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
'FUNCIONALIDAD PISTOLA DE CODIGOS
|
||||||
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
If UsuarioActual.Empresa.Funcionalidad(132) = "1" And e.Row.DBCampo("CodigoBarras").Trim <> "" Then
|
||||||
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
e.Row.FCTextBox("TxtCantidad").Enabled = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Protected Sub BtnCancelarTraspaso_Click(sender As Object, e As EventArgs)
|
Protected Sub BtnCancelarTraspaso_Click(sender As Object, e As EventArgs)
|
||||||
@@ -1838,7 +1927,7 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
|
|
||||||
Dim TipoAlmacenDestino As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero()
|
Dim TipoAlmacenDestino As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero()
|
||||||
Dim TipoAlmacenOrigen As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenSalida}").ToEntero()
|
Dim TipoAlmacenOrigen As Integer = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveTipoAlmacen", $"CveAlmacen = {CveAlmacenSalida}").ToEntero()
|
||||||
|
Dim CveSubProyectoRecibe = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen = {CveAlmacenEntrada}").ToEntero
|
||||||
|
|
||||||
Dim RealizarMovimientoVirtual As Boolean = False
|
Dim RealizarMovimientoVirtual As Boolean = False
|
||||||
|
|
||||||
@@ -1885,7 +1974,16 @@ Partial Class Inventarios_TraspasoAlmacen
|
|||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
Dim PrecioEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, gvr.DataKey("PU").ToString.ToDecimal)
|
Dim PrecioEntrada As Decimal = If(TipoAlmacenDestino = 26, 0, gvr.DataKey("PU").ToString.ToDecimal)
|
||||||
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=gvr.DataKey("Lote").ToString, FechaCaducidad:=gvr.DataKey("FechaCaducidad").ToDate, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
''RMF codigo temporal. por implementación
|
||||||
|
Dim tLote As String = gvr.DataKey("Lote").ToString
|
||||||
|
Dim tFechaCaducidad As Date = gvr.DataKey("FechaCaducidad").ToDate
|
||||||
|
|
||||||
|
If CveSubProyectoRecibe = 10276 Then
|
||||||
|
tLote = gvr.FCTextBox("TxtLote").text
|
||||||
|
tFechaCaducidad = gvr.FCTextBox("TxtCaducidad").text.todate
|
||||||
|
End If
|
||||||
|
|
||||||
|
If Not ObjInventario.AddMovimientoDetalle(CveMovimientoEntrada, gvr.FCTextBox("TxtCantidad").Text.ToString.ToDecimal, gvr.DataKey("CveUM").ToString.ToEntero, gvr.DataKey("CvePS").ToString.ToEntero, PrecioEntrada, CveAF:=gvr.DataKey("CveAF").ToString.ToEntero, CveSeccionAlmacen:=gvr.FCDropDownList("DdlSeccionAlmacen").SelectedValue.ToEntero, Serie:=gvr.DataKey("Serie").ToString, Lote:=tLote, FechaCaducidad:=tFechaCaducidad, CveMovimientoDetalleEntrada:=CveMovimientoDetalleEntrada) Then
|
||||||
ErrorMovInv = True
|
ErrorMovInv = True
|
||||||
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
TextoError = "Ocurrió un error al guardar los movimientos de salida"
|
||||||
Exit For
|
Exit For
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ Partial Class CatSubProyectos
|
|||||||
|
|
||||||
Private Sub RecargaGlobal()
|
Private Sub RecargaGlobal()
|
||||||
GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
|
GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) = Nothing
|
||||||
|
GlobalDTSubProyectosUsuarios(-1, -1, UsuarioActual.CveEmpresa) = Nothing
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#Region "O R D E N A M I E N T O"
|
#Region "O R D E N A M I E N T O"
|
||||||
|
|||||||
@@ -340,5 +340,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"</script>
|
<script src="<%= String.Format("https://maps.googleapis.com/maps/api/js?key={0}&libraries=drawing&libraries=places", Extensiones.GOOGLE_MAPS_API_KEY) %>"></script>
|
||||||
</asp:Content>
|
</asp:Content>
|
||||||
|
|||||||
@@ -493,7 +493,7 @@
|
|||||||
<td>
|
<td>
|
||||||
|
|
||||||
|
|
||||||
<div class="row col-md-12" align="right">
|
<div class="text-right">
|
||||||
<input type="text" id="TxtBusqueda7" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GVHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
<input type="text" id="TxtBusqueda7" class="form-control input-sm" onkeyup="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GVHistorial.ClientID) %>" style="display: inline-block; margin-right: -20px; width: 150px;" />
|
||||||
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GVHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
<a href="javascript:;" onclick="<%= String.Format("FiltrarTabla('TxtBusqueda7','{0}')", GVHistorial.ClientID) %>" style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"><i class="icon-magnifier"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1200,7 +1200,8 @@ function setwebservice(idDdlWS, idhdValue, idhdText, btn) {
|
|||||||
metodo: (!(DdlWS.data('metodo')) || DdlWS.data('metodo') == 'getps') ? ((!(DdlWS.parent().data('metodo')) || DdlWS.parent().data('metodo') == 'getps') ? 'getps' : DdlWS.parent().data('metodo')) : DdlWS.data('metodo'),
|
metodo: (!(DdlWS.data('metodo')) || DdlWS.data('metodo') == 'getps') ? ((!(DdlWS.parent().data('metodo')) || DdlWS.parent().data('metodo') == 'getps') ? 'getps' : DdlWS.parent().data('metodo')) : DdlWS.data('metodo'),
|
||||||
Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'),
|
Pagina: (!(DdlWS.data('pagina')) || DdlWS.data('pagina') == '') ? '-2' : DdlWS.data('pagina'),
|
||||||
ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'),
|
ColTexto: (!(DdlWS.data('coltexto')) || DdlWS.data('coltexto') == '') ? 'NC' : DdlWS.data('coltexto'),
|
||||||
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa')
|
aplicaparaventa: (!(DdlWS.data('aplicaparaventa')) || DdlWS.data('aplicaparaventa') == '') ? -1 : DdlWS.data('aplicaparaventa'),
|
||||||
|
cvemarca: (!(DdlWS.data('cvemarca')) || DdlWS.data('cvemarca') == '') ? -1 : DdlWS.data('cvemarca')
|
||||||
|
|
||||||
//Metodo: metodo
|
//Metodo: metodo
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -58,9 +58,9 @@
|
|||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<li>
|
<li>
|
||||||
|
|
||||||
<%--<a id="BtnClonarModal" runat="server" data-toggle="modal" style="width: 100%; margin-bottom: 10px;" href="#DivClonar"><i class="fa fa-clone"></i>Clonar Usuario </a>--%>
|
<%--<a id="BtnClonarModal" runat="server" data-toggle="modal" style="width: 100%; margin-bottom: 10px;" href="#DivClonar"><i class="fa fa-clone"></i>Clonar Usuario </a>--%>
|
||||||
|
|
||||||
<asp:LinkButton runat="server" ID="LnkClonarUsuario" OnClick="LnkClonarUsuario_Click" ><i class="fa fa-clone"></i> Clonar Usuario</asp:LinkButton>
|
<asp:LinkButton runat="server" ID="LnkClonarUsuario" OnClick="LnkClonarUsuario_Click"><i class="fa fa-clone"></i> Clonar Usuario</asp:LinkButton>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -113,6 +113,7 @@
|
|||||||
<asp:RequiredFieldValidator ID="RFVUsuario" runat="server" ControlToValidate="TxtUsuario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Usuario''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVUsuario" runat="server" ControlToValidate="TxtUsuario" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Usuario''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardar"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEUsuario" runat="server" HighlightCssClass="vco" TargetControlID="RFVUsuario" Width="300px"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEUsuario" runat="server" HighlightCssClass="vco" TargetControlID="RFVUsuario" Width="300px"></ajax:ValidatorCalloutExtender>
|
||||||
|
|
||||||
|
|
||||||
<asp:LinkButton ID="LnkRestablecer" runat="server" ToolTip="Restablecer Contraseña" data-toggle="confirmation" data-popout="true">
|
<asp:LinkButton ID="LnkRestablecer" runat="server" ToolTip="Restablecer Contraseña" data-toggle="confirmation" data-popout="true">
|
||||||
<i class="material-icons" style="font-size:20px;">vpn_lock</i>
|
<i class="material-icons" style="font-size:20px;">vpn_lock</i>
|
||||||
</asp:LinkButton>
|
</asp:LinkButton>
|
||||||
@@ -205,6 +206,17 @@
|
|||||||
<td>Autorizar equipo</td>
|
<td>Autorizar equipo</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr runat="server" id="TrCodigoAcceso" visible="false">
|
||||||
|
<td>Código Acceso:</td>
|
||||||
|
<td>
|
||||||
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password" Width="400px"></asp:TextBox>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<asp:LinkButton ID="LnkVerCodigoAcceso" runat="server" ToolTip="Ver Código Acceso">
|
||||||
|
<i class="material-icons" style="font-size:20px;">lock</i>
|
||||||
|
</asp:LinkButton>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -351,7 +363,8 @@
|
|||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<EditItemTemplate>
|
<EditItemTemplate>
|
||||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditAlmacen" />
|
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditAlmacen" />
|
||||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
|
||||||
|
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||||
</EditItemTemplate>
|
</EditItemTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
@@ -436,7 +449,8 @@
|
|||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<EditItemTemplate>
|
<EditItemTemplate>
|
||||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditSubProyecto" />
|
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditSubProyecto" />
|
||||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
|
||||||
|
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||||
</EditItemTemplate>
|
</EditItemTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
@@ -1606,6 +1620,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-1">
|
<div class="col-md-1">
|
||||||
Empresa:
|
Empresa:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<asp:DropDownList ID="DdlEmpresaAsignarPermiso" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="form-control input-sm select2me" Style="width: 100%" ValidationGroup="GrpGuardar">
|
<asp:DropDownList ID="DdlEmpresaAsignarPermiso" AutoPostBack="true" runat="server" AppendDataBoundItems="true" DataTextField="Empresa" DataValueField="CveEmpresa" Class="form-control input-sm select2me" Style="width: 100%" ValidationGroup="GrpGuardar">
|
||||||
@@ -2033,7 +2048,8 @@
|
|||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<EditItemTemplate>
|
<EditItemTemplate>
|
||||||
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditSubProyecto" />
|
<asp:LinkButton ID="imgU" runat="server" AlternateText="Actualizar" CausesValidation="True" CommandName="Update" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-check'></i>" ValidationGroup="GrpEditSubProyecto" />
|
||||||
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
|
||||||
|
<asp:LinkButton ID="imgC" runat="server" AlternateText="Cancelar" CausesValidation="False" CommandName="Cancel" CssClass="btn btn-circle btn-sm red" Text="<i class='fa fa-times'></i>" />
|
||||||
</EditItemTemplate>
|
</EditItemTemplate>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
<asp:LinkButton ID="imgE" runat="server" AlternateText="Editar" CausesValidation="False" ToolTip="Editar" CommandName="Edit" CssClass="btn btn-circle btn-sm green" Text="<i class='fa fa-pencil'></i>" />
|
||||||
@@ -2393,6 +2409,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
Usuario a clonar:
|
Usuario a clonar:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<asp:DropDownList ID="DdlUsuarioClonar" OnSelectedIndexChanged="DdlUsuarioClonar_SelectedIndexChanged" DataValueField="CveUsuario" DataTextField="Usuario" CssClass="select2me" Width="100%" AutoPostBack="true" runat="server"></asp:DropDownList>
|
<asp:DropDownList ID="DdlUsuarioClonar" OnSelectedIndexChanged="DdlUsuarioClonar_SelectedIndexChanged" DataValueField="CveUsuario" DataTextField="Usuario" CssClass="select2me" Width="100%" AutoPostBack="true" runat="server"></asp:DropDownList>
|
||||||
@@ -2470,7 +2487,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<div id="DivAgregarRestricción" class="modal fade ">
|
<div id="DivAgregarRestricción" class="modal fade ">
|
||||||
<asp:UpdatePanel UpdateMode="Conditional" class="modal-dialog " ID="UpAgregarRestriccion" runat="server"> <%--modal-lg--%>
|
<asp:UpdatePanel UpdateMode="Conditional" class="modal-dialog " ID="UpAgregarRestriccion" runat="server">
|
||||||
|
<%--modal-lg--%>
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header" style="background-color: #258FD7; height: 30px; padding-top: 3px;">
|
<div class="modal-header" style="background-color: #258FD7; height: 30px; padding-top: 3px;">
|
||||||
@@ -2483,6 +2501,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" style="max-width: 150px;">
|
<div class="col-md-3" style="max-width: 150px;">
|
||||||
IP:
|
IP:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<asp:TextBox ID="TxtIP" Text="" runat="server" />
|
<asp:TextBox ID="TxtIP" Text="" runat="server" />
|
||||||
@@ -2491,6 +2510,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" style="max-width: 150px;">
|
<div class="col-md-3" style="max-width: 150px;">
|
||||||
Mac:
|
Mac:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<asp:TextBox ID="TxtMAC" Text="" runat="server" />
|
<asp:TextBox ID="TxtMAC" Text="" runat="server" />
|
||||||
@@ -2512,6 +2532,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3" style="max-width: 150px;">
|
<div class="col-md-3" style="max-width: 150px;">
|
||||||
Aplica Restricción:
|
Aplica Restricción:
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<asp:CheckBox Text=" " CssClass="chksino " ID="ChkAplicaRestriccion" OnCheckedChanged="ChkAplicaRestriccion_CheckedChanged" AutoPostBack="true" runat="server" />
|
<asp:CheckBox Text=" " CssClass="chksino " ID="ChkAplicaRestriccion" OnCheckedChanged="ChkAplicaRestriccion_CheckedChanged" AutoPostBack="true" runat="server" />
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
Return ViewState("Password").ToString
|
Return ViewState("Password").ToString
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Private ReadOnly Property CodigoAcceso As String
|
||||||
|
Get
|
||||||
|
Return ViewState("CodigoAcceso").ToString
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
Private Property DtClasificaciones As DataTable
|
Private Property DtClasificaciones As DataTable
|
||||||
Get
|
Get
|
||||||
Return CType(ViewState("DtClasificaciones"), DataTable)
|
Return CType(ViewState("DtClasificaciones"), DataTable)
|
||||||
@@ -444,16 +449,19 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
TrDescuentoAutorizado.Visible = True
|
TrDescuentoAutorizado.Visible = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||||
|
TrCodigoAcceso.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
CargaDatos()
|
CargaDatos()
|
||||||
InicializaClonarUsuario()
|
InicializaClonarUsuario()
|
||||||
InicializaRestricciones()
|
InicializaRestricciones()
|
||||||
CargaGvBitacora()
|
CargaGvBitacora()
|
||||||
CargaEmpresasAsignaciones()
|
CargaEmpresasAsignaciones()
|
||||||
CreaDtAsignacionesMultiEmpresa()
|
CreaDtAsignacionesMultiEmpresa()
|
||||||
CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero
|
CveEmpresaAnterior = DdlEmpresaAsignaciones.SelectedValue.ToEntero
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
'DOCUMENTACION
|
'DOCUMENTACION
|
||||||
@@ -518,7 +526,7 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
CargarRol()
|
CargarRol()
|
||||||
CargaAsignaciones()
|
CargaAsignaciones()
|
||||||
|
|
||||||
CargaUsuarioResponsable
|
CargaUsuarioResponsable()
|
||||||
|
|
||||||
' ValidaAccesoEstatusOC()
|
' ValidaAccesoEstatusOC()
|
||||||
|
|
||||||
@@ -545,7 +553,7 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
ViewState("CveRol") = ObjUsuario.CveRol.ToString
|
ViewState("CveRol") = ObjUsuario.CveRol.ToString
|
||||||
DdlRol.SelectedValue = ObjUsuario.CveRol.ToString
|
DdlRol.SelectedValue = ObjUsuario.CveRol.ToString
|
||||||
TxtCorreo.Text = ObjUsuario.Correo
|
TxtCorreo.Text = ObjUsuario.Correo
|
||||||
|
TxtCodigoAcceso.Text = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString()
|
||||||
|
|
||||||
Dim autoip As String = ObjUsuario.DtResultados.Rows(0)("AutorizadoxIP").ToString().ToUpper()
|
Dim autoip As String = ObjUsuario.DtResultados.Rows(0)("AutorizadoxIP").ToString().ToUpper()
|
||||||
'chkSessionxEquipo.Checked = (autoip = "1" OrElse autoip = "TRUE")
|
'chkSessionxEquipo.Checked = (autoip = "1" OrElse autoip = "TRUE")
|
||||||
@@ -553,6 +561,7 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
'DdlAutoriza.SelectedValue = ObjUsuario.CveAutoriza.ToString
|
'DdlAutoriza.SelectedValue = ObjUsuario.CveAutoriza.ToString
|
||||||
|
|
||||||
ViewState("Password") = ObjUsuario.Contraseña
|
ViewState("Password") = ObjUsuario.Contraseña
|
||||||
|
ViewState("CodigoAcceso") = ObjUsuario.DtResultados.Rows(0)("CodigoAcceso").ToString()
|
||||||
|
|
||||||
ViewState("CveEmpresa") = ObjUsuario.CveEmpresaPredeterminada
|
ViewState("CveEmpresa") = ObjUsuario.CveEmpresaPredeterminada
|
||||||
DdlEmpresa.SelectedValue = CveEmpresa.ToString
|
DdlEmpresa.SelectedValue = CveEmpresa.ToString
|
||||||
@@ -818,10 +827,11 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
DtAsignacionesMultiEmpresa.Rows.Add(Row)
|
DtAsignacionesMultiEmpresa.Rows.Add(Row)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Dim CodigoAcceso As String = If(String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim), "-1", TxtCodigoAcceso.Text.Trim)
|
||||||
|
|
||||||
'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO
|
'REGISTRA O ACTUALIZA LOS DATOS GENERALES DEL USUARIO
|
||||||
If CveUsuario = -1 Then
|
If CveUsuario = -1 Then
|
||||||
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble)
|
CveUsuario = ObjUsuarios.AddUsuario(TxtUsuario.Text.Trim, Encripta(ContraseñaPredeterminada), TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, UsuarioActual.CveUsuario, DdlEmpresa.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, CveAlmacenAsignado:=DdlAlmacenGeneral.SelectedValue.ToEntero, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso)
|
||||||
EsNuevoUsuario = True
|
EsNuevoUsuario = True
|
||||||
If CveUsuario = -1 Then
|
If CveUsuario = -1 Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
@@ -833,7 +843,7 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble) Then
|
If Not ObjUsuarios.UpdateUsuario(TxtUsuario.Text.Trim, TxtNombre.Text.Trim, DdlRol.SelectedValue.ToEntero, TxtCorreo.Text.Trim, DdlPersonal.SelectedValue.ToEntero, DdlVendedor.SelectedValue.ToEntero, ChkCambiarContraseña.Checked, ChkEstatus.Checked, DdlEmpresa.SelectedValue.ToEntero, CveUsuario, DdlAlmacenGeneral.SelectedValue.ToEntero, DdlSubProyectos.SelectedValue.ToEntero, UsuarioActual.CveUsuario, AsignarSubProyecto:=ChkAsignarSubProyecto.Checked, AsignarOC:=ChkAsignarOC.Checked, DescuentoAutorizado:=TxtDescuentoAutorizado.Text.ToDouble, CodigoAcceso:=CodigoAcceso) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -1431,6 +1441,10 @@ Partial Class Sistemas_UsuarioDetalle
|
|||||||
Protected Sub LnkVerPass_Click(sender As Object, e As EventArgs) Handles LnkVerPass.Click
|
Protected Sub LnkVerPass_Click(sender As Object, e As EventArgs) Handles LnkVerPass.Click
|
||||||
Alert(Extensiones.Decripta(Password))
|
Alert(Extensiones.Decripta(Password))
|
||||||
End Sub
|
End Sub
|
||||||
|
Protected Sub LnkVerCodigoAcceso_Click(sender As Object, e As EventArgs) Handles LnkVerCodigoAcceso.Click
|
||||||
|
Alert(CodigoAcceso)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
|
|||||||
@@ -7981,7 +7981,11 @@ Partial Class Clientes
|
|||||||
Dim Row2 As DataRow = Nothing
|
Dim Row2 As DataRow = Nothing
|
||||||
Row2 = Dt2.NewRow()
|
Row2 = Dt2.NewRow()
|
||||||
LtlLimiteCreditoModal.Text = LimiteCredito.FormatoNumero()
|
LtlLimiteCreditoModal.Text = LimiteCredito.FormatoNumero()
|
||||||
Row2("limite") = LimiteCredito - Saldo
|
If LimiteCredito > 0 Then
|
||||||
|
Row2("limite") = LimiteCredito - Saldo
|
||||||
|
Else
|
||||||
|
Row2("limite") = 0
|
||||||
|
End If
|
||||||
Row2("saldo") = Saldo
|
Row2("saldo") = Saldo
|
||||||
Dt2.Rows.Add(Row2)
|
Dt2.Rows.Add(Row2)
|
||||||
Dim query2 = From s In Dt2.AsEnumerable() Select New With {.year = "", .limite = s("limite").ToString(), .saldo = s("saldo").ToString()}
|
Dim query2 = From s In Dt2.AsEnumerable() Select New With {.year = "", .limite = s("limite").ToString(), .saldo = s("saldo").ToString()}
|
||||||
|
|||||||
@@ -585,6 +585,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
||||||
|
<asp:UpdatePanel ID="UpTurno" runat="server" UpdateMode="Conditional" class=" xspadding .nolineheight bordered whitoutcol" style="color: white;">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div id="DivBloqueo" runat="server" style="width: 100%; text-align: center;" visible="false">
|
||||||
|
<asp:Button ID="BtnBloquearAcceso" CssClass="btn red-haze btn-outline btn-circle btn-sm" runat="server" Text="Bloquear Turno" OnClick="BtnBloquearAcceso_Click" />
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -833,7 +841,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<asp:UpdatePanel runat="server">
|
<asp:UpdatePanel runat="server">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight:bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
|
<asp:TextBox ID="TxtTotal" runat="server" ClientIDMode="Static" BorderStyle="None" Style="text-align: right; font-weight: bold" Text="0.00" Width="78px" ReadOnly="true"></asp:TextBox>
|
||||||
<asp:HiddenField ID="HdnVentaSaldo" runat="server" ClientIDMode="Static" Value="0" />
|
<asp:HiddenField ID="HdnVentaSaldo" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
<asp:HiddenField ID="HdnTotalVenta" runat="server" ClientIDMode="Static" Value="0" />
|
<asp:HiddenField ID="HdnTotalVenta" runat="server" ClientIDMode="Static" Value="0" />
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
@@ -1917,6 +1925,46 @@
|
|||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
<!-- ModalPopupExtender -->
|
<!-- ModalPopupExtender -->
|
||||||
|
|
||||||
|
|
||||||
|
<%-- ******************************************** Bloqueo de Caja *************************************************************************************************************************************** --%>
|
||||||
|
|
||||||
|
<asp:Button ID="BtnShowBloqueo" runat="server" Text="Show Modal Popup" Style="visibility: hidden; display: none;" />
|
||||||
|
<asp:Button ID="BtnCloseBloqueo" runat="server" CssClass="btn btn-danger" Style="visibility: hidden; display: none;" Text="Cancelar" />
|
||||||
|
|
||||||
|
<!-- ModalPopupExtender -->
|
||||||
|
<cc1:ModalPopupExtender ID="mpeBloque" runat="server" PopupControlID="PanelBloqueo" TargetControlID="BtnShowBloqueo"
|
||||||
|
BackgroundCssClass="modalBackground">
|
||||||
|
</cc1:ModalPopupExtender>
|
||||||
|
|
||||||
|
<asp:Panel ID="PanelBloqueo" runat="server" CssClass="modalPopup" align="center" Style="display: none">
|
||||||
|
<table border="0" width="250px" cellspacing="1" style="background-color: White; padding-left: 10px;">
|
||||||
|
<tr style="background-color: #3598dc; color: #FFFFFF; font-size: 14px; text-align: center">
|
||||||
|
<td colspan="2">
|
||||||
|
<asp:Label runat="server" Text="<i class='fa fa-lock fa-2 icontxt'></i> Acceso Restringido" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1">
|
||||||
|
<asp:Label runat="server" Text="Código de Acceso:" Font-Bold="true" Width="120px" />
|
||||||
|
</td>
|
||||||
|
<td colspan="1">
|
||||||
|
<asp:TextBox ID="TxtCodigoAcceso" runat="server" type="password"></asp:TextBox>
|
||||||
|
<asp:RequiredFieldValidator ID="RFVCodigoAcceso" runat="server" ControlToValidate="TxtCodigoAcceso" Display="None" ErrorMessage="<span class='has-error'><span id='username-error' class='help-block'>El campo <b>''Código de Acceso''</b> es necesario.</span></span>" ValidationGroup="GrpValidarCodigo"></asp:RequiredFieldValidator>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
<td colspan="1"> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<asp:Button ID="BtnCambiar" runat="server" CssClass="btn btn-success btn-sm" Text="Desbloquear" ValidationGroup="GrpValidarCodigo" OnClick="BtnCambiar_Click" />
|
||||||
|
|
||||||
|
</asp:Panel>
|
||||||
|
<!-- ModalPopupExtender -->
|
||||||
|
|
||||||
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
|
<div id="DivEstadoCaja" class="modal ADS fade" role="dialog">
|
||||||
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
|
<div class="modal-dialog" style="width: 470px; min-width: 470px;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@@ -2656,6 +2704,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlMarcaPS" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlMarcaPS.ClientID.ToString()%>">Marca:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
@@ -2838,6 +2896,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
|
<asp:DropDownList ID="DdlMarcaPSAjuste" CssClass="form-control input-sm select2me" runat="server" DataTextField="Marca" DataValueField="CveMarca" Width="100%" OnSelectedIndexChanged="DdlMarcaPS_SelectedIndexChanged" AutoPostBack="true">
|
||||||
|
<asp:ListItem Selected="True" Text="Seleccione la Marca (Todas)" Value="-1"></asp:ListItem>
|
||||||
|
</asp:DropDownList>
|
||||||
|
<label for="<%= DdlMarcaPSAjuste.ClientID.ToString()%>">Marca:</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
@@ -2868,7 +2936,7 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
<asp:TextBox ID="TxtEtiqueta" CssClass="form-control" runat="server" MaxLength="50"></asp:TextBox>
|
||||||
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
<label for="<%= TxtEtiqueta.ClientID.ToString()%>">Etiqueta:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2945,11 +3013,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
|
<asp:TextBox ID="TxtMesesUso" CssClass="form-control" runat="server" MaxLength="50" Enabled="false" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVMesesUso" runat="server" ControlToValidate="TxtMesesUso" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Meses de Uso''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEMesesUso" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesesUso"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEMesesUso" runat="server" HighlightCssClass="vco" TargetControlID="RFVMesesUso"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:FilteredTextBoxExtender ID="FTBEMesesUso" runat="server" TargetControlID="TxtMesesUso" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="FTBEMesesUso" runat="server" TargetControlID="TxtMesesUso" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight:bold">Meses de Uso:</label>
|
<label for="<%= TxtMesesUso.ClientID.ToString()%>" style="font-weight: bold">Meses de Uso:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -2974,11 +3042,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" style="font-weight:bold; font-size:20pt;"></asp:TextBox>
|
<asp:TextBox ID="TxtPorcentajeAjuste" CssClass="form-control" Enabled="false" runat="server" MaxLength="50" Style="font-weight: bold; font-size: 20pt;"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVPorcentajeAjuste" runat="server" ControlToValidate="TxtPorcentajeAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''% Ajuste''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeAjuste"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEPorcentajeAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVPorcentajeAjuste"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:FilteredTextBoxExtender ID="FTBEPorcentajeAjuste" runat="server" TargetControlID="TxtPorcentajeAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="FTBEPorcentajeAjuste" runat="server" TargetControlID="TxtPorcentajeAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight:bold">% Ajuste:</label>
|
<label for="<%= TxtPorcentajeAjuste.ClientID.ToString()%>" style="font-weight: bold">% Ajuste:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -3008,11 +3076,11 @@
|
|||||||
<div class="row" style="margin-top: 17px;">
|
<div class="row" style="margin-top: 17px;">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group form-md-line-input input-iconright">
|
<div class="form-group form-md-line-input input-iconright">
|
||||||
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50" ></asp:TextBox>
|
<asp:TextBox ID="TxtImporteAjuste" CssClass="form-control" runat="server" Enabled="false" MaxLength="50"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="RFVImporteAjuste" runat="server" ControlToValidate="TxtImporteAjuste" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Importe''</b> es necesario, por favor ingréselo." ValidationGroup="GrpAddVenta"></asp:RequiredFieldValidator>
|
||||||
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste"></ajax:ValidatorCalloutExtender>
|
<ajax:ValidatorCalloutExtender ID="VCEImporteAjuste" runat="server" HighlightCssClass="vco" TargetControlID="RFVImporteAjuste"></ajax:ValidatorCalloutExtender>
|
||||||
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
<ajax:FilteredTextBoxExtender ID="FTBEImporteAjuste" runat="server" TargetControlID="TxtImporteAjuste" FilterType="Custom, Numbers" ValidChars="." />
|
||||||
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight:bold">Importe:</label>
|
<label for="<%= TxtImporteAjuste.ClientID.ToString()%>" style="font-weight: bold">Importe:</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -3046,6 +3114,20 @@
|
|||||||
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
<asp:Content ID="Content7" ContentPlaceHolderID="JS" runat="Server">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
// Get the input field
|
||||||
|
var txtCodigoAcceso = document.getElementById("C_TxtCodigoAcceso");
|
||||||
|
|
||||||
|
// Execute a function when the user releases a key on the keyboard
|
||||||
|
txtCodigoAcceso.addEventListener("keyup", function (event) {
|
||||||
|
// Number 13 is the "Enter" key on the keyboard
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
// Cancel the default action, if needed
|
||||||
|
event.preventDefault();
|
||||||
|
// Trigger the button element with a click
|
||||||
|
document.getElementById("C_BtnCambiar").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function ValidarCodigoEnsamble(source, arguments) {
|
function ValidarCodigoEnsamble(source, arguments) {
|
||||||
let CveMarca = HdnPSAjusteMarca.value;
|
let CveMarca = HdnPSAjusteMarca.value;
|
||||||
let CveClasificacion = HdnPSAjusteClasificacion.value;
|
let CveClasificacion = HdnPSAjusteClasificacion.value;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ Imports System.Security.Cryptography.X509Certificates
|
|||||||
Imports System.Globalization
|
Imports System.Globalization
|
||||||
Imports System.Net.Http
|
Imports System.Net.Http
|
||||||
Imports Microsoft.Reporting.WebForms
|
Imports Microsoft.Reporting.WebForms
|
||||||
|
Imports ADSSession
|
||||||
|
|
||||||
Partial Class PV
|
Partial Class PV
|
||||||
Inherits ClsPaginas
|
Inherits ClsPaginas
|
||||||
@@ -1007,6 +1008,25 @@ Partial Class PV
|
|||||||
|
|
||||||
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
|
||||||
If Not IsPostBack Then
|
If Not IsPostBack Then
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||||
|
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||||
|
|
||||||
|
If DrUsuario("CodigoAcceso").ToString() <> "" Then
|
||||||
|
If UsuarioActual.SesionBloqueada Then
|
||||||
|
DivBloqueo.Visible = False
|
||||||
|
TxtCodigoAcceso.Focus()
|
||||||
|
RegistraScript("window.onload = function MuestraBloqueo() { document.getElementById(""C_BtnShowBloqueo"").click(); setTimeout(function(){ $('#C_TxtCodigoAcceso').focus(); }, 1000); }")
|
||||||
|
Else
|
||||||
|
DivBloqueo.Visible = True
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
DivBloqueo.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
DivBloqueo.Visible = False
|
||||||
|
End If
|
||||||
|
|
||||||
DdlBPPS.setEsWebService(True)
|
DdlBPPS.setEsWebService(True)
|
||||||
DdlBPPS.ddlWS.Attributes.Add("data-clear", "1")
|
DdlBPPS.ddlWS.Attributes.Add("data-clear", "1")
|
||||||
ViewState("ProcesoCorrecto") = True
|
ViewState("ProcesoCorrecto") = True
|
||||||
@@ -1116,6 +1136,8 @@ Partial Class PV
|
|||||||
CargarAlmacenes()
|
CargarAlmacenes()
|
||||||
CargaFormaEntrega()
|
CargaFormaEntrega()
|
||||||
CargaCuentasTerminal()
|
CargaCuentasTerminal()
|
||||||
|
CargaMarcasFiltro()
|
||||||
|
|
||||||
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(531).ToString = "1" Then
|
||||||
CargaAjuste()
|
CargaAjuste()
|
||||||
RVPorDesc.MaximumValue = UsuarioActual.DescuentoAutorizado.ToString
|
RVPorDesc.MaximumValue = UsuarioActual.DescuentoAutorizado.ToString
|
||||||
@@ -1231,6 +1253,24 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub CargaMarcasFiltro()
|
||||||
|
|
||||||
|
Using ObjMarcas As New ClsProductosServicios
|
||||||
|
If ObjMarcas.GetMarcas(UsuarioActual.CveEmpresa) Then
|
||||||
|
DdlMarcaPS.DataSource = ObjMarcas.DtResultados
|
||||||
|
DdlMarcaPSAjuste.DataSource = ObjMarcas.DtResultados
|
||||||
|
End If
|
||||||
|
End Using
|
||||||
|
DdlMarcaPS.DataBind()
|
||||||
|
DdlMarcaPSAjuste.DataBind()
|
||||||
|
|
||||||
|
DdlMarcaPS.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||||
|
DdlMarcaPSAjuste.Items.Insert(0, New ListItem("Todas", "-1"))
|
||||||
|
|
||||||
|
UpModalVenta.Update()
|
||||||
|
UpAjuste.Update()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function CargaVenta() As Boolean
|
Private Function CargaVenta() As Boolean
|
||||||
Dim Retorno As Boolean = False
|
Dim Retorno As Boolean = False
|
||||||
'CARGA PARA FACTURACION
|
'CARGA PARA FACTURACION
|
||||||
@@ -2722,7 +2762,7 @@ Partial Class PV
|
|||||||
End If
|
End If
|
||||||
DdlClasificacion.DataBind()
|
DdlClasificacion.DataBind()
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True)
|
Private Sub CargaPS(CveClasificacion As Integer, Objeto As ADServerControl.Dropdownlost, Optional AplicaAlmacen As Boolean = True, Optional CveMarca As Integer = -1)
|
||||||
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
|
Objeto.setEsWebService(UsuarioActual.Empresa.Funcionalidad(141).ToString = "1")
|
||||||
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
|
If Not UsuarioActual.Empresa.Funcionalidad(141).ToString = "1" Then
|
||||||
Objeto.ddl.Items.Clear()
|
Objeto.ddl.Items.Clear()
|
||||||
@@ -2742,6 +2782,7 @@ Partial Class PV
|
|||||||
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
|
Objeto.ddlWS.Attributes.Add("data-pagina", "-1")
|
||||||
End If
|
End If
|
||||||
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
|
Objeto.ddlWS.Attributes.Add("data-aplicaparaventa", "1")
|
||||||
|
Objeto.ddlWS.Attributes.Add("data-cvemarca", CveMarca.ToString)
|
||||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -3038,6 +3079,18 @@ Partial Class PV
|
|||||||
|
|
||||||
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
Protected Sub BtnEmitirImprimir_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnEmitirImprimir.Click
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(599) = "1" Then
|
||||||
|
Dim DrUsuario As DataRow = GlobalDTUsuarios(CveUsuario:=UsuarioActual.CveUsuario, CveEmpresa:=UsuarioActual.CveEmpresa).Rows(0)
|
||||||
|
|
||||||
|
If DrUsuario("CodigoAcceso").ToString() <> "" Then
|
||||||
|
If UsuarioActual.SesionBloqueada Then
|
||||||
|
Alert("Acceso denegado. La sesión se encuentra bloqueada", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
If Not CveCliente > 0 Then
|
If Not CveCliente > 0 Then
|
||||||
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia)
|
Alert("Es necesario seleccionar el cliente al cual se le va a facturar.", TipoMensaje.MsgAdvertencia)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -3069,7 +3122,7 @@ Partial Class PV
|
|||||||
|
|
||||||
'VALIDA PROMOCIONES Y EXISTENCIAS
|
'VALIDA PROMOCIONES Y EXISTENCIAS
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
|
||||||
DtPromociones = ObjVentas.DtResultados
|
DtPromociones = ObjVentas.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -3469,20 +3522,32 @@ Partial Class PV
|
|||||||
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
ObjFactura.DtInventario = DtInv.FiltraParametros("Seleccionado = 1")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
||||||
|
|
||||||
'VALIDA ENTREGA POR ADELANTADO
|
'VALIDA ENTREGA POR ADELANTADO
|
||||||
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
If UsuarioActual.Empresa.Funcionalidad(145) = "1" Then
|
||||||
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
'INCRUSTAMOS ALMACEN ENTREGA POR ADELANTADO CUANDO SEA REMISION Y NO TRAIGA ASIGNADO POR EL USUARIO
|
||||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
|
If ObjFactura.ServicioDomicilio Then
|
||||||
|
ObjFactura.CveAlmacenServicioDomicilio = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 29 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||||
|
ObjFactura.DtInventario = TmpDT.Copy.FiltraParametros("CveTipoPS = 2")
|
||||||
|
End If
|
||||||
|
|
||||||
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
ObjFactura.CveAlmacenTraspasoDestino = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveAlmacen", $"CveTipoAlmacen = 10 AND CveSubProyecto = {DdlSubProyectoDatos.SelectedValue}").ToString.ToEntero
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
'SI LA SUCURSAL NO TIENE ENTREGA POR ADELANTADO
|
||||||
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
If ObjFactura.CveAlmacenTraspasoDestino <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
ObjFactura.ErrorList.Add("Ocurrió un error al seleccionar el almacen de entrega por adelantado de la sucursal.")
|
||||||
End If
|
End If
|
||||||
End If
|
|
||||||
|
|
||||||
ObjFactura.ServicioDomicilio = ChkServicioDomicilio.Checked
|
'SI LA SUCURSAL NO TIENE SERVICIO A DOMICILIO
|
||||||
|
If ObjFactura.ServicioDomicilio AndAlso ObjFactura.CveAlmacenServicioDomicilio <= 0 And ObjFactura.TipoDocto = "Rem" Then
|
||||||
|
ObjFactura.ErrorList.Add("No existe un almacen configurado como 'Servicio a Domicilio' en esta sucursal.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -4533,7 +4598,7 @@ Partial Class PV
|
|||||||
|
|
||||||
'VALIDA PROMOCIONES
|
'VALIDA PROMOCIONES
|
||||||
Dim ObjVentas As New ClsVentas
|
Dim ObjVentas As New ClsVentas
|
||||||
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
|
If ObjVentas.GetPromocionesPS(-1, TxtFecha.Text.ToDateTime, DdlSubProyectoDatos.SelectedValue.ToEntero, CveCliente, DdlVendedor.SelectedValue.ToEntero, 1, UsuarioActual.CveEmpresa) Then
|
||||||
DtPromociones = ObjVentas.DtResultados
|
DtPromociones = ObjVentas.DtResultados
|
||||||
End If
|
End If
|
||||||
ObjVentas.Dispose()
|
ObjVentas.Dispose()
|
||||||
@@ -7350,4 +7415,93 @@ Partial Class PV
|
|||||||
|
|
||||||
Public Property Valido As Boolean
|
Public Property Valido As Boolean
|
||||||
End Class
|
End Class
|
||||||
|
Protected Sub DdlMarcaPS_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPS, CveMarca:=DdlMarcaPS.SelectedValue.ToEntero())
|
||||||
|
UpModalVenta.Update()
|
||||||
|
End Sub
|
||||||
|
Protected Sub DdlMarcaPSAjuste_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||||
|
CargaPS(DdlClasificacion.SelectedValue.ToEntero(), DdlPSAjuste, CveMarca:=DdlMarcaPSAjuste.SelectedValue.ToEntero())
|
||||||
|
UpAjuste.Update()
|
||||||
|
End Sub
|
||||||
|
Protected Sub BtnCambiar_Click(sender As Object, e As EventArgs)
|
||||||
|
If String.IsNullOrEmpty(TxtCodigoAcceso.Text.Trim) Then
|
||||||
|
Alert("Es necesario un código de acceso", TipoMensaje.MsgAdvertencia)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim CveUsuarioNuevo As Integer = -1
|
||||||
|
|
||||||
|
Using ObjUsuarios As New ClsSisUsuarios
|
||||||
|
CveUsuarioNuevo = ObjUsuarios.ValidaUsuarioCodigoAcceso(TxtCodigoAcceso.Text.Trim, UsuarioActual.CveEmpresa)
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Dim DrUsuario As DataRow = Nothing
|
||||||
|
|
||||||
|
If CveUsuarioNuevo > 0 Then
|
||||||
|
DrUsuario = GlobalDTUsuarios(CveUsuarioNuevo, UsuarioActual.CveEmpresa).FiltraParametros("Estatus = 1", "", {"CveUsuario", "Usuario", "Nombre", "Contraseña", "CveEmpresa", "Rol"}).Rows(0)
|
||||||
|
End If
|
||||||
|
|
||||||
|
If DrUsuario IsNot Nothing Then
|
||||||
|
|
||||||
|
Dim tUsuario, tContraseña As String
|
||||||
|
Dim tCveEmpresa As Integer
|
||||||
|
tUsuario = DrUsuario("Usuario").ToString
|
||||||
|
tContraseña = DrUsuario("Contraseña").ToString
|
||||||
|
tCveEmpresa = DrUsuario("CveEmpresa").ToString.ToEntero
|
||||||
|
|
||||||
|
Dim ObjUsuario As New ClsSisUsuarios
|
||||||
|
Dim Usuario As Usuario
|
||||||
|
|
||||||
|
Usuario = ObjUsuario.ValidaUsuario(tUsuario, tContraseña, IMEI, tCveEmpresa)
|
||||||
|
|
||||||
|
ObjUsuario.Dispose()
|
||||||
|
|
||||||
|
If Usuario IsNot Nothing Then
|
||||||
|
Dim dt As Data.DataTable = GlobalDTUsuarios(Usuario.CveUsuario)
|
||||||
|
ADSSessionConfig.sessionUser = Usuario
|
||||||
|
ADSSessionConfig.sessionUser.CvePlataforma = 1
|
||||||
|
ADSSessionConfig.sessionDpage = False
|
||||||
|
ADSSessionConfig.sessionUser.ModoSimulacion = False
|
||||||
|
|
||||||
|
If dt IsNot Nothing Then
|
||||||
|
If dt.Rows.Count >= 1 Then
|
||||||
|
If dt.Rows.Count > 1 Then ADSSessionConfig.sessionUser.MultipleEmpresa = True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
dt.Dispose()
|
||||||
|
|
||||||
|
Dim ObjEmpresa As New ClsSisEmpresas()
|
||||||
|
If ObjEmpresa.GetEmpresas(tCveEmpresa, "-1", "-1", "-1", "-1") Then
|
||||||
|
If ObjEmpresa.GetEmpresasFuncionalidades(tCveEmpresa) Then
|
||||||
|
Dim dttmp As Data.DataTable = ObjEmpresa.DtResultados
|
||||||
|
|
||||||
|
Dim EmpresasFuncionalidades As New HybridDictionary
|
||||||
|
For Each Row As Data.DataRow In dttmp.Rows
|
||||||
|
EmpresasFuncionalidades.Add(Convert.ToInt32(Row("CveFuncionalidad")), Row("Valor").ToString)
|
||||||
|
Next
|
||||||
|
ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
UsuarioActual.Empresa = ObjEmpresa.Empresa
|
||||||
|
ADSSessionConfig.sessionUser.CveEmpresa = ObjEmpresa.Empresa.CveEmpresa
|
||||||
|
|
||||||
|
ADSSession.ADSSessionConfig.SessionManager(ADSSession.OpcionSession.CambiarEmpresa, Nothing, ObjEmpresa.Empresa.CveEmpresa)
|
||||||
|
End If
|
||||||
|
ObjEmpresa.Dispose()
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/PV.aspx")
|
||||||
|
Else
|
||||||
|
Alert("No existe el código de acceso", TipoMensaje.MsgAdvertencia)
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
Protected Sub BtnBloquearAcceso_Click(sender As Object, e As EventArgs)
|
||||||
|
UsuarioActual.SesionBloqueada = True
|
||||||
|
|
||||||
|
Response.Redirect($"~/Ventas/PV.aspx")
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -15,7 +15,14 @@ Partial Class ProductosyServicios
|
|||||||
Return ViewState("CvePS").ToString.ToEntero
|
Return ViewState("CvePS").ToString.ToEntero
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
Public Property PSAdicionalAnterior As String
|
||||||
|
Get
|
||||||
|
Return ViewState("PSAdicionalAnterior").ToString
|
||||||
|
End Get
|
||||||
|
Set(value As String)
|
||||||
|
ViewState("PSAdicionalAnterior") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
Private Property CveSATPS As Integer
|
Private Property CveSATPS As Integer
|
||||||
Get
|
Get
|
||||||
Return ViewState("CveSATPS").ToString.ToEntero
|
Return ViewState("CveSATPS").ToString.ToEntero
|
||||||
@@ -1654,13 +1661,14 @@ Partial Class ProductosyServicios
|
|||||||
Private Sub GvPSAdicionales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPSAdicionales.RowDataBound
|
Private Sub GvPSAdicionales_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvPSAdicionales.RowDataBound
|
||||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||||
|
|
||||||
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
|
||||||
e.Row.FCDropDownList("DdlPSAdicional").DataSource = GlobalDTPS(UsuarioActual.CveEmpresa) '.FiltraParametros("CvePS = " + CvePS.ToString)
|
|
||||||
e.Row.FCDropDownList("DdlPSAdicional").DataBind()
|
|
||||||
e.Row.FCDropDownList("DdlPSAdicional").SelectedValue = e.Row.DBCampo("CvePSAdicional")
|
|
||||||
End If
|
|
||||||
|
|
||||||
End If
|
If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then
|
||||||
|
e.Row.FCDropDownList("DdlPSAdicional").DataSource = GlobalDTPS(UsuarioActual.CveEmpresa) '.FiltraParametros("CvePS = " + CvePS.ToString)
|
||||||
|
e.Row.FCDropDownList("DdlPSAdicional").DataBind()
|
||||||
|
e.Row.FCDropDownList("DdlPSAdicional").SelectedValue = e.Row.DBCampo("CvePSAdicional")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
Protected Sub GvPSAdicionales_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvPSAdicionales.RowCancelingEdit
|
Protected Sub GvPSAdicionales_RowCancelingEdit(sender As Object, e As GridViewCancelEditEventArgs) Handles GvPSAdicionales.RowCancelingEdit
|
||||||
GvPSAdicionales.EditIndex = -1
|
GvPSAdicionales.EditIndex = -1
|
||||||
@@ -1670,15 +1678,18 @@ Partial Class ProductosyServicios
|
|||||||
Dim TieneError = False
|
Dim TieneError = False
|
||||||
|
|
||||||
Dim CvePSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("CvePSAdicional").ToEntero
|
Dim CvePSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("CvePSAdicional").ToEntero
|
||||||
|
Dim PSAdicional = GvPSAdicionales.Rows(e.RowIndex).DataKey("PS").ToString
|
||||||
|
|
||||||
Dim ObjProductosServicios As New ClsProductosServicios()
|
Dim ObjProductosServicios As New ClsProductosServicios()
|
||||||
If Not ObjProductosServicios.RemovePSAdicionales(CvePS, CvePSAdicional) Then
|
If Not ObjProductosServicios.RemovePSAdicionales(CvePS, CvePSAdicional) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
|
Else
|
||||||
|
TieneError = EliminarProductosEquivalenteEnFranquicia(ObjProductosServicios, PSAdicional)
|
||||||
End If
|
End If
|
||||||
ObjProductosServicios.Dispose()
|
ObjProductosServicios.Dispose()
|
||||||
|
|
||||||
If Not TieneError Then
|
If Not TieneError Then
|
||||||
Alert("El Producto/Servicio Adicionala se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
Alert("El Producto/Servicio Adicional se eliminó correctamente.", TipoMensaje.MsgInformacion)
|
||||||
CargaPSAdicionales()
|
CargaPSAdicionales()
|
||||||
CargaGvPSAdicionales()
|
CargaGvPSAdicionales()
|
||||||
'RecargaGlobalEquivalencias()
|
'RecargaGlobalEquivalencias()
|
||||||
@@ -1720,7 +1731,7 @@ Partial Class ProductosyServicios
|
|||||||
If Not ObjProductosServicios.UpdatePSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
If Not ObjProductosServicios.UpdatePSAdicionales(CvePS, DdlPSAdicional.SelectedValue.ToEntero, CvePSAdicional, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||||
TieneError = True
|
TieneError = True
|
||||||
Else
|
Else
|
||||||
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, False)
|
TieneError = GuardarProductosEquivalenteEnFranquicia(ObjProductosServicios, False, PSAdicionalAnterior)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
@@ -1743,6 +1754,7 @@ Partial Class ProductosyServicios
|
|||||||
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
Dim GvRow As GridViewRow = DirectCast(DirectCast(sender, LinkButton).NamingContainer, GridViewRow)
|
||||||
BtnAgregarPSAdicional.Text = "Guardar"
|
BtnAgregarPSAdicional.Text = "Guardar"
|
||||||
TxtCantidadPSAdicional.Text = GvRow.DataKey("Cantidad")
|
TxtCantidadPSAdicional.Text = GvRow.DataKey("Cantidad")
|
||||||
|
PSAdicionalAnterior = GvRow.DataKey("PS").ToString
|
||||||
|
|
||||||
If TxtCantidadPSAdicional.Text.ToEntero = 0 Then
|
If TxtCantidadPSAdicional.Text.ToEntero = 0 Then
|
||||||
UpCantidad.Visible = False
|
UpCantidad.Visible = False
|
||||||
@@ -2936,7 +2948,7 @@ Partial Class ProductosyServicios
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean) As Boolean
|
Private Function GuardarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, Agregar As Boolean, Optional PSAdicionalAnterior As String = "") As Boolean
|
||||||
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||||
|
|
||||||
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||||
@@ -2949,7 +2961,7 @@ Partial Class ProductosyServicios
|
|||||||
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("El producto de la página no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If CvePSPagina <= 0 Then
|
If CvePSAdicional <= 0 Then
|
||||||
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -2958,16 +2970,36 @@ Partial Class ProductosyServicios
|
|||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Dim PSAnterior As String = GlobalDTPS(Franquicia).FiltroPrimeroValor("PS", String.Format("CvePS = '{0}'", CvePSAdicional))
|
Dim CvepsAdicionalAnt As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAdicionalAnterior)).ToEntero
|
||||||
Dim CvePSAnterio As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAnterior)).ToEntero
|
|
||||||
|
|
||||||
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvePSAnterio, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
If CvepsAdicionalAnt <= 0 Then
|
||||||
Return True
|
Alert(String.Format("El producto adicional no existe en la franquicia: '{0}'", GlobalDTEmpresas(Franquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia)
|
||||||
|
Else
|
||||||
|
If Not ObjPS.UpdatePSAdicionales(CvePSPagina, CvePSAdicional, CvepsAdicionalAnt, If(TxtCantidadPSAdicional.Visible, TxtCantidadPSAdicional.Text.ToDecimal, 0)) Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
Private Function EliminarProductosEquivalenteEnFranquicia(ObjPS As ClsProductosServicios, PSAdicional As String) As Boolean
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(563) <> "" Then
|
||||||
|
Dim StrEmpresas As String = UsuarioActual.Empresa.Funcionalidad(563)
|
||||||
|
Dim EmpresasFranquicia As List(Of Integer) = StrEmpresas.Split(","c).ToList().ConvertAll(Function(x) Convert.ToInt32(x))
|
||||||
|
For Each Franquicia As Integer In EmpresasFranquicia
|
||||||
|
Dim CvepsAdicional As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("PS = '{0}'", PSAdicional)).ToEntero
|
||||||
|
Dim CvePSPagina As Integer = GlobalDTPS(Franquicia).FiltroPrimeroValor("CvePS", String.Format("Codigo = '{0}'", TxtCodigo.Text.Trim)).ToEntero
|
||||||
|
If Not ObjPS.RemovePSAdicionales(CvePSPagina, CvepsAdicional) Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -341,11 +341,39 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
|||||||
If AnioMes.Trim.Length = 7 Then
|
If AnioMes.Trim.Length = 7 Then
|
||||||
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
||||||
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
FechaFtemporal = $"01/{AnioMes.Substring(5, 2).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
||||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
|
||||||
|
If FechaF = "-1" Then
|
||||||
|
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||||
|
Else
|
||||||
|
Dim FechaFRef As DateTime = FechaF.ToDateTime
|
||||||
|
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 2).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate()
|
||||||
|
|
||||||
|
If FechaFRef > FechaFMonth Then
|
||||||
|
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
|
||||||
|
Else
|
||||||
|
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
txtFechaI.Text = If(AnioMes <> "-1", String.Format("01/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4)), txtFechaI.Text)
|
||||||
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
FechaFtemporal = $"01/{AnioMes.Substring(5, 1).PadLeft(2, "0"c)}/{AnioMes.Substring(0, 4)}"
|
||||||
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
|
||||||
|
If FechaF = "-1" Then
|
||||||
|
txtFechaF.Text = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day)
|
||||||
|
Else
|
||||||
|
Dim FechaFRef As DateTime = FechaF.ToDateTime
|
||||||
|
Dim FechaFMonth As DateTime = String.Format("{2}/{0}/{1}", AnioMes.Substring(5, 1).PadLeft(2, "0"c), AnioMes.Substring(0, 4), FechaFtemporal.ToDate.LastDayOfMonth.Day).ToDate
|
||||||
|
|
||||||
|
If FechaFRef > FechaFMonth Then
|
||||||
|
txtFechaF.Text = FechaFMonth.ToString("dd/MM/yyyy")
|
||||||
|
Else
|
||||||
|
txtFechaF.Text = FechaFRef.ToString("dd/MM/yyyy")
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -754,6 +754,12 @@
|
|||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr align="left" id="TrServicioDomicilio" runat="server" visible="false">
|
||||||
|
<td><b>Servicio a Domicilio:</b> </td>
|
||||||
|
<td>
|
||||||
|
activado
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
|
|||||||
@@ -4012,6 +4012,10 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If UsuarioActual.Empresa.Funcionalidad(531) = "1" AndAlso CBool(DbRowVenta("ServicioDomicilio")) Then
|
||||||
|
TrServicioDomicilio.Visible = True
|
||||||
|
End If
|
||||||
|
|
||||||
'CargaDetalle
|
'CargaDetalle
|
||||||
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
If ObjVentas.GetVentaDetalle(CveVenta) Then
|
||||||
TmpDT = ObjVentas.DtResultados
|
TmpDT = ObjVentas.DtResultados
|
||||||
@@ -6392,6 +6396,7 @@ Partial Class Ventas
|
|||||||
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
Objeto.ddlWS.Attributes.Add("data-cveclasificacion", CveClasificacion.ToString())
|
||||||
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
Objeto.ddlWS.Attributes.Add("data-pagina", "ventas/ventas")
|
||||||
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
Objeto.ddlWS.Attributes.Add("data-Estatus", "1")
|
||||||
|
Objeto.ddlWS.Attributes.Add("data-AplicaparaVenta", "1")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -11289,8 +11294,7 @@ Partial Class Ventas
|
|||||||
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero()
|
CveCuentaIVATrasladado = GlobalDTClasificacionPorcentaje(UsuarioActual.CveEmpresa, PorcentajeIVA:=TmpDT.MAX("PorcentajeIVA").ToDouble).Rows(0)("CveCuentaIVATrasladado").ToString().ToEntero()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim UsaComplementariaClientes As Boolean = False
|
Dim UsaComplementariaClientes As Boolean = True
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
|
||||||
|
|
||||||
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
If ObjConta.GetPlantillaConceptos(ObjFactura.CveEmpresa, CvePlantilaPoliza) Then
|
||||||
Dim dtt As DataTable = ObjConta.DtResultados
|
Dim dtt As DataTable = ObjConta.DtResultados
|
||||||
@@ -12976,8 +12980,10 @@ Partial Class Ventas
|
|||||||
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
Dim tmpCostos As DataTable = DtCostos.FiltraParametros("", "", {"CveClasificacion"})
|
||||||
Dim IdCtaContable As Integer = 0
|
Dim IdCtaContable As Integer = 0
|
||||||
Dim CveCuenta As Integer = 0
|
Dim CveCuenta As Integer = 0
|
||||||
|
Dim TotalCostoAcumulado As Decimal = 0
|
||||||
|
|
||||||
If tmpCostos.Rows.Count > 0 Then
|
If tmpCostos.Rows.Count > 0 Then
|
||||||
Dim TotalCostoAcumulado As Decimal = 0
|
|
||||||
Dim cont As Integer = 1
|
Dim cont As Integer = 1
|
||||||
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
'Se agrega movimiento separado por la cuenta de ventas (ER)
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
@@ -12995,18 +13001,24 @@ Partial Class Ventas
|
|||||||
'If ValorInventario <> 0 Then
|
'If ValorInventario <> 0 Then
|
||||||
|
|
||||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto69, ValorInventario, factura.SerieFolio, 69, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveSubProyecto:=factura.CveSubProyecto, CveClasificacion:=RowInv("CveClasificacion").ToString().ToEntero(), CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=ValorInventario, CveCuenta:=CveCuenta) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
'End If
|
'End If
|
||||||
cont += 1
|
cont += 1
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'AJUSTA EL TOTAL
|
||||||
|
If Math.Abs(TotalCostoAcumulado - TotalCosto) = 0.01 Then
|
||||||
|
TotalCosto = TotalCostoAcumulado
|
||||||
|
End If
|
||||||
|
|
||||||
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 TotalCosto <> 0 Then
|
'If TotalCosto <> 0 Then
|
||||||
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
|
If Not ObjConta.AddPrePolizasDetalle(factura.CvePrePoliza, TipoMovto68, TotalCosto, factura.SerieFolio, 68, factura.SerieFolio, factura.Fecha, IdCtaContable, -1, CveVenta:=factura.CveVenta, CveCliente:=factura.CveCliente, CveMovimientoAlmacen:=CveMovimientoInventario, ImporteMX:=TotalCosto, CveCuenta:=CveCuenta, CveSubProyecto:=factura.CveSubProyecto) Then
|
||||||
OcurrioError = True
|
OcurrioError = True
|
||||||
End If
|
End If
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@@ -13834,8 +13846,8 @@ Partial Class Ventas
|
|||||||
Dim CuentasContablesInvalidasSIG As New StringBuilder
|
Dim CuentasContablesInvalidasSIG As New StringBuilder
|
||||||
Dim ContaIdPoliza As Integer = 0
|
Dim ContaIdPoliza As Integer = 0
|
||||||
Dim ConceptoAmortizacion As Integer = 0
|
Dim ConceptoAmortizacion As Integer = 0
|
||||||
Dim UsaComplementariaClientes As Boolean = False
|
Dim UsaComplementariaClientes As Boolean = True
|
||||||
If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
'If UsuarioActual.CveEmpresa.Contiene(1, 119) Then UsaComplementariaClientes = True
|
||||||
'Dim FechaMaxima As Date = MinFecha
|
'Dim FechaMaxima As Date = MinFecha
|
||||||
|
|
||||||
|
|
||||||
@@ -15119,7 +15131,7 @@ Partial Class Ventas
|
|||||||
Dim ValorInventario As Decimal = 0
|
Dim ValorInventario As Decimal = 0
|
||||||
|
|
||||||
For Each RowInv As DataRow In tmpCostos.Rows
|
For Each RowInv As DataRow In tmpCostos.Rows
|
||||||
ValorInventario = DTMovimientosDetalles.SUM("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).ToString().ToDecimal.RoundSQL()
|
ValorInventario = DTMovimientosDetalles.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD()
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGasto", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
|
|
||||||
@@ -15143,7 +15155,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero()
|
IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen = {ddlAlmacen.SelectedValue}").ToEntero()
|
||||||
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundSQL()
|
ValorInventario = DTMovimientosDetalles.SUMD("Total", $"CveMovimiento = {Mov("CveMovimiento")}").RoundAD()
|
||||||
|
|
||||||
If ValorInventario <> 0 Then
|
If ValorInventario <> 0 Then
|
||||||
'Entrada
|
'Entrada
|
||||||
@@ -18449,7 +18461,7 @@ Partial Class Ventas
|
|||||||
Return Not OcurrioError
|
Return Not OcurrioError
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
|
||||||
|
|
||||||
If CvePrePoliza <= 0 Then
|
If CvePrePoliza <= 0 Then
|
||||||
GenerarPrePolizaNueva = True
|
GenerarPrePolizaNueva = True
|
||||||
@@ -18462,7 +18474,7 @@ Partial Class Ventas
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
TotalCostoAcumulado += ValorInventario
|
TotalCostoAcumulado += ValorInventario
|
||||||
@@ -18603,10 +18615,10 @@ Partial Class Ventas
|
|||||||
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
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
|
||||||
|
|
||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
TotalCostoAcumulado += ValorInventario
|
TotalCostoAcumulado += ValorInventario
|
||||||
@@ -18720,10 +18732,10 @@ Partial Class Ventas
|
|||||||
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
|
||||||
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundSQL
|
Dim TotalCosto As Decimal = DtCostos.SUMD("Total").RoundAD
|
||||||
|
|
||||||
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
For Each RowInv As DataRow In DtCostosDistinct.Rows
|
||||||
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundSQL
|
ValorInventario = DtCostos.SUMD("Total", String.Format("CveClasificacion = {0}", RowInv("CveClasificacion"))).RoundAD
|
||||||
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
CveCuenta = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaGastoSIG", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero()
|
||||||
TotalCostoAcumulado += ValorInventario
|
TotalCostoAcumulado += ValorInventario
|
||||||
@@ -23186,7 +23198,7 @@ Partial Class Ventas
|
|||||||
Dim ObjBancos As New ClsBancos
|
Dim ObjBancos As New ClsBancos
|
||||||
|
|
||||||
If UsuarioActual.CveRol = 1 Then
|
If UsuarioActual.CveRol = 1 Then
|
||||||
GvComplementoPagos.Columns(8).Visible = True
|
GvComplementoPagos.Columns(7).Visible = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -23675,11 +23687,7 @@ Partial Class Ventas
|
|||||||
IdCuentaContableNoDeducible = 3114
|
IdCuentaContableNoDeducible = 3114
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim UsaComplementaria As Boolean = False
|
Dim UsaComplementaria As Boolean = True
|
||||||
|
|
||||||
If UsuarioActual.CveEmpresa = 119 Then
|
|
||||||
UsaComplementaria = True
|
|
||||||
End If
|
|
||||||
|
|
||||||
If MsgError = "" Then
|
If MsgError = "" Then
|
||||||
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, TxtFechaSaldarVenta.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
CvePrePoliza = ObjConta.AddPrePolizas("Ventas/Saldarr", 47, SaldoVenta, SaldoVenta, tCveMoneda, TxtFechaSaldarVenta.Text.ToDate, ConceptoPartida, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)
|
||||||
|
|||||||
Reference in New Issue
Block a user