diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 4361a0c36..2d60ba1bb 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -3345,12 +3345,10 @@ Partial Class ProductosyServicios End If Else - - If ObjPS.GetPS(-1, -1, CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper) Then - - If ObjPS.DtResultados IsNot Nothing AndAlso ObjPS.DtResultados.Rows.Count = 1 Then - Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero() - If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, + Dim CvePS As Integer = GlobalDTPSSimplificado(CveEmpresaFranquicia, Codigo:=TxtCodigo.Text.Trim.ToUpper).FiltroPrimeroValor("CvePS").ToEntero + If CvePS > 0 Then + 'Dim CvePS As Integer = ObjPS.DtResultados.FiltroPrimeroValor("CvePS", String.Format(" Codigo = '{0}'", TxtCodigo.Text.Trim.ToUpper)).ToEntero() + If Not ObjPS.UpdatePS(CveClasificacion, -1, CveUnidadMedida, TxtCodigo.Text.Trim, TxtNumeroParte.Text.Trim, TxtCodigoBarras.Text.Trim, PSS, TxtPrecio.Text.Trim.ToDouble, DdlIVA.SelectedValue.ToDouble, (TxtRetIVA.Text.Trim.ToDouble / 100), ChkInventariable.Checked, -1, True, ChkAplicaParaVenta.Checked, ChkEstado.Checked, UsuarioActual.CveUsuario, CvePS, CveMetodoInv, EsPaquete, DdlSATPS.SelectedValue.ToEntero, CveEmpresaFranquicia, CveTipoPS:=DdlTipoPS.SelectedValue.ToEntero, TipoServicio:=-1, CveClasificacion2:=CveClasificacion2, CveMarca:=CveMarcaFranquicia, AlmacenSeccion:=TxtAlmacenSeccion.Text.Trim, AplicaIEPS:=ChkAplicaIeps.Checked, IEPSPorcentaje:=DdlIEPSPorcentaje.SelectedValue.ToDecimal, @@ -3363,15 +3361,8 @@ Partial Class ProductosyServicios ClaveImpuestoUM:=DdlImpUM.SelectedValue.ToString, ClaveCategoriaToxicidad:=DdlCategoriaToxicidad.SelectedValue.ToString, ClaveImpuestoTipoProducto:=DdlImpTipoProducto.SelectedValue.ToString, AplicaSerie:=ChkSerie.Checked, AplicaLote:=ChkLote.Checked, AplicaCaducidad:=ChkCaducidad.Checked, AplicaSeccion:=ChkSeccion.Checked, TiempoCaducidad:=TxtTiempoCaducidad.Text.ToEntero()) Then - Return True - - End If - - Else - Alert(String.Format("El producto no existe en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia) Return True End If - Else Alert(String.Format("Se presento un error al consultar la existencia en la franquicia: '{0}'", GlobalDTEmpresas(CveEmpresaFranquicia).FiltroPrimeroValor("Empresa")), TipoMensaje.MsgAdvertencia) Return True