diff --git a/AC/RegNomina.aspx.vb b/AC/RegNomina.aspx.vb index a85fa5425..7568b2c12 100644 --- a/AC/RegNomina.aspx.vb +++ b/AC/RegNomina.aspx.vb @@ -421,9 +421,6 @@ Partial Class AC_RegNomina End If End If - - Dim drt As DataRow - IDPoliza = objAC.AddPoliza(3, TxtConcepto.Text.Trim, 0, 0, UsuarioActual.CveUsuario, Fecha) If IDPoliza > 0 Then diff --git a/App_Code/ClsContabilidad.vb b/App_Code/ClsContabilidad.vb index fbf0a6182..dd6e58ab7 100644 --- a/App_Code/ClsContabilidad.vb +++ b/App_Code/ClsContabilidad.vb @@ -258,7 +258,7 @@ Public Class ClsContabilidad Public Function UpdatePrePolizasDetalle(CvePrePolizaDetalle As Integer, Concepto As String, CveSubProyecto As Integer, IdCtaContable As Integer, TipoMovto As Boolean, ImporteMN As Decimal, Optional CveTipoGasto As Integer = -1, Optional CveConceptoContable As Integer = -1, Optional CveProveedor As Integer = -1, Optional CveCompra As Integer = -1, Optional CvePersonal As Integer = -1, Optional CveCliente As Integer = -1, Optional CveVenta As Integer = -1, - Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1) As Boolean + Optional Referencia As String = "-1", Optional CveUsuarioModifico As Integer = -1, Optional CveCuenta As Integer = -1, Optional PorcentajeImpuesto As Decimal = -1) As Boolean Dim Retorno As Boolean = False @@ -279,6 +279,7 @@ Public Class ClsContabilidad .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal .Add("@CveCliente", SqlDbType.Int).Value = CveCliente .Add("@CveVenta", SqlDbType.Int).Value = CveVenta + .Add("@PorcentajeImpuesto", SqlDbType.Money).Value = PorcentajeImpuesto .Add("@CveUsuarioModifico", SqlDbType.Int).Value = CveUsuarioModifico .Add("@CveCuenta", SqlDbType.Int).Value = CveCuenta End With diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 39ebe63e7..a4f596a68 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -2176,7 +2176,7 @@ Public Class ClsInventarios #Region " INVENTARIOS - INVENTARIO FISICO " - Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer) As Boolean + Public Function AddInventarioFisico(CveEmpresa As Integer, InventarioFisico As String, Observaciones As String, Estatus As Integer, CveSubProyecto As Integer, Optional ConAplicacion As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_InventarioFisicoAdd") @@ -2186,6 +2186,7 @@ Public Class ClsInventarios .Add("@InventarioFisico", SqlDbType.VarChar).Value = InventarioFisico .Add("@Observaciones", SqlDbType.VarChar).Value = Observaciones .Add("@Estatus", SqlDbType.Int).Value = Estatus + .Add("@ConAplicacion", SqlDbType.Int).Value = If(ConAplicacion, 1, 0) .Add("@CveInventarioFisico", SqlDbType.Int).Direction = ParameterDirection.Output End With @@ -2582,6 +2583,101 @@ Public Class ClsInventarios Return Retorno End Function + Public Function GetInventarioFisicoDetallesUsuarios(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoDetallesUsuariosGet") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al obtener los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al obtener llos usuarios del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function AddInventarioFisicoUsuarios(CveInventarioFisico As Integer, CveUsuario As Integer, Incluye As Boolean, Cerrado As Boolean, Bloqueado As Boolean) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoUsuariosAdd") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Incluye", SqlDbType.Bit).Value = If(Incluye, 1, 0) + .Add("@Cerrado", SqlDbType.Bit).Value = If(Cerrado, 1, 0) + .Add("@Bloqueado", SqlDbType.Bit).Value = If(Bloqueado, 1, 0) + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al guardar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al guardar los usuarios del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + + Public Function RemoveInventarioFisicoUsuarios(CveInventarioFisico As Integer) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoUsuariosRemove") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar los usuarios servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function UpdateInventarioFisicoUsuarios(CveInventarioFisico As Integer, CveUsuario As Integer, Cerrado As Boolean, Bloqueado As Boolean) As Boolean + + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_InventarioFisicoUsuariosUpdate") + With SqlAdapter.SelectCommand.Parameters + .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Cerrado", SqlDbType.Bit).Value = Cerrado + .Add("@Bloqueado", SqlDbType.Bit).Value = Bloqueado + + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + + Catch Ex1 As SqlException + Me.OnError("Ocurrió un error al eliminar los usuarios del inventario fisico.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + OnError("Ocurrió un error al eliminar los usuarios servicio del inventario fisico.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function GetInventarioFisicoDetallesProveedores(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False @@ -2767,12 +2863,13 @@ Public Class ClsInventarios Return Retorno End Function - Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer) As Boolean + Public Function GetInventarioFisicoResultados(CveInventarioFisico As Integer, CveEmpresa As Integer, Optional GPO As Integer = 1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Inv_InventarioFisicoResultadosGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveInventarioFisico", SqlDbType.Int).Value = CveInventarioFisico .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@GPO", SqlDbType.Int).Value = GPO End With Try SqlAdapter.Fill(Data) diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index 71020a7ac..ef4c518c0 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -1771,7 +1771,7 @@ Public Class ClsNominas #End Region #Region "" - Public Function GetPeriodos(CveTipoPeriodo As Integer, CveEmpresa As Integer, Ejercicio As Integer, Mes As Integer, CvePeriodo As Integer) As Boolean + Public Function GetPeriodos(CveTipoPeriodo As Integer, CveEmpresa As Integer, Ejercicio As Integer, Mes As Integer, CvePeriodo As Integer, Optional CveEstatus As Integer = -1) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Nom_PeriodosGet") @@ -1782,6 +1782,8 @@ Public Class ClsNominas .Add("@Mes", SqlDbType.Int).Value = Mes .Add("@CvePeriodo", SqlDbType.Int).Value = CvePeriodo .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveEstatus", SqlDbType.Int).Value = CveEstatus + End With Try @@ -2603,8 +2605,8 @@ Public Class ClsNominas End Try Return retorno End Function - Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Boolean - Dim retorno As Boolean = False + Public Function AddMovtoPermanente(cveConcepto As Int32, cvePersonal As Int32, descripcion As String, tipoDescuento As Int32, valor As Double, vecesAplicar As Int32, montoLimite As Decimal, fechaInicioAplicacion As String, estatus As Boolean, CveCuenta As Integer) As Integer + Dim retorno As Integer = 0 DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) With SqlAdapter.SelectCommand.Parameters @@ -2618,15 +2620,16 @@ Public Class ClsNominas .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) .Add("@estatus", SqlDbType.Bit).Value = (estatus) .Add("@CveCuenta", SqlDbType.Int).Value = (CveCuenta) + .Add("@CveMovtoPermanente", SqlDbType.Int).Direction = ParameterDirection.Output End With Try SqlAdapter.Fill(Data) - retorno = True + retorno = SqlAdapter.SelectCommand.Parameters("@IDConexion").Value.ToString.ToEntero Catch sqEx As SqlException - retorno = False + retorno = -1 OnError("Ocurrió un error al agregar los movimientos permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) Catch ex As Exception - retorno = False + retorno = -1 OnError("Ocurrió un error al agregar los movimientos permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End Try Return retorno diff --git a/App_Code/LogicNominas.vb b/App_Code/LogicNominas.vb index 8762937db..35304a37d 100644 --- a/App_Code/LogicNominas.vb +++ b/App_Code/LogicNominas.vb @@ -399,13 +399,13 @@ Public Class LogicNominas ObjOtrosPagos.Add(otrp) - If Row("SATCveConcepto").ToString().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio - ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "002", ' codigo fijo - .Clave = Row("Codigo").ToString(), .Concepto = "ISR", .Importe = Row("Importe").ToString().ToDecimal}) + If Row("SATCveConcepto").ToString().ToEntero() = 7 AndAlso Row("Importe").ToString().ToDecimal() > 0 Then 'Subsidio + 'ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "002", ' codigo fijo + ' .Clave = Row("Codigo").ToString(), .Concepto = "ISR", .Importe = Row("Importe").ToString().ToDecimal}) End If - If Row("SATCveConcepto").ToString().ToEntero() = 8 AndAlso Row("Importe").ToString().ToDecimal > 0 Then 'Subsidio - ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "071", ' codigo fijo - .Clave = Row("Codigo").ToString(), .Concepto = "(Ajuste en Subsidio para el empleo (efectivamente entregado al trabajador)", .Importe = Row("Importe").ToString().ToDecimal}) + If Row("SATCveConcepto").ToString().ToEntero() = 8 AndAlso Row("Importe").ToString().ToDecimal() > 0 Then 'Subsidio + 'ObjDeducciones.Add(New CFDINominaDeducciones With {.TipoDeduccion = "071", ' codigo fijo + ' .Clave = Row("Codigo").ToString(), .Concepto = "(Ajuste en Subsidio para el empleo (efectivamente entregado al trabajador)", .Importe = Row("Importe").ToString().ToDecimal}) End If End If diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 2f4fb03ae..95863dc34 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -3433,16 +3433,16 @@ Namespace Extensiones Public Class Archivo Public Sub New() filename = "" - patch = "Temp\" + path = "Temp\" descripcion = "" End Sub Public Property filename As String - Public Property patch As String + Public Property path As String Public Property descripcion As String - Public ReadOnly Property Extencion As String + Public ReadOnly Property Extension As String Get - Return IO.Path.GetExtension(String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename)).Replace(".", "") + Return IO.Path.GetExtension(String.Format("{0}{1}{2}", If(path.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), path, filename)).Replace(".", "") End Get End Property Public ReadOnly Property filenameO As String @@ -3452,7 +3452,7 @@ Namespace Extensiones End Property Public ReadOnly Property FileUrl As String Get - Return String.Format("{0}{1}{2}", If(patch.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), patch, filename) + Return String.Format("{0}{1}{2}", If(path.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory), path, filename) End Get End Property End Class diff --git a/Ashx/E48.ashx b/Ashx/E48.ashx index a3d8a1d15..385fd6efe 100644 --- a/Ashx/E48.ashx +++ b/Ashx/E48.ashx @@ -445,7 +445,7 @@ Public Class E48 : Implements IHttpHandler, IRequiresSessionState Property GlobalDTAlmacen(CveEmpresa As Integer, Optional CveTipoAlmacen As Integer = -1, Optional CveEstatus As Integer = 1, Optional CveAlmacen As Integer = -1) As DataTable Get Dim AppNombre As String = String.Format("GlobalDTAlmacen-{0}", CveEmpresa) - Dim dttemp As DataTable + Dim dttemp As DataTable = Nothing 'sino existe, recarga los datos Dim ObjUsr As New ClsInventarios If ObjUsr.GetAlmacenes(-1, -1, CveEmpresa, -1) Then dttemp = ObjUsr.DtResultados diff --git a/Ashx/SIGFacturacionCiclica.ashx b/Ashx/SIGFacturacionCiclica.ashx index 35541349c..63fd22d9f 100644 --- a/Ashx/SIGFacturacionCiclica.ashx +++ b/Ashx/SIGFacturacionCiclica.ashx @@ -343,7 +343,7 @@ Public Class SIGFacturacionCiclica : Implements IHttpHandler, IRequiresSessionSt Dim DtDetalle As DataTable = Nothing Dim objContratos As New ClsContratos - If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero) Then + If objContratos.GetContratosDetalle(DR("CveContrato").ToString.ToEntero, UsuarioActual.CveUsuario) Then DtDetalle = objContratos.DtResultados.FiltraParametros("CveTipoPresupuesto=2") Else DtDetalle = Nothing diff --git a/Ashx/SIGWeb.ashx b/Ashx/SIGWeb.ashx index 50ad3494f..11ec214c0 100644 --- a/Ashx/SIGWeb.ashx +++ b/Ashx/SIGWeb.ashx @@ -737,7 +737,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState Dim UsaGlobal As Boolean = True '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, 166) Then UsaGlobal = False Dim objInv As New ClsInventarios diff --git a/Bancos/CargarConciliacionesBancarias.aspx.vb b/Bancos/CargarConciliacionesBancarias.aspx.vb index 8fe358133..380ccb142 100644 --- a/Bancos/CargarConciliacionesBancarias.aspx.vb +++ b/Bancos/CargarConciliacionesBancarias.aspx.vb @@ -77,60 +77,14 @@ Partial Class Bancos_CargarConciliacionesBancarias Protected Sub BtnCargaExcel_Click(sender As Object, e As EventArgs) If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargaExcel(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 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()) - 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 Private Sub CargaExcel(Ruta As String, FileName As String, Tipo As String) If Not DdlCuenta.SelectedValue.ToEntero > 0 Then diff --git a/Bancos/Devoluciones.aspx b/Bancos/Devoluciones.aspx index 5bacecb2b..2ffebf93d 100644 --- a/Bancos/Devoluciones.aspx +++ b/Bancos/Devoluciones.aspx @@ -17,7 +17,7 @@ - +
@@ -58,10 +58,18 @@
- +
- -
+
+
+
+ + + + +
+
+
@@ -180,7 +188,49 @@
-
+
+
+
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+
+
+ +
@@ -189,6 +239,9 @@
+ + +
@@ -275,18 +328,18 @@ diff --git a/Nomina/CatPeriodos.aspx.vb b/Nomina/CatPeriodos.aspx.vb index a2fff6cc9..5ce0f941e 100644 --- a/Nomina/CatPeriodos.aspx.vb +++ b/Nomina/CatPeriodos.aspx.vb @@ -7,25 +7,33 @@ Imports Extensiones Partial Class Nomina_CatPeriodos Inherits ClsPaginas - - Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load + Private Property Comando As String + Get + Return ViewState("Comando").ToString + End Get + Set(value As String) + ViewState("Comando") = value + End Set + End Property + Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then ViewState("Orden") = "" - CargaDatos() - CargaTipoPeriodo() + CargaTipoPeriodo() + cargaEjercicios() + CargaDatos() - ''Permiso Registro - 'If PermisoRegistro Then - ' LbAgregar.Enabled = True - 'Else - ' LbAgregar.Enabled = False - 'End If - End If + ''Permiso Registro + 'If PermisoRegistro Then + ' LbAgregar.Enabled = True + 'Else + ' LbAgregar.Enabled = False + 'End If + End If End Sub Public Sub CargaDatos() Dim ObjNom_Periodos As New ClsNominas - If ObjNom_Periodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, Now.Year, -1, -1) Then + If ObjNom_Periodos.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, DdlEjercicio.SelectedValue.ToEntero, -1, -1, DdlEstatus.SelectedValue.ToEntero) Then ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados @@ -42,44 +50,27 @@ Partial Class Nomina_CatPeriodos End If End Sub - Protected Sub LbAgregar_Click(sender As Object, e As System.EventArgs) Handles LbAgregar.Click - Dim ObjNom_Periodos As New ClsNominas - Dim Numero As Integer = TxtNumero.Text.Trim.ToEntero - Dim EsInicioMes As Boolean = ChkEsInicioMes.Checked - Dim EsFinMes As Boolean = ChkEsFinMes.Checked - Dim EsInicioSS As Boolean = CBool(ChkEsInicioSS.Checked) - Dim EsFinSS As Boolean = ChkEsFinSS.Checked - Dim EsInicioAño As Boolean = ChkEsInicioAño.Checked - Dim EsFinAño As Boolean = ChkEsFinAño.Checked - Dim FueCalculado As Boolean = ChkFueCalculado.Checked - Dim FechaInicio As Date = TxtFechaInicio.Text.Trim.ToDate - Dim FechaFin As Date = TxtFechaFin.Text.Trim.ToDate - Dim Mes As Integer = FechaFin.Month - Dim Ejercicio As Integer = FechaFin.Year - Dim CveTipoPeriodo As Integer = DdlTipoPeriodo.SelectedValue.ToEntero - Dim Estatus As Integer = DdlEstatus.SelectedValue.ToEntero - - If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, ChkEsInicioSS.Checked, ChkEsFinAño.Checked, ChkEsInicioAño.Checked, ChkEsFinAño.Checked, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then - - Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) - UpDatos.Update() - ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados - CargaDatos() - If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - - End If - 'ObjNom_Periodos.Dispose() - End Sub #Region " C O M B O S" Private Sub CargaTipoPeriodo() DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo + DdlTipoPeriodoAdd.DataSource = GlobalDTTipoPeriodo + DdlTipoPeriodo.DataBind() + DdlTipoPeriodoAdd.DataBind() + End Sub + + Private Sub cargaEjercicios() + Dim ObjNom_Periodos As New ClsNominas + If ObjNom_Periodos.GetEjercicios(UsuarioActual.CveEmpresa) Then + DdlEjercicio.DataSource = ObjNom_Periodos.DtResultados + Else + DdlEjercicio.DataSource = Nothing + End If + ObjNom_Periodos.Dispose() + DdlEjercicio.DataBind() + DdlEjercicio.Items.Insert(0, New ListItem("Todos", "-1")) + End Sub #End Region @@ -120,12 +111,23 @@ Partial Class Nomina_CatPeriodos e.Row.Cells(12).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(13).HorizontalAlign = HorizontalAlign.Center e.Row.Cells(14).HorizontalAlign = HorizontalAlign.Center - If e.Row.RowState = DataControlRowState.Edit OrElse e.Row.RowState = 5 Then - e.Row.FCDropDownList("DdlTipoPeriodo").DataSource = GlobalDTTipoPeriodo - e.Row.FCDropDownList("DdlTipoPeriodo").DataBind() - e.Row.FCDropDownList("DdlTipoPeriodo").SelectedValue = e.Row.DBCampo("CveTipoPeriodo") - e.Row.FCDropDownList("DdlEstatus").SelectedItem.Text = e.Row.DBCampo("Estatus") + + e.Row.FCCheckBox("ChkEsInicioMes").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioMes").ToString) + e.Row.FCCheckBox("ChkEsFinMes").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinMes").ToString) + e.Row.FCCheckBox("ChkEsInicioSS").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioSS").ToString) + e.Row.FCCheckBox("ChkEsFinSS").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinSS").ToString) + e.Row.FCCheckBox("ChkEsInicioAño").Checked = Convert.ToBoolean(e.Row.DataKey("EsInicioAño").ToString) + e.Row.FCCheckBox("ChkEsFinAño").Checked = Convert.ToBoolean(e.Row.DataKey("EsFinAño").ToString) + e.Row.FCCheckBox("ChkFueCalculado").Checked = Convert.ToBoolean(e.Row.DataKey("FueCalculado").ToString) + + If e.Row.DataKey("Estatus").ToString.ToEntero = 1 Then + e.Row.FCLiteral("LtlEstatus").Text = "Actual" + ElseIf e.Row.DataKey("Estatus").ToString.ToEntero = 2 Or e.Row.DataKey("Estatus").ToString.ToEntero = 3 Then + e.Row.FCLiteral("LtlEstatus").Text = "Cerrado" + Else + e.Row.FCLiteral("LtlEstatus").Text = "" End If + End If End Sub @@ -156,51 +158,7 @@ Partial Class Nomina_CatPeriodos End If End Sub - Protected Sub GvDatos_RowUpdating(sender As Object, e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GvDatos.RowUpdating - Dim ObjNom_Periodos As New ClsNominas - Dim Numero As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtNumero"), TextBox).Text.Trim.ToEntero - Dim EsInicioMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioMes").Checked - Dim EsFinMes As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinMes").Checked - Dim EsInicioSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioSS").Checked - Dim EsFinSS As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinSS").Checked - Dim EsInicioAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsInicioAño").Checked - Dim EsFinAño As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkEsFinAño").Checked - Dim FueCalculado As Boolean = GvDatos.Rows(e.RowIndex).FCCheckBox("ChkFueCalculado").Checked - Dim FechaInicio As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaInicio"), TextBox).Text.Trim.ToDateTime - Dim FechaFin As Date = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("TxtFechaFin"), TextBox).Text.Trim.ToDateTime - Dim Mes As Integer = FechaFin.Month - Dim Ejercicio As Integer = FechaFin.Year - Dim CveTipoPeriodo As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlTipoPeriodo"), DropDownList).SelectedValue.ToEntero - Dim Estatus As Integer = DirectCast(GvDatos.Rows(e.RowIndex).FindControl("DdlEstatus"), DropDownList).SelectedValue.ToEntero - Dim CvePeriodo As Integer = GvDatos.DataKeys(e.RowIndex).Value.ToString.ToEntero - - If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, - CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa) Then - GvDatos.EditIndex = -1 - ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) - GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados - Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) - End If - - ObjNom_Periodos.Dispose() - - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - - End Sub - - Protected Sub GvDatos_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GvDatos.RowEditing - GvDatos.EditIndex = e.NewEditIndex - If ViewState("Orden").ToString() <> String.Empty Then - CargaGrid(ViewState("Orden").ToString()) - Else - CargaGrid("") - End If - End Sub #End Region #Region "O R D E N A M I E N T O" @@ -239,4 +197,151 @@ Partial Class Nomina_CatPeriodos UpDatos.Update() End Sub #End Region + + Private Sub LnkAddPeriodo_Click(sender As Object, e As EventArgs) Handles LnkAddPeriodo.Click + LimpiarModal() + Comando = "Agregar" + lblTiulomodal.Text = "Agregar Periodo" + RegistraScript("$('#divAddPeriodo').modal('show');") + End Sub + Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregar.Click + Dim ObjNom_Periodos As New ClsNominas + + Dim EsInicioMes As Boolean + Dim EsFinMes As Boolean + Dim EsInicioSS As Boolean + Dim EsFinSS As Boolean + Dim EsInicioAño As Boolean + Dim EsFinAño As Boolean + Dim FueCalculado As Boolean + Dim Numero As Integer = TxtNumeroAdd.Text.Trim.ToEntero + Dim FechaInicio As Date = TxtFechaInicioAdd.Text.Trim.ToDate + Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim.ToDate + Dim Mes As Integer = FechaFin.Month + Dim Ejercicio As Integer = FechaFin.Year + Dim CveTipoPeriodo As Integer = DdlTipoPeriodoAdd.SelectedValue.ToEntero + Dim Estatus As Integer = DdlEstatusAdd.SelectedValue.ToEntero + Dim CvePeriodo As Integer = hdnCvePerido.Value.ToEntero + + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + If item.Selected Then EsInicioMes = True Else EsInicioMes = False + Case 2 + If item.Selected Then EsFinMes = True Else EsFinMes = False + Case 3 + If item.Selected Then EsInicioSS = True Else EsInicioSS = False + Case 4 + If item.Selected Then EsFinSS = True Else EsFinSS = False + Case 5 + If item.Selected Then EsInicioAño = True Else EsInicioAño = False + Case 6 + If item.Selected Then EsFinAño = True Else EsFinAño = False + Case 7 + If item.Selected Then FueCalculado = True Else FueCalculado = False + End Select + Next + If Comando = "Agregar" Then + + If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + + Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion) + UpDatos.Update() + ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados + CargaDatos() + If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + + End If + ElseIf Comando = "Actualizar" Then + + If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa) Then + + Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion) + UpDatos.Update() + ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa) + GlobalDTNom_Periodos = ObjNom_Periodos.DtResultados + CargaDatos() + If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then + CargaGrid(ViewState("Orden").ToString()) + Else + CargaGrid("") + End If + End If + + End If + + + RegistraScript("$('#divAddPeriodo').modal('hide');") + + 'ObjNom_Periodos.Dispose() + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As System.EventArgs) Handles BtnConsultar.Click + CargaDatos() + End Sub + Protected Sub LnkEditar_Click(sender As Object, e As EventArgs) + LimpiarModal() + Comando = "Actualizar" + lblTiulomodal.Text = "Actualizar Periodo" + Dim GvRow As GridViewRow = DirectCast((DirectCast(sender, LinkButton)).NamingContainer, GridViewRow) + DdlTipoPeriodoAdd.SelectedValueExist(GvRow.DataKey("CveTipoPeriodo").ToString.ToEntero) + TxtNumeroAdd.Text = GvRow.DataKey("Numero").ToString + TxtFechaInicioAdd.Text = GvRow.DataKey("FechaInicio").ToString + TxtFechaFinAdd.Text = GvRow.DataKey("FechaFin").ToString + DdlEstatusAdd.SelectedValueExist(GvRow.DataKey("Estatus").ToString.ToEntero) + hdnCvePerido.Value = GvRow.DataKey("CvePeriodo").ToString + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioMes").ToString) + Case 2 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinMes").ToString) + Case 3 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioSS").ToString) + Case 4 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinSS").ToString) + Case 5 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsInicioAño").ToString) + Case 6 + item.Selected = Convert.ToBoolean(GvRow.DataKey("EsFinAño").ToString) + Case 7 + item.Selected = Convert.ToBoolean(GvRow.DataKey("FueCalculado").ToString) + End Select + Next + UpModalPerido.Update() + + RegistraScript("$('#divAddPeriodo').modal('show')") + End Sub + + Private Sub LimpiarModal() + DdlTipoPeriodoAdd.SelectedValueExist(-1) + TxtNumeroAdd.Text = "" + TxtFechaInicioAdd.Text = "" + TxtFechaFinAdd.Text = "" + DdlEstatusAdd.SelectedValueExist(-1) + For Each item As ListItem In CBLchk.Items + Select Case item.Value.ToEntero() + Case 1 + item.Selected = False + Case 2 + item.Selected = False + Case 3 + item.Selected = False + Case 4 + item.Selected = False + Case 5 + item.Selected = False + Case 6 + item.Selected = False + Case 7 + item.Selected = False + End Select + Next + UpModalPerido.Update() + End Sub End Class diff --git a/Nomina/Nomina.aspx b/Nomina/Nomina.aspx index f0db650f5..1f1a1c0d9 100644 --- a/Nomina/Nomina.aspx +++ b/Nomina/Nomina.aspx @@ -1359,9 +1359,9 @@
-
- Forma de pago
- +
+ Forma de pago
+ @@ -1374,11 +1374,36 @@
- + Días extras
+
+
+
+ + Ejercicio +
+
+
+
+
+ +
+ ¿Prima Vacacional? +
+ +
+
+
+ +
+ ¿Cobrar IMSS? +
+ +
+
Actualizar Guardar diff --git a/Nomina/Nomina.aspx.cs b/Nomina/Nomina.aspx.cs index 83f8726f9..5dc327da1 100644 --- a/Nomina/Nomina.aspx.cs +++ b/Nomina/Nomina.aspx.cs @@ -13,6 +13,7 @@ using iTextSharp.text.pdf; using System.IO; using System.Data.SqlClient; using System.Configuration; +using System.Collections.Specialized; public partial class Nomina_Nomina2 : ClsPaginas { @@ -1095,7 +1096,28 @@ public partial class Nomina_Nomina2 : ClsPaginas } UpDatos.Update(); } + private void CreaObjetoEmpresa(ref Usuario UsuarioActual) + { + ClsSisEmpresas ObjEmpresa = new ClsSisEmpresas(); + if (ObjEmpresa.GetEmpresas(UsuarioActual.CveEmpresa, "-1", "-1", "-1", "-1")) + { + if (ObjEmpresa.GetEmpresasFuncionalidades(UsuarioActual.CveEmpresa)) + { + System.Data.DataTable dttmp = ObjEmpresa.DtResultados; + HybridDictionary EmpresasFuncionalidades = new HybridDictionary(); + foreach (System.Data.DataRow Row in dttmp.Rows) + EmpresasFuncionalidades.Add(Convert.ToInt32(Row["CveFuncionalidad"]), Row["Valor"].ToString()); + ObjEmpresa.Empresa.SetFuncionalidades(EmpresasFuncionalidades); + } + + UsuarioActual.Empresa = ObjEmpresa.Empresa; + } + else + { + } + ObjEmpresa.Dispose(); + } protected void LnkTimbrar_Click(object sender, EventArgs e) { LinkButton lnk = (LinkButton)sender; @@ -1104,7 +1126,13 @@ public partial class Nomina_Nomina2 : ClsPaginas int CvePersonal = gvRow.DataKey("CvePersonal").ToEntero(); int CveNomina = gvRow.DataKey("CveNomina").ToEntero(); LogicNominas lognom = new LogicNominas(); - + Usuario UsuarioActual = null; + using(ClsSisUsuarios ObjUsuario= new ClsSisUsuarios()) + { + UsuarioActual =ObjUsuario.ValidaUsuario("jcaudillo", Encripta("45makako45"), "-1", 1); + } + CreaObjetoEmpresa(ref UsuarioActual); + UsuarioActual.CveEmpresa = this.UsuarioActual.CveEmpresa; string Msg = lognom.TimbrarNomina(CveNomina, CvePersonal, CvePeriodo, UsuarioActual); if (Msg != null && Msg.Length > 0) { Alert(Msg, TipoMensaje.MsgAdvertencia); } @@ -4558,8 +4586,7 @@ public partial class Nomina_Nomina2 : ClsPaginas bool Continuar; using (ClsNominas ObjMovt = new ClsNominas()) { - Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta); - + Continuar = ObjMovt.AddMovtoPermanente(cveConcepto, SRCvePersonal, descripcion, tipoDescuento, valor, vecesAplicar, montoLimite, fechaInicioAplicacion, estatus, CveCuenta) > 0; } if (Continuar) { diff --git a/OC/OC.aspx b/OC/OC.aspx index 59056f36c..53efa69e3 100644 --- a/OC/OC.aspx +++ b/OC/OC.aspx @@ -2747,7 +2747,7 @@

-
+
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info">
@@ -2781,7 +2781,7 @@ - + diff --git a/OC/OC.aspx.vb b/OC/OC.aspx.vb index d27decf12..92af42596 100644 --- a/OC/OC.aspx.vb +++ b/OC/OC.aspx.vb @@ -4,6 +4,7 @@ Imports System.Data Imports Extensiones Imports System.IO Imports GemBox.Spreadsheet +Imports Newtonsoft.Json Partial Class OC Inherits ClsPaginas @@ -2095,141 +2096,122 @@ Partial Class OC End If 'Valida cantidad en contrato - Dim ObjContratos As New ClsContratos + Dim TieneError As Boolean = False - Dim Mensaje As String = "" - Dim dttemp As DataTable = Nothing 'GlobalDTContratos(UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString)) - If dttemp IsNot Nothing AndAlso dttemp.Rows.Count > 0 Then - Dim drContrato As DataRow = dttemp.Rows(0) - If ObjContratos.GetContratosDetalle(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - Dim dtContratodetalle As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlP2.SelectedValue.ToString)) - If dtContratodetalle IsNot Nothing AndAlso dtContratodetalle.Rows.Count > 0 Then - Dim drContratoDetalle As DataRow = dtContratodetalle(0) - If Convert.ToBoolean(drContratoDetalle("LimitarCantidad")) Then - If ObjContratos.GetReporteContratosAvancesDetalleControl(drContrato("CveContrato").ToString.ToEntero, UsuarioActual.CveEmpresa) Then - Dim dtContratodetalleControl As DataTable = ObjContratos.DtResultados.FiltraParametros(String.Format("CvePS = {0}", DdlP2.SelectedValue.ToString)) - If dtContratodetalleControl IsNot Nothing AndAlso dtContratodetalleControl.Rows.Count > 0 Then - Dim drContratoDetalleControl As DataRow = dtContratodetalleControl(0) - If TxtCant.Text.Trim.ToDouble > drContratoDetalleControl("FaltanteCantidad").ToString.ToDouble Then - Mensaje = String.Format("La cantidad del Producto/Servicio debe ser menor o igual a {0}", drContratoDetalleControl("FaltanteCantidad").ToString) - TieneError = True - End If - Else - Mensaje = "Este producto no pertence al contrato seleccionado" - TieneError = True - End If - Else - Mensaje = "Error al consultar el contrato" - End If - End If - Else - Mensaje = "Este producto no pertence al contrato seleccionado" - TieneError = True - End If - Else - Mensaje = "Error al consultar el contrato" + Dim dttemp As New DataTable ' GlobalDTContratos().FiltraParametros(String.Format("CveSubProyecto = {0}", DdlSubProyecto.SelectedValue.ToString)) + dttemp.Columns.Add("CveSubProyecto", GetType(Integer)) + dttemp.Columns.Add("CvePS", GetType(Integer)) + dttemp.Columns.Add("Cantidad", GetType(Decimal)) + dttemp.Columns.Add("PU", GetType(Decimal)) + + Dim DrPSValidar = dttemp.NewRow + DrPSValidar("CveSubProyecto") = DdlSubProyecto.SelectedValue.ToString.ToEntero + DrPSValidar("CvePS") = DdlP2.SelectedValue.ToString.ToEntero + DrPSValidar("Cantidad") = TxtCant.Text.Trim.ToDecimal + DrPSValidar("PU") = txtPrecioUnitario.Text.Trim.ToDecimal + dttemp.Rows.Add(DrPSValidar) + If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then + Dim dtPSInvalidos As String = ValidarPSContrato(dttemp) + If dtPSInvalidos <> "" Then + Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) + Exit Sub End If End If - If Not TieneError Then - ObjContratos.Dispose() - If DtDetalle IsNot Nothing Then - Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("") - If DrPS Is Nothing Then - Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) - Exit Sub - End If - If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then - Dim ObjCon As New ClsContratos - Dim CvePresupuesto As Integer = 0 - Dim Autorizado As Double = 0 - Dim Ejercido As Double = 0 - If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then - If ObjCon.DtResultados.Rows.Count > 0 Then - CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero - If CvePresupuesto > 0 Then - If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then - If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then - Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble - End If + If DtDetalle IsNot Nothing Then + Dim DrPS = GlobalDTPS(CveEmpresaActual, CvePS:=DdlP2.SelectedValue.ToEntero).FiltroPrimero("") + If DrPS Is Nothing Then + Alert("Ocurrió un error al cargar la información del producto. Por favor vuelva a intentar.", TipoMensaje.MsgAdvertencia) + Exit Sub + End If + + If UsuarioActual.Empresa.Funcionalidad(532) = "1" Then + Dim ObjCon As New ClsContratos + Dim CvePresupuesto As Integer = 0 + Dim Autorizado As Double = 0 + Dim Ejercido As Double = 0 + If ObjCon.GetPresupuestos(-1, "-1", DdlSubProyecto.SelectedValue.ToEntero, 2, -1, UsuarioActual.CveEmpresa) Then + If ObjCon.DtResultados.Rows.Count > 0 Then + CvePresupuesto = ObjCon.DtResultados.Rows(0)("CvePresupuesto").ToString.ToEntero + If CvePresupuesto > 0 Then + If ObjCon.GetPresupuestosDetalle(CvePresupuesto, -1, UsuarioActual.CveEmpresa) Then + If ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows.Count > 0 Then + Autorizado = ObjCon.DtResultados.FiltraParametros($"CveClasificacion = {DdlClasificacion.SelectedValue.ToEntero} AND Importe > 0").Rows(0)("Importe").ToString.ToDouble End If - If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, - DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then - If ObjCon.DtResultados.Rows.Count > 0 Then - Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble - End If + End If + If ObjCon.GetPresupuestosRep(CvePresupuesto, -1, 1, $"01/09/{DateTime.Now.Year - 1}".ToDate, Now, UsuarioActual.CveEmpresa, DdlProyecto.SelectedValue.ToEntero, + DdlSubProyecto.SelectedValue.ToEntero, UsuarioActual.CveUsuario, DdlClasificacion.SelectedValue.ToEntero) Then + If ObjCon.DtResultados.Rows.Count > 0 Then + Ejercido = ObjCon.DtResultados.Rows(0)("Ejercido").ToString.ToDouble End If End If End If End If - ObjCon.Dispose() + End If + ObjCon.Dispose() - If CvePresupuesto > 0 And Autorizado > 0 Then - Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado - If Diferencia > 0 Then - Alert($"No hay presupuesto disponible en el subproyecto {DdlSubProyecto.SelectedItem.Text} y la clasificación {DdlClasificacion.SelectedItem.Text} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) - Exit Sub - End If + If CvePresupuesto > 0 And Autorizado > 0 Then + Dim Diferencia As Double = (Ejercido + If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0)) - Autorizado + If Diferencia > 0 Then + Alert($"No hay presupuesto disponible en el subproyecto {DdlSubProyecto.SelectedItem.Text} y la clasificación {DdlClasificacion.SelectedItem.Text} se excede por {Diferencia.FormatoNumero}", TipoMensaje.MsgAdvertencia) + Exit Sub End If End If - - - Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble - Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble - Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble - - 'If IvaPS = -1 Then 'IVA DE LA SUCURSAL - ' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble - 'End If - - Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble - Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) - Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero) - Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero) - Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto") - Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto") - Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0) - Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0) - Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 - - 'Si es Proveedor Extranjero el IVA es 0% - If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then - IvaPS = 0 - End If - - AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS, - CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto, - DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, - IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero, - DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text) - - TxtCant.Text = "" - CboUnidadMedida.SelectedIndex = 0 - DdlClasificacion.SelectedIndex = 0 - DdlP2.SelectedValue = "-1" - DdlP2.SelectedText = "Seleccione un producto o servicio" - txtPrecioUnitario.Text = "" - TxtObsPS.Text = "" - HdnCveActivoFijo.Value = "" - LblCodigo.Text = "" - LblCvePOA.Text = "" - TxtCant.Focus() - - Total.Text = "0.00" - TxtDescuentoAdd.Text = "0.00" - End If - CargaSuperior() - CargaDatosDetalles() - UPPDetalle.Update() - Else - Alert(Mensaje, TipoMensaje.MsgAdvertencia) + Dim RetISR As Double = DrPS("RetISR").ToString.ToDouble + Dim RetIVA As Double = DrPS("RetIVA").ToString.ToDouble + Dim IvaPS As Double = DrPS("IVA").ToString.ToDouble + + 'If IvaPS = -1 Then 'IVA DE LA SUCURSAL + ' IvaPS = GlobalDTSubProyectos(-1, DdlSubProyecto.SelectedValue.ToEntero).FiltroPrimeroValor("IVA").ToDouble + 'End If + + Dim IEPSPS As Double = DrPS("IEPSPorcentaje").ToString.ToDouble + Dim IEPSPSIVA As Double = If(DrPS("IEPSGrabaIVA").ToString = "True", DrPS("IEPSPorcentaje").ToString.ToDouble, 0) + Dim IdCuentaPorEjercer As Integer = If(HdnCveCuentaPorEjercer.Value = String.Empty, -1, HdnCveCuentaPorEjercer.Value.ToEntero) + Dim IdCuentaComprometido As Integer = If(HdnCveCuentaComprometido.Value = String.Empty, -1, HdnCveCuentaComprometido.Value.ToEntero) + Dim Proyecto As String = If(DdlProyecto.SelectedValue.ToString.ToEntero > 0, DdlProyecto.SelectedItem.Text, "Sin Proyecto") + Dim SubProyecto As String = If(DdlSubProyecto.SelectedValue.ToString.ToEntero > 0, DdlSubProyecto.SelectedItem.Text, "Sin SubProyecto") + Dim TotalPS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, (txtPrecioUnitario.Text.ToDouble * TxtCant.Text.ToDouble) - TxtDescuentoAdd.Text.ToDouble, 0) + Dim ImportePS As Double = If(txtPrecioUnitario.Text.ToDouble > 0, txtPrecioUnitario.Text.ToDouble, 0) + Dim CveOrdenCompraDetalle As Integer = DtDetalle.MAX("CveOrdenCompraDetalle").ToEntero + 100 + + 'Si es Proveedor Extranjero el IVA es 0% + If GlobalDTCompProveedores(CveEmpresaActual).FiltraParametros($"CveProveedor = {DdlProveedores.SelectedValue} AND RFC = 'XEXX010101000'").Rows.Count = 1 Then + IvaPS = 0 + End If + + AddPS(TxtCant.Text, DdlP2.SelectedValue.ToEntero, DdlP2.SelectedText, TxtObsPS.Text, ImportePS, TxtDescuentoAdd.Text.ToDouble, TotalPS, + CboUnidadMedida.SelectedValue.ToEntero, IvaPS, IEPSPS, IEPSPSIVA, DdlClasificacion.SelectedValue.ToEntero, CboUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedItem.Text, DdlProyecto.SelectedValue.ToEntero, Proyecto, + DdlSubProyecto.SelectedValue.ToEntero, SubProyecto, LblCodigo.Text, HdnCveActivoFijo.Value.ToEntero, 0, CveOrdenCompraDetalle, CveOrdenCompra, IdCuentaPorEjercer, + IdCuentaComprometido, DdlACGeneral1.SelectedValue.ToEntero, DdlACGeneral2.SelectedValue.ToEntero, DdlACGeneral3.SelectedValue.ToEntero, DdlACGeneral4.SelectedValue.ToEntero, + DdlACGeneral5.SelectedValue.ToEntero, RetIVA, RetISR, CveCultivoCuadroDetalle:=DdlCultivosCuadro.SelectedValue.ToEntero, Cuadro:=DdlCultivosCuadro.SelectedItem.Text) + + TxtCant.Text = "" + CboUnidadMedida.SelectedIndex = 0 + DdlClasificacion.SelectedIndex = 0 + DdlP2.SelectedValue = "-1" + DdlP2.SelectedText = "Seleccione un producto o servicio" + txtPrecioUnitario.Text = "" + TxtObsPS.Text = "" + HdnCveActivoFijo.Value = "" + LblCodigo.Text = "" + LblCvePOA.Text = "" + TxtCant.Focus() + + Total.Text = "0.00" + TxtDescuentoAdd.Text = "0.00" + End If - ObjContratos.Dispose() + + CargaSuperior() + CargaDatosDetalles() + + UPPDetalle.Update() End Sub Private Sub AddPS(Cantidad As String, CvePS As Integer, PS As String, Observaciones As String, Importe As Double, Descuento As Double, Total As Double, CveUnidadMedida As Integer, IVAPS As Double, IEPSPS As Double, IEPSPSIVA As Double, CveClasificacion As Integer, UM As String, Clasificacion As String, CveProyecto As Integer, Proyecto As String, CveSubProyecto As Integer, SubProyecto As String, CodigoAF As String, CveActivoFijo As Integer, TipoDato As Integer, @@ -2505,6 +2487,15 @@ Partial Class OC TieneError = True End If + If UsuarioActual.Empresa.Funcionalidad(545) = "1" Then + Dim dtPSInvalidos As String = ValidarPSContrato(DtDetalle.FiltraParametros("", "", {"CveSubProyecto", "CvePS", "Cantidad", "PU"})) + If dtPSInvalidos <> "" Then + Alert(dtPSInvalidos, TipoMensaje.MsgAdvertencia) + TieneError = True + End If + End If + + Return TieneError End Function Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs) Handles BtnGuardar.Click @@ -6369,8 +6360,8 @@ Partial Class OC 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 = AppDomain.CurrentDomain.BaseDirectory & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivo(Directorio, file.filename, Tipo) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) @@ -7746,7 +7737,7 @@ Partial Class OC Protected Sub BtnCargaExcelCot_Click(sender As Object, e As EventArgs) If TxtExcelCot.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcelCot.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivoCot(Directorio, file.filename) CargaCotizaciones(CveOrdenCompra) @@ -8522,8 +8513,9 @@ Partial Class OC CargaSuperior() CargaDatosDetalles() - - RegistraScript("$('#DivmodalConmtrato').modal('hide')") + If Not ChkContinualAgregandoControl.Checked Then + RegistraScript("$('#DivmodalConmtrato').modal('hide')") + End If UPPDetalle.Update() @@ -8544,4 +8536,40 @@ Partial Class OC DdlCultivosCuadroEdit.SelectedValueExist(CveCultivoCuadroDetalle) End Sub + + Private Function ValidarPSContrato(DtPS As DataTable) As String + Dim Retorno As String = "" + Dim objContratos As New ClsContratos + Dim TempPS As String = JsonConvert.SerializeObject(DtPS).ToString + Dim MensajeProducto As String = "" + Dim MensajeCantidad As String = "" + Dim MensajeImporte As String = "" + If objContratos.ValidaPSContrato(TempPS) Then + If objContratos.DtResultados.Rows.Count > 0 Then + MensajeProducto = "Los siguientes productos no pertenece al contrato seleccionado: " + MensajeCantidad = "Los siguientes productos sobrepasan la cantidad faltante del contrato seleccionado: " + MensajeImporte = "Los siguientes productos sobrepasan los importes faltantes del contrato seleccionado: " + For Each dr As DataRow In objContratos.DtResultados.Rows + If dr("ProductoNoContratado").ToString.ToEntero = 1 Then + MensajeProducto += String.Format("
{0}", dr("PS")) + ElseIf dr("CantidadSobrePasada").ToString.ToEntero = 1 Then + MensajeCantidad += String.Format("
{0} - Cantidad maxima: {1}", dr("PS"), dr("FaltanteCantidad")) + ElseIf dr("ImporteSobrePasado").ToString.ToEntero = 1 Then + MensajeImporte += String.Format("
{0} - Importe maximo: {1}", dr("PS"), dr("FaltanteImporte")) + End If + Next + End If + End If + + If MensajeProducto.Length <> 64 Then + Retorno = MensajeProducto + ElseIf MensajeCantidad.Length <> 84 Then + Retorno = MensajeCantidad + ElseIf MensajeImporte.Length <> 86 Then + Retorno = MensajeImporte + End If + + Return Retorno + + End Function End Class diff --git a/OI/MinutaDetalle.aspx.cs b/OI/MinutaDetalle.aspx.cs index e6391f1ed..8c129d4e0 100644 --- a/OI/MinutaDetalle.aspx.cs +++ b/OI/MinutaDetalle.aspx.cs @@ -335,8 +335,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } bool Continuar = true; @@ -490,8 +490,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtTareaArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -614,8 +614,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in TxtAgendaArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -709,8 +709,8 @@ public partial class OI_MinutaDetalle : ClsPaginas foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } using (ClsOIEventos objoi = new ClsOIEventos()) { diff --git a/OI/Proyecto.aspx.cs b/OI/Proyecto.aspx.cs index 2e6630d24..24749ecf1 100644 --- a/OI/Proyecto.aspx.cs +++ b/OI/Proyecto.aspx.cs @@ -134,8 +134,8 @@ public partial class OI_Proyecto : ClsPaginas //foreach (Archivo item in TxtArchivo.getfiles().Archivos) //{ // archivoname = item.filenameO; - // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename); + // ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.path, item.filename); //} diff --git a/OI/RepProyectos.aspx.cs b/OI/RepProyectos.aspx.cs index 640866951..4e142a81e 100644 --- a/OI/RepProyectos.aspx.cs +++ b/OI/RepProyectos.aspx.cs @@ -100,8 +100,8 @@ public partial class OI_RepProyectos : ClsPaginas //foreach (Archivo item in TxtArchivo.getfiles().Archivos) //{ // archivoname = item.filenameO; - // ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.patch, item.filename); + // ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + // rutaarchivoOri = string.Format("{0}{1}{2}", ModExtensiones.DirectorioBaseEmpresas, item.path, item.filename); //} diff --git a/OI/TareaDetalle.aspx.cs b/OI/TareaDetalle.aspx.cs index 58b263e8c..ea868bc5d 100644 --- a/OI/TareaDetalle.aspx.cs +++ b/OI/TareaDetalle.aspx.cs @@ -715,8 +715,8 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } @@ -1118,8 +1118,8 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in Txtfilecomentario.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } using (ClsOIEventos objoi = new ClsOIEventos()) { @@ -1209,8 +1209,8 @@ public partial class OI_TareaDetalle : ClsPaginas foreach (Archivo item in txtActualizarArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } string ruta = string.Format("{0}OIFiles\\", UsuarioActual.Empresa.Ruta); if (!System.IO.Directory.Exists(ruta)) diff --git a/PyME/Sistemas/WizardRegistro.aspx.vb b/PyME/Sistemas/WizardRegistro.aspx.vb index f1e9aaa76..ca9193bc0 100644 --- a/PyME/Sistemas/WizardRegistro.aspx.vb +++ b/PyME/Sistemas/WizardRegistro.aspx.vb @@ -493,8 +493,8 @@ Partial Class Sistemas_WizardRegistro Case 4 If TxtFormatoFactura.getfiles().Archivos().Count > 0 Then Dim FormatoFactura As Archivo = TxtFormatoFactura.getfiles().Archivos(0) - Dim PathFormato = $"{UsuarioActual.Empresa.Ruta}Formatos\" - Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extencion) + Dim PathFormato = $"{ModExtensiones.DirectorioBaseEmpresas}Empresas\{CveEmpresa}\Formatos\" + Dim dirFormato As String = String.Format("{0}\Factura.{1}", PathFormato, FormatoFactura.Extension) If File.Exists(dirFormato) Then My.Computer.FileSystem.DeleteFile(dirFormato) End If @@ -1940,7 +1940,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddUnidadesMedida.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddUnidadesMedida.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarExcelUnidadesMedida(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2433,7 +2433,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddProveedor.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddProveedor.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoProveedor(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2615,7 +2615,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddClientes.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddClientes.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoCliente(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) @@ -2807,7 +2807,7 @@ Partial Class Sistemas_WizardRegistro If TxtAddFactura.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtAddFactura.getfiles().Archivos(0) Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & file.patch - Dim Tipo As String = If(file.Extencion.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") + Dim Tipo As String = If(file.Extension.Contiene("xlsx", "xlsx", "xlsm", "xlsb"), "EXCEL", "CSV") CargarArchivoFactura(Directorio, file.filename, Tipo) Else Alert("No existe el archivo.Favor de subir un archivo csv o excel a la plataforma", TipoMensaje.MsgError) diff --git a/RH/ActualizacionMasiva.aspx.vb b/RH/ActualizacionMasiva.aspx.vb index 800133704..4251563ed 100644 --- a/RH/ActualizacionMasiva.aspx.vb +++ b/RH/ActualizacionMasiva.aspx.vb @@ -327,7 +327,7 @@ Partial Class RH_ActualizacionMasiva End If End Using If continuar Then - Dim FileExtension As String = fileItem.Extencion.ToUpper() + Dim FileExtension As String = fileItem.Extension.ToUpper() If FileExtension = "XLS" Or FileExtension = "XLSX" Or FileExtension = "CSV" Then Else diff --git a/Sistemas/Librerias.aspx b/Sistemas/Librerias.aspx index 2477770a8..068e6a572 100644 --- a/Sistemas/Librerias.aspx +++ b/Sistemas/Librerias.aspx @@ -195,7 +195,7 @@ color:blue;mso-ansi-language:EN-US">:TextBox>

