From b0296087bfb3db68aa4cb6f387082eb25d8424f6 Mon Sep 17 00:00:00 2001 From: JORGE LUIS CAUDILLO ESPARZA Date: Mon, 7 Oct 2019 13:09:15 -0700 Subject: [PATCH 1/2] --- Compras/Compras.aspx | 3 +++ Compras/Compras.aspx.vb | 28 +++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Compras/Compras.aspx b/Compras/Compras.aspx index 6fb4ef422..7b6f8fcc3 100644 --- a/Compras/Compras.aspx +++ b/Compras/Compras.aspx @@ -13,6 +13,9 @@ +
  • + +
  • Agregar Concepto
  • diff --git a/Compras/Compras.aspx.vb b/Compras/Compras.aspx.vb index 557ae3e82..a09bfd53d 100644 --- a/Compras/Compras.aspx.vb +++ b/Compras/Compras.aspx.vb @@ -3755,7 +3755,7 @@ Partial Class Compras_Compras Dim GuardaNoDeducibles As Boolean = False If ChkEsNoDeducible.Checked Then For Each Row As DataRow In TmpDT.Rows - If Row("NoDeducible").ToString().ToUpper() = "TRUE" OrElse Row("NoDeducible").ToString().ToUpper() = "1" Then + If Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1") Then GuardaNoDeducibles = True End If Next @@ -4748,7 +4748,7 @@ Partial Class Compras_Compras CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, OtrosGastos:=Row("OtrosGastos").ToString.ToDecimal, RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, - IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString = "True" OrElse Row("NoDeducible").ToString = "1") AndAlso EsNoDeducible, True, False)) Then + IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False)) Then ErrorDetalles = True Exit For @@ -9312,7 +9312,7 @@ Partial Class Compras_Compras If Not ObjCompra.UpdateCompraDetalle(Row("CvePS").ToString.ToEntero, Row("Cantidad").ToString.ToDouble, Row("PU").ToString.ToDouble, Row("IVA").ToString.ToDouble, Row("Total").ToString.ToDouble, Row("Descuento").ToString.ToDouble, Row("Obs").ToString, Row("CveSubProyecto").ToString.ToEntero, Row("CvePresupuestoEgreso").ToString.ToEntero, CveAF, Row("CveCompraDetalle").ToString.ToEntero, CvePersonal:=CvePersonal, CveTipoGasto:=Row("CveTipoGasto").ToString.ToEntero, AF_Medida:=Row("AFMedida").ToString.ToEntero, AF_TipoMantenimiento:=Row("AFTipoMantenimiento").ToString.ToEntero, Referencia:=Referencia, RetIVA:=Row("RetIVA").ToString.ToDouble, RetISR:=Row("RetISR").ToString.ToDouble, IEPSPS:=Row("IEPSPS").ToString.ToDouble, IEPSPSIVA:=Row("IEPSPSIVA").ToString.ToDouble, - IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If(Row("NoDeducible").ToString = "True" AndAlso EsNoDeducible, True, False)) Then + IVAPorcentaje:=Row("IVAPorcentaje").ToString.ToDouble, RetIVAPorcentaje:=Row("RetIVAPorcentaje").ToString.ToDouble, RetISRPorcentaje:=Row("RetISRPorcentaje").ToString.ToDouble, IEPSPSPorcentaje:=Row("IEPSPSPorcentaje").ToString.ToDouble, IEPSPSIVAPorcentaje:=Row("IEPSPSIVAPorcentaje").ToString.ToDouble, NoDeducible:=If((Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1")) AndAlso EsNoDeducible, True, False)) Then Retorno = False Exit For @@ -16518,7 +16518,7 @@ Partial Class Compras_Compras Dim PS As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=DdlPS.SelectedValue.ToEntero).FiltroPrimero("") DdlIVA.Enabled = True - ChkEsNoDeduciblePS.Checked = If(GvRow.DataKey("NoDeducible").Contiene("True", "1"), True, False) + ChkEsNoDeduciblePS.Checked = If(GvRow.DataKey("NoDeducible").ToUpper().Contiene("TRUE", "1"), True, False) If PS IsNot Nothing Then If PS("IVA").ToString.ToEntero() <> -1 Then @@ -18988,5 +18988,23 @@ Partial Class Compras_Compras End If ObjComp.Dispose() - End Sub + End Sub + Protected Sub btnpruebas_Click(sender As Object, e As EventArgs) + Dim GuardaNoDeducibles As Boolean = False + If ChkEsNoDeducible.Checked Then + For Each Row As DataRow In TmpDT.Rows + If Row("NoDeducible").ToString().ToUpper().Contiene("TRUE", "1") Then + GuardaNoDeducibles = True + End If + + Next + If GuardaNoDeducibles = False Then + Alert("Si la compra es No Deducible, mínimo se debe registrar un producto No Deducible", TipoMensaje.MsgAdvertencia) + Exit Sub + Else + Alert("todo bien!", TipoMensaje.MsgInformacion) + + End If + End If + End Sub End Class \ No newline at end of file From 2035766c199d8221eac64919de071ba2ec6c45f3 Mon Sep 17 00:00:00 2001 From: janeth arvizu Date: Mon, 7 Oct 2019 13:38:30 -0700 Subject: [PATCH 2/2] Salida Automatica de Almacen al facturar Cot --- Ventas/Ventas.aspx.vb | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 24c458fb8..0b9e6e136 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1598,6 +1598,14 @@ Partial Class Ventas End Set End Property + Private Property CvePrecioLista As Integer + Get + Return ViewState("CvePrecioLista").ToString.ToEntero + End Get + Set(value As Integer) + ViewState("CvePrecioLista") = value + End Set + End Property #End Region @@ -1652,6 +1660,7 @@ Partial Class Ventas ViewState("ClienteDesglosaIEPS") = False ViewState("ClienteRetIVA") = 0 ViewState("ClienteRetISR") = 0 + ViewState("CvePrecioLista") = 0 idCuentaContabilizacion = 1 CveEmpresaCRM = 0 CveAcercamientoCRM = 0 @@ -3848,6 +3857,7 @@ Partial Class Ventas DdlSubProyectoDatos.Items.Insert(0, New ListItem("Seleccione", "-1")) End If DdlSubProyectoDatos.SelectedValueExistInsert(DbRowVenta("CveSubProyecto").ToString, DbRowVenta("SubProyecto").ToString) + CargarAlmacenes() If DdlSubProyectoCobranza.Items.Count = 0 Then DdlSubProyectoCobranza.Items.Insert(0, New ListItem("Seleccione", "-1")) @@ -4444,7 +4454,7 @@ Partial Class Ventas End Function Private Sub CargarAlmacenes() - If CveVenta > 0 Then + If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then DivAlmacen.Visible = False Else Dim DTAlmacen As DataTable @@ -4605,6 +4615,8 @@ Partial Class Ventas ViewState("CveCuentaRetISR") = ObjCliente.CveCuentaRetISR ViewState("CodCliente") = ObjCliente.Codigo + ViewState("CvePrecioLista") = ObjCliente.CvePrecioLista + ViewState("CliNoExt") = ObjCliente.NoExt ViewState("CliNoInt") = ObjCliente.NoInt ViewState("CliLocalidad") = If(ObjCliente.Localidad.Trim.Length = 0, ObjCliente.Ciudad.Trim, ObjCliente.Localidad.Trim) @@ -5780,7 +5792,7 @@ Partial Class Ventas End If - If CveVenta > 0 Then + If CveVenta > 0 And DdlTipoComprobante.SelectedValue <> "Cot" Then If e.Row.DBCampo("CveConcepto").ToEntero = 3 Then CveAlmacenDevolucion = e.Row.DBCampo("CveAlmacen").ToEntero e.Row.FCCheckBox("cbInv").Visible = False End If @@ -13851,10 +13863,10 @@ Partial Class Ventas PU = 0 Dim PrecioSugerido As Decimal = 0 - Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero - If CvePrecioListaPS > 0 Then + 'Dim CvePrecioListaPS = GlobalDTCliente(UsuarioActual.CveEmpresa, -1).FiltroPrimeroValor("CvePrecioLista", $"CveCliente = {CveCliente}").ToEntero + If CvePrecioLista > 0 Then Dim ObjPS As New ClsProductosServicios - If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioListaPS, CvePS:=CvePSAdicional) Then + If ObjPS.GetPSPreciosLista(UsuarioActual.CveEmpresa, CvePrecioLista, CvePS:=CvePSAdicional) Then PrecioSugerido = ObjPS.DtResultados.FiltroPrimeroValor("PrecioLista").ToDecimal If PrecioSugerido = 0 Then @@ -14500,7 +14512,7 @@ Partial Class Ventas GvPS.DataBind() 'RECARGA GV INVENTARIO - If Not CveVenta > 0 Then + If Not CveVenta > 0 Or DdlTipoComprobante.SelectedValue = "Cot" Then DtInv = TmpDT.Copy.FiltraParametros("CveTipoPS = 2") CargaGVInv(DtInv) End If