From 44f9fbecf777bb240be0cbc41c560028bfe17a6a Mon Sep 17 00:00:00 2001 From: rakcsle Date: Thu, 30 Jan 2025 20:44:43 -0700 Subject: [PATCH 1/2] 7 Kardex OC --- App_Code/ClsVentas.vb | 4 +++- Inventarios/Kardex.aspx | 29 +++++++++++++++++++++++++++-- Inventarios/Kardex.aspx.vb | 6 +++++- Ventas/RepRemisiones.aspx | 5 +++-- Ventas/RepRemisiones.aspx.vb | 17 +++++++++++++---- 5 files changed, 51 insertions(+), 10 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index 966cac521..c89366233 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -3267,7 +3267,8 @@ Public Class ClsVentas Return Retorno End Function - Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False) As Boolean + Public Function GetRepRemisionesSinFacturar(FechaI As String, FechaF As String, FechaV As String, CveSubProyecto As String, CveCliente As Integer, CveContrato As Integer, CveVendedor As String, CveEmpresa As Integer, + Optional CveUsuarioConsulta As Integer = -1, Optional ConsultaInventario As Boolean = False, Optional PrimerProducto As Boolean = False) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_RepRemisionesGet") @@ -3282,6 +3283,7 @@ Public Class ClsVentas .Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa .Add("@CveUsuarioConsulta", SqlDbType.Int).Value = CveUsuarioConsulta .Add("@ConsultaInventario", SqlDbType.Bit).Value = ConsultaInventario + .Add("@PrimerProducto", SqlDbType.Bit).Value = PrimerProducto End With Try diff --git a/Inventarios/Kardex.aspx b/Inventarios/Kardex.aspx index 33d5bf72d..5ffcc68ab 100644 --- a/Inventarios/Kardex.aspx +++ b/Inventarios/Kardex.aspx @@ -113,6 +113,13 @@ font-weight: 600; color: #3e4f5e; } + + .modal-dialog { + display: flex; + align-items: center; + justify-content: center; + min-height: 50vh; + } @@ -418,7 +425,7 @@
-
+
@@ -426,7 +433,25 @@
-
+
+ + +
+
+ OC +
+
+ +
+ +
+ +
+
+ + +
+
" style="display: inline-block; margin-right: -20px; width: 150px;" /> " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb index dba056008..ecdac6154 100644 --- a/Inventarios/Kardex.aspx.vb +++ b/Inventarios/Kardex.aspx.vb @@ -301,7 +301,7 @@ Partial Class Inventarios_Kardex If NumeroParte.Trim.Length > 0 Then If UsuarioActual.TienePermisoPagina(13) Then - LblNumeroParte.Text = $" Producto: {Codigo} -{NumeroParte} - {PS}" + LblNumeroParte.Text = $" Producto: {Codigo} - {NumeroParte} - {PS}" Else LblNumeroParte.Text = $" Producto: {NumeroParte}" End If @@ -333,10 +333,12 @@ Partial Class Inventarios_Kardex If ObjOC.PendientesCompra(ddlProducto2.SelectedValue.ToEntero, tCveSubProyectos, UsuarioActual.CveEmpresa) Then GvOC.DataSource = ObjOC.DtResultados.Copy.FiltraParametros("", "Fecha Desc") LnkIndicador_OC.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() + LnkIndicador_OC2.Text = ObjOC.DtResultados.Copy.SUM("CantidadPendienteVincular").ToString() End If ObjOC.Dispose() GvOC.DataBind() UpModalOC.Update() + UpOCS.Update() End Sub Private Function CargarKardex(CvePS As Integer) As DataTable @@ -408,6 +410,8 @@ Partial Class Inventarios_Kardex If UsuarioActual.Empresa.Funcionalidad(382) = "1" Then CargarOCPendientesCompra() DivIndicadorOC.Visible = True + DivIndicadorOC2.Visible = True + UpOCS.Update() End If UpIndicadores.Update() diff --git a/Ventas/RepRemisiones.aspx b/Ventas/RepRemisiones.aspx index df62c4fe9..12bd915ec 100644 --- a/Ventas/RepRemisiones.aspx +++ b/Ventas/RepRemisiones.aspx @@ -216,13 +216,13 @@
- - + @@ -230,6 +230,7 @@ + diff --git a/Ventas/RepRemisiones.aspx.vb b/Ventas/RepRemisiones.aspx.vb index 9b4f3a457..a25f9bfaf 100644 --- a/Ventas/RepRemisiones.aspx.vb +++ b/Ventas/RepRemisiones.aspx.vb @@ -67,7 +67,12 @@ Partial Class RepRemisiones #End Region Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load - If Not Page.IsPostBack Then + If Not Page.IsPostBack Then + + If UsuarioActual.CveEmpresa.Contiene(189) Then + GvDatos.Columns(9).Visible = True + End If + CargaSucursales() CargaCliente() CargaContrato() @@ -89,18 +94,19 @@ Partial Class RepRemisiones Sucursales = IIf(DdlSubProyectos.GetSelectedValuesM = "", "-1", DdlSubProyectos.GetSelectedValuesM).ToString Dim Vendedores As String = IIf(DdlVendedor.GetSelectedValuesM = "", "-1", DdlVendedor.GetSelectedValuesM).ToString + Dim PrimerProducto As Boolean = If(UsuarioActual.CveEmpresa.Contiene(189), True, False) Dim ObjVentas As New ClsVentas - If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked) Then + If ObjVentas.GetRepRemisionesSinFacturar(FechaI, FechaF, FechaV, Sucursales, CveCliente, CveContrato, Vendedores, UsuarioActual.CveEmpresa, CveUsuarioConsulta:=UsuarioActual.CveUsuario, ConsultaInventario:=chkInv.Checked, PrimerProducto:=PrimerProducto) Then DtVentas = ObjVentas.DtResultados.Copy() GvDatos.DataSource = DtVentas End If If DtVentas IsNot Nothing Then - GvDatos.Columns(11).Visible = DtVentas.SUMD("Descuento") > 0 + GvDatos.Columns(12).Visible = DtVentas.SUMD("Descuento") > 0 End If - GvDatos.Columns(14).Visible = chkInv.Checked 'solo se visualiza si está selccionada + GvDatos.Columns(15).Visible = chkInv.Checked 'solo se visualiza si está selccionada ObjVentas.Dispose() GvDatos.DataBind() @@ -124,7 +130,10 @@ Partial Class RepRemisiones e.Row.Cells(2).ForeColor = Drawing.Color.Red End If + e.Row.Cells(1).Text = $"{e.Row.DataKey("Fecha").ToDate().ToString("dd/MM/yyyy HH:mm:ss")}" + End If + e.Row.FCLiteral("LtlTotal").Text = " 0, e.Row.DBCampo("CveCliente").ToString(), DdlClientes.SelectedValue) & "&CveContrato=" & CveContrato & "&CveSubProyecto=" & Sucursales & "&CveMoneda=" & e.Row.DBCampo("CveMoneda") & """>" & e.Row.FCLiteral("LtlTotal").Text & "" End If From abeea658a4a04655ae38dd2897ad35f9d2d2696b Mon Sep 17 00:00:00 2001 From: rakcsle Date: Fri, 31 Jan 2025 15:11:34 -0700 Subject: [PATCH 2/2] 8 -COMO CANCELAR DE MUCHAS PROMOCIONES _siguiente semana (Acciones inactivar), Proveedores abonar RNC remision generada ya existe --- App_Code/ClsVentas.vb | 21 ++++++++++++ Bancos/ProveedoresAbonar.aspx.vb | 20 +++++++++--- Ventas/CatPromociones.aspx | 53 ++++++++++++++++++++++++++++-- Ventas/CatPromociones.aspx.vb | 55 +++++++++++++++++++++++++++++++- 4 files changed, 141 insertions(+), 8 deletions(-) diff --git a/App_Code/ClsVentas.vb b/App_Code/ClsVentas.vb index c89366233..a1502f8a6 100644 --- a/App_Code/ClsVentas.vb +++ b/App_Code/ClsVentas.vb @@ -2611,6 +2611,27 @@ Public Class ClsVentas Return Retorno End Function + Public Function UpdatePromocionEstatus(CvePromocion As Integer, Estatus As Boolean, CveUsuario As Integer, CveEmpresa As Integer) As Boolean + Dim Retorno As Boolean = False + DataAdapter("PA_Vta_PromocionEstatusUpdate") + + With SqlAdapter.SelectCommand.Parameters + .Add("@CvePromocion", SqlDbType.Float).Value = CvePromocion + .Add("@Estatus", SqlDbType.Bit).Value = Estatus + .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 actualizar el estatus la Promoción.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo) + End Try + + Return Retorno + End Function + Public Function RemovePromociones(CvePromocion As Integer, CveEmpresa As Integer) As Boolean Dim Retorno As Boolean = False DataAdapter("PA_Vta_PromocionesRemove") diff --git a/Bancos/ProveedoresAbonar.aspx.vb b/Bancos/ProveedoresAbonar.aspx.vb index c647ba164..2c5693387 100644 --- a/Bancos/ProveedoresAbonar.aspx.vb +++ b/Bancos/ProveedoresAbonar.aspx.vb @@ -858,6 +858,7 @@ Partial Class Bancos_ProveedoresAbonar Pago.CveMonedaPago = CveMoneda 'inserto las compras que voy a pagar + Dim nRow As Integer = 1 For Each gvr As GridViewRow In GvCxP.Rows If gvr.FCCheckBox("Chk").Checked Then @@ -963,7 +964,7 @@ Partial Class Bancos_ProveedoresAbonar If serieFolioArray.Length = 2 Then SerieRNC = serieFolioArray(0) FolioRNC = serieFolioArray(1) - SerieFolioRNC = $"{FolioRNC}-D-{SerieRNC = serieFolioArray(0)}" + SerieFolioRNC = $"D-{SerieRNC}-{ FolioRNC}" Else FolioRNC = serieFolioArray(0) @@ -992,9 +993,19 @@ Partial Class Bancos_ProveedoresAbonar End If + Dim ExisteRNC As Boolean = False + If ObjComp.GetCompras(-1, $"D-{SerieRNC}", FolioRNC, CveProveedor, -1, UsuarioActual.CveEmpresa) Then + Dim dtRNC As DataTable = ObjComp.DtResultados.FiltraParametros(" TipoDocto ='RNC' ") + If dtRNC.Rows.Count > 0 Then + ExisteRNC = True + SerieFolioRNC = $"D{nRow}-{SerieRNC}-{ FolioRNC}" + End If + + End If + Dim CveCompraRNC As Integer = GeneraRNC(Descuento, ObjComp.IniciaTransacSQL, gvr.DataKey("CveCompra").ToEntero, CompraActual, ObjMov, CvePrePoliza, CveProveedor, HplProveedor.Text, TxtFechaDocumento.Text.ToDate, $"Remisión Nota de Crédito pago {gvr.DataKey("SerieFolio").ToString}", gvr.DataKey("CveMoneda").ToEntero, TxtTC.Text.ToDecimal, SerieRNC, FolioRNC, PorcentajeIVA:=PorcentajeIVA, - CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero) + CveSubProyecto:=gvr.DataKey("CveSubProyecto").ToEntero, nRow:=nRow, ExisteRNC:=ExisteRNC) If CveCompraRNC > 0 Then @@ -1012,6 +1023,7 @@ Partial Class Bancos_ProveedoresAbonar End If + nRow = nRow + 1 Next Dim UsaComplementariaBancos As Boolean = Not UsuarioActual.CveEmpresa.Contiene(7, 11, 122, 145, 13, 83) @@ -1956,7 +1968,7 @@ Partial Class Bancos_ProveedoresAbonar Public Function GeneraRNC(ImporteRNC As Decimal, ByRef sqltransaccion As SqlTransaction, CveCompraAmortizada As Integer, ByRef CompraActual As Compra, ByRef ObjConta As ClsContabilidad, CvePrePoliza As Integer, CveProveedor As Integer, NombreProveedor As String, Fecha As Date, Descripcion As String, CveMoneda As Integer, TipoCambio As Decimal, Serie As String, Folio As String, Optional EsDRMN As Boolean = False, - Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1) As Integer + Optional TmpListadoPS As DataTable = Nothing, Optional PorcentajeIVA As Decimal = 0, Optional CveSubProyecto As Integer = -1, Optional nRow As Integer = -1, Optional ExisteRNC As Boolean = False) As Integer Dim CveCompraRNC As Integer = -1 Dim respuesta As Boolean = True 'Dim PorcentajeIVA As Decimal = TmpDT.MAX("IVAPorcentaje").ToDecimal @@ -1990,7 +2002,7 @@ Partial Class Bancos_ProveedoresAbonar .Fecha = Fecha, .CveMoneda = CveMoneda, .TipoCambio = If(CveMoneda = 1, 1, TipoCambio), - .Serie = $"D-{Serie}", + .Serie = If(ExisteRNC, $"D{nRow}-{Serie}", $"D-{Serie}"), .Folio = Folio, .CveCompraAmortizacion = CveCompraAmortizada, .CveCompraRelacionada = CveCompraAmortizada diff --git a/Ventas/CatPromociones.aspx b/Ventas/CatPromociones.aspx index e19fcc227..dbc391dc6 100644 --- a/Ventas/CatPromociones.aspx +++ b/Ventas/CatPromociones.aspx @@ -8,6 +8,9 @@
  • Nueva Promoción
  • +
  • + Inactivar +
  • @@ -90,16 +93,47 @@
    - " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    + +
    + +
    + + + + Inactivar + + +
    +
    + " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " style="margin-top: -3px;" class="btn btn-circle btn-sm label-info"> + +
    + +
    + + - + + + + + + + + + @@ -128,5 +162,18 @@ + diff --git a/Ventas/CatPromociones.aspx.vb b/Ventas/CatPromociones.aspx.vb index a18864c75..ce3ffbc43 100644 --- a/Ventas/CatPromociones.aspx.vb +++ b/Ventas/CatPromociones.aspx.vb @@ -22,18 +22,25 @@ Partial Class Ventas_CatPromociones Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load If Not Page.IsPostBack Then + + If UsuarioActual.TienePermisoProceso(386) Then + LnkAccInactivar.Visible = True + End If + InicializaControles() + OcultarMostrarInactivar(True) CargaDatos() End If End Sub + Private Sub InicializaControles() CargarCentrosDeCosto(Nothing, Nothing, Nothing, LblSubProyecto) - GvDatos.Columns(6).HeaderText = LblSubProyecto.Text + GvDatos.Columns(7).HeaderText = LblSubProyecto.Text DdlSubProyecto.DataSource = GlobalDTSubProyectosUsuarios(UsuarioActual.CveUsuario, -1, UsuarioActual.CveEmpresa) DdlSubProyecto.DataBind() @@ -95,4 +102,50 @@ Partial Class Ventas_CatPromociones CargaDatos() End Sub + + Protected Sub LnkAccInactivar_Click(sender As Object, e As EventArgs) + OcultarMostrarInactivar(True) + End Sub + + Private Sub OcultarMostrarInactivar(Mostrar As Boolean) + + GvDatos.Columns(0).Visible = Mostrar + LnkInactivar.Visible = Mostrar + UpInactivar.Update() + UpDatos.Update() + End Sub + Protected Sub LnkInactivar_Click(sender As Object, e As EventArgs) + Dim ObjVentas As New ClsVentas + ObjVentas.IniciaTransacSQL() + Dim ErrorProceo As Boolean = False + + Dim ContInactivadas As Integer = 0 + For Each GvRow As GridViewRow In GvDatos.Rows + Dim Chk As CheckBox = GvRow.FCCheckBox("chk") + Dim CvePromocion As Integer = GvRow.DataKey("CvePromocion").ToEntero + + If Chk.Checked Then + If ObjVentas.UpdatePromocionEstatus(CvePromocion, False, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then + ContInactivadas = ContInactivadas + 1 + Else + ErrorProceo = True + Exit Sub + End If + End If + + Next + + If ErrorProceo Then + ObjVentas.RollBack() + Else + ObjVentas.Commit() + Alert($"Se inactivaron {ContInactivadas} promociones.") + OcultarMostrarInactivar(False) + End If + + + + ObjVentas.Dispose() + End Sub + End Class \ No newline at end of file