-

 

'.VB

                'obtiene el listado de archivos cargados

                Dim Filesgral As List(Of Archivo) = TxtLogo.getfiles().Archivos

                'este if se puede reemplazar por un foreach en caso de que se dee agregar mas de un archivo

                If Filesgral.Count > 0 Then

                    Dim fileItem As Archivo = Filesgral(0)

                    Dim Path As String = HttpContext.Current.Request.ApplicationPath

                    Path = HttpContext.Current.Request.MapPath(Path)

                    Path = String.Format("{0}Imagenes\Empresas\", Path)

                    'aqui se elimina el archivo anterior en este caso particular se esta actualizando el archivo y para que no exista conflicto al reemplazar el archvio

                    If Not Directory.Exists(Path) Then

                        Directory.CreateDirectory(Path)

                    End If

                    'para poner el nombre del archivo esto te puede ayudar

                    'fileItem.filenameO : Nombre original del archivo sin tick

                    'fileItem.Extencion : extension del archivo

                    'fileItem.filename : este es el nombre del archivo con un tick el cual lo debe har unico en el servidor

                    Path = String.Format("{0}Logo_{1}.png", Path, idEmpresa)

                    If File.Exists(Path) Then

                        File.Delete(Path)

                    End If

                    'este es el paso  mas importante aqui se mueve el archivo de la carpeta temporal a nuestra carpeta deseada. fileItem.FileUrl es la ubicacion del archivo temporal en nuestro servidor

                    My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)

                End If

                'no olvides limpiar el textvox para que no tenga archivos cargados cuando lo vuelvan a usar

                TxtLogo.Text = ""

