diff --git a/Acumuladores/EntradasUsados.aspx b/Acumuladores/EntradasUsados.aspx deleted file mode 100644 index b7c2dd864..000000000 --- a/Acumuladores/EntradasUsados.aspx +++ /dev/null @@ -1,19 +0,0 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="EntradasUsados.aspx.vb" Inherits="Acumuladores_EntradasUsados" %> - - - - - - - - - - - - - - - - - - diff --git a/Acumuladores/EntradasUsados.aspx.vb b/Acumuladores/EntradasUsados.aspx.vb deleted file mode 100644 index 3a0e4f59c..000000000 --- a/Acumuladores/EntradasUsados.aspx.vb +++ /dev/null @@ -1,5 +0,0 @@ - -Partial Class Acumuladores_EntradasUsados - Inherits System.Web.UI.Page - -End Class diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx b/Acumuladores/EntradasUsadosResumenRep.aspx new file mode 100644 index 000000000..9399901c2 --- /dev/null +++ b/Acumuladores/EntradasUsadosResumenRep.aspx @@ -0,0 +1,104 @@ +<%@ Page Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="EntradasUsadosResumenRep.aspx.vb" Inherits="Acumuladores_RepEntradasUsados" %> + + + + + + + Reporte de Usados + + + + +
  • + +
  • +
    + + + +
    +
    + + + + + + + +
    +
    +
    + + +
    +
    +
    + +
    + +
    + +
    +
    + + + + +
    + + + + + + +
    + +
    +
    + + + + +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + diff --git a/Acumuladores/EntradasUsadosResumenRep.aspx.vb b/Acumuladores/EntradasUsadosResumenRep.aspx.vb new file mode 100644 index 000000000..8e8489b85 --- /dev/null +++ b/Acumuladores/EntradasUsadosResumenRep.aspx.vb @@ -0,0 +1,66 @@ +Imports System.Data +Imports Extensiones +Imports Microsoft.Reporting.WebForms + +Partial Class Acumuladores_RepEntradasUsados + Inherits ClsPaginas + + Private DiasSemana(7) As String + Private Meses(12) As String + + Private Property DatosEntradasUsados() As DataTable + Get + Return CType(ViewState("DatosEntradasUsados"), DataTable) + End Get + Set(value As DataTable) + ViewState("DatosEntradasUsados") = value + End Set + End Property + + Protected Sub Page_Load() Handles Me.Load + If Not IsPostBack Then + txtFechaI.Text = Today.AddDays((-1) * (Today.Day - 1)) + txtFechaF.Text = Today + CargarDatos() + End If + End Sub + + Protected Sub CargarDatos() + DdlAlmacenes.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1) + DdlAlmacenes.DataBind() + End Sub + + Protected Sub BtnConsultar_Click(sender As Object, e As EventArgs) + Dim ObjAcum As New ClsAcumuladores + + If ObjAcum.EntradasUsadosGet(UsuarioActual.CveEmpresa, DdlAlmacenes.SelectedValue.ToEntero, txtFechaI.Text, txtFechaF.Text) Then + GvAcum.DataSource = ObjAcum.DtResultados + DatosEntradasUsados = ObjAcum.DtResultados + + End If + ObjAcum.Dispose() + GvAcum.DataBind() + + End Sub + + Protected Sub BtnImprimir_Click(sender As Object, e As EventArgs) + + + Dim Dia As String = {"lunes", "martes", "miércoles", "jueves", "viernes", "sábado", "domingo"}(If((Weekday(Today) - 2) = -1, 7, Weekday(Today) - 2)) + Dim Mes As String = {"enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"}(Month(Today) - 1) + + Dim FechaConFormato As String = String.Format("{0}, {1} de {2} de {3}", Dia, Month(Today), Mes, Year(Today)) + + Dim params As New List(Of ReportParameter) + + params.Add(New ReportParameter("Direccion", "asdfasdfasdf")) + params.Add(New ReportParameter("FechaConFormato", FechaConFormato)) + params.Add(New ReportParameter("FechaInicial", txtFechaI.Text)) + params.Add(New ReportParameter("FechaFinal", txtFechaF.Text)) + + Dim rds As New ReportDataSource With {.Name = "DataSet1", .Value = DatosEntradasUsados} + + ImprimirPDF(String.Format("Empresas/{0}/Formatos/RepEntradasUsados2.rdlc", UsuarioActual.CveEmpresa), DatosEntradasUsados, params, "prueba", "PDF") + + End Sub +End Class diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx b/Acumuladores/RepEntradasUsadosClientes.aspx new file mode 100644 index 000000000..3a55af4e0 --- /dev/null +++ b/Acumuladores/RepEntradasUsadosClientes.aspx @@ -0,0 +1,65 @@ +<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="RepEntradasUsadosClientes.aspx.vb" Inherits="Acumuladores_RepEntradasUsadosClientes" %> + + + + + + + + + + + + + + + + +
    +
    +
    + + "> + +
    +
    +
    Almacen:
    +
    + +
    +
    +
    Fecha Inicio:
    +
    +
    + + + + +
    + + +
    +
    Fecha Fin:
    +
    +
    + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    + +
    + + + diff --git a/Acumuladores/RepEntradasUsadosClientes.aspx.vb b/Acumuladores/RepEntradasUsadosClientes.aspx.vb new file mode 100644 index 000000000..29d60c703 --- /dev/null +++ b/Acumuladores/RepEntradasUsadosClientes.aspx.vb @@ -0,0 +1,48 @@ +Imports Extensiones +Imports System + +Partial Class Acumuladores_RepEntradasUsadosClientes + Inherits ClsPaginas + + Private Sub Acumuladores_EntradasUsados_Load(sender As Object, e As EventArgs) Handles Me.Load + + If Not Page.IsPostBack Then + CargaCombos() + End If + + End Sub + + Private Sub BtnConsultar_Click(sender As Object, e As EventArgs) Handles BtnConsultar.Click + CargaDatos() + + End Sub + + Public Sub CargaCombos() + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacen.DataBind() + DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + + TxtFechaI.text = now.Firstdayofmonth + txtfechaf.text = now.toshortdatestring + + End Sub + + Private Sub CargaDatos() + + Dim FechaI, FechaF As Date + FechaI = If(IsDate(TxtFechaI.Text.Trim()), TxtFechaI.Text.Trim.todate, minfecha) + FechaF = If(IsDate(TxtFechaF.Text.Trim()), TxtFechaF.Text.Trim.todate, maxfecha) + + Dim CveAlmacen As Integer = If(DdlAlmacen.SelectedValue = "", "-1", DdlAlmacen.SelectedValue).ToString.toentero + + Dim Acum As New ClsAcumuladores + + If Acum.EntradasUsadosClientesRep(CveAlmacen, FechaI, FechaF, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + GvDatos.datasource = Acum.DtResultados + End If + + Acum.Dispose() + GvDatos.databind + + End Sub +End Class diff --git a/App_Code/ClsAcumuladores.vb b/App_Code/ClsAcumuladores.vb index 423775dc4..870e809fa 100644 --- a/App_Code/ClsAcumuladores.vb +++ b/App_Code/ClsAcumuladores.vb @@ -243,12 +243,38 @@ Public Class ClsAcumuladores End Try Return Retorno - End Function - + End Function + + Public Function EntradasUsadosGet(CveEmpresa As Integer, CveAlmacen As Integer, FechaInicial As Date, FechaFinal As Date) As Boolean + Dim retorno As Boolean = False + + SqlDataAdapter("PA_Acum_EntradasUsadosResumenRep") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen + .Add("@FechaInicial", SqlDbType.Date).Value = FechaInicial + .Add("@FechaFinal", SqlDbType.Date).Value = FechaFinal + End With + + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + + OnError("Ocurrió un error al traerse el reporte de usados.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + + End Try + + Return retorno + + End Function + + #End Region - + #Region " TIPOS DEFECTO " - + Public Function TiposDefectoGet(CveTipoDefecto As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable @@ -674,7 +700,7 @@ Public Class ClsAcumuladores #Region "GARANTIAS DETALLES" - Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer, + Public Function AddGarantiasDetalle(CveVentaDetalle As Integer, CvePS As Integer, CveFolioGarantia As Integer, CveTipoUso As Integer, CodigoEnsamble As String, CodigoLinea As String, CodigoInspeccion As String, CveTipoDefecto As Integer, NumPoliza As String, Importe As Double, Consecutivo As String) As Boolean @@ -682,6 +708,7 @@ Public Class ClsAcumuladores SqlDataAdapter("PA_Acum_GarantiasDetalleAdd") With SqlAdapter.SelectCommand.Parameters .Add("@CveVentaDetalle", SqlDbType.Int).Value = CveVentaDetalle + .Add("@CvePS", SqlDbType.Int).Value = CvePS .Add("@CveFolioGarantia", SqlDbType.Int).Value = CveFolioGarantia .Add("@CveTipoUso", SqlDbType.Int).Value = CveTipoUso .Add("@CodigoEnsamble", SqlDbType.VarChar).Value = CodigoEnsamble @@ -840,11 +867,11 @@ Public Class ClsAcumuladores Return Retorno End Function - Public Function EntradasUsadosGet(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function EntradasUsadosClientesRep(CveAlmacen As Integer, FechaI As Date, FechaF As Date, CveUsuario As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False 'Data = New DataTable - SqlDataAdapter("PA_Acum_EntradasUsadosGet") + SqlDataAdapter("PA_Acum_EntradasUsadosClientesGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 09af84a3e..c74ea1059 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -1778,7 +1778,11 @@ Public Class ClsInventarios Retorno = SqlAdapter.SelectCommand.Parameters("@Existencia").Value.ToString.ToDecimal() Me.CvePS = SqlAdapter.SelectCommand.Parameters("@CvePSRetorno").Value.ToString.ToEntero Catch Ex1 As SqlException - Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + If Ex1.Message.Contains("deadlocked") Then + Me.OnError("Ocurrió un error al obtener las existencias del producto. Puede intentarlo de nuevo", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Else + Me.OnError("Ocurrió un error al obtener las existencias del producto.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End If Catch ex As Exception OnError("Ocurrió un error al obtener las existencias del producto.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) End Try @@ -3290,8 +3294,27 @@ Public Class ClsInventarios End Function #End Region + Public Function GetMovimientoMetodoNulo(CveMovimiento As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Inv_MovimientoMetodoNulo") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveMovimiento", SqlDbType.Int).Value = CveMovimiento + .Add("@Valido", SqlDbType.Int).Direction = ParameterDirection.Output + End With + + Try + SqlAdapter.Fill(Data) + Retorno = If(SqlAdapter.SelectCommand.Parameters("@Valido").Value.ToString.ToEntero = 1, True, False) + Catch ex As Exception + OnError("Ocurrió un error al obtener El Costo del Producto/Servicio.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #Region " INVENTARIOS - COSTO PS " - Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Date, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal + Public Function GetCostoPS(CvePS As Integer, Cantidad As Double, CveAlmacen As Integer, SerieLote As String, FechaFin As Datetime, Optional CveSubProyecto As Integer = -1, Optional CveTipoAlmacen As Integer = 1) As Decimal Dim Retorno As Decimal = -1D DataAdapter("PA_Inv_PSCostoGet") @@ -3300,7 +3323,7 @@ Public Class ClsInventarios .Add("@Cantidad", SqlDbType.Float).Value = Cantidad .Add("@CveAlmacen", SqlDbType.Int).Value = CveAlmacen .Add("@SerieLote", SqlDbType.VarChar).Value = SerieLote - .Add("@FechaFin", SqlDbType.Date).Value = FechaFin + .Add("@FechaFin", SqlDbType.DateTime).Value = FechaFin .Add("@CveSubProyecto", SqlDbType.Int).Value = CveSubProyecto .Add("@CveTipoAlmacen", SqlDbType.Int).Value = CveTipoAlmacen .Add("@Costo", SqlDbType.Money).Direction = ParameterDirection.Output diff --git a/App_Code/ClsModulos.vb b/App_Code/ClsModulos.vb index a26983a44..3c47376f4 100644 --- a/App_Code/ClsModulos.vb +++ b/App_Code/ClsModulos.vb @@ -429,7 +429,7 @@ Public Class ClsModulos ' Visual Basic agregó este código para implementar correctamente el modelo descartable. Public Sub Dispose() Implements IDisposable.Dispose ' No cambie este código. Coloque el código de limpieza en Dispose ( que se dispone como Boolean). - ConexionClose() + 'ConexionClose() Dispose(True) GC.SuppressFinalize(Me) End Sub diff --git a/App_Code/ClsNominas.vb b/App_Code/ClsNominas.vb index a98a423b0..5dbc2169f 100644 --- a/App_Code/ClsNominas.vb +++ b/App_Code/ClsNominas.vb @@ -172,6 +172,25 @@ Public Class ClsNominas #Region "ClsNominas_Nominas" + Public Function GetCalculoAguinaldo(ejercicio As Int32, cveEmpresa As Int32, importe As Double, CveTipoPeriodo As Integer, CvePeriodo As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_NomCalcularAguinaldo", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = cveEmpresa + .Add("@Ejercicio", SqlDbType.Int).Value = ejercicio + .Add("@Importe", SqlDbType.Float).Value = importe + .Add("@CveTipoPeriodo", SqlDbType.Float).Value = CveTipoPeriodo + .Add("@CvePeriodo", SqlDbType.Float).Value = CvePeriodo + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch ex As Exception + OnError("Ocurrió un error al Realizar el calculo del Aguinaldo.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function GetCalculoUtilidades(ejercicio As Int32, cveEmpresa As Int32, importe As Double, importeA As Double) As Boolean Dim retorno As Boolean = False DataAdapter("PA_NomCalcularUtilidades", CommandType.StoredProcedure) @@ -1890,6 +1909,102 @@ Public Class ClsNominas End Try Return retorno End Function +#Region "MovtosPermanentes" + + Public Function GetMovtoPermanente(CveEmpresa As Int32, CvePersonal As Integer) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_GetMovtoPermanente", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al obtener los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al obtener los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + 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) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_AddMovtoPermanente", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@cveConcepto", SqlDbType.Int).Value = (cveConcepto) + .Add("@cvePersonal", SqlDbType.Int).Value = (cvePersonal) + .Add("@descripcion", SqlDbType.VarChar).Value = (descripcion) + .Add("@tipoDescuento", SqlDbType.Int).Value = (tipoDescuento) + .Add("@valor", SqlDbType.Float).Value = (valor) + .Add("@vecesAplicar", SqlDbType.Int).Value = (vecesAplicar) + .Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite) + .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) + .Add("@estatus", SqlDbType.Bit).Value = (estatus) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function UpMovtoPermanente(cveMovtoPermanente As Int32, 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) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_UpMovtoPermanente", CommandType.StoredProcedure) + With SqlAdapter.SelectCommand.Parameters + .Add("@cveMovtoPermanente", SqlDbType.Int).Value = (cveMovtoPermanente) + .Add("@cveConcepto", SqlDbType.Int).Value = (cveConcepto) + .Add("@cvePersonal", SqlDbType.Int).Value = (cvePersonal) + .Add("@descripcion", SqlDbType.VarChar).Value = (descripcion) + .Add("@tipoDescuento", SqlDbType.Int).Value = (tipoDescuento) + .Add("@valor", SqlDbType.Float).Value = (valor) + .Add("@vecesAplicar", SqlDbType.Int).Value = (vecesAplicar) + .Add("@montoLimite", SqlDbType.Decimal).Value = (montoLimite) + .Add("@fechaInicioAplicacion", SqlDbType.VarChar).Value = (fechaInicioAplicacion) + .Add("@estatus", SqlDbType.Bit).Value = (estatus) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function + Public Function RemoveMovtoPermanente(cveMovtoPermanente As Int32) As Boolean + Dim retorno As Boolean = False + DataAdapter("PA_RemoveMovtoPermanente", CommandType.StoredProcedure) + + With SqlAdapter.SelectCommand.Parameters + .Add("@cveMovtoPermanente", SqlDbType.Int).Value = (cveMovtoPermanente) + End With + Try + SqlAdapter.Fill(Data) + retorno = True + Catch sqEx As SqlException + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", sqEx, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + Catch ex As Exception + retorno = False + OnError("Ocurrió un error al agregar los Movtos Permanentes.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + Return retorno + End Function +#End Region + #Region "IDisposable Support" ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index 71f7c993a..0550ccc34 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -4581,7 +4581,8 @@ Public Class ClsPaginas PaginaDict.Add("/Acumuladores/CatTiposUso.aspx".ToUpper(), 1034) PaginaDict.Add("/Acumuladores/CatFoliosGarantia.aspx".ToUpper(), 1035) PaginaDict.Add("/Acumuladores/CatGarantiasMeses.aspx".ToUpper(), 1036) - PaginaDict.Add("/Acumuladores/EntradasUsados.aspx".ToUpper(), 543) + 'PaginaDict.Add("/Acumuladores/EntradasUsados.aspx".ToUpper(), 543) + PaginaDict.Add("/Acumuladores/EntradasUsadosResumenRep.aspx".ToUpper(), 1032) 'Antes de aquí. diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 3df18c5db..317ff984a 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -1696,6 +1696,41 @@ Public Class ClsProductosServicios Return Retorno End Function + Public Function UpdatePSPrecios(Importe As Decimal, CvePrecioLista As Integer, Porcentaje As Decimal, CvePS As Integer, CveUsuario As Integer, Fecha As DateTime, Fijo As Boolean, Optional PrecioMinimo As Decimal = Nothing) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PSPrecioUpdate") + + With SqlAdapter.SelectCommand.Parameters + + If Importe = -1 Then + .Add("@Importe", SqlDbType.Float).Value = DBNull.Value + Else + .Add("@Importe", SqlDbType.Float).Value = Importe + End If + + If Porcentaje = -1 Then + .Add("@Porcentaje", SqlDbType.Money).Value = DBNull.Value + Else + .Add("@Porcentaje", SqlDbType.Money).Value = Porcentaje + End If + + .Add("@PrecioMinimo", SqlDbType.Decimal).Value = PrecioMinimo + .Add("@CvePS", SqlDbType.Int).Value = CvePS + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@Fecha", SqlDbType.DateTime).Value = Fecha + .Add("@Fijo", SqlDbType.Bit).Value = Fijo + + End With + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al actualizar los precios de lista.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) + End Try + + Return Retorno + End Function + Public Function GetPSPrecioLista(CvePS As Integer, CveEmpresa As Integer, Optional CvePrecioLista As Integer = -1) As Boolean Dim Retorno As Boolean = False diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb index 022ef5ff0..b072d702b 100644 --- a/App_Code/ClsRH.vb +++ b/App_Code/ClsRH.vb @@ -131,7 +131,8 @@ Public Class ClsRH Return Retorno End Function - Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Public Function AddAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, CveUsuario As Integer, CveEmpresa As Integer, + chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_AsistenciasInasistenciasAdd") @@ -143,6 +144,12 @@ Public Class ClsRH .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + .Add("@AplicaVacacion", SqlDbType.Bit).Value = chkAplicaVacacion + .Add("@AplicaIncapacidad", SqlDbType.Bit).Value = chkAplicaIncapacidad + .Add("@AplicaRetardo", SqlDbType.Bit).Value = chkAplicaRetardo + .Add("@AplicaAguinaldo", SqlDbType.Bit).Value = chkAplicaAguinaldo + .Add("@AplicaUtilidades", SqlDbType.Bit).Value = chkAplicaUtilidades + End With Try @@ -161,7 +168,8 @@ Public Class ClsRH Return Retorno End Function - Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer) As Boolean + Public Function UpdateAsistenciasInasistencias(Tipo As String, AplicaFalta As Boolean, AplicaAsistencia As Boolean, Estatus As Boolean, CveAI As Integer, +chkAplicaVacacion As Boolean, chkAplicaIncapacidad As Boolean, chkAplicaRetardo As Boolean, chkAplicaAguinaldo As Boolean, chkAplicaUtilidades As Boolean) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_RH_AsistenciasInasistenciasUpdate") @@ -172,6 +180,12 @@ Public Class ClsRH .Add("@AplicaAsistencia", SqlDbType.Bit).Value = AplicaAsistencia .Add("@Estatus", SqlDbType.Bit).Value = Estatus .Add("@CveAsistenciasInasistencias", SqlDbType.Int).Value = CveAI + + .Add("@AplicaVacacion", SqlDbType.Bit).Value = chkAplicaVacacion + .Add("@AplicaIncapacidad", SqlDbType.Bit).Value = chkAplicaIncapacidad + .Add("@AplicaRetardo", SqlDbType.Bit).Value = chkAplicaRetardo + .Add("@AplicaAguinaldo", SqlDbType.Bit).Value = chkAplicaAguinaldo + .Add("@AplicaUtilidades", SqlDbType.Bit).Value = chkAplicaUtilidades End With Try diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index fad317df6..55cd012c9 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2344,13 +2344,14 @@ Public Class ClsVentas #Region " ANTICIPOS/NOTASCREDITO - VENTAS " - Public Function GetVentasAntNC(CveVenta As Integer, CveVentaNC As Integer) As Boolean + Public Function GetVentasAntNC(CveVenta As Integer, CveVentaNC As Integer, Optional AplicaAmortizacion As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_VentasAntNCGet") With SqlAdapter.SelectCommand.Parameters .Add("@CveVenta", SqlDbType.Int).Value = CveVenta .Add("@CveVentaNC", SqlDbType.Int).Value = CveVentaNC + .Add("@AplicaAmortizacion", SqlDbType.Bit).Value = AplicaAmortizacion End With Try diff --git a/App_Code/Modelos.vb b/App_Code/Modelos.vb index 0e91e582c..e4cdc187b 100644 --- a/App_Code/Modelos.vb +++ b/App_Code/Modelos.vb @@ -491,6 +491,10 @@ Namespace Modelos If ObjVentas.GetVentasAntNC(-1, CveVenta) Then Me.DtNCVinculadas = ObjVentas.DtResultados.Copy() End If + + If ObjVentas.GetVentasAntNC(-1, CveVenta, AplicaAmortizacion:=EsNCAmortizacion) Then + Me.DtAnticipos = ObjVentas.DtResultados.Copy() + End If End If End If @@ -501,12 +505,6 @@ Namespace Modelos ObjVentas.Dispose() - 'Dim ObjMovtos As New ClsMovimientos() - 'If ObjMovtos.GetAnticiposNCIxCCliente(CveCliente, CveMoneda) Then - ' Me.DtAnticipos = ObjMovtos.DtResultados.FiltraParametros($"Saldo > 0 AND SaldoSubtotal > 0 {If(CveVenta < 0, "AND Tipo = 'Ant'", "")} {If(TipoDocto = "Ant", "AND Tipo = 'NC'", "")}") - 'End If - 'ObjMovtos.Dispose() - If Me.RealizarDevolucionAlmacen Then Me.CveAlmacenDevolucion = Me.CveAlmacenDevolucionVenta End If @@ -1349,7 +1347,7 @@ Namespace Modelos 'Ajustes' If DtAjustes IsNot Nothing AndAlso DtAjustes.Rows.Count > 0 Then For Each Dr As DataRow In DtAjustes.Rows - If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, + If Not ObjAcum.AddGarantiasDetalle(Dr("CveVentaDetalle").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("CveFolioGarantia").ToString.ToEntero, Dr("CveTipoUso").ToString.ToEntero, Dr("CodigoEnsamble").ToString, Dr("CodigoLinea").ToString, Dr("CodigoInspeccion").ToString, Dr("CveTipoDefecto").ToString.ToEntero, Dr("NumPoliza").ToString, Dr("Importe").ToString.ToDouble, Dr("Consecutivo").ToString) Then ErrorList.Add("Ocurrió un error al agregar la garantia detalle.") @@ -2335,12 +2333,12 @@ Namespace Modelos Exit Select End If - If ObjFactura.TipoDocto = "Ing" AndAlso ValorMultiplicador = -1 Then - For Each row2 As DataRow In ObjFactura.DtAntNCVinculadas.Rows + If ObjFactura.TipoDocto.Contiene("Ing", "Egs") AndAlso ValorMultiplicador = -1 Then + For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows If row2("CveConceptoContable").ToString().ToEntero = 11 Then importeMovimiento = row2("Importe").ToString().ToDecimal * ValorMultiplicador '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal) If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - + CveIEAnticipo = -1 IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos CveSubProyectoContabilizar = CveSubProyectoVenta @@ -2358,38 +2356,40 @@ Namespace Modelos Next End If - 'cuando es anticipo - ' cuando es amortización de nota de crédito, y es la nc - ' cuando es amortización por descuento, y es el ingreso - ' cuando es amortización en cero - If ObjFactura.CveTipoAmortizacionAnticipo = 2 AndAlso ObjFactura.TipoDocto.Contiene("Egs") OrElse - ObjFactura.CveTipoAmortizacionAnticipo = 1 AndAlso ObjFactura.TipoDocto.Contiene("Ing") OrElse - ObjFactura.CveTipoAmortizacionAnticipo = 3 Then - - For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows - If row2("CveConceptoContable").ToString().ToEntero = 3 Then - CveIEAnticipo = row2("CveIE").ToString.ToEntero - importeMovimiento = row2("Importe").ToString().ToDecimal() '- ((row2.FCTextBox("TxtAnticipo" & row2.RowIndex).Text.ToDecimal / row2.DataKey("TotalAnticipo").ToDecimal) * row2.DataKey("IVAAnticipo").ToDecimal) - If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" - - IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos - CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos - CveSubProyectoContabilizar = CveSubProyectoVenta - - If importeMovimiento <> 0 Then - If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=row2("CveVenta").ToString.ToEntero, - CveVentaAmortizacion:=ObjFactura.CveVenta, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, - ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, - CveSubProyecto:=CveSubProyectoContabilizar) Then - ErrorPrepoliza = True - Exit For - Else - ObjFactura.SeGuardoPrePoliza = True - End If - End If - End If - Next + If ValorMultiplicador = 1 Then + 'cuando es anticipo + ' cuando es amortización de nota de crédito, y es la nc + ' cuando es amortización por descuento, y es el ingreso + ' cuando es amortización en cero + If ObjFactura.CveTipoAmortizacionAnticipo = 2 AndAlso ObjFactura.TipoDocto.Contiene("Egs") OrElse + ObjFactura.CveTipoAmortizacionAnticipo = 1 AndAlso ObjFactura.TipoDocto.Contiene("Ing") OrElse + ObjFactura.CveTipoAmortizacionAnticipo = 3 Then + For Each row2 As DataRow In ObjFactura.DtAnticipos.Rows + If row2("CveConceptoContable").ToString().ToEntero = 11 Then + CveIEAnticipo = -1 + importeMovimiento = row2("Importe").ToString().ToDecimal() + If tipoCambio > 1 Then Concepto += $" TC:{tipoCambio} ${importeMovimiento.FormatoNumero(2)}" + + IdCtaContable = ObjFactura.Cliente.IdCtaContAnticipos + CveCuenta = ObjFactura.Cliente.CveCuentaAnticipos + CveSubProyectoContabilizar = CveSubProyectoVenta + + If importeMovimiento <> 0 Then + If Not ObjConta.AddPrePolizasDetalle(ObjFactura.CvePrePoliza, TipoMovimiento, importeMovimiento, Referencia, ConceptoContable, Concepto, FechaMovimiento, IdCtaContable, -1, CveVenta:=ObjFactura.CveVenta, + CveVentaAmortizacion:=row2("CveVenta").ToString.ToEntero, CveCliente:=ObjFactura.CveCliente, CveIE:=CveIEAnticipo, + ImporteMX:=importeMovimiento * tipoCambio, ImporteME:=If(tipoCambio = 1, 0, importeMovimiento), CveCuenta:=CveCuenta, + CveSubProyecto:=CveSubProyectoContabilizar) Then + ErrorPrepoliza = True + Exit For + Else + ObjFactura.SeGuardoPrePoliza = True + End If + End If + End If + Next + End If End If + 'Cuando la funcionalidad de amortizacion en PS esta activa If Not ErrorPrepoliza Then DT = TmpDTDetalle.FiltraParametros($"CvePS = {ObjFactura.CvePSAmortizacion}") @@ -2667,7 +2667,7 @@ Namespace Modelos importeMovimiento = 0 Case 150 'Descuento sobre ventas - If ObjFactura.TipoDocto.Contiene("Egs", "Dev") Then + If ObjFactura.TipoDocto.Contiene("Egs", "Dev") AndAlso Not EsNCAmortizacion Then Dim ConceptoContableAplicar = 150 Dim CveVentaAplicar = ObjFactura.CveVenta @@ -3858,6 +3858,13 @@ Namespace Modelos Return Retorno End If + If ObjFactura.TipoDocto = "Ant" AndAlso ObjFactura.SaldoAmortizado > 0 Then + Retorno.Mensaje = "La factura no se puede cancelar debido a que tiene pagos vinculados." + Retorno.TipoMensaje = TipoMensaje.MsgAdvertencia + + Return Retorno + End If + 'SI LA REMISION ESTA FACTURADA NO SE PUEDE CANCELAR If ObjFactura.TipoDocto = "Rem" Then Dim ObjV As New ClsVentas @@ -4283,11 +4290,6 @@ Namespace Modelos End If End If - 'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL - If Not GeneraMovimientosVirtuales(CveVenta, ObjInventario) Then - ErrorCancelar = True - MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." - End If Else 'UTILIZA LA DEVOLUCION YA REALIZADA If ObjInventario.GetInv_Mov(CveVenta, UsuarioActual.CveEmpresa) Then @@ -4298,6 +4300,12 @@ Namespace Modelos End If End If + 'REALIZA LA DEVOLUCION AL ALMACEN VIRTUAL + If Not GeneraMovimientosVirtuales(CveVenta, ObjInventario) Then + ErrorCancelar = True + MensajeError = "Ocurrió un error al cargar los datos de devolución. Por favor vuelva a intentar." + End If + 'DEVOLUCION REMISION - REGRESA LAS EXISTENCIAS A ENTREGA POR ADELANTADO SI LA FACTURA VIENE DE REMISION If Not ErrorCancelar AndAlso RevivirRemisiones Then If Not GeneraMovimientosEntregaPorAdelantadoRemision(CveMovimiento, ObjVentas, ObjInventario, DtDevRem, ListaRemisionesCancelar) Then @@ -5057,6 +5065,8 @@ Namespace Modelos Public Property SaldoVentaDevolucion As Decimal Public Property Saldo As Decimal Public Property SaldoAlmacen As Decimal + Public Property SaldoAnticipo As Decimal + Public Property SaldoAmortizado As Decimal Public Property CvePAC As Integer Public Property CveAnticipo As Integer Public Property RemisionesLista As List(Of Integer) @@ -5544,6 +5554,7 @@ Namespace Modelos Public Property CveVentaRelacion As Integer = -1 Public Property ImporteRelacion As Decimal + Public Property EsNCAmortizacion As Boolean #End Region @@ -9736,6 +9747,119 @@ Namespace Modelos Public Property RequierePersonal As Boolean Public Property EsAcumulador As Boolean End Class - #End Region + +#Region "P O L I Z A - V I R T U A L" + Public Class MPolizaVentaLTHWSD + Public Property customer_name As String + Public Property customer_last_name1 As String + Public Property customer_last_name2 As String + Public Property customer_birthday As DateTime + Public Property customer_phone As String + Public Property customer_email As String + Public Property customer_gender As String + Public Property customer_advertising As Boolean + Public Property sale_date As DateTime + Public Property sale_paidby As String + Public Property sale_type As String + Public Property sale_type_service As String + Public Property product_code As String + Public Property product_unique_code As String + Public Property product_sale_type As String + Public Property used_product As Boolean + Public Property used_brand As String + Public Property used_bci As String + Public Property used_month As Integer + Public Property used_year As Integer + Public Property used_sale_date As DateTime + Public Property customer_car_brand As String + Public Property customer_car_model As String + Public Property customer_car_year As Integer + Public Property sale_discount As Decimal + Public Property sale_id As String + End Class + Public Class MPolizaVentaWS + Public Property customer_name As String + Public Property customer_last_name1 As String + Public Property customer_last_name2 As String + Public Property customer_birthday As DateTime + Public Property customer_phone As String + Public Property customer_email As String + Public Property customer_gender As String + Public Property customer_advertising As Boolean + Public Property sale_date As DateTime + Public Property sale_paidby As String + Public Property sale_type As String + Public Property sale_type_service As String + Public Property sale_total As Decimal + Public Property product_code As String + Public Property product_unique_code As String + Public Property product_sale_type As String + Public Property used_product As Boolean + Public Property used_brand As String + Public Property used_bci As String + Public Property used_month As Integer + Public Property used_year As Integer + Public Property used_sale_date As DateTime + Public Property customer_car_brand As String + Public Property customer_car_model As String + Public Property customer_car_year As Integer + Public Property sale_discount As Decimal + Public Property sale_id As String + End Class + Public Class MIndicador + + Sub New(Optional UsaValoresPrueba As Boolean = False) + If UsaValoresPrueba Then + Dim Index As Integer = 0 + For Each p As Reflection.PropertyInfo In Me.GetType().GetProperties() + Index = Index + 1 + p.SetValue(Me, Convert.ChangeType(Index, p.PropertyType), Nothing) + Next + End If + End Sub + + Public Property v_b_optima As Integer + Public Property v_b_fullpower As Integer + Public Property v_b_hitec As Integer + Public Property v_b_agm As Integer + Public Property v_b_suv As Integer + Public Property v_b_taxi As Integer + Public Property v_b_america As Integer + Public Property v_b_lth As Integer + Public Property v_b_cronos As Integer + Public Property v_b_diener As Integer + Public Property v_b_heavyduty As Integer + Public Property v_m_lth As Integer + Public Property v_o_filtros As Integer + Public Property v_o_lub1 As Integer + Public Property v_o_lubgalon As Integer + Public Property v_o_lub5 As Integer + Public Property v_o_aa As Integer + Public Property v_o_aaa As Integer + Public Property g_b_optima As Integer + Public Property g_b_fullpower As Integer + Public Property g_b_hitec As Integer + Public Property g_b_agm As Integer + Public Property g_b_suv As Integer + Public Property g_b_taxi As Integer + Public Property g_b_america As Integer + Public Property g_b_lth As Integer + Public Property g_b_cronos As Integer + Public Property g_b_diener As Integer + Public Property g_b_heavyduty As Integer + Public Property g_m_lth As Integer + Public Property a_b_optima As Integer + Public Property a_b_fullpower As Integer + Public Property a_b_hitec As Integer + Public Property a_b_agm As Integer + Public Property a_b_suv As Integer + Public Property a_b_taxi As Integer + Public Property a_b_america As Integer + Public Property a_b_lth As Integer + Public Property a_b_cronos As Integer + Public Property a_b_diener As Integer + Public Property a_b_heavyduty As Integer + End Class +#End Region End Namespace \ No newline at end of file diff --git a/App_Code/modExtensiones.vb b/App_Code/modExtensiones.vb index 11b2f7c26..f4a068120 100644 --- a/App_Code/modExtensiones.vb +++ b/App_Code/modExtensiones.vb @@ -367,9 +367,9 @@ Namespace Extensiones End Sub - Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "") + Public Sub OnError(Obj As Object, Mensaje As String, Exeption As Exception, Optional InfoAdicional As String = "", Optional TipoMensaje As TipoMensaje = TipoMensaje.MsgError) GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) - Alert(Obj, Mensaje, TipoMensaje.MsgError) + Alert(Obj, Mensaje, TipoMensaje) If WebConfigurationManager.AppSettings("SiteName") IsNot Nothing AndAlso WebConfigurationManager.AppSettings("SiteName").ToString = "1" Then MandaCorreoError(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", Mensaje, Exeption.ToString, vbCrLf, InfoAdicional)) End Sub diff --git a/Contabilidad/PlantillasPolizasDetalle.aspx.vb b/Contabilidad/PlantillasPolizasDetalle.aspx.vb index 56fd3a6bb..e778a21ea 100644 --- a/Contabilidad/PlantillasPolizasDetalle.aspx.vb +++ b/Contabilidad/PlantillasPolizasDetalle.aspx.vb @@ -105,7 +105,7 @@ Partial Class Contabilidad_PlantillasPolizasDetalle Me.GvDatos.DataSource = Nothing End If - OrdenaDatos() + ' OrdenaDatos() End Sub Public Sub CargaDatosPoliza(CvePlantillaPoliza As Integer) Dim ObjPlantillaPolizas As New ClsContabilidad diff --git a/General/SaldosIniciales.aspx.vb b/General/SaldosIniciales.aspx.vb index bedb6ca26..11221fb2f 100644 --- a/General/SaldosIniciales.aspx.vb +++ b/General/SaldosIniciales.aspx.vb @@ -371,15 +371,15 @@ Partial Class General_SaldosIniciales Exit Sub End If - If Not dt.Columns(12).ColumnName = "Servicio" Then - Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If + 'If Not dt.Columns(12).ColumnName = "Servicio" Then + ' Alert("El nombre de la treceava columna debe ser 'Servicio'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If - If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then - Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError) - Exit Sub - End If + 'If Not dt.Columns(13).ColumnName = "Conversion Unidad" Then + ' Alert("El nombre de la catorceava columna debe ser 'Conversion Unidad'. Favor de corregirlo", TipoMensaje.MsgError) + ' Exit Sub + 'End If ElseIf RblFormato.SelectedValue = "6" Then If Not dt.Columns(0).ColumnName = "Código" Then @@ -669,8 +669,8 @@ Partial Class General_SaldosIniciales Dim IEPS As Decimal = Row("IEPS").ToString.ToDecimal Dim Tamaño As String = Row("Tamaño").ToString.Trim Dim SATClavePS As String = Row("Código SAT").ToString.Trim - Dim Clasificacion2 As String = Row("Servicio").ToString.Trim - Dim Litraje As Double = Row("Conversion Unidad").ToString.ToDouble + Dim Clasificacion2 As String = If(dt.Columns.Contains("Servicio"), Row("Servicio").ToString.Trim, "") + Dim Litraje As Double = If(dt.Columns.Contains("Conversion Unidad"), Row("Conversion Unidad").ToString.ToDouble, 0) Dim RinTamaño As String = If(Row.Table.Columns.Contains("Tamaño de Rin"), Row("Tamaño de Rin").ToString.Trim, "") Dim Medida As String = If(Row.Table.Columns.Contains("Medida"), Row("Medida").ToString.Trim, "") Dim SATClaveUnidadMedida As String = If(Row.Table.Columns.Contains("Clave Unidad"), Row("Clave Unidad").ToString.Trim, "") diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb index 657be3877..55e2ac042 100644 --- a/Inicio.aspx.vb +++ b/Inicio.aspx.vb @@ -81,23 +81,22 @@ Partial Class Inicio If UsuarioActual.CveRol = 1 Then divInd.Visible = True CargaSubProyectos() - End If - - If UsuarioActual.TienePermisoProceso(271) Then MuestraVentasPUE() + End If + + 'Ventas no timbradas por centro de costo + If UsuarioActual.TienePermisoProceso(208) Then MuestraNoTimbradasCentroCosto() + + 'Reporte facaturas pendientes por autorizar Oscar 2016-07-06 + If UsuarioActual.TienePermisoProceso(158) Then + RegistraScript("$( document ).ready(function() { AbrirVentana('/Compras/PopUpFacturasPendientesAutorizar.aspx');});", "repFacturas") + End If + + If UsuarioActual.TienePermisoProceso(271) Then MuestraVentasPUE() If UsuarioActual.TienePermisoProceso(270) Then MuestraComprasPUE() - Dim EsDEV = ConfigurationManager.ConnectionStrings("Conexion").ConnectionString.Contains("Desarrollo2017") + Dim EsDEV = Not UsuarioActual.Empresa.FacturaProduccion If Not EsDEV Then - If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100 - End If - - 'Ventas no timbradas por centro de costo - If UsuarioActual.TienePermisoProceso(208) Then MuestraNoTimbradasCentroCosto() - - - 'Reporte facaturas pendientes por autorizar Oscar 2016-07-06 - If UsuarioActual.TienePermisoProceso(158) Then - RegistraScript("$( document ).ready(function() { AbrirVentana('/Compras/PopUpFacturasPendientesAutorizar.aspx');});", "repFacturas") + If UsuarioActual.CveUsuario.Contiene(93, 1425, 2, 1606, 1472, 100) Then MuestraInconsistencias() '100 End If 'MUESTRA CALENDARIO SOLO ROL ADMINISTRADOR-AD diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index 3b705d02a..df303871d 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -113,7 +113,6 @@
    - diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index 40fa29776..b6eff1c35 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -301,10 +301,11 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim CveUMTemp = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteDesarmado.SelectedValue.ToEntero).FiltroPrimeroValor("CveUM").ToEntero CveVendedor = If(RowApartadosDesarmado.Visible, DdlVendedorDesarmado.SelectedValue.ToEntero, -1) CveCliente = If(RowClienteDesarmado.Visible, DdlClienteDesarmado.SelectedValue.ToEntero, -1) + Dim FechaFin As String = TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd 23:59") Dim ObjInventarios As New ClsInventarios - Dim Existencia = ObjInventarios.GetExistenciasPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, CveUMTemp, UsuarioActual.CveEmpresa, DdlAlmacenDesarmado.SelectedValue.ToEntero, FechaMovto:=TxtFechaDesarmado.Text.ToDateTime.ToString("yyyy/MM/dd HH:mm"), CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) - Dim CostoPromedio = ObjInventarios.GetCostoPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, TxtCantidadDesarmado.Text.ToDouble, DdlAlmacenDesarmado.SelectedValue.ToEntero, "-1", TxtFechaDesarmado.Text.ToDate) + Dim Existencia = ObjInventarios.GetExistenciasPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, CveUMTemp, UsuarioActual.CveEmpresa, DdlAlmacenDesarmado.SelectedValue.ToEntero, FechaMovto:=FechaFin, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) + Dim CostoPromedio = ObjInventarios.GetCostoPS(DdlPaqueteDesarmado.SelectedValue.ToEntero, TxtCantidadDesarmado.Text.ToDouble, DdlAlmacenDesarmado.SelectedValue.ToEntero, "-1", FechaFin.ToDate, CveTipoAlmacen:=-1) ObjInventarios.Dispose() If Existencia - TxtCantidadDesarmado.Text.ToDouble < 0 Then diff --git a/Inventarios/RecepcionEntrega.aspx b/Inventarios/RecepcionEntrega.aspx index 43992542a..e6bf45a69 100644 --- a/Inventarios/RecepcionEntrega.aspx +++ b/Inventarios/RecepcionEntrega.aspx @@ -336,7 +336,7 @@
    Información: - +
    diff --git a/Inventarios/RecepcionEntrega.aspx.vb b/Inventarios/RecepcionEntrega.aspx.vb index 1ab6dbd11..d2251c4a9 100644 --- a/Inventarios/RecepcionEntrega.aspx.vb +++ b/Inventarios/RecepcionEntrega.aspx.vb @@ -2261,10 +2261,38 @@ Partial Class Inventarios_RecepcionEntrega End If End If + 'QUEMAR REMISIONES + If Not ErrorMovInv And EsDevolucionVenta = 1 And TipoDocto = "Ing" Then + Dim DtDevRem As New DataTable + + 'CARGA REMISIONES DE LA VENTA DEVUELTA + If ObjInventario.GetDevolucionRemisionesFacturadas(CveVentaSurtir) Then + DtDevRem = ObjInventario.DtResultados.FiltraParametros("CantidadAlmacen = 0") + Else + ErrorMovInv = True + End If + + If Not ErrorMovInv Then + If DtDevRem.Rows.Count > 0 Then + For Each DrMovtos As DataRow In DtDevRem.FiltraParametros("", "CveRem", {"CveRem"}).Rows + If Not ObjInventario.ActualizarEsDevolucionVenta(DrMovtos("CveRem").ToString.ToEntero, 2) Then + TextoError = "Ocurrió un error al hacer la devolución hacia la remision. Por favor vuelva a intentar." + ErrorMovInv = True + Exit For + End If + Next + End If + Else + TextoError = "Ocurrió un error al hacer la devolucion a remisión. Por favor vuelva a intentar." + ErrorMovInv = True + End If + + End If + 'QUEMA DEVOLUCION | QUEMA = LA QUITA DE PENDIENTE POR RECIBIR (DEVOLVER) If Not ErrorMovInv And EsDevolucionVenta = 1 Then If Not ObjVentas.UpdateVentasDevolucionAlmacen(2, CveVentaSurtir) Then - TextoError = "Ocurrió un error al hacer la devolucion. Por favor vuelva a intentar." + TextoError = "Ocurrió un error al hacer la devolución. Por favor vuelva a intentar." ErrorMovInv = True End If End If diff --git a/Inventarios/RecepcionUsados.aspx b/Inventarios/RecepcionUsados.aspx index 10c7f1c90..ba194c182 100644 --- a/Inventarios/RecepcionUsados.aspx +++ b/Inventarios/RecepcionUsados.aspx @@ -105,7 +105,7 @@
    - Entrada + Entrada Salida
    diff --git a/Inventarios/RecepcionUsados.aspx.vb b/Inventarios/RecepcionUsados.aspx.vb index 7fe120eaa..381d6ef3c 100644 --- a/Inventarios/RecepcionUsados.aspx.vb +++ b/Inventarios/RecepcionUsados.aspx.vb @@ -1066,10 +1066,10 @@ Partial Class Inventarios_RecepcionUsados For Each Dr As DataRow In DtMovimientos.Rows - If CveConcepto = 2 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then - ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate) - Else - ImporteConcepto = Dr("PU").ToString.ToDouble + If CveConcepto = 42 AndAlso DdlMoneda.SelectedValue.ToEntero = 2 Then + ImporteConcepto = Dr("PU").ToString.ToDouble * GlobalTipoCambio(TxtFecha.Text.ToDate) + Else + ImporteConcepto = Dr("PU").ToString.ToDouble End If If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, ImporteConcepto, Dr("CveAF").ToString.ToEntero, -1, Dr("SerieLote").ToString, Dr("Observaciones").ToString, Lote:=Dr("Lote").ToString, Batch:=Dr("Batch").ToString, CveUsuarioModifico:=UsuarioActual.CveUsuario) Then @@ -1083,10 +1083,10 @@ Partial Class Inventarios_RecepcionUsados ErrorMovInv = True Exit For End If - 'si es selectedvalue = 2, es entrada ,3 -salida - Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 2, 1, 2) + 'si es selectedvalue = 42, es entrada ,3 -salida + Dim CveConceptoUsados As Integer = If(RBLOpcion.SelectedValue.ToEntero = 42, 1, 2) - If RBLOpcion.SelectedValue.ToEntero = 2 AndAlso EsDistribuidor Then + If RBLOpcion.SelectedValue.ToEntero = 42 AndAlso EsDistribuidor Then If Not ObjAcum.DistribuidorMovtosAdd(DdlClientes.SelectedValue.ToEntero, Dr("Cantidad").ToString.ToEntero(), Dr("CveTamaño").ToString.ToEntero, CveConceptoUsados, CveVenta, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, 0, Dr("Observaciones").ToString, CveMovimiento:=CveMovimiento) Then diff --git a/Nomina/Aguinaldo.aspx b/Nomina/Aguinaldo.aspx index 8d90b33d2..888b07b2c 100644 --- a/Nomina/Aguinaldo.aspx +++ b/Nomina/Aguinaldo.aspx @@ -1,19 +1,118 @@ -<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="Aguinaldo.aspx.vb" Inherits="Nomina_Aguinaldo" %> +<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Aguinaldo.aspx.cs" Inherits="Nomina_Aguinaldo" %> - + - + - + + + Aguinaldo - + - + - + - + + + + +
    +
    +
    +
    + +
    + +
    + + +
    + + + + +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + --%> + + + + +
    - + diff --git a/Nomina/Aguinaldo.aspx.cs b/Nomina/Aguinaldo.aspx.cs new file mode 100644 index 000000000..985f32a52 --- /dev/null +++ b/Nomina/Aguinaldo.aspx.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; + +public partial class Nomina_Aguinaldo : ClsPaginas +{ + #region Propiedades + private DataTable DTAguinaldos + { + get + { + return (DataTable)ViewState["DTAguinaldos"]; + } + set + { + ViewState["DTAguinaldos"] = value; + } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + using (ClsNominas objnom = new ClsNominas()) + { + + objnom.GetEjercicios(UsuarioActual.CveEmpresa); + DdlEjercicios.DataSource = objnom.DtResultados; + } + DdlEjercicios.DataBind(); + + DdlTipoPeriodo.DataSource = GlobalDTTipoPeriodo.FiltraParametros("Estatus = 'Activo'"); + DdlTipoPeriodo.DataBind(); + DdlTipoPeriodo.Items.Insert(0, new ListItem("Seleccione", "-1")); + if (DdlTipoPeriodo.Items.Count > 0) + { + DdlTipoPeriodo.SelectedIndex = 0; + } + } + + } + + protected void BtnCalcular_Click(object sender, EventArgs e) + { + + int ejercicio = DdlEjercicios.SelectedValue.ToEntero(); + int CveTipoPeriodo = DdlTipoPeriodo.SelectedValue.ToEntero(); + int CvePeriodo = -1; + + using (ClsNominas objnom = new ClsNominas()) + { + objnom.GetCalculoAguinaldo(ejercicio, UsuarioActual.CveEmpresa, 0, CveTipoPeriodo, CvePeriodo); + DTAguinaldos = objnom.DtResultados; + GVCalcularAguinaldo.DataSource = DTAguinaldos; + } + + GVCalcularAguinaldo.DataBind(); + LnkAutorizarModal.Visible = true; + upDatosPA_N.Update(); + } + + protected void LnkAutorizarModal_Click(object sender, EventArgs e) + { + + } +} \ No newline at end of file diff --git a/Nomina/Aguinaldo.aspx.vb b/Nomina/Aguinaldo.aspx.vb deleted file mode 100644 index e275a58f8..000000000 --- a/Nomina/Aguinaldo.aspx.vb +++ /dev/null @@ -1,5 +0,0 @@ - -Partial Class Nomina_Aguinaldo - Inherits ClsPaginas - -End Class diff --git a/Nomina/Finiquito.aspx b/Nomina/Finiquito.aspx index 44af81510..1391076fe 100644 --- a/Nomina/Finiquito.aspx +++ b/Nomina/Finiquito.aspx @@ -190,7 +190,7 @@
    - +