diff --git a/AF/AF.aspx b/AF/AF.aspx index 82e22650c..ecf2bb86b 100644 --- a/AF/AF.aspx +++ b/AF/AF.aspx @@ -2882,7 +2882,7 @@
Almacén:
- +
diff --git a/AF/AF.aspx.vb b/AF/AF.aspx.vb index d5be1124a..690738748 100644 --- a/AF/AF.aspx.vb +++ b/AF/AF.aspx.vb @@ -537,7 +537,7 @@ Partial Class AF_AF HLAFInv.Visible = True - Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,2,12)" + Dim StrAlmacenes As String = "CveTipoAlmacen IN (1,15)" DdlAFInvAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, CveEmpresaActual, CveTipoAlmacen:=-1).FiltraParametros(StrAlmacenes) DdlAFInvAlmacen.Items.Insert(0, New ListItem(" Seleccione ", "-1")) DdlAFInvAlmacen.SelectedValue = "-1" diff --git a/AF/CatTiposServicios.aspx b/AF/CatTiposServicios.aspx new file mode 100644 index 000000000..f5cabf7c6 --- /dev/null +++ b/AF/CatTiposServicios.aspx @@ -0,0 +1,76 @@ +<%@ Page Title="AF - Catálogo de Tipos de Servicio" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTiposServicios.aspx.cs" Inherits="AF_CatTiposServicios" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Tipos de Servicios + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatTiposServicios.aspx.cs b/AF/CatTiposServicios.aspx.cs new file mode 100644 index 000000000..c553b8dd1 --- /dev/null +++ b/AF/CatTiposServicios.aspx.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatTiposServicios : ClsPaginas +{ + private int CveTipoServicio + { + get + { + return ViewState["CveTipoServicio"].ToString().ToEntero(); + } + + set + { + ViewState["CveTipoServicio"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetTiposServicios(-1, -1, -1, UsuarioActual.CveEmpresa)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + if (ObjAF.GetTiposMantenimiento(-1)) + { + DdlTipoMantenimiento.DataSource = ObjAF.DtResultados; + DdlTipoMantenimiento.DataBind(); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicioD_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Agregar"; + TxtNombre.Text = ""; + DdlTipoMantenimiento.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicio = GvRow.DataKey("CveTipoServicio").ToEntero(); + TxtNombre.Text = GvRow.DataKey("Nombre"); + DdlTipoMantenimiento.SelectedValueExist(GvRow.DataKey("CveTipoMantenimiento")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicio = GvRow.DataKey("CveTipoServicio").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteTiposServicios(CveTipoServicio)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se eliminó el Tipo de Gasto correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicio_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarTipoServicio.Text == "Agregar") + { + if (ObjAF.AddTiposServicios(TxtNombre.Text,DdlTipoMantenimiento.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se agregó el Tipo de Gasto correctamente"); + } + } + else + { + if (ObjAF.UpdateTiposServicios(CveTipoServicio, TxtNombre.Text, DdlTipoMantenimiento.SelectedValue.ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + Alert("Se actualizó el Tipo de Gasto correctamente"); + } + } + ObjAF.Dispose(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposD")); + } +} \ No newline at end of file diff --git a/AF/CatTiposServiciosActividades.aspx b/AF/CatTiposServiciosActividades.aspx new file mode 100644 index 000000000..6d0cfbf64 --- /dev/null +++ b/AF/CatTiposServiciosActividades.aspx @@ -0,0 +1,84 @@ +<%@ Page Title="AF - Catálogo de Actividades de Tipos de Servicio" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTiposServiciosActividades.aspx.cs" Inherits="AF_CatTiposServiciosActividades" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Actividades de Tipos de Servicio + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatTiposServiciosActividades.aspx.cs b/AF/CatTiposServiciosActividades.aspx.cs new file mode 100644 index 000000000..80f1e0df3 --- /dev/null +++ b/AF/CatTiposServiciosActividades.aspx.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatTiposServiciosActividades : ClsPaginas +{ + private int CveTipoServicioActividad + { + get + { + return ViewState["CveTipoServicioActividad"].ToString().ToEntero(); + } + + set + { + ViewState["CveTipoServicioActividad"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetTiposServiciosActividades(-1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + if (ObjAF.GetActividades(-1,-1,-1,UsuarioActual.CveEmpresa)) + { + DdlActividades.DataSource = ObjAF.DtResultados; + DdlActividades.DataBind(); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicioD_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Agregar"; + TxtDuracion.Text = ""; + TxtObservaciones.Text = ""; + DdlActividades.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosActividadesD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero(); + TxtDuracion.Text = GvRow.DataKey("Duracion"); + TxtObservaciones.Text = GvRow.DataKey("Observaciones"); + DdlActividades.SelectedValueExist(GvRow.DataKey("CveActividad")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosActividadesD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicioActividad = GvRow.DataKey("CveTipoServicioActividad").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteTiposServiciosActividades(CveTipoServicioActividad)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosActividadesD")); + Alert("Se eliminó la Actividad del Tipo de Servicio correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicio_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarTipoServicio.Text == "Agregar") + { + if (ObjAF.AddTiposServiciosActividades(DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + { + Alert("Se agregó la Actividad del Tipo de Servicio correctamente"); + } + } + else + { + if (ObjAF.UpdateTiposServiciosActividades(CveTipoServicioActividad,DdlActividades.SelectedValue.ToEntero(),TxtDuracion.Text.ToEntero(),TxtObservaciones.Text)) + { + Alert("Se actualizó la Actividad del Tipo de Servicio correctamente"); + } + } + ObjAF.Dispose(); + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosActividadesD")); + } +} \ No newline at end of file diff --git a/AF/CatTiposServiciosMateriales.aspx b/AF/CatTiposServiciosMateriales.aspx new file mode 100644 index 000000000..65010d147 --- /dev/null +++ b/AF/CatTiposServiciosMateriales.aspx @@ -0,0 +1,98 @@ +<%@ Page Title="AF - Catálogo de Materiales de Tipos de Servicio" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="CatTiposServiciosMateriales.aspx.cs" Inherits="AF_CatTiposServiciosMateriales" %> + +<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> + + + + + + + + Catálogo de Materiales de Tipos de Servicio + + + + +
  • + +
  • + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AF/CatTiposServiciosMateriales.aspx.cs b/AF/CatTiposServiciosMateriales.aspx.cs new file mode 100644 index 000000000..91633b322 --- /dev/null +++ b/AF/CatTiposServiciosMateriales.aspx.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Extensiones; +using System.Data; + +public partial class AF_CatTiposServiciosMateriales : ClsPaginas +{ + private int CveTipoServicioMaterial + { + get + { + return ViewState["CveTipoServicioMaterial"].ToString().ToEntero(); + } + + set + { + ViewState["CveTipoServicioMaterial"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CargaDatos(); + } + } + + private void CargaDatos() + { + ClsAF ObjAF = new ClsAF(); + if (ObjAF.GetTiposServiciosMaterial(-1, -1)) + { + GvDatos.DataSource = ObjAF.DtResultados; + GvDatos.DataBind(); + } + + if (ObjAF.GetTiposServicios(-1, -1,-1,UsuarioActual.CveEmpresa)) + { + DdlTipoServicio.DataSource = ObjAF.DtResultados; + DdlTipoServicio.DataBind(); + } + + DdlUM.DataSource = get_GlobalDTUnidadesMedida(UsuarioActual.CveEmpresa); + DdlUM.DataBind(); + + DdlPS.DataSource = get_GlobalDTPS(UsuarioActual.CveEmpresa); + DdlPS.DataBind(); + + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicioD_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Agregar"; + TxtCantidad.Text = ""; + TxtTipo.Text = ""; + DdlTipoServicio.SelectedValueExist(-1); + DdlUM.SelectedValueExist(-1); + DdlPS.SelectedValueExist(-1); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosMaterialD")); + } + + protected void LnkEditar_Click(object sender, EventArgs e) + { + BtnAgregarTipoServicio.Text = "Actualizar"; + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicioMaterial = GvRow.DataKey("CveTipoServicioMaterial").ToEntero(); + TxtCantidad.Text = GvRow.DataKey("Cantidad"); + TxtTipo.Text = GvRow.DataKey("Tipo"); + DdlTipoServicio.SelectedValueExist(GvRow.DataKey("CveTipoServicio")); + DdlPS.SelectedValueExist(GvRow.DataKey("CvePS")); + DdlUM.SelectedValueExist(GvRow.DataKey("CveUM")); + UpModalTiposD.Update(); + RegistraScript(String.Format("$('#{0}').modal();", "DivAgregarTiposServiciosMaterialD")); + } + + protected void LnkEliminar_Click(object sender, EventArgs e) + { + GridViewRow GvRow = (GridViewRow)(((LinkButton)sender).NamingContainer); + CveTipoServicioMaterial = GvRow.DataKey("CveTipoServicioMaterial").ToEntero(); + ClsAF ObjAF = new ClsAF(); + if (ObjAF.DeleteTiposServiciosMaterial(CveTipoServicioMaterial)) + { + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosMaterialD")); + Alert("Se eliminó el Material del Tipo de Servicio correctamente"); + } + ObjAF.Dispose(); + } + + protected void BtnAgregarTipoServicio_Click(object sender, EventArgs e) + { + ClsAF ObjAF = new ClsAF(); + if (BtnAgregarTipoServicio.Text == "Agregar") + { + if (ObjAF.AddTiposServiciosMaterial(DdlTipoServicio.SelectedValue.ToEntero(),TxtCantidad.Text.ToDecimal(),DdlUM.SelectedValue.ToEntero(),DdlPS.SelectedValue.ToEntero(),TxtTipo.Text.ToEntero())) + { + Alert("Se agregó el Material del Tipo de servicio correctamente"); + } + } + else + { + if (ObjAF.UpdateTiposServiciosMaterial(CveTipoServicioMaterial, DdlTipoServicio.SelectedValue.ToEntero(), TxtCantidad.Text.ToDecimal(), DdlUM.SelectedValue.ToEntero(), DdlPS.SelectedValue.ToEntero(), TxtTipo.Text.ToEntero())) + { + Alert("Se actualizó el Material del Tipo de servicio correctamente"); + } + } + ObjAF.Dispose(); + CargaDatos(); + UpDatos.Update(); + RegistraScript(String.Format("$('#{0}').modal('hide');", "DivAgregarTiposServiciosMaterialD")); + } +} \ No newline at end of file diff --git a/App_Code/ClsAF.vb b/App_Code/ClsAF.vb index 3b6189bef..07ef8202a 100644 --- a/App_Code/ClsAF.vb +++ b/App_Code/ClsAF.vb @@ -3732,12 +3732,54 @@ Public Class ClsAF End Try Return Retorno - End Function + End Function + + Public Function GetTiposMantenimiento(CveTipoMantenimiento As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_TiposMantenimientoGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveTipoMantenimiento", SqlDbType.Int).Value = CveTipoMantenimiento + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener los tipos de mantenimiento.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + + Public Function GetActividades(CveActividad As Integer, CvePuesto As Integer, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + + DataAdapter("PA_AF_ActividadesGet") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CveActividad", SqlDbType.Int).Value = CveActividad + .Add("@CvePuesto", SqlDbType.Int).Value = CvePuesto + .Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario + .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa + End With + + Try + SqlAdapter.Fill(Data) + Retorno = True + Catch ex As Exception + OnError("Ocurrió un error al obtener las actividades", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + #End Region - - + + #Region " IDisposable Support " - ' IDisposable + ' IDisposable Protected Overridable Sub Dispose(ByVal disposing As Boolean) If Not disposedValue Then If disposing Then diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb index 03a37d2fa..f7c161809 100644 --- a/App_Code/ClsInventarios.vb +++ b/App_Code/ClsInventarios.vb @@ -128,6 +128,7 @@ Public Class ClsInventarios Public Property CveRemanufactura As Integer Public Property ResponsableCarga As String Public Property ResponsableRecibio As String + Public Property Modulo As String @@ -851,6 +852,7 @@ Public Class ClsInventarios PuestoRecibio = dr("PuestoEntrego").ToString ResponsableCarga = dr("ResponsableCarga").ToString ResponsableRecibio = dr("ResponsableRecibio").ToString + Modulo = dr("Modulo").ToString Retorno = True End If diff --git a/App_Code/ClsPaginas.vb b/App_Code/ClsPaginas.vb index bf5a7dea3..628bf554b 100644 --- a/App_Code/ClsPaginas.vb +++ b/App_Code/ClsPaginas.vb @@ -3952,6 +3952,9 @@ Public Class ClsPaginas PaginaDict.Add("/AF/RepEventosProgramados.aspx".ToUpper(), 656) PaginaDict.Add("/AF/RegistroRevision.aspx".ToUpper(), 1251) PaginaDict.Add("/AF/RepRevision.aspx".ToUpper(), 1252) + PaginaDict.Add("/AF/CatTiposServicios.aspx".ToUpper(), 765) + PaginaDict.Add("/AF/CatTiposServiciosActividades.aspx".ToUpper(), 766) + PaginaDict.Add("/AF/CatTiposServiciosMateriales.aspx".ToUpper(), 767) #End Region 'AIMMGM #Region "AIMMGM" diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index e4cb5ef17..e3592c397 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -445,7 +445,7 @@ Public Class ClsVentas Catch Ex1 As SqlException If Ex1.Message.Contains("Número: 2627;") And Ex1.Message.Contains("UK_Ventas_TipoDocto_Serie_Folio_CveSubProyecto") Then Alert(String.Format("el Folio '{0}' ya se encuentra registrado", FolioFact), TipoMensaje.MsgAdvertencia) - GuardaLog(String.Format("el folio ya se encuentra registrado {0} {1}", Ex1.Message, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) + GuardaLogAD(String.Format("el folio ya se encuentra registrado {0} {1}", Ex1.Message, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())) Else Me.OnError("Ocurrió un error al Guardar la Venta.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()) End If diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb index 39658a220..5b067c967 100644 --- a/Compras/PopUpVerFactura.aspx.vb +++ b/Compras/PopUpVerFactura.aspx.vb @@ -3518,6 +3518,7 @@ Partial Class PopUpVerFactura params.Add(New ReportParameter("Puesto", dr("Puesto").ToString)) params.Add(New ReportParameter("PuestoEntrego", dr("PuestoEntrego").ToString)) params.Add(New ReportParameter("Departamento", dr("Departamento").ToString)) + params.Add(New ReportParameter("DepartamentoEntrego", dr("DepartamentoEntrego").ToString)) params.Add(New ReportParameter("Folio", dr("Folio").ToString)) params.Add(New ReportParameter("Sucursal", dr("SubProyecto").ToString)) params.Add(New ReportParameter("Telefono", dr("Celular").ToString)) diff --git a/Contabilidad/RepIVA.aspx b/Contabilidad/RepIVA.aspx index ac20c6490..5e60f096a 100644 --- a/Contabilidad/RepIVA.aspx +++ b/Contabilidad/RepIVA.aspx @@ -126,7 +126,8 @@ - + + @@ -202,6 +203,8 @@ + + <%-- diff --git a/Inventarios/EntradasSalidas.aspx.vb b/Inventarios/EntradasSalidas.aspx.vb index 39e43da47..7891db1e0 100644 --- a/Inventarios/EntradasSalidas.aspx.vb +++ b/Inventarios/EntradasSalidas.aspx.vb @@ -3421,6 +3421,7 @@ Partial Class Inventarios_EntradasSalidas Dim DTOCs As DataTable = DtCostos.FiltraParametros("", "", {"CveOrdenCompraDetalle"}) Dim IdCtaContable As Integer = 0 Dim ConceptoPoliza As String = String.Format("{0}-{1}", DdlConcepto.SelectedItem.Text, If(DdlConcepto.SelectedValue.ToEntero.Contiene(3), HplVenta.Text, TxtFolio.Text)) + Dim Contabilizable As Boolean = True If tmpCostos.Rows.Count > 0 Then Dim Concepto As String = If(TxtObservaciones.Text = "", ConceptoPoliza, $" {TxtObservaciones.Text}") @@ -3455,44 +3456,51 @@ Partial Class Inventarios_EntradasSalidas End If Next Else - If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then - 'genero las prepolizas manuales - Dim tCveConcepto As Integer = 95 - Dim CveCuenta As Integer - If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 - IdCtaContable = 1 - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta) Then + If ObjInventario.Modulo = "ASA/G1" Then + Contabilizable = False + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimientoRelacionado, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True - End If - Else - - Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero - Dim tCveConcepto As Integer = 69 - If DdlConcepto.SelectedValue = "30" Then - tCveConcepto = 181 - IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero - End If - - For Each RowInv As DataRow In tmpCostos.Rows - ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL - If tCveConcepto = 69 Then - IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero - End If - - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + If DdlConcepto.SelectedValue.Contiene("6", "22", "23", "7", "16", "21", "24") Then + 'genero las prepolizas manuales + Dim tCveConcepto As Integer = 95 + Dim CveCuenta As Integer + If UsuarioActual.CveEmpresa = 119 Then CveCuenta = 55519 + IdCtaContable = 1 + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, DtCostos.SUMD("Total"), Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=-1, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total"), CveSubProyecto:=-1, CveCuenta:=CveCuenta, Contabilizable:=Contabilizable) Then ErrorMovInv = True - Exit For + End If - Next + Else + Dim tCveSubProyecto = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CveSubProyecto", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero + Dim tCveConcepto As Integer = 69 + If DdlConcepto.SelectedValue = "30" Then + tCveConcepto = 181 + IdCtaContable = UsuarioActual.Empresa.Funcionalidad(342).ToEntero + End If + + For Each RowInv As DataRow In tmpCostos.Rows + ValorInventario = DtCostos.SUM("Total", $"CveClasificacion = {RowInv("CveClasificacion")}").ToString.ToDecimal.RoundSQL + If tCveConcepto = 69 Then + IdCtaContable = GlobalDTClasificaciones(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCuentaCostos", $"CveClasificacion = {RowInv("CveClasificacion")}").ToEntero + End If + + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, Not MovAlmacen, ValorInventario, Concepto, tCveConcepto, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveClasificacion:=RowInv("CveClasificacion").ToString.ToEntero, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=ValorInventario, CveSubProyecto:=tCveSubProyecto) Then + ErrorMovInv = True + Exit For + End If + + Next + + End If End If End If IdCtaContable = GlobalDTAlmacen(UsuarioActual.CveEmpresa).FiltroPrimeroValor("IdCtaContable", $"CveAlmacen={DdlAlmacen.SelectedValue.ToEntero}").ToEntero - If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL) Then + If Not ObjConta.AddPrePolizasDetalle(CvePrePoliza, MovAlmacen, DtCostos.SUMD("Total").RoundSQL, Concepto, 68, Concepto, TxtFecha.Text.ToDate, IdCtaContable, -1, CveVenta:=CveVenta, CveMovimientoAlmacen:=CveMovimiento, ImporteMX:=DtCostos.SUMD("Total").RoundSQL, Contabilizable:=Contabilizable) Then ErrorMovInv = True End If End If diff --git a/Inventarios/EntregaAlmacen.aspx.vb b/Inventarios/EntregaAlmacen.aspx.vb index 0c025cc20..c8cc4acb8 100644 --- a/Inventarios/EntregaAlmacen.aspx.vb +++ b/Inventarios/EntregaAlmacen.aspx.vb @@ -2366,9 +2366,9 @@ Partial Class Inventarios_EntregaAlmacen TextoError.AppendFormat("Ocurrió un error, no se tienen registros que ingresar") Exit Sub End If - For Each Dr As DataRow In ObjInventario.DtResultados.Rows - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccionAlmacen").ToString.ToEntero, -1), EsInterno:=EsInterno) Then + + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, Dr("PU").ToString.ToDecimal, CveAF:=Dr("CveAF").ToString.ToEntero, Serie:=Dr("Serie").ToString, CveMovimientoDetalleEntrada:=Dr("CveMovimientoDetalle").ToString.ToEntero, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=-3, EsInterno:=EsInterno) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de traspaso de apartado. Por favor vuelva a intentar.") Exit For @@ -2398,7 +2398,7 @@ Partial Class Inventarios_EntregaAlmacen PU = DtExistencias.FiltroPrimeroValor("PU", $"CveTipoAlmacenDevolucion <> 26 AND CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND Serie = '{Dr1("Serie").ToString}'").ToString.ToDecimal End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, 1, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, Serie:=Dr1("Serie").ToString, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=-3) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.") Exit For @@ -2410,7 +2410,7 @@ Partial Class Inventarios_EntregaAlmacen PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero} AND Serie = '{Dr1("Serie").ToString}'").ToString.ToDecimal End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, Dr1("Cantidad").ToString.ToDouble, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=-3) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos con serie. Por favor vuelva a intentar.") Exit For @@ -2421,7 +2421,7 @@ Partial Class Inventarios_EntregaAlmacen PU = DtExistencias.FiltroPrimeroValor("PU", $"CvePS = {Dr("CvePS")} AND CveUM = {Dr("CveUM").ToString.ToEntero}").ToString.ToDecimal End If - If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=If(CBool(Dr("AplicaSeccion")), Dr("CveSeccion").ToString.ToEntero, -1)) Then + If Not ObjInventario.AddMovimientoDetalle(CveMovimiento, CantidadPendiente, Dr("CveUM").ToString.ToEntero, Dr("CvePS").ToString.ToEntero, PU, CveVentaDetalle:=Dr("CveVentaDetalle").ToString.ToEntero, FechaCaducidad:=If(CBool(Dr("AplicaCaducidad")), Dr("FechaCaducidad").ToString.ToDate, MinFecha), Lote:=If(CBool(Dr("AplicaLote")), Dr("Lote").ToString, "-1"), CveSeccionAlmacen:=-3) Then ErrorMovInv = True TextoError.AppendFormat("Ocurrió un error al procesar los conceptos de salida. Por favor vuelva a intentar.") Exit For diff --git a/Inventarios/InventarioFisico.aspx b/Inventarios/InventarioFisico.aspx index aed516fe4..441bbb7c4 100644 --- a/Inventarios/InventarioFisico.aspx +++ b/Inventarios/InventarioFisico.aspx @@ -28,7 +28,7 @@
    -
    SubProyecto:
    +
    SubProyecto:
    @@ -148,7 +148,7 @@
    - + SubProyecto:
    diff --git a/Inventarios/InventarioFisico.aspx.vb b/Inventarios/InventarioFisico.aspx.vb index 8e9f7a024..3f8632f2d 100644 --- a/Inventarios/InventarioFisico.aspx.vb +++ b/Inventarios/InventarioFisico.aspx.vb @@ -88,6 +88,7 @@ Partial Class Inventarios_InventarioFisico Inventario.Dispose() gvIF.DataSource = dt gvIF.EditIndex = -1 + gvIF.Columns(1).HeaderText = LblSubProyecto.Text gvIF.DataBind() gvIF.Columns(6).Visible = UsuarioActual.TienePermisoProceso(178) End Sub @@ -125,11 +126,8 @@ Partial Class Inventarios_InventarioFisico UPPPSExcluye.Update() End Sub Private Sub CargaDdlSubProyectos() - DdlSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlSubProyecto.DataBind() - DdlFiltroSubProyecto.Items.Insert(0, New ListItem("Todas", "-1")) - DdlFiltroSubProyecto.DataSource = GlobalDTSubProyectos(-1, CveEmpresa:=UsuarioActual.CveEmpresa) - DdlFiltroSubProyecto.DataBind() + CargarCentrosDeCosto(Nothing, DdlSubProyecto, Nothing, LblSubProyecto) + CargarCentrosDeCosto(Nothing, DdlFiltroSubProyecto, Nothing, LblFiltroSubProyecto) End Sub Private Sub CargaDdlClasificacion() DdlClasificacion.Items.Insert(0, New ListItem("Todos", "-1")) @@ -552,6 +550,7 @@ Partial Class Inventarios_InventarioFisico If ObjInventario.GetInventarioFisico(-1, UsuarioActual.CveEmpresa, DdlFiltroSubProyecto.SelectedValue.ToEntero, DdlEstado.SelectedValue) Then gvIF.DataSource = ObjInventario.DtResultados gvIF.DataBind() + gvIF.Columns(1).HeaderText = LblSubProyecto.Text End If UppInventarioFisico.Update() ObjInventario.Dispose() diff --git a/Inventarios/PaquetesArmadoDesarmado.aspx.vb b/Inventarios/PaquetesArmadoDesarmado.aspx.vb index d76c06fd0..7e8f78fbe 100644 --- a/Inventarios/PaquetesArmadoDesarmado.aspx.vb +++ b/Inventarios/PaquetesArmadoDesarmado.aspx.vb @@ -211,7 +211,7 @@ Partial Class Inventarios_PaquetesArmadoDesarmado Dim DtDatos As New DataTable Dim drP As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPaqueteArmado.SelectedValue.ToEntero).FiltroPrimero("") - Dim AplicaSerie As Boolean = False + Dim CveUMTemp = drP("CveUM").ToString.ToEntero If ObjProductosServicios.GetPaqueteDetalle(DdlPaqueteArmado.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, CveUMTemp, TxtCantidadArmado.Text.ToDouble, DdlAlmacenArmado.SelectedValue.ToEntero, TxtFechaArmado.Text.ToDate, CveVendedor:=CveVendedor, CveCliente:=If(UsuarioActual.Empresa.Funcionalidad(146) = "1", -1, CveCliente)) Then DtDatos = ObjProductosServicios.DtResultados.FiltraParametros("CveTipoPS = 2").Copy @@ -278,8 +278,8 @@ Partial Class Inventarios_PaquetesArmadoDesarmado GvDatosArmado.DataSource = DtDatos GvDatosArmado.DataBind() + GvDatosArmado.Columns(4).Visible = DtDatos.MAX("AplicaSerie", "") = "True" GvDatosArmado.Columns(5).Visible = DtDatos.MAX("AplicaSeccion") = "True" - 'GvDatosArmado.Columns(6).Visible = DtDatos.MAX("Serie", "") <> "" GvDatosArmado.Columns(6).Visible = False 'DtDatos.MAX("Lote", "") <> "" GvDatosArmado.Columns(7).Visible = False 'DtDatos.MAX("FechaCaducidad", "FechaCaducidad is not null").ToDate > MinFecha @@ -758,10 +758,10 @@ Partial Class Inventarios_PaquetesArmadoDesarmado 'Dim Contador = DtDatosDetalle.FiltraParametros(String.Format("ConsecId = {0}", e.Row.DBCampo("Consec"))).Rows.Count 'e.Row.FCTextBox("TbCantidadF").Text = Contador.ToString - If AplicaSerie Then - e.Row.FCLinkButton("BtnSeriePaquete").Visible = True + 'If AplicaSerie Then + e.Row.FCLinkButton("BtnSeriePaquete").Visible = True e.Row.FCLinkButton("BtnSeriePaquete").Attributes.Add("data-toggle", "tooltip") - End If + 'End If Else e.Row.FCButton("BtnSerie").Visible = False diff --git a/Inventarios/RecepcionAlmacen.aspx.vb b/Inventarios/RecepcionAlmacen.aspx.vb index 54a7daf21..d094c150b 100644 --- a/Inventarios/RecepcionAlmacen.aspx.vb +++ b/Inventarios/RecepcionAlmacen.aspx.vb @@ -616,7 +616,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjInventarios As New ClsInventarios If ddlProveedor.SelectedValue.ToEntero > 0 Then - If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveEmpresa) Then + If ObjInventarios.ComprasPendientesAlmacenGet(ddlProveedor.SelectedValue.ToEntero, MinFecha.ToShortDateString.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then Dim FiltroTemporal = If(UsuarioActual.CveEmpresa = 119, "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')") DdlFolio.DataSource = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}") Else @@ -695,7 +695,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim ObjInventarios As New ClsInventarios Dim DtPendientes As New DataTable - If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveEmpresa) Then + If ObjInventarios.ComprasPendientesAlmacenGet(-1, TxtFechaPendientes.Text.ToDate, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then Dim FiltroTemporal = If(UsuarioActual.CveEmpresa.Contiene(119, 140), "AND TipoDocto IN ('Fac','NC','DEV')", "AND TipoDocto IN ('Fac')") DtPendientes = ObjInventarios.DtResultados.FiltraParametros($"CantOC >= 0 {FiltroTemporal}") Else @@ -1975,7 +1975,7 @@ Partial Class Inventarios_RecepcionAlmacen Dim CantConsulta = DtDatosImportacion.SUM(VariableCampo) If CantidadGV <> CantConsulta Then CargaFleteSurtir(CveFleteSurtir) - Alert("Ha sido cambiada la informacion de existencias costo indirecto actual, se han recargado la información.", TipoMensaje.MsgAdvertencia) + Alert(String.Format("Ha sido cambiada la informacion de existencias costo indirecto actual, se han recargado la información.[{0}-{1}]", CantidadGV, CantConsulta), TipoMensaje.MsgAdvertencia) ObjComprasDif.Dispose() Return False End If @@ -3151,6 +3151,7 @@ Partial Class Inventarios_RecepcionAlmacen drc("SubTotal") = drr("SubTotal") drc("TipoCambio") = drr("TipoCambio") drc("CveProveedor") = drr("CveProveedor") + drc("SubTotalTC") = drr("SubTotalTC") DtTempCompras.Rows.Add(drc) End If diff --git a/Inventarios/RepMaximoMinimo.aspx b/Inventarios/RepMaximoMinimo.aspx index 902ef3ed4..3be94d878 100644 --- a/Inventarios/RepMaximoMinimo.aspx +++ b/Inventarios/RepMaximoMinimo.aspx @@ -277,9 +277,12 @@
    - - - + + + + <%----%> + <%----%>
    diff --git a/Inventarios/RepMaximoMinimo.aspx.vb b/Inventarios/RepMaximoMinimo.aspx.vb index 342203af5..4b08f2b3a 100644 --- a/Inventarios/RepMaximoMinimo.aspx.vb +++ b/Inventarios/RepMaximoMinimo.aspx.vb @@ -56,17 +56,17 @@ Partial Class Inventarios_RepMaximoMinimo DdlSubProyecto.Items.Insert(0, New ListItem("Todas", "-1")) - DdlAlmacen.DataSource = GlobalDTAlmacen(UsuarioActual.CveEmpresa) + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1) 'GlobalDTAlmacen(UsuarioActual.CveEmpresa) DdlAlmacen.DataBind() DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) - DdlAlmacenModal.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) + DdlAlmacenModal.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1) DdlAlmacenModal.DataBind() DdlAlmacenModal.Items.Insert(0, New ListItem("Seleccione Almacén", "-1")) - DdlPSModal.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) - DdlPSModal.DataBind() - DdlPSModal.Items.Insert(0, New ListItem("Seleccione", "-1")) + 'DdlPSModal.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa) + 'DdlPSModal.DataBind() + 'DdlPSModal.Items.Insert(0, New ListItem("Seleccione", "-1")) UpModalMaximoMinimo.Update() @@ -86,9 +86,9 @@ Partial Class Inventarios_RepMaximoMinimo DdlAlmacen.Items.Clear() 'If DtSubptoyecto.Rows.Count > 0 Then 'Dim CveSucursal As Integer = DtSubptoyecto(0)("CveSucursal").ToString.ToEntero - DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa).FiltraParametros(String.Format("CveSubProyecto={0}", DdlSubProyecto.SelectedValue.ToEntero)) - DdlAlmacen.DataBind() - DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) + DdlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CveTipoAlmacen:=-1).FiltraParametros(String.Format("CveSubProyecto={0}", DdlSubProyecto.SelectedValue.ToEntero)) + DdlAlmacen.DataBind() + DdlAlmacen.Items.Insert(0, New ListItem("Todos", "-1")) 'Else ' DdlAlmacen.DataSource = Nothing ' DdlAlmacen.DataBind() @@ -195,7 +195,8 @@ Partial Class Inventarios_RepMaximoMinimo Private Sub LnkDefinir_Click(sender As Object, e As EventArgs) Handles LnkDefinir.Click HFDefinir.Value = "I" DdlAlmacenModal.SelectedIndex = 0 - DdlPSModal.SelectedIndex = 0 + DdlPSModal.SelectedValue = "-1" + DdlPSModal.SelectedText = "Seleccione" TxtMaximo.Text = "" TxtMinimo.Text = "" DdlAlmacenModal.Enabled = True @@ -206,20 +207,26 @@ Partial Class Inventarios_RepMaximoMinimo End Sub Private Sub LbAgregarMaximoMinimo_Click(sender As Object, e As EventArgs) Handles LbAgregarMaximoMinimo.Click - Dim ObjInventario As New ClsInventarios - If HFDefinir.Value = "I" Then - If ObjInventario.AddAlmacenMaximoMinimo(DdlAlmacenModal.SelectedValue.ToEntero, DdlPSModal.SelectedValue.ToEntero, TxtMaximo.Text.ToDouble, TxtMinimo.Text.ToDouble, UsuarioActual.CveUsuario) Then - Alert("El Máximo/Mínimo se agregó correctamente.", TipoMensaje.MsgInformacion) - End If - ElseIf HFDefinir.Value = "U" Then - If ObjInventario.UpdateAlmacenMaximoMinimo(DdlAlmacenModal.SelectedValue.ToEntero, DdlPSModal.SelectedValue.ToEntero, TxtMaximo.Text.ToDouble, TxtMinimo.Text.ToDouble, UsuarioActual.CveUsuario) Then - Alert("El Máximo/Mínimo se actualizó correctamente.", TipoMensaje.MsgInformacion) - End If - End If + If DdlPSModal.SelectedValue.ToEntero > 0 Then - CargaGrid() - RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalMaximoMinimo")) - ObjInventario.Dispose() + Using ObjInventario As New ClsInventarios + + If HFDefinir.Value = "I" Then + If ObjInventario.AddAlmacenMaximoMinimo(DdlAlmacenModal.SelectedValue.ToEntero, DdlPSModal.SelectedValue.ToEntero, TxtMaximo.Text.ToDouble, TxtMinimo.Text.ToDouble, UsuarioActual.CveUsuario) Then + Alert("El Máximo/Mínimo se agregó correctamente.", TipoMensaje.MsgInformacion) + End If + ElseIf HFDefinir.Value = "U" Then + If ObjInventario.UpdateAlmacenMaximoMinimo(DdlAlmacenModal.SelectedValue.ToEntero, DdlPSModal.SelectedValue.ToEntero, TxtMaximo.Text.ToDouble, TxtMinimo.Text.ToDouble, UsuarioActual.CveUsuario) Then + Alert("El Máximo/Mínimo se actualizó correctamente.", TipoMensaje.MsgInformacion) + End If + End If + End Using + + CargaGrid() + RegistraScript(String.Format("$('#{0}').modal('hide');", "ModalMaximoMinimo")) + Else + Alert("Seleccione un producto o servicio", TipoMensaje.MsgAdvertencia) + End If End Sub Protected Sub UpdateMaximoMinimo(sender As Object, e As EventArgs) @@ -227,13 +234,15 @@ Partial Class Inventarios_RepMaximoMinimo HFDefinir.Value = "U" Dim CveAlmacen As Integer = GvRow.DataKey("CveAlmacen").ToString.ToEntero Dim CvePS As Integer = GvRow.DataKey("CvePS").ToString.ToEntero + Dim strPS As String = GvRow.DataKey("PS").ToString() Dim Maximo As String = GvRow.DataKey("Maximo").ToString Dim Minimo As String = GvRow.DataKey("Minimo").ToString DdlAlmacenModal.Enabled = False DdlPSModal.Enabled = False - DdlAlmacenModal.SelectedValue = CveAlmacen.ToString + DdlAlmacenModal.SelectedValue = CveAlmacen.ToString() + DdlPSModal.SelectedText = strPS DdlPSModal.SelectedValue = CvePS.ToString TxtMaximo.Text = Maximo TxtMinimo.Text = Minimo diff --git a/Inventarios/TraspasoAlmacen.aspx b/Inventarios/TraspasoAlmacen.aspx index 3c6546336..34fce1e71 100644 --- a/Inventarios/TraspasoAlmacen.aspx +++ b/Inventarios/TraspasoAlmacen.aspx @@ -119,68 +119,66 @@
    - +
    - +
    -
    +
    -
    - +
    +
    -
    +
    -
    +
    - + <%--CARGA EXCEL--%> <%--Modal para agregar camion--%> - - - +
    @@ -1340,6 +1345,7 @@ +
    @@ -3858,7 +3864,7 @@