+

 

'.VB

                'obtiene el listado de archivos cargados

                Dim Filesgral As List(Of Archivo) = TxtLogo.getfiles().Archivos

                'este if se puede reemplazar por un foreach en caso de que se dee agregar mas de un archivo

                If Filesgral.Count > 0 Then

                    Dim fileItem As Archivo = Filesgral(0)

                    Dim Path As String = HttpContext.Current.Request.ApplicationPath

                    Path = HttpContext.Current.Request.MapPath(Path)

                    Path = String.Format("{0}Imagenes\Empresas\", Path)

                    'aqui se elimina el archivo anterior en este caso particular se esta actualizando el archivo y para que no exista conflicto al reemplazar el archvio

                    If Not Directory.Exists(Path) Then

                        Directory.CreateDirectory(Path)

                    End If

                    'para poner el nombre del archivo esto te puede ayudar

                    'fileItem.filenameO : Nombre original del archivo sin tick

                    'fileItem.Extension : extension del archivo

                    'fileItem.filename : este es el nombre del archivo con un tick el cual lo debe har unico en el servidor

                    Path = String.Format("{0}Logo_{1}.png", Path, idEmpresa)

                    If File.Exists(Path) Then

                        File.Delete(Path)

                    End If

                    'este es el paso  mas importante aqui se mueve el archivo de la carpeta temporal a nuestra carpeta deseada. fileItem.FileUrl es la ubicacion del archivo temporal en nuestro servidor

                    My.Computer.FileSystem.MoveFile(fileItem.FileUrl, Path)

                End If

                'no olvides limpiar el textvox para que no tenga archivos cargados cuando lo vuelvan a usar

                TxtLogo.Text = ""

#ADS number diff --git a/UserControl/TareaNueva.ascx.cs b/UserControl/TareaNueva.ascx.cs index b9640b9cc..1ce591d19 100644 --- a/UserControl/TareaNueva.ascx.cs +++ b/UserControl/TareaNueva.ascx.cs @@ -177,8 +177,8 @@ public partial class UserControl_TareaNueva : System.Web.UI.UserControl foreach (Archivo item in TxtArchivo.getfiles().Archivos) { archivoname = item.filenameO; - ArchivoExtencion = string.Format("{0}{1}", (item.Extencion.Length > 0 ? "." : ""), item.Extencion); - rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.patch, item.filename); + ArchivoExtencion = string.Format("{0}{1}", (item.Extension.Length > 0 ? "." : ""), item.Extension); + rutaarchivoOri = string.Format("{0}{1}{2}", AppDomain.CurrentDomain.BaseDirectory, item.path, item.filename); } diff --git a/Ventas/ActualizarPrecios.aspx.vb b/Ventas/ActualizarPrecios.aspx.vb index ca172e5ec..d3a8d25d2 100644 --- a/Ventas/ActualizarPrecios.aspx.vb +++ b/Ventas/ActualizarPrecios.aspx.vb @@ -389,7 +389,7 @@ Partial Class Ventas_ActualizarPrecios If TxtExcel.getfiles().Archivos.Count > 0 Then Dim file As Archivo = TxtExcel.getfiles().Archivos(0) - Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivo(Directorio, file.filename) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/Ventas/CatMetasVendedores.aspx b/Ventas/CatMetasVendedores.aspx index d02cb68a3..e502470b9 100644 --- a/Ventas/CatMetasVendedores.aspx +++ b/Ventas/CatMetasVendedores.aspx @@ -74,7 +74,7 @@ - + @@ -84,7 +84,7 @@ - + diff --git a/Ventas/CatMetasVendedores.aspx.vb b/Ventas/CatMetasVendedores.aspx.vb index db8d9ff24..d8871551c 100644 --- a/Ventas/CatMetasVendedores.aspx.vb +++ b/Ventas/CatMetasVendedores.aspx.vb @@ -221,7 +221,7 @@ Partial Class CatMetasVendedores Private 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 = AppDomain.CurrentDomain.BaseDirectory & file.patch + Dim Directorio As String = AppDomain.CurrentDomain.BaseDirectory & file.path CargarArchivo(Directorio, file.filename) Else Alert("No existe el archivo. Favor de subir un archivo excel a la plataforma.", TipoMensaje.MsgError) diff --git a/asmx/WSGPSApp.asmx b/asmx/WSGPSApp.asmx index 5a00618b0..3249864b7 100644 --- a/asmx/WSGPSApp.asmx +++ b/asmx/WSGPSApp.asmx @@ -8,7 +8,6 @@ Imports System.Data Imports Extensiones Imports Newtonsoft.Json Imports Newtonsoft.Json.Linq -Imports WebServiceApp Imports System.Globalization Imports System.Web.Script.Services Imports System.Web.Script.Serialization diff --git a/reporteador.aspx.cs b/reporteador.aspx.cs index 5b0a79f08..a6d229997 100644 --- a/reporteador.aspx.cs +++ b/reporteador.aspx.cs @@ -16,10 +16,6 @@ public partial class reporteador : ClsPaginas return ViewState["rutaArchivo"].ToString(); } set { ViewState["rutaArchivo"] = value; } - } - protected void Page_PreInit(object sender, EventArgs e) - { - } protected void Page_Load(object sender, EventArgs e) { diff --git a/vwd.webinfo b/vwd.webinfo index 5384d515a..d3ade46a8 100644 --- a/vwd.webinfo +++ b/vwd.webinfo @@ -272,6 +272,14 @@ + + + + + + + +