diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index d45f8afca..fa47212e6 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -78,6 +78,7 @@ Public Class ClsInventarios Public Property CveVenta As Integer Public Property TipoEstatus As Integer Public Property EsDevolucionVenta As Integer + Public Property CantidadVenta As Decimal Public Property CvePersonal As Integer Public Property NombreCompleto As String Public Property NombreCapturo As String @@ -3576,8 +3577,9 @@ Public Class ClsInventarios If Data IsNot Nothing AndAlso Data.Rows.Count = 1 Then Dim dr As DataRow = Data.Rows(0) - TipoEstatus = dr("TipoEstatus").ToString.ToEntero - EsDevolucionVenta = dr("EsVentaDevolucion").ToString.ToEntero + TipoEstatus = dr("TipoEstatus").ToString().ToEntero + EsDevolucionVenta = dr("EsVentaDevolucion").ToString().ToEntero + CantidadVenta = dr("CantidadVenta").ToString().ToDecimal() Retorno = True End If diff --git a/App_Code/ClsOS.vb b/App_Code/ClsOS.vb index 1263b38d9..b2f8c1d29 100644 --- a/App_Code/ClsOS.vb +++ b/App_Code/ClsOS.vb @@ -497,7 +497,7 @@ Public Class ClsOS Public Function GetRepOrdenesServicioMedicasRep(FechaI As Date, FechaF As Date, CveCliente As Integer, CveVendedor As Integer, CveEstatusOrdenServicio As Integer, CveUsuarioAtendio As Integer, CveSubProyecto As Integer, CveEmpresa As Integer, - Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1) As Boolean + Optional CveMedico As Integer = -1, Optional CveProcedimiento As Integer = -1, Optional CveEspecialidad As Integer = -1, Optional CveClienteSucursal As Integer = -1, Optional CveUsuario As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_OS_OrdenesServiciosMedicasRepGet") @@ -516,6 +516,7 @@ Public Class ClsOS .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveEspecialidad", SqlDbType.Int).Value = CveEspecialidad .Add("@CveClienteSucursal", SqlDbType.Int).Value = CveClienteSucursal + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario End With diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index a800a3856..2e23ed098 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -7115,7 +7115,7 @@ Public Class ClsPaginas params.Add(New ReportParameter("CveVenta", Vta.CveVenta.ToString)) End If 'COMPU DN DIFUSA - If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177) Then + If UsuarioActual.CveEmpresa.Contiene(1, 72, 80, 119, 137, 132, 144, 177, 186) Then Dim FirmaVendedor As New System.IO.FileInfo(String.Format("{0}Firmas\{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveVendedor)) params.Add(New ReportParameter("FirmaVendedor", If(FirmaVendedor.Exists, New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Firmas/{1}.png", UsuarioActual.CveEmpresa, Vta.CveVendedor))).AbsoluteUri, ""))) params.Add(New ReportParameter("Entrega", Vta.Entrega)) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 79e1de33e..21f150695 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -6931,7 +6931,7 @@ Public Class ClsVentas #End Region - Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer) As Boolean + Public Function GetVentasMedicasIndicadoresRep(Grupo As Integer, FechaI As Date, FechaF As Date, CveCliente As Integer, CveMedico As Integer, CveProcedimiento As Integer, CveEmpresa As Integer, CveVendedor As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasMedicasIndicadoresRepGet") @@ -6943,6 +6943,7 @@ Public Class ClsVentas .Add("@CveMedico", SqlDbType.Int).Value = CveMedico .Add("@CveProcedimiento", SqlDbType.Int).Value = CveProcedimiento .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveVendedor", SqlDbType.Int).Value = CveVendedor End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 854ab6997..5bb948f6b 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -681,6 +681,49 @@ Namespace Extensiones directorioNew.Clear() Return retorno End Function + + + Public Function FilesCopy(oldName As String, newName As String, newDirectorio As String, Optional Sobreescribir As Boolean = False, Optional ConcatenarDirectorioBase As Boolean = True) As Boolean + Dim retorno As Boolean = True + Dim directorioOld As New StringBuilder + Dim directorioNew As New StringBuilder + directorioOld.AppendFormat("{0}Temp\{1}", AppDomain.CurrentDomain.BaseDirectory, oldName) + If newName = "" Then + newName = oldName + Else + newName = String.Format("{0}{1}", newName, System.IO.Path.GetExtension(directorioOld.ToString())) + End If + + 'SI VA A LA CARPETA DE EMPRESAS TIENE QUE TOMAR LA RUTA DE EMPRESAS + If ConcatenarDirectorioBase Then + If newDirectorio.Contains("Empresas") Then + directorioNew.AppendFormat("{0}{1}\", ModExtensiones.DirectorioBaseEmpresas, newDirectorio) + Else + directorioNew.AppendFormat("{0}{1}\", AppDomain.CurrentDomain.BaseDirectory, newDirectorio) + End If + Else + 'SI YA TIENE EL DIRECTORIO COMPLETO NO CONCANTENA EL DIRECTORIO + directorioNew.AppendFormat("{0}\", newDirectorio) + End If + + + If Not Directory.Exists(directorioNew.ToString) Then + Directory.CreateDirectory(directorioNew.ToString) + End If + + directorioNew.Append(newName) + Try + My.Computer.FileSystem.CopyFile(directorioOld.ToString, directorioNew.ToString, Sobreescribir) + + Catch ex As Exception + Alert("", String.Format("{0} code[FilesMove]", ex.Message), TipoMensaje.MsgAdvertencia) + retorno = False + End Try + directorioOld.Clear() + directorioNew.Clear() + Return retorno + End Function + Public Function DirectoryExistsCreate(ByRef NombreDirectorio As String) As Boolean diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index d1ff5c083..99e204bf0 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -1967,7 +1967,7 @@ Partial Class Inventarios_EntregaAlmacen ValidaUsaConsola() - + Dim CantidadVenta As Decimal = 0 '' INICIA: VALIDACIONES 'Valida el estatus de la Venta, si es = 5 O DevolucionVenta = 2, NO SE SURTE! @@ -1975,6 +1975,7 @@ Partial Class Inventarios_EntregaAlmacen If ObjVentaInv.GetEstatusVentaPorSurtir(CveVentaSurtir) Then TipoEstatus = ObjVentaInv.TipoEstatus EsDevolucionVenta = ObjVentaInv.EsDevolucionVenta + CantidadVenta = ObjVentaInv.CantidadVenta End If ObjVentaInv.Dispose() @@ -2166,7 +2167,9 @@ Partial Class Inventarios_EntregaAlmacen DtDatosVenta = ObjInventario.DtResultados End If Dim CantidadGV As Decimal = GvDatos.Rows.Cast(Of GridViewRow)().Sum(Function(gvr) gvr.DataKey("CantidadF").ToDecimal) - If CantidadGV > DtDatosVenta.SUMD("CantidadF") Then + + 'VERIFICA SI LA CANTIDADES NOT SON MAYORES A LO ESTABLECIDO EN LA VENTA O LO QUE FALTA POR RECIBIR + If CantidadGV > DtDatosVenta.SUMD("CantidadF") OrElse Cantidad > CantidadVenta Then ObjInventario.RollBack() ObjInventario.Dispose() ObjConta.Dispose() @@ -2175,7 +2178,13 @@ Partial Class Inventarios_EntregaAlmacen '' identificar que productos no están completos. CargaVentaPorSurtir(CveVentaSurtir) CargaPendientes() - Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia) + + If Cantidad > CantidadVenta Then + Alert("No se puede procesar una cantidad mayor a la que esta definida en la venta.", TipoMensaje.MsgAdvertencia) + Else + Alert("Ha sido cambiada la informacion de existencias de la venta actual, se han recargado la información.", TipoMensaje.MsgAdvertencia) + End If + Exit Sub End If @@ -3290,6 +3299,14 @@ Partial Class Inventarios_EntregaAlmacen End If End If + 'SI YA FUE DEVUELTO LA CANTIDAD COMPLETA DE LA DEVOLUCION,MARCAR PARA QUE NO APAREZCA + If Not ErrorMovInv AndAlso Cantidad.RoundSQL(6) = CantidadVenta.RoundSQL(6) AndAlso TipoDocto = "Dev" Then + If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then + TextoError.AppendFormat("Ocurrió un error al actualizar la devolucion.") + ErrorMovInv = True + End If + End If + If Not ErrorMovInv Then ObjInventario.Commit() diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx index 3d3defc25..c00c2b15b 100644 --- a/OS/OrdenesServicios.aspx +++ b/OS/OrdenesServicios.aspx @@ -1314,46 +1314,55 @@ -