From 67f6acf2d8b88090354877be7a1268248bea55f2 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Sep 2024 18:35:14 -0700 Subject: [PATCH 01/14] --FIX. Aplicar pago con devolucion al facturar cotizacion. --- Ventas/Ventas.aspx.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 002e09ad6..2ba37de12 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -24425,7 +24425,7 @@ Partial Class Ventas 'SI ES AMORTIZACION POR NOTA DE CREDITO DEBE SUMAR LA TOTALIDAD PARA COMPARAR EL PAGO If DdlTipoComprobante.SelectedValue.Contiene("Ing", "Ant") AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("2", "4") Then For Each gvr As GridViewRow In GVAnticipos.Rows - If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3, 12) Then + If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3, 12, 66) Then AmortizacionNC += gvr.FCTextBox(String.Format("TxtAnticipo{0}", gvr.RowIndex)).Text.ToDecimal End If Next From 001693c1e093192c7efaacfacaa33cd79414c86f Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Sep 2024 19:09:58 -0700 Subject: [PATCH 02/14] =?UTF-8?q?Puntos=20GDiaz:=20--Analizar=20la=20posib?= =?UTF-8?q?ilidad=20de=20establecer=20un=20limite=20m=C3=ADnimo=20%=20de?= =?UTF-8?q?=20utilidad=20de=20venta=20por=20producto.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App_Code/ClsProductosServicios.vb | 6 ++-- Ventas/ProductosServicios.aspx | 34 +++++++++++++-------- Ventas/ProductosServicios.aspx.vb | 12 ++++++-- Ventas/Ventas.aspx.vb | 50 +++++++++++++++++++++++++------ 4 files changed, 75 insertions(+), 27 deletions(-) diff --git a/App_Code/ClsProductosServicios.vb b/App_Code/ClsProductosServicios.vb index 65d76357c..0c659229c 100644 --- a/App_Code/ClsProductosServicios.vb +++ b/App_Code/ClsProductosServicios.vb @@ -415,7 +415,7 @@ Public Class ClsProductosServicios Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1, Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0, Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, - Optional Imagen As String = "") As Integer + Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0) As Integer Dim Retorno As Integer = -1 DataAdapter("PA_ProductosServiciosAdd") @@ -525,6 +525,7 @@ Public Class ClsProductosServicios .Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno .Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion .Add("@Imagen", SqlDbType.VarChar).Value = Imagen + .Add("@PorcentajeMinimoUtilidad", SqlDbType.Decimal).Value = PorcentajeMinimoUtilidad End With Try @@ -681,7 +682,7 @@ Public Class ClsProductosServicios Optional CveMaterialPeligroso As Integer = -1, Optional CveEmbalaje As Integer = -1, Optional PesoKg As Decimal = -1, Optional Dimensiones As String = "", Optional CveObjetoImpuesto As Integer = 0, Optional RegistroRSCO As String = "-1", Optional FechaVigenciaRSCO As Date = MinFecha, Optional VigenciaIndeterminadaRSCO As Boolean = False, Optional CveTipoEmpacado As Integer = -1, Optional CveTipoOrganico As Integer = -1, Optional NombreComercial As String = "", Optional NotasAdicionales As String = "", Optional EcommerceEtiquetas As String = "", Optional ActivoEcommerce As Boolean = False, Optional EcommercePrecio As Decimal = 0, - Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, Optional Imagen As String = "") As Boolean + Optional CveClasificacionEcommerce As Integer = -1, Optional EcommerceCantidad As Decimal = 0, Optional CodigoAlterno As String = "-1", Optional PSAlterno As String = "-1", Optional ProductoExhibicion As Boolean = False, Optional Imagen As String = "", Optional PorcentajeMinimoUtilidad As Decimal = 0) As Boolean Dim Retorno As Boolean = False @@ -790,6 +791,7 @@ Public Class ClsProductosServicios .Add("@PSAlterno", SqlDbType.VarChar).Value = PSAlterno .Add("@ProductoExhibicion", SqlDbType.Bit).Value = ProductoExhibicion .Add("@Imagen", SqlDbType.VarChar).Value = Imagen + .Add("@PorcentajeMinimoUtilidad", SqlDbType.Decimal).Value = PorcentajeMinimoUtilidad End With Try diff --git a/Ventas/ProductosServicios.aspx b/Ventas/ProductosServicios.aspx index 231cfe849..1dd0d9d97 100644 --- a/Ventas/ProductosServicios.aspx +++ b/Ventas/ProductosServicios.aspx @@ -269,6 +269,14 @@ +
+ + + + + +
+
@@ -1828,11 +1836,11 @@ -
- -   +
+ +  
@@ -2340,17 +2348,17 @@
-
- - - - - +
+ + + + +
- + Adicional Similar @@ -2363,7 +2371,7 @@
- + Depende del PS Fijo diff --git a/Ventas/ProductosServicios.aspx.vb b/Ventas/ProductosServicios.aspx.vb index 684a7cc16..f2f5634ac 100644 --- a/Ventas/ProductosServicios.aspx.vb +++ b/Ventas/ProductosServicios.aspx.vb @@ -449,6 +449,7 @@ Partial Class ProductosyServicios If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then DivPSAdicionales.Visible = True DivTipoAdicional.Visible = True + DivPorMinimoUtilidad.Visible = True End If CvePSAdicional = -1 @@ -1148,6 +1149,10 @@ Partial Class ProductosyServicios DivPSExhibicion.Visible = True ChkPSExhibicion.Checked = CBool(ObjProductosServicios.DtResultados.Rows(0)("ProductoExhibicion").ToString) End If + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + TxtPorMinimoUtilidad.Text = ObjProductosServicios.DtResultados.Rows(0)("PorcentajeMinimoUtilidad").ToString + End If Else Alert("El Producto o Servicio Solicitado no existe, por favor revise su búsqueda.", TipoMensaje.MsgAdvertencia) RegistraScript("$('#C_Tab_TabPaquetes_tab').css('display' , 'none')") @@ -1543,8 +1548,9 @@ Partial Class ProductosyServicios CvePSAdicionalVigencia:=DdlPSAdicionalVigencia.SelectedValue.ToEntero(), PrecioLibre:=ChkPrecioLibre.Checked, CveMaterialPeligroso:=DdlMaterialPeligroso.SelectedValue.ToEntero, CveEmbalaje:=DdlEmbalaje.SelectedValue.ToEntero, PesoKg:=TxtPesoKg.Text.ToDecimal, Dimensiones:=TxtDimensiones.Text.Trim, CveObjetoImpuesto:=DdlObjetoImpuesto.SelectedValue.ToEntero, Litraje:=TxtLitraje.Text.ToDecimal, RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked, - NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, - CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) > 0 Then + NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, + CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, + PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) > 0 Then ViewState("CvePS") = ObjProductosServicios.CvePS For Each GVR As GridViewRow In GvImpuestosLocales.Rows If GVR.FCCheckBox("ChkDeduccion").Checked Then @@ -1618,7 +1624,7 @@ Partial Class ProductosyServicios RegistroRSCO:=TxtRegistroRSCO.Text, FechaVigenciaRSCO:=TxtFechaVigenciaRSCO.Text.ToDate, VigenciaIndeterminadaRSCO:=ChkFechaIndeterminadaRSCO.Checked, NombreComercial:=TxtNombreComercial.Text.Trim, NotasAdicionales:=TxtEcommerceNota.Text.Trim, EcommerceEtiquetas:=TxtEcommerceEtiquetas.Text.Trim.Replace(".", ""), ActivoEcommerce:=ChkActivoEcommerce.Checked, EcommercePrecio:=TxtEcommercePrecio.Text.Trim.ToDecimal, CveClasificacionEcommerce:=DdlEcommerceClasificacion.SelectedValue.ToEntero, EcommerceCantidad:=TxtEcommerceCantidad.Text.Trim.ToDecimal, - CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked) Then + CodigoAlterno:=TxtCodigoAlterno.Text.Trim, PSAlterno:=TxtPSAlterno.Text.Trim, ProductoExhibicion:=ChkPSExhibicion.Checked, PorcentajeMinimoUtilidad:=TxtPorMinimoUtilidad.Text.ToDecimal()) Then If Not ObjProductosServicios.LimpiaImpuestosLocales(CvePS) Then TieneError = True diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 2ba37de12..35d1b6b6a 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -9125,8 +9125,18 @@ Partial Class Ventas Dim CostoMenor As Decimal = 0 Dim CostoMayor As Decimal = 0 + Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + If DatarowPS IsNot Nothing Then + If DatarowPS("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then + PorcentajeMinimoCostoEmpresa = DatarowPS("PorcentajeMinimoUtilidad").ToString().ToDecimal() + End If + End If + End If + 'PRECIO MINIMO - If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then + If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo If PrecioMinimo > 0 Then 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA @@ -9134,7 +9144,7 @@ Partial Class Ventas EsValido = True End If Else - CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo) + CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo) 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then EsValido = True @@ -9172,7 +9182,7 @@ Partial Class Ventas MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo
", DatarowPS("PS").ToString()) If TienePermisoImportes Then MensajeCosto.AppendFormat("El costo del producto es: ${0:#,###.00}
", Costo) - MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% ${1}
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) + MensajeCosto.AppendFormat("El rango menor aceptado es: {0:#,###.00}% ${1}
", PorcentajeMinimoCostoEmpresa, CostoMenor) MensajeCosto.AppendFormat("El precio indicado es: ${0:#,###.00} ({1}% de ganancia)
", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero) End If @@ -10103,8 +10113,19 @@ Partial Class Ventas End If + Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + Dim DrPSCosto As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=dr("CvePS").ToString().ToEntero()).Rows(0) + If DrPSCosto IsNot Nothing Then + If DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then + PorcentajeMinimoCostoEmpresa = DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() + End If + End If + End If + 'PRECIO MINIMO - If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then + If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo If PrecioMinimo > 0 Then 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA @@ -10112,7 +10133,7 @@ Partial Class Ventas EsValido = True End If Else - CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo) + CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo) 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then EsValido = True @@ -10151,7 +10172,7 @@ Partial Class Ventas MensajeCosto.AppendFormat("El Producto {0}. No se puede vender a un precio menor de su Costo ni a un precio mayor de su rango aceptado
", dr("PS").ToString()) If TienePermisoImportes Then MensajeCosto.AppendFormat("El costo del producto es: {0:#,###.00}$
", Costo) - MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) + MensajeCosto.AppendFormat("El rango menor aceptado es: {0} {1:#,###.00}$
", PorcentajeMinimoCostoEmpresa, CostoMenor) MensajeCosto.AppendFormat("El precio indicado es: {0:#,###.00}$ ({1}% de ganancia)
", PU.FormatoNumero, If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)) End If End If @@ -19300,8 +19321,19 @@ Partial Class Ventas Dim CostoMenor As Decimal = 0.0D Dim CostoMayor As Decimal = 0.0D + Dim PorcentajeMinimoCostoEmpresa = UsuarioActual.Empresa.Funcionalidad(129).ToDecimal + + If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then + Dim DrPSCosto As DataRow = GlobalDTPS(UsuarioActual.CveEmpresa, CvePS:=CvePS).Rows(0) + If DrPSCosto IsNot Nothing Then + If DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() > 0 Then + PorcentajeMinimoCostoEmpresa = DrPSCosto("PorcentajeMinimoUtilidad").ToString().ToDecimal() + End If + End If + End If + 'PRECIO MINIMO - If UsuarioActual.Empresa.Funcionalidad(129).ToEntero() > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then + If PorcentajeMinimoCostoEmpresa > 0 AndAlso UsuarioActual.CveUsuario <> 1560 Then '' NOTA. si tiene preciominimo, debe de validarlos e ignorar el costo, pero se debe de considerar el TC, para el costo If PrecioMinimo > 0 Then 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA @@ -19309,7 +19341,7 @@ Partial Class Ventas EsValido = True End If Else - CostoMenor = Costo + ((UsuarioActual.Empresa.Funcionalidad(129).ToDecimal / 100) * Costo) + CostoMenor = Costo + ((PorcentajeMinimoCostoEmpresa / 100) * Costo) 'SI EL PRECIO ES MAYOR AL COSTO, SI PASA If PU * If(DdlMoneda.SelectedValue.ToEntero() = 1, 1, TxtTipoCambio.Text.ToDecimal) >= CostoMenor Then EsValido = True @@ -19363,7 +19395,7 @@ Partial Class Ventas MensajeCosto.AppendFormat("El Producto {0}-{1}. No se puede vender a un precio menor de su Costo
", HdnCodigoPS.Value, HdnPS.Value) If TienePermisoImportes Then MensajeCosto.AppendFormat("El costo del producto es: ${0:#,###.00}
", Costo) - MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% ${1:#,###.00}
", UsuarioActual.Empresa.Funcionalidad(129).ToEntero(), CostoMenor) + MensajeCosto.AppendFormat("El rango menor aceptado es: {0}% ${1:#,###.00}
", PorcentajeMinimoCostoEmpresa, CostoMenor) MensajeCosto.AppendFormat("El precio indicado es: ${0:#,###.00} ({1}% de ganancia)
", PU.FormatoNumero, (If(Costo > 0, ((PU - Costo) * 100) / Costo, 0)).FormatoNumero) End If From cf5d3b864c5684197e320cc184ebe46f6572feab Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Sep 2024 19:58:18 -0700 Subject: [PATCH 03/14] Puntos GDiaz: --verificar el permiso para visualizar la columna del costo en cotizaciones con proceso --- Ventas/Ventas.aspx | 6 ++++- Ventas/Ventas.aspx.vb | 52 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/Ventas/Ventas.aspx b/Ventas/Ventas.aspx index e0200a5c8..1fb845849 100644 --- a/Ventas/Ventas.aspx +++ b/Ventas/Ventas.aspx @@ -1131,6 +1131,7 @@ + @@ -1254,9 +1255,10 @@ <%-- --%> + - + <%----%> @@ -1519,6 +1521,8 @@ <%--22--%> + <%--23--%> + diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index 35d1b6b6a..fe46d8524 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -2805,6 +2805,9 @@ Partial Class Ventas TmpDT.Columns.Add("NumeroPedimento", GetType(String)) TmpDT.Columns.Add("CodigoAlterno", GetType(String)) TmpDT.Columns.Add("PSAlterno", GetType(String)) + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D + GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -2823,6 +2826,9 @@ Partial Class Ventas If ObjCGame.ManifiestoForVtaGet(UsuarioActual.CveEmpresa, UsuarioActual.CveUsuario, Request("CveManifiesto").ToEntero()) Then GvPS.DataSource = ObjCGame.DtResultados TmpDT = ObjCGame.DtResultados + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D + GvPS.DataBind() End If @@ -2866,6 +2872,8 @@ Partial Class Ventas TmpDT.Columns.Add("NumeroPedimento", GetType(String)) TmpDT.Columns.Add("CodigoAlterno", GetType(String)) TmpDT.Columns.Add("PSAlterno", GetType(String)) + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D GvPS.DataSource = ObjVentas.DtResultados GvPS.DataBind() @@ -4922,6 +4930,9 @@ Partial Class Ventas TmpDT.Columns.Add("ImporteProntoPago", GetType(Decimal)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D End If CargaAFVenta() @@ -5844,6 +5855,7 @@ Partial Class Ventas 'Ocultamos los botones Clonar y Ordenar GvPS.Columns(19).Visible = False GvPS.Columns(20).Visible = False + thOrden.Visible = False GvFirmas.DataSource = DTmpF GvFirmas.DataBind() @@ -19709,11 +19721,23 @@ Partial Class Ventas NumTurnos = TxtNumTurnos.Text.ToDecimal() End If + 'SI TIENE PERMISO PARA VER COSTO, QUE LO AGREGUE AL TMPDT + Dim Costo As Decimal = 0 + If UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso UsuarioActual.TienePermisoProceso(385) Then + Dim ObjInventarios As New ClsInventarios + + Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, DdlSubProyectoDatos.SelectedValue.ToEntero(), CveTipoAlmacen:=1) + 'si el costo es cero, puede ser que no halla movimientos del producto, en esa sucursal. y se volverá a sacar sin especificar sucursal + If Costo <= 0 Then Costo = ObjInventarios.GetCostoPS(CvePS, TxtCantidad.Text.Trim.ToDecimal, -1, "-1", TxtFecha.Text.ToDate, -1, CveTipoAlmacen:=1) + + ObjInventarios.Dispose() + End If + AgregarProductoServicio(Cantidad, DdlUnidadMedida.SelectedValue.ToEntero(), DdlUnidadMedida.SelectedItem.Text, DdlClasificacion.SelectedValue.ToEntero(), DdlClasificacion.SelectedItem.Text, CvePS, "", TxtObsPS.Text.TrimEnd, PU, ObjDescuento.ImporteDescuento, DdlProyecto.SelectedValue.ToEntero(), DdlProyecto.SelectedItem.Text, DdlSubProyecto.SelectedValue.ToEntero(), DdlSubProyecto.SelectedItem.Text, Serie:=If(DIVCod.Visible, TxtCodigoSerie.Text.Trim, ""), TiempoEntrega:=TxtTiempoEntrega.Text, CuentaPredial:=TxtCuentaPredial.Text.Trim, RegeneraIEPS:=ClienteDesglosaIEPS, CvePromocionDetalle:=ObjDescuento.CvePromocionDetalle, - ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos) + ImporteProntoPago:=ObjDescuento.ImporteProntoPago, ObjDescuento:=ObjDescuento, CvePrecioLista:=CvePrecioListaPS, PrecioLista:=PrecioListaPS, NumTurnos:=NumTurnos, Costo:=Costo) CalculaUsados() @@ -19865,7 +19889,8 @@ Partial Class Ventas Optional CveOrdenCompraDetalle As Integer = 0, Optional CveVentaDetalleRemision As Integer = 0, Optional CveVentaDetalleCotizacion As Integer = 0, Optional CuentaPredial As String = "", Optional RegeneraIEPS As Boolean = True, Optional CveVentaDetallePedido2 As Integer = 0, Optional SeActualiza As Boolean = False, Optional CvePromocionDetalle As Integer = -1, Optional EsCargo As Boolean = False, Optional ImporteProntoPago As Decimal = 0, Optional ByRef ObjDescuento As Modelos.VentaDescuentos = Nothing, Optional CvePrecioLista As Integer = -1, Optional PrecioLista As String = "", - Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0) As Boolean + Optional CveActivoFijo As Integer = -1, Optional AFDepreciacion As Decimal = 0D, Optional AFValorInicial As Decimal = 0D, Optional NumTurnos As Decimal = 0D, Optional CantidadConversion As Decimal = 0, + Optional Costo As Decimal = 0) As Boolean Dim Retorno As Boolean = False Try @@ -20122,6 +20147,7 @@ Partial Class Ventas Row("AFValorInicial") = AFValorInicial Row("NumTurnos") = NumTurnos + Row("Costo") = Costo Row("CodigoAlterno") = DrPS("CodigoAlterno") Row("PSAlterno") = DrPS("PSAlterno") @@ -20388,6 +20414,9 @@ Partial Class Ventas TmpDT.Columns("CantidadConversion").DefaultValue = 0 TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal)) + + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D End Sub Private Sub CreaDTmpC() DTmpC = New DataTable @@ -21337,6 +21366,16 @@ Partial Class Ventas HlAgregarExcel.Visible = True End If + If (CveVenta <= 0 OrElse EsCreaApartirDe) AndAlso UsuarioActual.Empresa.Funcionalidad(382) = "1" AndAlso DdlTipoComprobante.SelectedValue = "Cot" Then + GvPS.Columns(23).Visible = True + thCosto.Visible = True + thCosto2.Visible = True + Else + GvPS.Columns(23).Visible = False + thCosto.Visible = False + thCosto2.Visible = False + End If + UpPS.Update() UpCargaExceles.Update() UpFacturar.Update() @@ -27077,6 +27116,7 @@ Partial Class Ventas GvPS.Columns(17).Visible = False GvPS.Columns(19).Visible = False GvPS.Columns(20).Visible = False + thOrden.Visible = False DdlVendedor.SelectedValue = DbRowVenta("CveVendedor").ToString() DdlTipoComprobante.Enabled = False @@ -30952,6 +30992,8 @@ Partial Class Ventas 'TmpDT.Columns.Add("CveActivoFijo", GetType(Integer)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D End If Dim FechaFactura As DateTime = NowADS() @@ -31594,6 +31636,8 @@ Partial Class Ventas GvPS.Columns(18).Visible = False GvPS.Columns(19).Visible = False GvPS.Columns(20).Visible = False + thOrden.Visible = False + DivRemisionesFacturadas.Visible = False DivAnticiposVinculados.Visible = False @@ -36398,6 +36442,8 @@ Partial Class Ventas TmpDT.Columns.Add("CveMovimientoDetallePedido", GetType(Integer)) TmpDT.Columns.Add("AFDepreciacion", GetType(Decimal)) TmpDT.Columns.Add("AFValorInicial", GetType(Decimal)) + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D End If If ObjVentas.GetVenta(CveVentaNC, UsuarioActual.CveEmpresa, VerificaAlmacen:=False) Then @@ -36562,6 +36608,8 @@ Partial Class Ventas TmpDT.Columns("NumTurnos").DefaultValue = 0D TmpDT.Columns.Add("NumeroPedimento", GetType(String)) TmpDT.Columns.Add("TotalConImpuestos", GetType(Decimal)) + TmpDT.Columns.Add("Costo", GetType(Decimal)) + TmpDT.Columns("Costo").DefaultValue = 0D Return TmpDT End Function From 80019fcb0422fb51fbaae4c272ffed92fd7ca840 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Thu, 5 Sep 2024 20:42:10 -0700 Subject: [PATCH 04/14] =?UTF-8?q?Puntos=20GDiaz:=20--Pol=C3=ADtica.=20Las?= =?UTF-8?q?=20cancelaciones=20de=20facturas=20en=20el=20mismo=20d=C3=ADa?= =?UTF-8?q?=20de=20facturaci=C3=B3n=20deber=C3=A1n=20cancelarse=20el=20pag?= =?UTF-8?q?o,.=20Las=20devoluciones=20de=20d=C3=ADas=20anteriores,=20de=20?= =?UTF-8?q?las=20facturas=20pagadas,=20se=20aplican=20ala=20nueva=20factur?= =?UTF-8?q?a=20relacion=C3=A1ndola=20entre=20s=C3=AD=20y=20sin=20emitir=20?= =?UTF-8?q?alg=C3=BAn=20otro=20cfdi,=20que=20no=20sea=20el=20propio=20ingr?= =?UTF-8?q?eso.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Ventas/Ventas.aspx.vb | 46 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Ventas/Ventas.aspx.vb b/Ventas/Ventas.aspx.vb index fe46d8524..2a0453b04 100644 --- a/Ventas/Ventas.aspx.vb +++ b/Ventas/Ventas.aspx.vb @@ -1370,6 +1370,15 @@ Partial Class Ventas End Set End Property + Private Property ListaDevolucionesAplicadas As List(Of Modelos.MAnticipoRelacionado) + Get + Return If(IsNothing(ViewState("ListaDevolucionesAplicadas")), Nothing, CType(ViewState("ListaDevolucionesAplicadas"), List(Of Modelos.MAnticipoRelacionado))) + End Get + Set(value As List(Of Modelos.MAnticipoRelacionado)) + ViewState("ListaDevolucionesAplicadas") = value + End Set + End Property + Private Property CveTimbreCartaPorteVenta As Integer Get Return If(IsNothing(ViewState("CveTimbreCartaPorteVenta")), -1, ViewState("CveTimbreCartaPorteVenta").ToString().ToEntero()) @@ -10981,6 +10990,10 @@ Partial Class Ventas ListaAnticiposAplicados.Clear() End If + If ListaDevolucionesAplicadas IsNot Nothing Then + ListaDevolucionesAplicadas.Clear() + End If + 'ENVIAR POLIZA VIRTUAL If ErrorList.Count = 0 Then If UsuarioActual.Empresa.Funcionalidad(576) = "1" AndAlso EsProduccion Then @@ -13505,6 +13518,26 @@ Partial Class Ventas Next End If + 'DEVOLUCIONES DE OTRA VENTA, APLICADAS EN UNA NUEVA + If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso Obj.TipoDocto = "Ing" AndAlso DdlTipoAmortizacionAnticipo.SelectedValue = "4" Then + If ListaDevolucionesAplicadas IsNot Nothing AndAlso ListaDevolucionesAplicadas.Count > 0 Then + Timbre.CFDIRelacionados.UUID.Clear() + For Each Dev As Modelos.MAnticipoRelacionado In ListaDevolucionesAplicadas + Timbre.CFDIRelacionados.UUID.Add(Dev.FolioFiscal) + Next + + 'TEMPORAL- DEBE SER TIPO RELACION "01 - Nota de crédito de los documentos relacionados" + Dim CveTipoRelacion As Integer = 1 + + Obj.CveTipoRelacion = CveTipoRelacion + + Dim RowTipoRelacion As DataRow = GlobalDTVtaTiposRelacion().FiltroPrimero($"CveTipoRelacion = {CveTipoRelacion}") + + Timbre.CFDIRelacionados.TipoRelacion = RowTipoRelacion("SATClaveTipoRelacion").ToString() + Timbre.CFDIRelacionados.TipoRelacionTexto = RowTipoRelacion("SATTipoRelacion").ToString() + End If + End If + Dim totSubTotal As Decimal = Obj.SubTotal Dim totIVA As Decimal = Obj.IVA Dim totRetIVA As Decimal = Obj.RetIVA @@ -17471,6 +17504,12 @@ Partial Class Ventas ListaAnticiposAplicados = New List(Of Modelos.MAnticipoRelacionado) End If + If ListaDevolucionesAplicadas IsNot Nothing Then + ListaDevolucionesAplicadas.Clear() + Else + ListaDevolucionesAplicadas = New List(Of Modelos.MAnticipoRelacionado) + End If + HdnIVACalculado.Value = HdnIVAOriginal.Value For Each gvr As GridViewRow In GVAnticipos.Rows If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(3) Then @@ -17481,6 +17520,13 @@ Partial Class Ventas 'CvePSAmortizacion = GlobalDTPS(UsuarioActual.CveEmpresa).FiltroPrimeroValor("CvePS", "CveConceptoContable = 11").ToEntero() End If + + 'AGREGAR LAS DEV + If UsuarioActual.CveEmpresa.Contiene(1, 189) AndAlso DdlTipoAmortizacionAnticipo.SelectedValue.Contiene("4") Then + If gvr.FCCheckBox("Chk" & gvr.RowIndex) IsNot Nothing AndAlso gvr.FCCheckBox("Chk" & gvr.RowIndex).Checked AndAlso gvr.DataKey("CveConceptoContable").ToEntero().Contiene(12) Then + ListaDevolucionesAplicadas.Add(New Modelos.MAnticipoRelacionado() With {.CveVenta = gvr.DataKey("CveVenta").ToEntero(), .FolioFiscal = gvr.DataKey("FolioFiscal")}) + End If + End If Next 'Amortizacion += TmpDTImpuestos.SUM("Importe").ToDecimal 'RMF. 2018.12.20- saque de la jugada en la amortización los impuestos locales From ee631606382fbfee00846a7016c74352c7755661 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Fri, 6 Sep 2024 15:51:14 -0700 Subject: [PATCH 05/14] --FIX CargaGlobal garantia meses --- Acumuladores/CatGarantiasMeses.aspx.vb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Acumuladores/CatGarantiasMeses.aspx.vb b/Acumuladores/CatGarantiasMeses.aspx.vb index 5b917d1c9..33a6ff2a3 100644 --- a/Acumuladores/CatGarantiasMeses.aspx.vb +++ b/Acumuladores/CatGarantiasMeses.aspx.vb @@ -174,6 +174,8 @@ Partial Class Acumuladores_CatFoliosGarantia ObjAcum.Dispose() + GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, -1, -1, -1) = Nothing + End Sub Public Sub Remove_ClickFolioGarantia(sender As Object, e As EventArgs) @@ -196,6 +198,8 @@ Partial Class Acumuladores_CatFoliosGarantia CveGarantiaMes = -1 + GlobalDTAcumGarantiasTipoUsoMeses(UsuarioActual.CveEmpresa, -1, -1, -1) = Nothing + End Sub Public Sub Edit_ClickFolioGarantia(sender As Object, e As EventArgs) From 4c302ac8005c246f5e05f81dc9313f81bbb19259 Mon Sep 17 00:00:00 2001 From: Jonathan Alexis Perez Morales Date: Sat, 7 Sep 2024 11:16:55 -0700 Subject: [PATCH 06/14] =?UTF-8?q?Puntos=20GDiaz:=20--=20Inv.=20Fisico,=20e?= =?UTF-8?q?xportar=20productos=20con=20diferencias=20--Ajustes=20de=20Inv?= =?UTF-8?q?=20F=C3=ADsico,=20permitir=20la=20importaci=C3=B3n=20de=20produ?= =?UTF-8?q?ctos=20de=20diferencia.(IF).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inventarios/EntradasSalidas.aspx | 521 +++++++++++++++------------- Inventarios/EntradasSalidas.aspx.vb | 118 ++++++- Inventarios/RepAnomalias.aspx | 144 ++++---- Inventarios/RepAnomalias.aspx.vb | 56 +++ 4 files changed, 522 insertions(+), 317 deletions(-) diff --git a/Inventarios/EntradasSalidas.aspx b/Inventarios/EntradasSalidas.aspx index 0aa50ae21..6a2dbe295 100644 --- a/Inventarios/EntradasSalidas.aspx +++ b/Inventarios/EntradasSalidas.aspx @@ -15,7 +15,7 @@ .infomov .col-md-1, .infomov .col-md-2, .infomov .col-md-6 { float: left; - padding-right: 5px; + padding-right: 5px; } .infomov .col-md-1 { @@ -74,7 +74,7 @@
  • Descargar Carta Porte
  • -
  • +
  • Descargar Carta Porte Timbrado
  • @@ -86,7 +86,7 @@
  • Ver PrePóliza -
  • +
  • @@ -105,7 +105,7 @@
  • -
  • +
  • @@ -119,7 +119,7 @@ - +
    @@ -141,26 +141,26 @@
    - +
    - +
    -
    +
    - - - - - <%--
    + + + + + <%--
    @@ -176,10 +176,9 @@
    --%> +
    -
    - - <%-- + <%--
    -
    -
    +
    +
    @@ -219,13 +218,13 @@
    - +
    -
    +
    - +