From b89b7ab9c4e08a57417fc97e26aac0c7cc2b830b Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Mon, 6 Sep 2021 15:49:14 -0700 Subject: [PATCH] =?UTF-8?q?Correciones:=20Carga=20de=20Retenciones=20al=20?= =?UTF-8?q?CrearAPartirDe,=20Validaci=C3=B3n=20de=20existencia=20solo=20en?= =?UTF-8?q?=20productos,=20Validaci=C3=B3n=20de=20surtidos=20al=20facturar?= =?UTF-8?q?=20remisi=C3=B3n,=20aplicaci=C3=B3n=20de=20NC,=20boton=20de=20a?= =?UTF-8?q?gregar=20cliente=20en=20E140=20cuando=20es=20cotizaci=C3=B3n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index d7df65f78..9c6fbc075 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2628,6 +2628,10 @@ Partial Class Ventas 'DdlEstatus.Enabled = False End If + If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then + LnkAgregarCliente.Visible = True + End If + End If CargaEstatusFactura(Opcion) @@ -5632,7 +5636,7 @@ Partial Class Ventas ViewState("ClienteRetIVA") = ObjCliente.RetIVA / 100 ViewState("ClienteRetISR") = ObjCliente.RetISR / 100 - If CveVenta <= 0 Then + If CveVenta <= 0 OrElse EsCreaApartirDe Then DdlTipoRetencion.SelectedValueExist(ObjCliente.DtResultados(0)("CveTipoRetencion").ToString()) DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) @@ -7689,13 +7693,7 @@ Partial Class Ventas Dim CveProducto As Integer Dim Existencia As Double Dim CveAlmacen = ddlAlmacen.SelectedValue.ToEntero() - For Each dr As DataRow In TmpDT.Rows - - 'SI ES SERVICIO NO VALIDA - 'GlobalDTProductosServicios - If GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).FiltroPrimeroValor("CveTipoPS").ToString().ToEntero() = 1 Then - Continue For - End If + For Each dr As DataRow In TmpDT.FiltraParametros("CveTipoPS = 2").Rows If DdlTipoComprobante.SelectedValue <> "Cot" And ChkSinExistencia.Checked = False Then 'VALIDA EXISTENCIA @@ -18966,6 +18964,12 @@ Partial Class Ventas ' rowSurtidos("Surtido").ToString().ToDouble < rowSurtidos("Cantidad").ToString().ToDouble AndAlso (dr("CantidadDisponible").ToString().ToDouble - rowSurtidos("Surtido").ToString().ToDouble > 0 Or dr("Serie").ToString() <> "") If rowSurtidos("Surtido").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDecimal Then Dim CantidadSurtida As Double = If(dr("CantidadDisponible").ToString().ToDecimal < rowSurtidos("Cantidad").ToString().ToDouble, dr("CantidadDisponible").ToString().ToDecimal, rowSurtidos("Cantidad").ToString().ToDecimal) + + 'SI LA CANTIDAD SURTIDA SUPERA LO REQUERIDO, TOMA SOLO LO NECESARIO PARA COMPLETAR + If (rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida) > rowSurtidos("Cantidad").ToString().ToDecimal Then + CantidadSurtida = (rowSurtidos("Cantidad").ToString().ToDecimal - rowSurtidos("Surtido").ToString().ToDecimal) + End If + MovDTCuadrados.ImportRow(dr) MovDTCuadrados(MovDTCuadrados.Rows.Count - 1)("Cantidad") = CantidadSurtida DtRemConceptosSurtidos(Indice)("Surtido") = rowSurtidos("Surtido").ToString().ToDecimal + CantidadSurtida @@ -26913,7 +26917,7 @@ Partial Class Ventas For Each Dr As DataRow In DtImpuestosLocal.Rows FiltroStr = String.Format("ISNULL(PorcentajeIVA,0) = {0} AND ISNULL(PorcentajeRetIVA,0) = {1} AND ISNULL(PorcentajeRetISR,0) = {2} AND ISNULL(PorcentajeIEPS,0) = {3} AND ISNULL(CveSubProyecto,0) = {4} ", Dr("PorcentajeIVA").ToString().ToDecimal, Dr("PorcentajeRetIVA").ToString().ToDecimal, Dr("PorcentajeRetISR").ToString().ToDecimal, Dr("PorcentajeIEPS").ToString().ToDecimal, Dr("CveSubProyecto")) - Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("Total", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))) + Dim importePuTemp As Decimal = (Porcentaje * (TmpDT.SUMD("TotalImporte", FiltroStr) - TmpDT.SUMD("Descuento", FiltroStr))) If Not AplicaImpuestosLocales Then importePuTemp = importePuTemp - TotalImpuestosLocalesVentaOriginal @@ -29767,7 +29771,7 @@ Partial Class Ventas End If End If ObjCliente.Dispose() - 'DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) + DdlTipoRetencion_SelectedIndexChanged(DdlTipoRetencion, EventArgs.Empty) TrVistaPrevia.Visible = True TxtFechaVencimientoCotizacion.Text = Now.ToShortDateString @@ -31158,6 +31162,8 @@ Partial Class Ventas tClienteRetIVA = 0.04D ElseIf DdlTipoRetencion.SelectedValue.Contiene("4") AndAlso CBool(RowServicio("EsOutSourcing").ToString()) Then tClienteRetIVA = 0.06D + ElseIf DdlTipoRetencion.SelectedValue.Contiene("0") Then + tClienteRetIVA = 0.00D End If ViewState("ClienteRetIVA") = tClienteRetIVA End If